Skip to main content


Showing posts from August, 2007

Manager Tools - my favourite podcast for over 2 years

Back in 2005 I blogged about the podcasts that I subscribe to and one of my favourites was Manager Tools.

Well two years later my list has changed a little (click on the 'podcasts' link on the left for a closer look) but Manager Tools is still my favourite podcast, the moment the show music starts to play in my car I know I'm in for an hour of energetic & informative advice regarding all aspects of management & leadership.

I'm amazed at how much time & effort Michael Auzenne & Mark Horstman put into producing a timely weekly show full of great content with such audio finesse as well.

I was recently very fortunate to get a sneak preview of some of their premium content and I must say if it's all of the same high quality (which with Mike & Mark is a given) then it's definitely worth the month fee.

They are consistantly the number 1 business podcast at PodcastAlley and have won the "Best Business Podcast" for two years in a row. If you o…

Having cron troubles with percent (%) signs in crontabs?

I recently wrote a cronjob which would save off my Ubuntu home server's current packages list every night to a dated file so that I have a history of the changes that I've made to my system. The entry in my crontab looked something like this:
# package lists (5am)
0 5 * * * dpkg -l > /var/log/packages/`date +%F`.txtAfter a couple of days I decided to take a look at the files generated so far but to my disappointment I found none. After a quick search for dpkg in /var/log I found my problem reported in syslog:
... /USR/SBIN/CRON[28508]: ... CMD (dpkg -l > /var/log/packages/`date +)I noticed that the command recorded to the logs was up to '`date +' - the next character - the percent sign (%) - was causing some kind of issue. A quick search threw up the Wikipedia page for Crontab which mentioned:
Another common mistake is to use unescaped % in your command; you have to escape themAll I had to do was change % to be \%. My working crontab entry now looks like this:
# p…

How to open Firefox Google searches in a new tab

I'm always using the built-in Google search box in Firefox to do my research. I used to click the 'New Tab' button (or CTRL-T) to open a fresh tab, then type in the box and hit return to open the results in my newly created tab.

I then found that it will open in a new tab automatically if you use Ctrl-Return rather than just Return when searching. That was a great improvement but if I forgot to hold down Ctrl I would wipe out my current tab with the Google search results.

Well I've found the ultimate solution from an 'Hacking Firefox' article on Computer World found via the excellent LifeHacker blog. It's an about:config value that makes the search results open in a new tab (in the same way that Ctrl-Return did).

To enable it, enter about:config in the location bar. Enter in the "Filter" text box and then double click the listed to change it's value from false to true:

Oh, and if you want the r…

Getting Tomcat contexts to work in IntelliJ IDEA (and stop it starting Tomcat twice!)

If you run Tomcat within IDEA then you might have noticed a couple of things:Your application gets started, undeployed and then started again, increasing the start up time of Tomcat and reinitialising any load-on-startup servlets for a second time.
Your carefully crafted <context>stanzas don't work as IDEA hasn't picked then up from either server.xml or META-INF/context.xml.When you start Tomcat inside IDEA it copies the contents of your Tomcat conf directory to an IntelliJ system area (on Linux it's hidden in your home directory) and then runs Tomcat looking at those configuration files instead of the normal ones. In doing this it seems to ignore any context.xml files, any context stanzas of the server.xml and messes up any context files you might have in conf/Catalina/.

To get around this big mess and just use your Tomcat as if you ran it outside of IDEA you simply add a CATALINA_BASE environment variable to the configuration of Tomcat (within IDEA) pointing to you…

How to get the Home & End keys working in remote Linux shells & terminals

Have you ever SSH'ed onto a remote linux server only to find that your Home and End keys don't take you to the start and end of the line and instead give you a rather unhelpful "~"?

One solution is to use CTRL-A instead of Home and CTRL-E instead of End but I wanted to solve it properly.

The linux command line is managed by readline. The configuration file for controlling key bindings (amongst other things) is /etc/inputrc. In Ubuntu this file contains a number of commented out sections relating to the Home and End keys. To find out which keycodes are being sent to readline when Home & End are pressed I used od - a stdin dump utility which can display ASCII characters or backslash escapes:
$ od -c

<Home key pressed> ^[[7~
<End key pressed> ^[[8~
The key bits here are the 7 and 8, these need to be entered at the very end of /etc/inputrc as follows:
"\e[7~": beginning-of-line
"\e[8~": end-of-lineAfter you've made these changes …