MikeBD

weblog for MikeBD.com. Musings of a 24/6 techie (Software Architect / Technical Manager) family guy struggling to find meaning, balance and strong design / implementation supporting excellent user experiences.

Your Ad Here Your Ad Here Your Ad Here

Wednesday, August 02, 2006

Got me a new PC - part 2: command line fun + a sidebar on how timesheets suck

In part 1 - hardware / OS platform, I discussed the rationale behind purchasing a new PC laptop and configuring it with Windows as a virtual machine host and Ubuntu as a guest OS.

The unfortunate reality of my professional life for the last few years has been that I have spent most of my time in meetings or using MS Word, Outlook, Project and a series of horribly designed timesheet management applications.

Is there a rule in some obscure tome that precludes any usability testing on timesheet applications? One of these timesheet applications was so bad, that I built my own front end to it which quickly grew in popularity amongst the staff. I have enough trouble understanding why employees are made to suffer with the chore of recording their time in the first place. Any manager that is paying attention should be able to account for the time their staff is spending in enough detail to serve realistic enterprise reporting needs. Especially in companies that routinely expect staff to work unpaid overtime, it is counterproductive to force overworked employees to record a detailed accounting of their time. In the companies I have worked for, I have witnessed much more selfless effort contributed by teams that were not asked to keep timesheets than I have seen at other organizations.
My coding habit is crying out for some attention and that is a big part of why I recently changed jobs. When not using MS bloatware and attending endless meetings, any self respecting software developer spends a lot of time at a command line.

Tweaking the command line experience is an up-front task that I always do with every new development environment. The rewards of such time investment in capability and productivity are many.

The first step many take on a Windows machine is installing Cygwin. This provides a Unix style shell environment and portability layer for running Unix commands in Windows. The command shell native to cygwin is, for the most part, not a big step forward from the Windows command shell.

Power users that have experimented with various terminal environments know many benefits that others never realize they are lacking. Tabbed shells in one parent window, split / tiled windows, command macro environments specific to terminal operation (not shell scripting)...

GNU Screen is one great utility in this class that deserves a look by anyone who spends significant time at a command line (especially if it is at multiple concurrent command lines in separate windows). This is the only option of its caliber that I know of that can be used in pure text (telnet, SSH) environments.

In addition to the pure text mode terminal utilities, further usability and functional enhancements are available through X windows GUI terminal emulators. Those running a KDE desktop have access to Konsole which drove my expectations when looking for a lightweight, fast, feature laden option that is a step up from xterm, without all the overhead of a full KDE or Gnome footprint. Konsole can be run outside of a full KDE session and that was my original plan.

I started looking through the X terminals installed with cygwin which led me to rxvt. It was a nice step up over xterm but still a ways away from what I remember having with Konsole. But it led me to a very happy place when I found mrxvt. mrxvt does not do all that GNU Screen does but I plan to use them together to get the best of both worlds. mrxvt for a tabbed interface with highly configurable look and feel and macro support + Gnu Screen for split / tiled windows inside the tabs + additional macro support. Truly, I think I could go a long time with just mrxvt given the availability of X windows on the machine hosting the terminal process and leave Screen for the pure text mode connections. However, they both have their strengths and I hope they will play together nicely (I have not tried the combination yet - perhaps a future post will document that).

I have mrxvt running in cygwin on Windows and on Ubuntu. The install for cygwin was a simple:
  • download of source
  • tar zxf
  • ./configure --enable-everything --disable-debug
  • make
  • make install
The Ubuntu configuration took longer, I suspect because it is a clean server install and I had to apt-get a lot of development and X tools and libraries before the .configure would run cleanly. I probably went through 10 or so google searches as a newbie trying to figure out all the packages I needed to install. If I recall correctly, something like the following (before the ./configure step should do the trick):
  • sudo apt-get install build-essential libx11-dev libfontenc-dev libxaw-headers libxmu-headers libxft-dev
  • optionally, if you want background images in these formats:
    sudo apt-get install lib{jpeg62,png,tiff4}-dev
I used the very nice checkinstall package (sudo apt-get install checkinstall) to replace the final 'make install' step with 'sudo checkinstall' which monitors the installation and creates a package that can be distributed and removed / upgraded in the future.

The apt-get for lib{jpeg62,png,tiff4}-dev and checkinstall both require universe repository support. Enable that by uncommenting the corresponding 2 lines in /etc/apt/sources.list and perform a 'sudo apt-get update'.
The next step is man mrxvt and editing ~/.mrxvtrc to get a comfortable look and feel. I am using white on black as my colour scheme and dircolor support by putting alias ls='ls --color' in ~/.profile on cygwin (it is already enabled in Ubuntu).

