ssh -i
This command can be used to acces any other kind of service by changing port number
scp -r user@host:folder_path source_path_of_current_machine
scp user@host:"path1 path2" source_path_of_current_machine
scp user@host:"foder_path/{file1,file2}" source_path_of_current_machine
#ff5_dir/firefox -P "ff5" -no-remote
#ff6_dir/firefox -P "ff6" -no-remote
rm home_dir/.mozilla/firefox/firefox_profile_name/cookies.sqlite
Host server_address IdentityFile ssh_private_key_location(change server_address and ssh_private_key_location accordingly)
ssh -D 9999 -i key_file_location username@ec2_instance_addressthen set SOCKS HOST proxy setting for the firefox (prefernce->network tab) or other browser as shown in the figure
SET GLOBAL general_log_file = '/var/log/mysql/mysql.log'; SET GLOBAL general_log = 'ON'
SET GLOBAL general_log = 'OFF'
Below is script to take backup of complete database on S3, also remove 10 day old backup file from S3
You need install s3cmd, and configure it before using this script, also need to create S3 bucket on aws
also change mysql username and password accordingly.
#!/bin/bash
#below is path of variable to put dump of mysql
DATA=/data
#filename of today
file_name=db_`date +'%d-%m-%Y'`.sql.gz
#filename of today
file_name_10_day_old=db_`date --date='10 days ago' +'%d-%m-%Y'`.sql.gz
#take dump of mysql
mysqldump -u mysql_unsername -p mysql_password --all-databases | gzip > $DATA/$file_name
#push to s3
s3cmd put $DATA/$file_name s3://backup_bucket
#cleanup of file
rm $DATA/$file_name
s3cmd del s3://backup_bucket/$file_name_10_day_old