add-apt-repository

add-apt-repository command can be used to add repository in ubuntu.

To install, run

Example

rvm

rvm is ruby version manager. Allow you to have multiple ruby version.

To install rvm, run

To install a ruby version, run

To set it default, use

Disable WordPress wp-cron.php

WordPress run its sheduled tasks using wp-cron.php, this get called every time visitor visits web site. This is not efficient method for high traffic web sites. Since this have to be loaded using web server, it can cause web server process hang if your cronjob take more time to finish. It is better disable wordpress cronjob and set a real cronjob.

To disable wordpress cronjob, edit wp-config.php file, add following

Now set a cronjob as follows

rsync

Restart rsync on failure

rsync command with exclude option, full server backup to remote server.

Transfer a file

I normally use scp to do single file transfer. It may be better to it with rsync as you will be able to resume.

-P == –partial –progress

If you use non standard SSH port, then replace -e ssh with “-e ssh -p PORT_NUMBER”.

Example

See backup

smartctl

To check hard disk for errors, run

Here is an example of HDD with errors

To get detailed, result, run

hdd

aws s3 cp command

aws

Prevent an EC2 Instance getting Terminated by AutoScale
Amazon RDS ERROR 1040 (08004): Too many connections
Install Amazon AWS awscli
Amazon Workmail
AWS Cloud​Formation
Getting Started with Amazon Elastic Beanstalk
Deploy Docker Image using Elastic Beanstalk
Amazon Route 53 DKIM error
Resize Amazon EC2 Boot Disk

AWS Price calculator

To backup a folder to Amazon S3 bucket, run

Example

aws s3 cp command

To sync (download) a s3 bucket to your local computer, run

To list all s3 buckets, run

Example

Nginx

Nginx Tricks

Nginx Configuration for scripts