felixabele
6/11/2013 - 6:52 AM

Server Administration

Server Administration

search Log

grep -A 1 "imone" production.log-20200610

# with credential
/usr/local/bin/wkhtmltopdf --username user --password pw https://staging.extranet.ses.com/ output.pdf
http://10.0.2.2:3002
rails s -b 0.0.0.0 -p 3002
# --- list cronjobs
crontab -u deploy -l

# --- S3 Sync / Copy
s3cmd sync /local/path/ s3://test-bucket/backup/
s3cmd cp --recursive s3://images.brandnooz.de/system/products/ s3://dev.brandnooz.de/system/products/

# --- Gzip 
tar -xvf file.tar
tar -czvf  Output_File_Name.tar.gz Directory_Name

# --- clear log
> production.log

# --- Split
split -b 50000k myfile segment

# --- Import MySQLdump
mysql -u root -p  brandnooz_bcms_stage < temp5.sql

# --- Tail Logfile
tail -f /opt/brandnooz/current/log/production.log
tail -f /opt/brandnooz_stage/current/log/production.log

# --- delete a bunch of folders
 sudo rm -R 201301* -f

# --- make a folder and its children public
sudo chmod 777 -R /backups2

# --- MySQL default
/var/lib/mysql

# --- symlinking
ln -s /origin /target

# --- connect to mongoDB with SSH Tunnel
ssh -L 4321:localhost:27017 -i ~/.ssh/deploy_brandnooz deploy@brandnooz.de

# --- connect to Redis with SSH Tunnel
ssh -L 4322:localhost:6379 -i ~/.ssh/deploy_brandnooz deploy@brandnooz.de

# --- Automysql Backup
Global Config: /etc/automysqlbackup
Executable: /usr/local/bin
Backups: '/var/backup/db'

# --- Download File via SCP
scp your_username@remotehost.edu:foobar.txt /local/dir

# upload: local -> remote
scp local_file user@remote_host:remote_file


ssh-keygen -t rsa -b 4096


# --- start simple webserver
python -m SimpleHTTPServer 8000
curl -s https://raw.githubusercontent.com/xdissent/ievms/master/ievms.sh | env IEVMS_VERSIONS="7 9 EDGE" bash