Posted on August 17, 2016, 10:46 am, by admin, under
bash,
linux.
Random port tunnelling using a private key: #!/bin/sh ssh -L 5446:hostname:5446 -i /home/imran/Servers/iaghayev iaghayev@192.168.1.10 -p 2222 Mysql port tunnelling using a private key: #!/bin/sh ssh -L 3309:127.0.0.1:3306 -i /home/imran/Servers/iaghayev iaghayev@192.168.1.10 -p 2222
Posted on April 29, 2016, 5:12 am, by admin, under
apache,
linux.
Use /var/www-production & /var/www-prerelease Link /var/www.repo1 to /var/www-production and /var/www.repo2 to /var/www-prerelease. Update /var/www-prerelease, test, do customizations. When ready simply swap the links, move prerelease production and production to prerelease
Posted on January 8, 2016, 12:07 pm, by admin, under
linux.
If you forgot root’s password follow these steps to reset it: 1. Reboot, press ESC to get to GRUB boot loader menu 2. Choose from the list kernel with (recovery mode) 3. From the menu screen choose "Drop to root shell prompt" 4. By default it gives you read-only filesystem Run this for read/write: mount […]
Posted on December 14, 2015, 9:50 am, by admin, under
linux.
Ssh protocol version 1 key generation. ssh-keygen When asked for a “passphrase”, we won’t enter one. Just press enter twice. It will generate 2 files: /home/user/.ssh/id_rsa.pub /home/user/.ssh/id_rsa 2. Copy id_rsa.pub to the remove host scp id_rsa.pub user@hostname:/home/user/.ssh/id_rsa.pub or ssh-copy-id -i .ssh/id_rsa.pub user@hostname 3. Login to remote host and add to authorized_keys file ssh hostname -v […]
Posted on December 9, 2015, 3:10 pm, by admin, under
linux.
Posted on December 9, 2015, 3:00 pm, by admin, under
linux.
useradd -d /home/testuser -m testuser
Posted on November 25, 2015, 5:48 am, by admin, under
linux.
tail -n +1 filename.txt > filename.txt.new
Posted on November 11, 2015, 6:58 am, by admin, under
bash,
linux.
Use convert utility from ImageMagick package /usr/bin/convert *.jpg result.pdf
Posted on October 23, 2015, 6:44 am, by admin, under
bash,
linux.
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
Posted on August 29, 2015, 6:51 am, by admin, under
linux.
1. Go to editor: crontab -e 2. */5 * * * * /usr/bin/curl https://www.natality-dating.com/1/bulkmailer/1 2>/dev/null >/dev/null 3. Check the result: crontab -l 4. Check if cron is running: ps -aef | grep cron