tmux

CTRL+B % Split window vertically
CTRL+B “ Split window horizontally
CTRL+B c Create new window
CTRL+B d Detach tmux session
CTRL+B $ Rename session
CTRL+B n Next window.
CTRL+B p Previous window.
CTRL+B arrow keys switch between panes.

.tmux.conf

.tmux.conf file is used to configure tmux

Here is the .tmux.conf i use

https://gist.github.com/serverok/f8f729e2c22a5ab1fa6b0d82765bcddc

If you change this file, you need to restart the terminal or run

Scroll Mode in tmux

To scroll, you need to enter scroll mode by pressing

To exit scroll mode, press q

apt doesn’t support architecture i386

After adding facebook hhvm repository on Ubuntu 16.04, i get following error when running “apt update” command.

This is fixed by editing

Find

Replace with

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

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