Smoothwall Firewall project

Sunday 31 August 2014

Using Docker to run rtorrent to reduce your servers resource requirements



Let me state early and clearly , any one who thinks Docker is a new technology, knows nothing about IT and even less about virtualisation. So if some smartalec in your office starts spouting about this new technology, take them down a peg or two with a few links to Solaris containers, OpenVZ or LXC.

What the Docker team have done extremely well, is make these ancient technologies very accessible and very easy to use, with a well defined tool set and API. This they must be highly praised for.

In the words of Einstein however, they work on the shoulders of giants, who did a lot of the heavy lifting, and let us all not forget this.

I have been using containers for years, and we worked on a very successful cloud at Nokia using OpenVZ, where we built our own tools.

So I thought I would give Docker a spin on one of my cloud servers and just kick the tyres to start. I picked an application I use a lot for downloading Linux ISO's so it seemed a good choice. It was very straight forward indeed.

The host operating system was CentOS 6.5 - which I'm growing less fond of as each week passes, as in the fast moving cloud space, Ubuntu is simply better. It was installed however, and I couldn't be bothered to change it. You need to enable the EPEL repository and install docker with yum.

I decided to download and use the userland tools of a Docker Ubuntu image - but whatever image you choose - the host kernel is the one that will be used. This is to do with the historically well thought out ABI built into the Linux kernel that allows this all to work.



Once the image was retrieved from the Docker registry - I fired up a container with Ubuntu 14.04 tools and installed screen, rtorrent , vim and htop.

I always run rtorrent with screen so I can just leave it running and come back to it when required. Also importantly - when starting your container use /bin/bash so you can have an interactive session with it to be able to go back and check your screen/rtorrent session. A command like the following will do.

docker run -i -t my-ubuntu-image /bin/bash

Be care however when you want to exit this container , DON'T type exit but CTRL-p, CTRL-q , so everything keeps running and you can reattach to the container when you wish to check on progress.

This uses significantly less resources than spinning up a KVM virtual image to do the same job, as it uses the resources of the host system that are already running.

I have deliberately not put all the commands need to do this here , as the Docker documentation is good and very clear, so duplication is pointless




Saturday 19 July 2014

Industries illogical use of Agencies in IT contractor procurement - a humorous musing



I thought I would write a light hearted look at what I genuinely consider to be the most illogical waste of companies money, in paying the middle men. These middle men take anything from 10-30% off the top of other peoples work, for doing virtually nothing.

Hiring IT managers know the sort of people they need, but instead of putting an advert directly on their web site or via aggregated sites like Jobserve, they employ the services of an agency. Here in lies the problem, as most agents have a strange and various past employment history and almost exclusively know next to nothing about complex IT systems. They may have heard of Windows if you're lucky, but start talking about Linux, Java, Ruby and Cloud Services and they start to glaze over

So in an attempt to consider what might be going through an ex-RSPCA dog handlers mind when talking to an IT hiring manager - here is my stab.

1) Agile - hmm so he wants the new guy to do yoga - probably a small office

2) Puppet - ok that makes sense he can keep the kids happy with a show on "bring your kids to work day"

3) Chef - good point , saves on kitchen staff as he can cook lunch while programming

4) Java - well if he is making the lunch he might as well make the coffee as well.

5)Tomcat - lion taming is a great skill, and could work well while the kids are in

6) VMware - probably similar to Tupaware - but why he wants him to sell home goods is a bit odd

7) Solaris - well green energy is in vogue - so sola panel knowledge could be handy

8) Perl - Knowledge of jewellery is always handy - especially to please the bosses wife

9) Ruby - Boy he really is into his Jewellery, I will have to check what they do for a business.

10) Python - that is just odd, perhaps he keeps snakes in the office as pets. Hope they don't escape, could cause chaos with the Lion.

This is obviously not an exhaustive list , and I could have been a lot harsher, but I hope it makes you smile like it does me when I see job adverts for Pearl developers - do they want me to polish gems for a living.


Saturday 28 June 2014

Is using email still relevant? Hell yes


I have been working in IT long enough to remember many changes in technology usage. I can remember just missing out on having to use punch cards to get my programs loaded into the mainframe.

So I can remember a time when people seriously did not think that email would or could be useful. I have actually worked in companies where the senior managers would get their secretaries to print out their emails and give them to them on paper. I can also vividly recall the many hours spent convincing these people of the benefit of email , and how it could save them time and money.

If you look at the world today through your 21st Century eyes, you would probably find those sentiments cute, if not funny, however I'm beginning to hear statements in my technology reading about the post email era, and I really think this would be a bad thing for many busy people.

I know we all get fed up with the spam we get, and the unsolicited contacts etc. but with a well set up email configuration, and not clicking on all those "send me updates" boxes, this can be controlled fairly easily.

Now I'm not some techno Luddite arguing from the sidelines as your knowledge gets swept away with yesterdays chip papers, but from a very practical perspective. I have shifted to using the mobile technology paradigm like everyone else, and use Whatsapp, Facebook Chat, Twitter and Wechat as well as the next man, but they have a big drawback. They are all great tools and I can see a use for them going forward , no doubt. However on your mobile devices they demand your attention , and are constant interrupts to your busy day. They are like a nagging yappy dog , constantly demanding to get in your face. Yes you can turn them down or the notifications off , but you have just killed 9/10ths of the usefulness of them in the first place. They are either in your face , or why bother using them at all?

