Eternal Bash History

Sometimes you need your bash history to store more than the default few hundred commands. Changing the


variable allows you to set the amount of lines you want to store in your history. There are a few other variables you can use to customise but you can find them Here

Changing HISTSIZE to an empty string will allow the history to go on and on and on….

# Eternal bash history.
export HISTSIZE=
export HISTTIMEFORMAT="[%F %T] "
# Change the file location because certain bash sessions truncate .bash_history file upon close.
export HISTFILE=~/.bash_eternal_history
# Force prompt to write history after every command.


Ubuntu auto start ssh server

Having to setup an Ubuntu server recently, all the CentOS commands had to get thrown out the Window.
Before i could put the server into the rack i had to make sure sshd started if the server ever reset.
Below is the following command to add ssh to the default startup.

It actually updates the rc.d scripts so probably also adds shutdown scripts to the unneeded run levels

sudo update-rc.d ssh defaults

Bash Profile

I find myself working in iTerm a lot. Well to be honest i prefair a terminal over a Finder window any day.
So i find myself running the same commands over and over, {{ git status }} over and over to check if any files have changed.
Checking which branch i’m currently on.

I spent a lot of time altering my bash profile to enable colours by default, changing the prompt layout, setting up aliases etc.
I finally found a brilliant template online by Jacob Tomlinson at Terminal Piperita Theme

The prompt integrates into git, so if git is enabled in the current directory it will add the current branch to the prompt and tell me if there have been any changes made. It’ll give me the user my terminal is logged in as and the hostname of the machine along with the current folder all with some pretty colours that change if i am logged in as root too. Continue reading