How to batch resize images in Ubuntu recursively within the terminal?

You could use imagemagick. For instance, for resizing all the JPG images under the current directory to 50% of their original size, you could do: for f in `find . -name “*.jpg”` do convert $f -resize 50% $f.resized.jpg done The resulting files will have “.jpg” twice in their names. If that is an issue, you … Read more

How can I restore /etc/nginx? [closed]

To recreate it, first uninstall using purge to remove even configuration files and records: sudo apt-get purge nginx nginx-common nginx-full then reinstall: sudo apt-get install nginx If above doesn’t work for you, you can also try using –force-confmiss option of dpkg. sudo dpkg –force-confmiss -i /var/cache/apt/archives/nginx-common_*.deb

Rails: FATAL – Peer authentication failed for user (PG::Error)

If you installed postresql on your server then just host: localhost to database.yml, I usually throw it in around where it says pool: 5. Otherwise if it’s not localhost definitely tell that app where to find its database. development: adapter: postgresql encoding: unicode database: kickrstack_development host: localhost pool: 5 username: kickrstack password: secret Make sure … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)