Ubuntu – Install packages from CD-ROM
If you ever find your self needing to install packages on your ubuntu server but do not have an internet connection you can install packages directly from the installation CD. Take in to consideration the fact that the packages will only ever be up to date as the day the CD was released but it could certainly save the day.
There are three simple steps to get a package installed, for example to install ‘build-essentials’ you would:-
apt-cdrom add apt-get update apt-get install build-essential
The first line tells apt to use the cd-rom as a source. Line two updates the source listings making all the packages on the cd-rom available. The third will install it as normal.
Once you have finished installing the packages you need or no longer require the the cd-rom as a source if you now have internet access you can remove it by:-
vim /etc/apt/sources
Then remove any lines that contain ‘cd-rom’, save the file and then do an apt-get update.
Install SSH key in one line to remote server
I quite often create new linux based servers and always secure SSH using key based authentication. Using the quick tip below you can install your public key on the remote server in one line and set secure permissions on the file.
cat .ssh/your_key.pub | ssh user@server "cat - >> ~/.ssh/authorized_keys; chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys"
Once you have run this line the next time you attempt to login (as long as your key has been loaded in to the ssh-agent) you will no longer be required to type your password.
In a future post I will be talking about further ways to secure your SSH server.
Site IPv6 Ready
A quick note to mention that the wikinixi.com site is fully IPv6 ready. Visiting www.wikinixi.com will work with IPv4 and IPv6 addresses. To force an IPv6 connection use ipv6.wikinixi.com
Quick tip: Monitor Logs Live

There are times you want to monitor log files and immediately see new entries as it is updated. This is easily achieved using ‘tail’.
tail is used to display the end of a file and by default shows the last 10 lines of a file using:-
Install Zabbix Server 1.8.9 on CentOS6
The following instructions will install the latest version of Zabbix server on CentOS6 including setting up mysql databases. It presumes a fairly basic install of CentOS6.
Zabbix is an open source, highly customisable server monitoring tool. More details are available here.
These instructions use the EPEL repository for a more upto date version than the included version in the main repos.
How to Import all your existing Instapaper Items to Evernote
Please note, depending on the amount of Instapaper items you may need a Evernote premium account if you wish to make all your articles synced.
The script will parse each URL from your Instapaper account though Instapaper Mobalizer before adding it to your Evernote notebook to tidy things up a little. The page title of the website becomes the note title.
Get External IP address from Ubuntu Command line
Some times you want to check your external IP address of your server. This can easily be done with:-
curl -s http://checkip.dyndns.org/ | sed 's/[a-zA-Z<>/ :]//g'
As you can see you will require curl installed, if you don’t have it type:-
apt-get install curl
Split Files in to Smaller Chunks
I had problem copying off a large file on a server so I decided that it may be easier to chop the file up in to smaller pieces. This can be easily achieved by:-
nohup nice split --line-bytes=500m foo.tar.gz foo_ &
To break it down, ‘nohup nice’ runs the task in the background, ‘split’ is the command we are using, ‘–line-bytes=500m’ this defines the size of each piece, in this case 500MB each, ‘ foo.tar.gz’ the file you want to split, ‘foo_’ the starting part of each piece of the filenames, then finally ‘&’ part of the nohup.
This will create files 500mb in size named, foo_aa, foo_ab, foo_ac…….and so on.
To piece the files back together we use:-
nohup nice cat foo_a* > foo_FULL.tar.gz &
This time we use ‘cat’ and specify ‘foo_a*’ as the input files and ‘foo_FULL.tar.gz’ as the resulting combined file.
Quick Tip: Re-run command as sudo

If you run a command and get an error such as ‘rm: Test/Downloads: Permission denied’ and you know you should have used sudo at the beginning of the command there is a quick way to correct this. Read more 



