Easy coloured tail output

As part of my job I’m often watching the output of a tail -f <filename> command run down my terminal window… and on my development and quite testing machines this is all well and good.

But what if the system is a pretty busy one? Well here it can be hard to spot the messages that might be of interest to you. And that is why I use a little trick to highlight a specific word in the output.

How to highlight words in tail output?

1) Basically add the following lines to your .bashrc  file

ctail(){
  tail -f $1 | perl -pe 's/'$2'/\e[1;31;43m$&\e[0m/g'
}

This adds a function available to you in bash that can be then be used to do exactly what you want. Say for example you want to highlight all instances of Error when tailing a file called foo.txt you can run the following.

ctail foo.txt Error

The Developer’s Linux Setup

A quick foreword, this is how I’ve got my relatively new Linux setup running so please, please leave comments to let me know what I’ve overlooked.

As someone who flits between different computers it’s nice to have a common set of tools to help me as a developer… and have a new Ubuntu setup in my home office I thought I’d document those which really help me in day to day work etc.

Development Tools

SciTE – As an all-round editor I just love SciTE (and it’s fun to say it’s name too). It’s a no-nonsense editor with a vast amount of languages supported.

Eclipse – OK, so I don’t really like eclipse but as a tool for developing for Android it does it’s job just fine.

Firefox – Yup, an excellent browser which also hosts some excellent add-ons (Firebug, Web Developer, ColorZilla)

Designer Tools

Balsamiq – For wireframing websites, web apps and mobile applications Balsamiq is pretty good.

Communication

Tweetdeck – What can I say about Tweetdeck apart from it’s a brilliant client for Twitter and Facebook.

Skype – The current Skype client on linux is a little ‘clumsy’ in my opinion and is a fair few releases behind it’s Windows counterparts. As a basic VoIP client though it’s second to none.

Utilities

Adobe Air – This cross platform runtime environment enables you to take advantage of some really super tools and applications.

Dropbox – This is just one of the dandiest apps around… brilliant cloud based storage with cross platforms clients. If you haven’t got it yet what are you waiting for… go get Dropbox now!

EvernoteEvernote is a brilliant cloud based note taking and management app

Filezilla – A few linux fans might not appreciate me mentioning GUI (s)FTP clients such as Filezilla but as an ex-Windows user having familiar tools to winSCP makes the migration much easier.

How to get Dropbox on Linux Working through a Proxy

I was recently a little stumped on getting Dropbox working on my Ubuntu 10.10 install (Maverick Meerkat) through our corporate proxy…. having got it working though I thought I’d share with you.

Dropbox Logo

In a terminal start Dropbox with the following command.

dropbox start
Starting Dropbox...
The Dropbox daemon is not installed!
Run "dropbox start -i" to install the daemon

This tells us that the Dropbox daemon needs to be installed… so run the command as suggested

dropbox start -i

This will start the installer and if you have a proxy in the way then this process will throw you an error. What you need to do is specify the proxy settings (including username and password. For some reason setting it via Gnome (System->Preferences -> Network Proxy) does not seem to work and we need to set the Environment variable http_proxy.

export http_proxy=http://username:password@proxy:8080

If you re-run the dropbox start -i command now the install should proceed as required and you’ll have a nice working install of Dropbox running. Note also that during installation it is possible to set the Proxy information that will be used by Dropbox for everyday running so there is no need to put the previously mentioned export command in your .bashrc file.



[jbox color=”blue” vgradient=”#fdfeff|#bae3ff” title=”Get Dropbox”]If you haven’t got Dropbox yet go grab it from here.[/jbox]