Archive for July, 2005

Prompt Promptly

2005-07-08

When providing command examples for others I change my ksh prompt from my more informative prompt to the default ksh dollar sign.

Actually this all started years back when I first worked at Prime
Computer Solution Centre in Hayes. It was a habit I learned quickly
as a well respected colleague, David Brown (Thanks for all your help
David, much appreciated… where are you now?) would not give me
advice with a long Primos CPL prompt that caused my command line to
wrap and foul up ‘como’ files (that’s script(1) in UNIX speak).

To change the prompt promptly to and from the default I have two aliases
set up, spromt and lprompt (at Prime I named them
dave and stace respectfully). These work like this:

enoexec(5.11-64)$ sprompt
$ alias sprompt
sprompt=PS1='"$OPS1";export PS1'
$ alias lprompt
lprompt=PS1='"$LPS1"; export PS1'
$ lprompt
enoexec(5.11-64)$

The values of environment variable OPS1 and LPS1 are set in a
script which is ‘sourced’ by my .profile, the script includes:

## Set up prompt; use sprompt or lprompt alias to exchange prompts...
[[ -x /bin/isainfo ]] && bits="-$(/bin/isainfo -b)" || bits=""
[[ $(/bin/uname -p) == "i386" ]] && bits="${bits}i"
case $TERM in
"sun-cmd") # For some reason 'tput' fails to work for sun-cmd!
bold='33[K7m'
norm='33][m'
break;;
"emacs") # tput complains about emacs
bold=""
norm=""
break;;
*)
bold=`tput bold`
norm=`tput sgr0`
;;
esac
[[ $(/bin/id) == *root* ]] && OPS1='# ' || OPS1='$ '
export OPS1
## if parent used /bin/script then use simple prompt.
if [[  $(/bin/ps -p$PPID) == *script* ]]; then
export PS1=$OPS1
else
LPS1="$bold$UNAME($(/bin/uname -r)${bits})$norm$OPS1"
export PS1="$LPS1"
fi
unset bits bold norm

Stace

Tag:

Somebody’s watching me

2005-07-06

While working a solution today I viewed a file over the network
from within XEmacs. To do this I simply invoked EFS by specifying a
slightly different path to find-file-at-point, i.e. by pressing
Control-X Control-F. At the prompt “Find File” I then specified the
path as /userid@hostname:pathname

Well it seems this set alarms bells going on the internal network
as the file I loaded was ‘passwd’. You see under the hood this key
sequence opened up an FTP session to the server name and logged in as
me, did a cd to the correct directory and then did a ftp ‘get
passwd’.

From now on I will be using ‘tramp
in place of EFS which instead of using ftp it uses SSH. To use ‘tramp’ all I have to
do is use a slightly different syntax when prompted for the file name.

For tramp at the “Find File” prompt I simply use /[hostname]pathname

Those square brackets are needed, their not optional which through
me for a moment.

Control-X Control-K

Stace

Tag:

Switched on and hot… But nobodys watching.

2005-07-02

I often pop in to the office on a Saturday, I pass it on my way to our daughters singing and dance classes, and so I pop in to drop off some clean clothes and things so that I don’t have to carry them on my bicycle during the week.

The first thing one notices is that the building is in darkness and as you approach lights switch on to light the way. What a great energy saving idea that is.

The second thing I notice is the number of monitors switched on displaying “Enter your user id” or some pretty screen saver. What a waste of Energy, these monitors are running for around 48 hours over the weekend with absolutely nothing useful displayed on them.

Personally I switch my monitor off every night before I leave. But surely there is a way to have the monitor enter “energy star” power saving automatically?

Favourite Musicals

2005-07-01

Isamu, a talented colleague here at Sun, just asked me if I could recommend a musical to go and see in a theatre.

Well, personally I love musicals and I don’t think I have seen a bad one. But then I have not seen them all 😉

At number 1 I’d have to say Miss Saigon. I really enjoyed it. The whole play from beginning to end is just magical, its amazing how they manage to do so much on the stage.

Number 2 has got to be Singing in the Rain. And you simply must be sitting in the first few rows to get the full affect. Brilliant.

At number 3 I’m going to say Mumma Mia. The story is corny to say the least, but if you like ABBA then this musical is a lot of fun.

Others I would recommend are Blood Brothers, Jesus Christ Super Star, Joseph and the Technicoloured Dream Coat, The Lion King, Oliver, The Phantom of the Opera and Chitty-Chitty Bang-Bang.

One that I still have to see is “Les Miserables”.

So while I’m on the subject of theatre I have just got to recommend the play “The Woman in Black”. It is a tragic tale that has you jumping out of your seat throughout. I loved it.