(31 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | == mac keep env variable when sudo == |
||
+ | * 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 iTerm2== |
||
+ | *http://iterm2.com/ |
||
+ | |||
==install jdk == |
==install jdk == |
||
* install jdk 7 on mac osx 10.9, the jdk location is |
* install jdk 7 on mac osx 10.9, the jdk location is |
||
Line 5: | Line 17: | ||
lokvins-mbp:~ lokvin$ /usr/libexec/java_home -v 1.7 |
lokvins-mbp:~ lokvin$ /usr/libexec/java_home -v 1.7 |
||
/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home |
/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home |
||
+ | |||
+ | * install jdk 6 on mac osx 10.9 |
||
+ | https://developer.apple.com/downloads/ <br> |
||
+ | search "java", download "Java for OS X 2013-004 Developer Package" |
||
+ | |||
+ | ==install homebrew== |
||
+ | http://brew.sh/ |
||
+ | |||
+ | ==install wget == |
||
+ | brew install wget |
||
+ | |||
+ | ==ls with color == |
||
+ | >alias ls='ls -G' |
||
+ | |||
+ | ==install command line tools== |
||
+ | xcode-select --install |
||
+ | |||
+ | == mac install zlib == |
||
+ | xcode-select --install |
||
+ | |||
+ | ==install apache with php == |
||
+ | * 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 \ |
||
+ | --enable-mem-cache=shared |
||
+ | |||
+ | $make |
||
+ | $sudo make install |
||
+ | |||
+ | * install apache with php http://php.net/manual/en/install.unix.apache2.php |
||
+ | $tar -zxvf php-5.4.31.tar.gz |
||
+ | $cd php-5.4.31 |
||
+ | $./configure --with-apxs2=/opt/apache22/bin/apxs --with-mysql |
||
+ | $make |
||
+ | $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> |
||
+ | |||
+ | <FilesMatch "\.ph(p[2-6]?|tml)$"> |
||
+ | SetHandler application/x-httpd-php |
||
+ | </FilesMatch> |
||
+ | *create a info.php file under htdocs like: |
||
+ | <?php |
||
+ | phpinfo(); |
||
+ | ?> |
||
+ | * access http://localhost/info.php |
||
+ | |||
+ | == install memcached == |
||
+ | * http://www.rahuljiresal.com/2014/03/installing-memcached-on-mac-with-homebrew-and-lunchy/ |
||
+ | |||
+ | * 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 == |
||
+ | * command + shift + i , call the menu, edit the tab name |
||
+ | |||
+ | == set env viriable== |
||
+ | * http://www.dowdandassociates.com/blog/content/howto-set-an-environment-variable-in-mac-os-x-terminal-only/ |
||
+ | |||
+ | ==brew update m4 == |
||
+ | brew install homebrew/dupes/m4 |
||
+ | |||
+ | install location |
||
+ | /usr/local/Cellar/m4/1.4.17 |
||
+ | |||
+ | add below to path |
||
+ | /usr/local/Cellar/m4/1.4.17/bin |
||
+ | |||
+ | ==lock screen == |
||
+ | * System Preferences > Security & Privacy > General. required password "immediately" after sleep |
||
+ | * ctrl + shift + enject |
||
+ | |||
+ | ==use Mail app receive email == |
||
+ | *https://thehub.thomsonreuters.com/docs/DOC-945919?utm_source=results&utm_medium=full&utm_campaign=search#jive_content_id_How_to_setup_your_work_email_in_Apple_mail |
||
+ | |||
+ | ==Mail app mark all as read == |
||
+ | * https://support.apple.com/kb/PH19169?locale=en_US |
||
+ | * Control-click a mailbox, then choose Mark All Messages As Read. |
||
+ | |||
+ | == install tree == |
||
+ | >brew install tree |
||
+ | |||
+ | == mac set utf8 locale == |
||
+ | * 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 == |
||
+ | * http://osxdaily.com/2015/10/05/disable-rootless-system-integrity-protection-mac-os-x/ |
||
+ | * Hold ⌘R during reboot, enter recory mode, From the Utilities menu, run Terminal . |
||
+ | disable SIP |
||
+ | csrutil disable |
||
+ | |||
+ | enable SIP, except dtrace |
||
+ | csrutil enable --without dtrace |
||
+ | csrutil status |
||
+ | |||
+ | == mac mail app == |
||
+ | * mail reply remove vertical line |
||
+ | Mail.app - preferences - composing - uncheck 'Increase quote level' |
||
+ | |||
+ | == mac change host name == |
||
+ | |||
+ | sudo scutil --set HostName mimu |
||
+ | sudo scutil --set ComputerName mimu // 修改共享主机名 |
Latest revision as of 14:48, 21 May 2018
mac keep env variable when sudo[]
- 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 iTerm2[]
install jdk[]
- install jdk 7 on mac osx 10.9, the jdk location is
http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html
lokvins-mbp:~ lokvin$ /usr/libexec/java_home -v 1.7 /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home
- install jdk 6 on mac osx 10.9
https://developer.apple.com/downloads/
search "java", download "Java for OS X 2013-004 Developer Package"
install homebrew[]
install wget[]
brew install wget
ls with color[]
>alias ls='ls -G'
install command line tools[]
xcode-select --install
mac install zlib[]
xcode-select --install
install apache with php[]
- 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 \ --enable-mem-cache=shared
$make $sudo make install
- install apache with php http://php.net/manual/en/install.unix.apache2.php
$tar -zxvf php-5.4.31.tar.gz $cd php-5.4.31 $./configure --with-apxs2=/opt/apache22/bin/apxs --with-mysql $make $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>
<FilesMatch "\.ph(p[2-6]?|tml)$"> SetHandler application/x-httpd-php </FilesMatch>
- create a info.php file under htdocs like:
<?php phpinfo(); ?>
- access http://localhost/info.php
install memcached[]
* 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[]
- command + shift + i , call the menu, edit the tab name
set env viriable[]
brew update m4[]
brew install homebrew/dupes/m4
install location
/usr/local/Cellar/m4/1.4.17
add below to path
/usr/local/Cellar/m4/1.4.17/bin
lock screen[]
- System Preferences > Security & Privacy > General. required password "immediately" after sleep
- ctrl + shift + enject
use Mail app receive email[]
Mail app mark all as read[]
- https://support.apple.com/kb/PH19169?locale=en_US
- Control-click a mailbox, then choose Mark All Messages As Read.
install tree[]
>brew install tree
mac set utf8 locale[]
- 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[]
- http://osxdaily.com/2015/10/05/disable-rootless-system-integrity-protection-mac-os-x/
- Hold ⌘R during reboot, enter recory mode, From the Utilities menu, run Terminal .
disable SIP
csrutil disable
enable SIP, except dtrace
csrutil enable --without dtrace csrutil status
mac mail app[]
- mail reply remove vertical line
Mail.app - preferences - composing - uncheck 'Increase quote level'
mac change host name[]
sudo scutil --set HostName mimu sudo scutil --set ComputerName mimu // 修改共享主机名