The absolute beauty of email is it's asynchronous nature, and you can choose the time and place that you wish to read or respond to what has arrived in your inbox. It has also got thirty years of tooling development surrounding it, so finding and dealing with issues that took place a year ago is a breeze. Try doing that with Whatsapp - good luck with that.

Skype does a better job than most for recording what you have been up to with conversations, but it is still time limited. You can literally search you email threads from the day you opened your account, which has saved my bacon on more than one occasion.

I think the tricks to using email wisely are to be ruthless on your inbox, make sure you have a sensible structure with the folders/tags of the email you wish to keep and constantly look to help your spam engine to get rid of rubbish.

I'm sure email will be replaced at some point with probably more human friendly methods of communication , like video or on-the-fly video conversation recording. The main issue there will be the extremely complex nature of search, not a trivial issue with video. Lets hope the worlds computer scientists are on the case as I type ;-)

Wednesday 30 April 2014

Problem loading/starting a KVM virtual machine on a CentOS 6.5 host that has SELINUX disabled


If you have recently built a KVM host for all your virtual machines and left SELINUX enabled, then all will be well, but what happens when you turn that setting off. Well you will end up with VM's that won't load with the error message

error: Failed to start domain Ubuntu1404
error: unsupported configuration: Unable to find security driver for label selinux


It is easy to fix , use the following command and just remove the seclabel section on the virtual machine domain XML - virsh edit Ubuntu1404

# virsh edit Ubuntu1404
...
  <;seclabel type='dynamic' model='selinux' relabel='yes'>;
    <label>system_u:system_r:svirt_t:s0:c95,c664</label>
    <imagelabel>system_u:object_r:svirt_image_t:s0:c95,c664</imagelabel>
  </seclabel>  

Once you have done that, the domains will load as normal.

Make sure if you have backup's of the domain XML, they are also changed, as I have found that they will over write the domain if your not careful

Check in /etc/libvirt/qemu to make sure the changes have happen, and the XML has been updated.

Thursday 3 April 2014

Fixing a problem with VMware vcloud when putting a Virtual Machine back into the cloud Catalog




If you use vcloud, then I'm sure you have pushed fully patched and configured virtual machines back into the catalog as gold masters many times. If you have customised scripts, then you may or may not have come across this problem.

However yesterday, I came across a problem where the custom script settings within vcloud version 5.5 were not working, and the init scripts were not be run when you created a new vapp. This is a setting that tells the VM, if they have been run or not

It turns out the code for pushing VM's back into the catalog was not resetting the static file needed, to tell the init scripts to run correctly. If you look in .customisation in roots home directory, you can see the file it is looking for.

So , the work around - after much digging around in the code to find the file that VMware tools were looking for - is as follows

On a Linux system just type the following.

touch /.guest-customisation-post-reboot-pending


Once this file is in place, shutdown your VM, copy it back to the catalog, and all will be fine on the next start - it will run your desired init scripts as you wanted in the first place ;-)

Hope this saves you some time.

Wednesday 12 March 2014

Setting up Adobe Flash with Wine and Windows Firefox on Linux - all to get VMware vSphere working in a browser






As I regularly need to use vmware software for a lot of cloud implementations , it has become more of a pain to keep switching to a virtual machine just to allow me to use a later version of Flash, that Adobe no longer supports in Linux. This is because VMware in their wisdom have decided that the web version of vSPhere management will only work with Flash version 11.5 and above.

So I decide today to do something about it, and make it easier.

Here are the steps to get it working.

1) Install wine from your Distros repos - or download the latest from WineHQ

2) If you are behind a proxy make sure you have http_proxy set - if this doesn't work then use this util to set the proxy in Wine - Proxycfg.exe - links at bottom
e.g. wine Proxycfg.exe -p http://myproxy-server.co.uk:8080

3) Download and install a Windows version of Firefox from the link below
e.g. chmod u+x Firefox Setup 27.0.1.exe ; wine  Firefox Setup 27.0.1.exe

4) Download the version of Adobe flash I point to in the links - don't go to the Adobe page it doesn't work for me.

5) Run the command "wine install_adobe_flash_11_plugin.exe" and just follow the instructions.

6) Start up firefox with wine, and heh presto you can now connect to the vSphere console, and go to other Adobe sites if you like.

Hope this saves people time when trying to do the same.

Latest stable Windows version of Firefox

Copy of the Proxycfg.exe file for configuring wines proxy settings

The version of Adobe Flash I found to work with Ubuntu 12.04 - wine version 1.4

Wine help on how to use Proxycfg.exe - search page for proxy

Wednesday 12 February 2014

A quick post on how to get Ubuntu 14.04 graphics working with Virtualbox 3.6 with Ubuntu 12.04



This post is going to be short and to the point.

The title is a mouthful I know, but it does describe the problem.

Like all users of Virtualization I like the ability to look at the future and the past of operating systems, but with this combination it was proving problematic.

Basically the screen resolution was dreadful after installing the Virtualbox tools on the Ubuntu 14.04 guest, and something needed to be done.

I trawled the web and found the following commands that should be run in the guest 14.04 virtual machine, and you then get graphic resolutions you can work with for testing.

Here they are.


sudo apt-get update
sudo apt-get upgrade
sudo apt-get install linux-headers-$(uname -r)
sudo apt-get install dkms build-essential
Then mount the install CD image for the Virtualbox tools and install them.
cd /media/nick/VBOXADDITIONS_4.3.6_91406/
sudo ./VBoxLinuxAdditions.run

sudo apt-get install virtualbox-guest-x11

Then, once this is done you will have decent screen resolutions.
Hope this saves you some time and effort.