Yahoo! User Interface
August 22, 2007
I’ve been working with the Yahoo! User Interface library a lot lately. I’m planning on doing a lot of examples, etc here … right now, I’m just testing to make sure my post styles work
CODE EXAMPLE
Some code example can go here…
Colorizing the bash shell…
June 28, 2007
Not an app this time around, but still some fun stuff
If you’re like me – colors help to convey information in a very fast manner… when scrolling through log files, directory listings, and such it does help to have a splash of color added.
Here are my bash aliases related to coloring the shell… drop these in your ~/.bashrc if you want them to be added on logon. You can also type them directly at a shell and it will affect only the current shell.
alias ls=”ls –color=auto”
alias less=”less -+C -R”
alias tail=”less +F -R”
Note: the tail alias overrides the actual tail command and uses less in streaming mode to support an updating file with ANSI escape codes. To exit you’ll need to press CTRL-C and then Q. The -+C on less will cause the screen to be cleared between pages (don’t really want that for a less command).
When piping to less or using the aliased tail any ANSI escape codes will be processed and the colors will be changed. The same is true of positioning codes, etc.
If you’re generating files from Perl, the module Term::ANSIColor will help with the insertion of color codes. Just add;
use Term::ANSIColor;
And then you can insert an escape code by calling the ‘color’ function ->
print color(’bold blue’), “This prints in bold blue!”, “\n”;
print color(’reset’); # reset the colors before exiting if you want your shell to look normal.
Another thing you can do is colorize the prompt. My prompt came from somewhere on the ‘net (with some minor changes). I just added the following to my .bashrc;
function elite
{
local GRAY=”\[33[1;30m\]“
local LIGHT_GRAY=”\[33[0;37m\]“
local CYAN=”\[33[0;36m\]“
local LIGHT_CYAN=”\[33[1;36m\]“
local NO_COLOUR=”\[33[0m\]“
case $TERM in
xterm*|rxvt*|screen)
local TITLEBAR=’\[33]0;\W:\u@\h:\w07\]’
;;
*)
local TITLEBAR=”"
;;
esac
local temp=$(tty)
local GRAD1=${temp:5}
PS1=”$TITLEBAR\
\n$GRAY-$CYAN-$LIGHT_CYAN(\
$CYAN\u$GRAY@$CYAN\h\
$LIGHT_CYAN)$CYAN-$LIGHT_CYAN(\
$CYAN\#$GRAY/$CYAN$GRAD1\
$LIGHT_CYAN)$CYAN-$LIGHT_CYAN(\
$CYAN\$(date +%H%M)$GRAY/$CYAN\$(date +%d-%b-%y)\
$LIGHT_CYAN)$CYAN-$GRAY-\
$LIGHT_GRAY\n\
$GRAY-$CYAN-$LIGHT_CYAN(\
$CYAN\$$GRAY:$CYAN\w\
$LIGHT_CYAN)$CYAN-$GRAY-$LIGHT_GRAY “
PS2=”$LIGHT_CYAN-$CYAN-$GRAY-$NO_COLOUR “
}
elite
This will give you a prompt which looks like this;
--(username@hostname)-(01/pts/8)-(1332/28-Jun-07)--
--($:/tmp/blog/posts)-- _
The cursor will end up where the _ is… there is also a blank line added above the prompt which gives a little spacer between any output and the prompt itself.
There are some good prompts out there, just do a google search for “color bash prompt” to find them
Have fun!
Free UNIX Shells
May 8, 2007
Boy, I thought free shell servers were gone a long time ago – but after a quick google this morning while looking for somewhere to bounce a reverse ssh tunnel off of – I discovered they are alive and well. If anyone else finds themselves in the same need, check out “The biggest Free Shell list on the net
“.
Carry on…
Total Commander
May 7, 2007
I was using one of my ’staple’ applications today and realized that there are probably a lot of people who are not familiar with it, so this update is a quick note about Total Commander.
I’ve been using Total Commander (originally named Windows Commander) for over 10 years now and it’s one of the first apps to get installed on any new workstation.
Not just “another shell” or “another file manager”, Total Commander makes hard and impossible tasks easy.
The basics are certainly covered (and then some) and the support for plugins makes this app one you’ll find yourself using for just about every file task under the sun from copying files, to syncing FTP sites, browsing SCP sites and (if you’re a super die-hard geek) – reading and writing email!
Since I’m at work and have to make this short – go check out the Total Commander website. You won’t be sorry
BTW – I just thought of posting this app since I’m heading over to download the CvsBrowser plug-in…
My Rating: 3.5/5 for a base install, 5/5 once plug-ins are added
Firefox Extension: FireBug
March 14, 2007
I’ve recently started working with a lot of JavaScript and CSS and trying to basically follow a complex solution to simplify my life (does that make sense?)
One of the tools which I’ve found to be absolutely invaluable for this is a free Firefox extension called “FireBug”.
You can do everything from DOM inspection to viewing a live JS console, CSS inspection, etc. And of course, the price is right too!
I’ve been using it with the Yahoo! UI library on the front-end UI driven on the back end by Perl/Mod Perl (perlrun) w/Template Toolkit. Not the easiest environment to debug, but this makes it a whole lot easier. Try <script> console.log(”message”); </script> or, if you’re using the Yahoo toolkit -> <script> YAHOO.log(”message”); </script>.
FireBug is available from Mozilla.org at https://addons.mozilla.org/firefox/1843/
Install, develop, be happy.
Until next time…
Trevor
My Rating: 4/5 (will probably call this one a 5/5 once I learn more about how to use it!)
Find and Run Robot
March 8, 2007
The first tool I’d like to bring attention to is a great little desktop application called “Find and Run Robot” from DonationCoder.com. This is a wonderful little freeware/donationware application which will speed up navigation of your desktop considerable. It sits silently in the system tray waiting for a key combo (Ctrl-Space by default, although I always enable Alt-Space as well) at which time it pops up the window below.

Simply start typing the name of the application you wish to run (firefox, for example) and it will search your start menu, desktop and any other folders you’ve defined. A list of options will start filling the box – weighted by a score based on frequency of use and pre-defined rules. Hit enter to run the first app in the window, or ALT-NUM to run any of the apps (by number).If you get tired of hunting around your desktop and start menu and clicking on endlessly nested menus – this is the solution. I can get to 99% of the applications I use daily with a simply hotkey and 2 or 3 characters of the name.
Find and Run Robot is free from donationcoder.com. You’ll need to join their forums for a free license key, or make a donation if you prefer not to join the forums.
My Rating: 5/5