2016年3月30日 星期三

2016年3月22日 星期二

nginx for Mac

Ref : https://coolestguidesontheplanet.com/installing-homebrew-os-x-yosemite-10-10-package-manager-unix-apps/

1. Install Brew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
password was needed and not shown on the screen

2. brew doctor

3. Install nginx
Ref:http://learnaholic.me/2012/10/10/installing-nginx-in-mac-os-x-mountain-lion/

3. Start nginx
bash$ ngix
Chrome localhost:8080
4. Stop nginx
$nginx -s stop
4. Re-Start nginx
==> Pouring nginx-1.8.1.yosemite.bottle.tar.gz
==> Caveats
Docroot is: /usr/local/var/www

The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.

nginx will load all files in /usr/local/etc/nginx/servers/.

To have launchd start nginx at login:
  ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgents
Then to load nginx now:
  launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
Or, if you don't want/need launchctl, you can just run:
  nginx

==> Summary
Ref:http://flylib.com/books/en/2.97.1.54/1/

2016年3月14日 星期一

bash batch file

ref:http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-2.html#ss2.1
Macbook pro with Yosemite

1. Edit batch file
vi hello.sh
#!/bin/bash        
echo Hello World

2. chmod +x hello.sh

3. ./hello.sh