mac keep env variable when sudo Edit

  • sudo visudo
sudo visudo
## add you need keep env variable
Defaults        env_keep += "http_proxy"

>sudo printenv
# you can find http_proxy avaliable in sudo 

install iTerm2Edit

install jdk Edit

  • install jdk 7 on mac osx 10.9, the jdk location is

lokvins-mbp:~ lokvin$ /usr/libexec/java_home -v 1.7
  • install jdk 6 on mac osx 10.9
search "java", download "Java for OS X 2013-004 Developer Package"

install homebrewEdit

install wget Edit

brew install wget

ls with color Edit

>alias ls='ls -G'

install command line toolsEdit

xcode-select --install

mac install zlib Edit

xcode-select --install

install apache with php Edit

  • install apache httpd
$tar zxvf httpd-2.2.25.tar.gz
$cd httpd-2.2.25
$./configure \
   --prefix=/opt/apache22 \
   --enable-so \
   --enable-mods-shared=all \ 
   --enable-proxy=shared \
   --enable-cache=shared \
   --enable-file-cache=shared \
   --enable-disk-cache=shared \
$sudo make install
$tar -zxvf php-5.4.31.tar.gz
$cd php-5.4.31
$./configure --with-apxs2=/opt/apache22/bin/apxs --with-mysql
$sudo make install
$cp php.ini-development /usr/local/lib/php.ini
  • add to apache httpd.conf
<FilesMatch \.php$>
   SetHandler application/x-httpd-php
<FilesMatch "\.ph(p[2-6]?|tml)$">
   SetHandler application/x-httpd-php
  • create a info.php file under htdocs like:

install memcached Edit

* You should also make sure your Homebrew is up-to-date. Use update and doctor commands to update and fix any issues it may have.
brew update
brew doctor
  • install memcached
brew install memcached
gem install lunchy
brew info memcached
cp /usr/local/Cellar/memcached/$version/homebrew.mxcl.memcached.plist ~/Library/LaunchAgents/
lunchy start memcached
lunchy stop memcached

set terminal tab name Edit

  • command + shift + i , call the menu, edit the tab name

set env viriableEdit

brew update m4 Edit

brew install homebrew/dupes/m4

install location


add below to path


lock screen Edit

  • System Preferences > Security & Privacy > General. required password "immediately" after sleep
  • ctrl + shift + enject

use Mail app receive email Edit

Mail app mark all as read Edit

install tree Edit

>brew install tree

mac set utf8 locale Edit

  • add below to ~/.bash_profile
export LC_ALL=en_US.UTF-8  
export LANG=en_US.UTF-8

disable System Integrity on Mac OSX EI Edit

disable SIP

csrutil disable

enable SIP, except dtrace

csrutil enable --without dtrace
csrutil status

mac mail app Edit

  • mail reply remove vertical line - preferences - composing - uncheck 'Increase quote level'

mac change host name Edit

sudo scutil --set HostName mimu
sudo scutil --set ComputerName mimu // 修改共享主机名
Community content is available under CC-BY-SA unless otherwise noted.