My .mrxvtrc looks like:
# Look and Feel
Mrxvt.background: Black
Mrxvt.foreground: White
Mrxvt.geometry: 100x40
Mrxvt.saveLines: 3000
Mrxvt.scrollbarRight: True
Mrxvt.scrollabrStyle: next
Mrxvt.showMenu: True
Mrxvt.syncTabIcon: True
Mrxvt.syncTabTitle: True
Mrxvt.xft: True
Mrxvt.xftAntialias: True
Mrxvt.xftSize: 12

#Functionality
Mrxvt.loginShell: True
The following is a screen shot of 3 mrxvt terminals, each with different font settings, to show the difference in quality. They are arranged top down from worst to best (IMO). The respective settings are:
  1. xft without antialiasing:
    Mrxvt.xft: True
    Mrxvt.xftAntialias: False
  2. xft off:
    Mrxvt.xft: False
    Mrxvt.font: -misc-fixed-medium-*-*-*-14-*-*-*-*-*-*-*
  3. xft with antialiasing:
    Mrxvt.xft: True
    Mrxvt.xftAntialias: True

If xft is available to you, and the mrxvt host is local or near to your X server on the network, then use xft with antialiasing. If there is a lot of network latency between the mrxvt host and your X server, then turn xft off rather than running it without antialiasing (which would otherwise be required to have decent performance given the network overhead).

I haven't yet gotten to all the macro programming of the mrxvt terminal or integration with GNU Screen yet, but I hope this is enough to get you interested in exploring the world of power terminal tools.

When I'm not at the command line, I expect to use mc (midnight commander) for file management, gvim / vim for straight text editing and eclipse for Java and now PHP coding / debugging.

Happy coding :)

Got me a new PC - part 1: hardware / OS platform

I tend to go a long time between PC upgrades, generally preferring to plunk down for near-top-of-the-line systems / components and riding them for 4-5 years. My progression of PCs has gone something like: Commodore 64, Intel 386, AMD K6, AMD Athlon XP, Intel Core Duo.

I built the 386 and K6 machines myself from wholesale parts. The Athlon was sourced from the same wholesale vendor but I chose to let them put it all together for me. The new guy is a Dell Laptop. Seems I've come full circle on sourcing since the Commodore 64, I just hope this laptop will not go through as many power supplies...

The Athlon is still running Windows 2000 Professional, which is an install that was carried forward from the K6. The laptop has Windows XP professional. Both of these serve as host OS to VMware virtual machines that run various flavours of consumer Windows releases (for testing software development and installs) and Linux. VMware can be configured the other way around (Linux host, Windows guest) but I prefer to give Windows the native view of the hardware as it is more resource intensive.

With all the recent hype around the Intel Core Duo Macintosh machines, I was really tempted to go that direction with this purchase. I will likely need a Mac Mini or iMac in order to test web development on OS X. However, it just seems too soon to bet on the new Apple hardware, I think it needs some time to mature.

From a productivity point of view, I am happy to defer the Mac purchase as I don't have loads of time to spend learning and configuring a new toy - err, development environment. Since most of my development lately is server side / browser based client, any learning on the client OS configuration of the Mac will offer little savings for my professional skills development.

This PC will be my primary development and customer demo platform for both my independent consulting (Benilan - custom business software, database and website development) and day job (Avema - telecom expense management) efforts.

So, with all that in mind, I went for the best Windows laptop (D820) I could spec out in my budget. The primary needs I wanted this machine to fulfill are basic office productivity, Java / LAMP development and possibly some MS Visual C++ 6, VB 6 and C#.Net development.

My currently active development projects are Java and PHP4 / MySQL work. I would like to do PHP5 and Ruby / Rails soon.

The high level software stack on the new machine looks like:
It is possible to facilitate most of LAMP development (pseudo-Linux, Apache, MySQL, PHP) natively under Windows or through the cygwin emulation layer. However, I prefer to use Windows + cygwin as a "thin as possible" client layer to services running in a true Linux environment.

In the past I have run RedHat linux many times and was looking forward to trying out Fedora. However, the draw of Ubuntu's famed ease of use and administration drew me in. In less than 1 hour I was able to install VMware, download Ubuntu, install Ubuntu and login :) How far we've come from the days of FTPing Kernel sources and compiling Linux by hand...

My experience installing software packages for Ubuntu using apt-get so far has been a true joy. Nothing I could ever have said about previous experience trying to align library versions and other dependencies in RedHat while compiling projects from sources. The Ubuntu tag line - "Linux for human beings" is holding up nicely so far.

Since I am running Ubuntu in a virtual machine and mostly for server side tasks, I am happy to leave the whole Gnome / KDE debate to others and run a minimal X install with basic terminal and file manager utilities. Cygwin serves as my X server and hosts terminals from both the Windows host and Ubuntu guest operating systems.

There are many resources available to help with installation of any of the above. So rather than recreate the wheel with HOWTOs, I will focus on the what and why of my configuration for those that are interested and may like to follow along at home :) If you get stuck with your installation and would like me to comment on how I got stuff working, feel free to use the comments or contact me directly. I will write up the answers to any common questions that seem to lack readily available reference resources.

Up next: command line fun...