Archive for the ‘bash’ Category

Rsync examples

cd /home/imran/Projects/pp-frontend rsync -azP –exclude .git/ –exclude .idea/ –exclude user_guide . imran@192.168.56.101:/var/www/vhosts/httpdocs Rsync local to remote cd /home/imran rsync -avz –exclude default-soapui-workspace.xml –exclude Desktop –exclude Dropbox –exclude "Google Drive" –exclude –exclude NetBeansProjects –exclude PhpstormProjects –exclude Public –exclude Software –exclude "Software Archive" –exclude "Soap UI Configuration" /home/imran/* /home/imran/Google\ Drive Rsync remote to local rsync -chavzP kaspi-emlak.com@ssh.kaspi-emlak.com:/www/* […]

Generate pdf from jpg files

Use convert utility from ImageMagick package /usr/bin/convert *.jpg result.pdf

Image optimize

Run optipng to optimize png files in directory: for i in `ls`; do optipng -i0 -o7 -zm1-9 $i; done Run optipng for a single file: /usr/bin/optipng -i0 -o7 -zm1-9 upload/banner/kaspi132px.png Run jpegoptim for a single file: /usr/bin/jpegoptim –strip-all upload/banner/kaspi132px.jpg Run gifscle for a single file: /usr/bin/gifsicle -b -O2 upload/banner/kaspi132px.gif