Pages

Custom Colourful Bash Prompt

Bash, a command line shell is one of the most used pieces of software in my daily work. I like scripting repetitive actions to save a lot time (it brings me great joy!). One of the simplest and easiest customisations is to add a bit of colour to your otherwise boring bash prompt (otherwise known as $PS1):

[ngrogan@localhost:~]$

can be turned in to this:

My Colour Bash Prompt

The thing about Bash is the colour codes to achieve this can look archaic:

export PS1="\[$(tput bold)\]\[$(tput setaf 4)\][\[$(tput setaf 6)\]\u\[$(tput setaf 7)\]@\[$(tput setaf 2)\]\h\[$(tput setaf 7)\]:\[$(tput setaf 1)\]\W\[$(tput setaf 4)\]]\\$ \[$(tput sgr0)\]"

To get a prompt like this easily, all you need to do is use this handy $PS1 generator. A highly recommended tool!

Document it (please)

Very good technical documentation skills are a must for any Software Engineer - to explain how a system works in detail forces you to think about the flaws present within the design. "Bad smells" of documentation often can be a sign of weaknesses on your product. Is this section too verbose or did we make it too complex for the customer? Should we explain ancillary parts of our system (either operating system components or other applications?)  within our documentation besides the inherent risks (out-of-date documentation)?

These are all tough questions, but the important part is: it makes you stop and think. This not only applies to your customer facing documents, but internal documentation. In my job I am mostly the one who updates the "New Starts" section of our internal documentation. It is of huge benefit to any new starters on my team, to get them up to speed fast on our processes, tools and ways of working. I believe it saves the new person and myself countless hours of often trivial questions. Of course I always happily answer (and enjoy answering) the tough questions also. This is all well and I hear you say, you get productive software engineers faster, but what is in it for me as a company?

Better retention of customers for one. Recognising the need to keep things simple, have a short and easy to comprehend manual goes a long way to keeping customers loyal. I've been told that the biggest complaint  received is poor documentation and we're lucky that our customers are very forthright and vocal. Good documentation is understandably hard to do, time consuming and easy to sweep aside due to time and cost pressures. In a world where operational expenditure is a key pressure (in both employee and customer time) - I firmly believe that money spent reducing support costs is a very worthwhile investment. Like investments in refactoring code, these investments take time to pay off - but ultimately will.


Tor Talks

If you haven’t heard of Tor, it is alternative internet - one with privay in mind. I’ve recently started to watch a lot of technical talks online. The two main guys behind Tor are some of the best speakers I’ve seen. They describe in great detail how open source works and the myriad of open source projects around Tor in this talk:

and in an older talk they describe how countries have tried to censor Tor and how they have combatted some censorship (interesting for the technical measures deployed):

Of course as is metioned in the first talk, Tor is mainly funded by the US Government. Asked why they should be trusted - they say they shouldn’t be. Don your tinfoil hat now!