Docker commands

$ sudo docker build Dockerfile

$ sudo docker start -d

List of images

$ sudo docker images

Run docker container by ID

$sudo docker run ID

Get dockers ip

$ docker-machine ip

$ sudo iptables -L -n

Delete old containers

$ docker rmi $(docker images -q -f dangling=true)

Delete all images

docker rmi $(docker images -q)

Docker-composer

$ docker-compose build

$ docker-compose up -d

Restart web server Nginx + PHP-FPM Mac OS

Restart NGINX

$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist

Settings

$ cp /usr/local/Cellar/php55/5.5.31/homebrew.mxcl.php55.plist ~/Library/LaunchAgents/

Restart PHP-FPM

$ launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist
 
$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist

 

Optimize jpg with Jpegtran

Install Jpegtran:

$ apt-get install libjpeg-progs

Convert one file to Progressive JPEG and optimize with Jpegtran:

$ jpegtran -progressive -optimize -outfile image.jpg image.jpg

Convert all files to Progressive JPEG and optimize with Jpegtran:

$ find /the/image/path -name "*.jpg" -type f -exec jpegtran -copy none -optimize -outfile {} {} \;