Wednesday, April 29, 2009

CPU and MEM Usage of Processes

In Solaris, if you want to find out the percentage of CPU and memory utilisation of processes, you will use the /usr/ucb/ps aguxwww to get the details. However, sometimes the value from SZ column may be too big and overflow the formatting, as highlighted in red.
$ /usr/ucb/ps aguxwww
USER       PID %CPU %MEM   SZ  RSS TT       S    START  TIME COMMAND
root     23190  0.0  0.0 7608 4080 ?        S 08:27:47  0:00 /usr/lib/ssh/sshd
chihung  23252  0.0  0.0 3464 3040 pts/21   O 08:28:06  0:00 /usr/ucb/ps -aguxwww
root     22658  0.0  0.0    0    0 ?        S   Oct 25  0:00 zsched
root     22676  0.0  0.0 2024 1200 ?        S   Oct 25  0:16 /sbin/init
root     22678  0.0  0.110808 9496 ?        S   Oct 25  1:57 /lib/svc/bin/svc.startd
root     22680  0.0  0.1 9496 8560 ?        S   Oct 25  2:20 /lib/svc/bin/svc.configd
daemon   22720  0.0  0.0 3808 2128 ?        S   Oct 25  0:00 /usr/lib/crypto/kcfd
root     22726  0.0  0.0 4028 2824 ?        S   Oct 25  6:37 /usr/sbin/nscd
root     22782  0.0  0.0 2264 1048 ?        S   Oct 25  0:32 /usr/sbin/cron
daemon   22786  0.0  0.0 2280 1088 ?        S   Oct 25  0:00 /usr/sbin/rpcbind
daemon   22788  0.0  0.0 2336 1624 ?        S   Oct 25  0:00 /usr/lib/nfs/statd
daemon   22793  0.0  0.0 2068 1400 ?        S   Oct 25  0:00 /usr/lib/nfs/lockd
root     22794  0.0  0.0 1696  968 ?        S   Oct 25  0:03 /usr/lib/saf/sac -t 300
root     22798  0.0  0.0 1920 1184 ?        S   Oct 25  0:03 /usr/lib/saf/ttymon
root     22801  0.0  0.0 4972 3436 ?        S   Oct 25  0:00 /usr/lib/inet/inetd start
root     22804  0.0  0.0 1060  680 ?        S   Oct 25  0:15 /usr/lib/utmpd
root     22807  0.0  0.0 1952 1236 console  S   Oct 25  0:00 /usr/lib/saf/ttymon -g -d /dev/console -l console -T vt100 -m ldterm,ttcompat -
root     22870  0.0  0.0 4276  984 ?        S   Oct 25  0:00 /usr/lib/autofs/automountd
root     22871  0.0  0.0 4616 1968 ?        S   Oct 25  0:39 /usr/lib/autofs/automountd
root     22878  0.0  0.0 3352 1500 ?        S   Oct 25  0:00 /usr/lib/ssh/sshd
root     22882  0.0  0.0 3720 1756 ?        S   Oct 25  2:34 /usr/sbin/syslogd
root     22923  0.0  0.0 1700 1100 ?        S   Oct 25  0:00 /usr/sadm/lib/smc/bin/smcboot
root     22926  0.0  0.0 1696  748 ?        S   Oct 25  0:00 /usr/sadm/lib/smc/bin/smcboot
root     22927  0.0  0.0 1696  748 ?        S   Oct 25  0:00 /usr/sadm/lib/smc/bin/smcboot
root     22934  0.0  0.0 1888  716 ?        S   Oct 25  0:00 /usr/lib/locale/ja/wnn/dpkeyserv
root     22941  0.0  0.0 1572  648 ?        S   Oct 25  0:00 /usr/lib/locale/ja/wnn/jserver
root     22942  0.0  0.0 2264 1536 ?        S   Oct 25  0:00 /usr/lib/locale/ja/wnn/jserver_m
root     22946  0.0  0.0 1732  764 ?        S   Oct 25  0:00 /usr/lib/locale/ja/atokserver/atokmngdaemon
root     22951  0.0  0.0 2816 1400 ?        S   Oct 25  0:00 /usr/lib/im/htt -port 9010 -syslog -message_locale C
root     22953  0.0  0.0 4424 2448 ?        S   Oct 25  0:00 htt_server -port 9010 -syslog -message_locale C
root     22961  0.0  0.0 4400 1820 ?        S   Oct 25  0:00 /usr/dt/bin/dtlogin -daemon
root     23033  0.0  0.1 6828 5020 ?        S   Oct 25  1:28 /usr/sfw/sbin/snmpd
chihung  23197  0.0  0.0 7388 2004 ?        S 08:27:47  0:00 /usr/lib/ssh/sshd
chihung  23200  0.0  0.0 2524 1784 pts/21   S 08:27:47  0:00 -bash

Here I will show you couple of 'clean' ways to get processes' %CPU and %MEM.

  • With OpenSolaris, you can browse the source code and modify the formatting of the /usr/ucb/ps ps(1b). You can download the source code from here.
  • You can use the "-o" flag in /usr/bin/ps ps(1) to specify what you want the output to be. Here I get ps to list out only the PID, User, %CPU, %MEM and the command. Handy, isn't. man ps to find out all the format specification, or type in some garbage flags for a quick help (see below)
    $ ps -ef -o 'pid,user,pcpu,pmem,args'
      PID     USER %CPU %MEM COMMAND
    22951     root  0.0  0.0 /usr/lib/im/htt -port 9010 -syslog -message_locale C
    22680     root  0.0  0.1 /lib/svc/bin/svc.configd
    22878     root  0.0  0.0 /usr/lib/ssh/sshd
    22793   daemon  0.0  0.0 /usr/lib/nfs/lockd
    22927     root  0.0  0.0 /usr/sadm/lib/smc/bin/smcboot
    22798     root  0.0  0.0 /usr/lib/saf/ttymon
    22942     root  0.0  0.0 /usr/lib/locale/ja/wnn/jserver_m
    22961     root  0.0  0.0 /usr/dt/bin/dtlogin -daemon
    22678     root  0.0  0.1 /lib/svc/bin/svc.startd
    22953     root  0.0  0.0 htt_server -port 9010 -syslog -message_locale C
    22804     root  0.0  0.0 /usr/lib/utmpd
    22788   daemon  0.0  0.0 /usr/lib/nfs/statd
    22871     root  0.0  0.0 /usr/lib/autofs/automountd
    22720   daemon  0.0  0.0 /usr/lib/crypto/kcfd
    22923     root  0.0  0.0 /usr/sadm/lib/smc/bin/smcboot
    22882     root  0.0  0.0 /usr/sbin/syslogd
    23033     root  0.0  0.1 /usr/sfw/sbin/snmpd
    22676     root  0.0  0.0 /sbin/init
    22926     root  0.0  0.0 /usr/sadm/lib/smc/bin/smcboot
    22934     root  0.0  0.0 /usr/lib/locale/ja/wnn/dpkeyserv
    22794     root  0.0  0.0 /usr/lib/saf/sac -t 300
    22941     root  0.0  0.0 /usr/lib/locale/ja/wnn/jserver
    22807     root  0.0  0.0 /usr/lib/saf/ttymon -g -d /dev/console -l console -T vt100 -m ldterm,ttcompat -
    22782     root  0.0  0.0 /usr/sbin/cron
    22726     root  0.0  0.0 /usr/sbin/nscd
    22786   daemon  0.0  0.0 /usr/sbin/rpcbind
    22870     root  0.0  0.0 /usr/lib/autofs/automountd
    23197  chihung  0.0  0.0 /usr/lib/ssh/sshd
    23190     root  0.0  0.0 /usr/lib/ssh/sshd
    23200  chihung  0.0  0.0 -bash
    23467  chihung  0.0  0.0 ps -ef -o pid,user,pcpu,pmem,args
    22946     root  0.0  0.0 /usr/lib/locale/ja/atokserver/atokmngdaemon
    22801     root  0.0  0.0 /usr/lib/inet/inetd start
    22658     root  0.0  0.0 zsched
    
    $ ps -garbage
    ps: arbage is an invalid non-numeric argument for -g option
    usage: ps [ -aAdeflcjLPyZ ] [ -o format ] [ -t termlist ]
            [ -u userlist ] [ -U userlist ] [ -G grouplist ]
            [ -p proclist ] [ -g pgrplist ] [ -s sidlist ] [ -z zonelist ]
      'format' is one or more of:
            user ruser group rgroup uid ruid gid rgid pid ppid pgid sid taskid ctid
            pri opri pcpu pmem vsz rss osz nice class time etime stime zone zoneid
            f s c lwp nlwp psr tty addr wchan fname comm args projid project pset
    
    
  • Compile this ps and ptime mashup. This gives you the CPU breakdown in USR and SYS over a certain interval.

With this, you should be able to plot the CPU/MEM utilisation of processes.

Labels:

Friday, April 17, 2009

Inspiring Quotes, Part 2

Two weeks ago, I posted Inspiring Quotes, Part 1. Here is Part 2:

Inspiring Quotes (Part II)

"Life's challenges are not supposed to paralyze you, they're supposed to help you discover who you are. - Bernice Johnson Reagon

"Challenges are what make life interesting; overcoming them is what makes life meaningful. - Joshua J. Marine

"There are only two ways to live your life. One is as though nothing is a miracle. The other is as if everything is. " - Albert Einstein

"The measure of a man is the way he bears up under misfortune. - Plutarch

"When life gives you a hundred reasons to cry, show life that you have a thousand reasons to smile. - Duke Ellington

"Change your thoughts and you change your world. - Norman Vincent Peale

"No one can make you feel inferior without your consent. - Eleanor Roosevelt

"Life is either a daring adventure or nothing. - Helen Keller

"In the end, what we regret most are the chances we never took." - Frasier Crane

"It is hard to fail, but it is worse never to have tried to succeed. - Theodore Roosevelt

"A bend in the road is not the end of the road... unless you fail to make the turn." - Unknown

"The block of granite which was an obstacle in the pathway of the weak, became a stepping-stone in the pathway of the strong. - Thomas Carlyle

"A smooth sea never made a skillful mariner. - Anonymous

"Obstacles are those frightful things you see when you take your eyes off your goals. - Anonymous

"Our greatest glory is not in never failing, but in rising up every time we fail. - Ralph Waldo Emerson

"What happens to a man is less significant than what happens within him. - Louis L. Mann

"What lies behind us and what lies before us are tiny matters compared to what lies within us." - Emerson

Labels:

Tuesday, April 14, 2009

OpenSolaris Live USB Creator in Windows

Last Saturday, Hiroshi Chonan announced this:
Hello All!

Nowadays, there are lot of OpenSolaris-flavored USB Images. Didn't you
feel difficult when creating LiveUSB sticks?
Do you want to create sticks using easy way on Windows PC?

I wrote utility to create OpenSolaris LiveUSB stick which work under
Windows OS.

Please check URL below ;
http://devzone.sites.pid0.org/OpenSolaris/opensolaris-liveusb-creator
Hiroshi Chonan

--
Hiroshi Chonan
SCA # OS0255

Labels:

Saturday, April 11, 2009

Google Uncloaks Their Servers and Data Centre

Not sure whether you know that Google does not buy servers from vendors, instead they build their own. Do you know that their data centres do not come with UPS power because each server has its own 12-volt battery to supply power if there's a problem with the main source of electricity.

Read this article for more details.

This video features Google container data center tour

Shouldn't those who work in data centre given hearing protector. See the video at 4:19.

Labels: ,

An Interview With One of the AWK Inventors

Read this interview with one of the AWK inventors, Brian Kernighan.

AWK is definitely one of my favourite tools in my Swiss Army Knife

Labels:

Friday, April 10, 2009

Serialise Asynchronous Shell Scripts

You know that your shell script will break if more than one copy is running in the system. You also know that your script will be launched via a scheduler and you do not have control on when the job will be run. In such situation, you may want to have some form of locking mechanism feature in your script to ensure serialisation. First, your script has to start with acquiring a lock before doing any work. If not, it will have to go into a spin and check periodically to see whether such lock is still available, else exit if such lock cannot be acquired within a certain period. Removal of lockfile is part of the cleanup process when the script terminates.

Here is my sample template to implement what I described above. Hope it can help you to serialise your asynchronous jobs.

#! /bin/ksh


trap "lock_release" 0 1 2 3 5 9 15
LOCK_FILE="${TMPDIR:-/tmp}/lockfile-${0##*/}"
too_old=86400; # 1 day, 86400 seconds
verbose=1


debug()
{
        [ $verbose -eq 1 ] && echo $*
}
lock_acquire()
{
        debug "Acquiring lock ..."

        #
        # if lockfile is too old, remove it
        #
        if [ -f $LOCK_FILE ]; then
                tdiff=`perl -e '@a=stat("'$LOCK_FILE'");print time()-$a[9]'`
                if [ $tdiff -gt $too_old ]; then
                        debug "Lock file ($LOCK_FILE) is older than 1 day, remove it"
                        rm -f $LOCK_FILE
                fi
        fi

        spin=5
        timeout=30
        howlong=0
        while :
        do
                if [ ! -f $LOCK_FILE ]; then
                        touch $LOCK_FILE
                        LOCK_STATUS=0
                        break
                fi
                sleep $spin
                (( howlong = howlong + spin))
                if [ $howlong -gt $timeout ]; then
                        LOCK_STATUS=1
                        break
                fi
                debug "Waited ${howlong}s for lockfile ($LOCK_FILE) to be released"
        done

        if [ $LOCK_STATUS -eq 1 ]; then
                debug "ERROR. Unable to acquire lock. Exit."
                exit 1
        fi
        debug "OK. Lock ($LOCK_FILE) acquired."
        return $LOCK_STATUS
}
lock_release()
{
        if [ $LOCK_STATUS -eq 0 ]; then
                debug "Releasing lock ($LOCK_FILE)"
                rm -f $LOCK_FILE > /dev/null 2>&1
        fi
}
lock_acquire


# ----- main program ------
debug "Do something"
sleep 30

Try to run this script in a few terminals to have a feel yourself.

Labels:

paste: too many files- limit 12, in Solaris

When you collect performance data from system, very often you would want to prepend with timestamp (HH:MM:SS). Suppose you collect similar data across a number of servers, you would want to put them together and have them imported in your favourite spreadsheet software for further analysis.

In UNIX, you can paste them together. Below I will create 20 files (host*.txt) with some random data prepended with timestamp

$ for i in `perl -e '$,=" ";print 1..20'`
do
        for j in 1 2 3 4 5 6 7 8 9
        do
                ((v=RANDOM%100))
                echo "0$j:00:00 $v"
        done > host$i.txt
done

$ paste host1.txt host2.txt host3.txt host4.txt
01:00:00 56     01:00:00 61     01:00:00 83     01:00:00 50
02:00:00 59     02:00:00 1      02:00:00 96     02:00:00 72
03:00:00 31     03:00:00 33     03:00:00 71     03:00:00 60
04:00:00 54     04:00:00 29     04:00:00 61     04:00:00 36
05:00:00 62     05:00:00 69     05:00:00 25     05:00:00 36
06:00:00 2      06:00:00 72     06:00:00 76     06:00:00 8
07:00:00 69     07:00:00 59     07:00:00 91     07:00:00 89
08:00:00 51     08:00:00 75     08:00:00 80     08:00:00 61
09:00:00 17     09:00:00 12     09:00:00 59     09:00:00 83

Looks promising. Now, I need to get rid of the redundant timestamp. With AWK, we just have to take the even field values.

$ paste host1.txt host2.txt host3.txt host4.txt | awk '
{
        printf("%s\t%d", $1, $2)
        for ( i=4 ; i<=NF ; i+=2 ) {
                printf("\t%d",$i)
        }
        printf("\n")
}'
01:00:00        56      61      83      50
02:00:00        59      1       96      72
03:00:00        31      33      71      60
04:00:00        54      29      61      36
05:00:00        62      69      25      36
06:00:00        2       72      76      8
07:00:00        69      59      91      89
08:00:00        51      75      80      61
09:00:00        17      12      59      83

So far so good. Now I want to do that for all the hosts (host*.txt). You can use Bash brace expansion to supply the arguments to paste

$ paste host{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}.txt
paste: too many files- limit 12

Ouch! paste cannot take more than 12 files. Stuck ? What we can do is to do one file at a time within a loop. Since I want the output to be imported to spreadsheet, I will output that as comma separated values (CSV) file (all_hosts.csv)

$ tmpfile=".tmp-$$"

$ cp /dev/null all_hosts.csv

$ for i in `perl -e '$,=" ";print 1..20'`
do
        f="host$i.txt"
        paste all_hosts.csv $f > $tmpfile
        mv $tmpfile all_hosts.csv
done

Now we have all the hosts data in one file. The final step is to remove the redundant timestamp.

$ awk '
{
        printf("%s,%d", $1, $2)
        for ( i=4 ; i<=NF ; i+=2 ) {
                printf(",%d",$i)
        }
        printf("\n")
}' all_hosts.csv
01:00:00,56,61,83,50,22,6,83,10,6,88,75,61,46,24,33,8,82,90,29,90
02:00:00,59,1,96,72,80,63,5,61,42,90,7,24,78,58,5,85,35,79,0,46
03:00:00,31,33,71,60,99,41,61,92,34,84,61,46,8,1,52,10,21,82,84,69
04:00:00,54,29,61,36,7,85,69,2,26,42,56,82,17,14,93,95,45,76,3,37
05:00:00,62,69,25,36,54,42,81,8,2,94,44,10,44,28,64,68,96,22,9,45
06:00:00,2,72,76,8,96,21,85,35,89,92,93,98,31,99,67,25,77,43,73,9
07:00:00,69,59,91,89,39,72,11,45,90,9,28,15,22,3,66,64,83,46,60,40
08:00:00,51,75,80,61,22,60,61,12,37,66,24,34,92,21,63,99,27,45,40,35
09:00:00,17,12,59,83,32,44,78,91,16,89,97,52,81,52,51,59,78,14,85,49

Labels: , , ,

Tuesday, April 07, 2009

Think Big

Suppose you have some command output consists of hexadecimal that require to be converted to decimal number, likely you will use bc to work it out
$ bc
ibase=16
ABCDEF
11259375
abcdef
syntax error on line 3, teletype
0089
137
^D

So if you want to make use of it in shell script, you need to do the following. Bear in mind that bc only accept uppercase hex number.

$ echo "ibase=16; ABCDEF" | bc
11259375

$ echo "ibase=16; abcdef" | bc
syntax error on line 1, teletype

$ echo "ibase=16; abcdef" | tr '[a-z]' '[A-Z]' | bc
syntax error on line 1, teletype
1123455

$ echo "abcdef" | tr '[a-z]' '[A-Z]' | xargs -I{} echo 'ibase=16;{}' | bc
11259375

This may work fine for small data set. However, if you need to loop through thousands of lines to do hex to dec convert, it becomes a performance problem. Below I am going to show you what are the alternatives.

Traditional shell script way. You can see how slow it is when we throw it with large data set.

$ cat hex.input
drive1 0089
drive2 0a2f
drive3 1FFE
drive4 980B
drive5 0011780c

$ cat hex2dec-sh.sh
#! /bin/sh


if [ $# -ne 1 ]; then
        echo "Usage: $0 <hex-input>"
        exit 1
fi


cat $1 | while read drive hex
do
        dec=`echo $hex | tr '[a-z]' '[A-Z]' | xargs -I{} echo "ibase=16; {}" | bc`
        echo "Drive=$drive, Hex=$hex, Dec=$dec"
done

$ time ./hex2dec-sh.sh hex.input
Drive=drive1, Hex=0089, Dec=137
Drive=drive2, Hex=0a2f, Dec=2607
Drive=drive3, Hex=1FFE, Dec=8190
Drive=drive4, Hex=980B, Dec=38923
Drive=drive5, Hex=0011780c, Dec=1144844

real    0m0.042s
user    0m0.011s
sys     0m0.065s

$ for i in `perl -e '$,=" "; print 1..1000'`
do
    cat hex.input
done > hex.big

$ wc -l hex.big
    5000 hex.big

$ time ./hex2dec-sh.sh hex.big > /dev/null

real    0m32.141s
user    0m9.131s
sys     0m56.458s

What if I have a few million lines to convert? You will need a lot of coffee breaks. The alternative is to use some high level scripting languages, such as Perl, Python, Tcl, ... In fact you can crank out your own function in AWK to do this kind of thing. Here I will show you a Perl one-liner and the AWK way.

Perl one-liner:

$ time perl -ne 'chomp();@l=split(/\s+/);print "Drive=",$l[0]," Hex=",$l[1]," Dec=",hex($l[1]),"\n"' < hex.input
Drive=drive1 Hex=0089 Dec=137
Drive=drive2 Hex=0a2f Dec=2607
Drive=drive3 Hex=1FFE Dec=8190
Drive=drive4 Hex=980B Dec=38923
Drive=drive5 Hex=0011780c Dec=1144844

real    0m0.008s
user    0m0.003s
sys     0m0.005s

$ time perl -ne 'chomp();@l=split(/\s+/);print "Drive=",$l[0]," Hex=",$l[1]," Dec=",hex($l[1]),"\n"' < hex.big  > /dev/null

real    0m0.044s
user    0m0.038s
sys     0m0.005s

AWK way:

$ cat hex2dec-awk.sh
#! /bin/sh


if [ $# -ne 1 ]; then
        echo "Usage: $0 <hex-input>"
        exit 1
fi


nawk '
function hex2dec(hex, h, i, factor, n, sum) {
        n = length(hex)
        factor = 1
        sum = 0
        for ( i=n ; i>0 ; --i ) {
                h = substr(hex, i, 1)
                if ( h == "a" || h == "A" ) { h=10 }
                if ( h == "b" || h == "B" ) { h=11 }
                if ( h == "b" || h == "B" ) { h=11 }
                if ( h == "c" || h == "C" ) { h=12 }
                if ( h == "d" || h == "D" ) { h=13 }
                if ( h == "e" || h == "E" ) { h=14 }
                if ( h == "f" || h == "F" ) { h=15 }
                sum += factor * h
                factor *= 16
        }
        return sum
}
{
        printf("Drive=%s, Hex=%s, Dec=%s\n", $1, $2, hex2dec($2))
}' $1

$ time ./hex2dec-awk.sh hex.input
Drive=drive1, Hex=0089, Dec=137
Drive=drive2, Hex=0a2f, Dec=2607
Drive=drive3, Hex=1FFE, Dec=8190
Drive=drive4, Hex=980B, Dec=38923
Drive=drive5, Hex=0011780c, Dec=1144844

real    0m0.008s
user    0m0.002s
sys     0m0.006s

$ time ./hex2dec-awk.sh hex.big > /dev/null 2>&1

real    0m0.100s
user    0m0.093s
sys     0m0.006s

For 5000 lines, you can reduce it from 32 seconds run time down to sub second. I am sure you can see the performance differences in the 3 implementations. Next time, think big! Bigger data size.

Labels: , , ,

Monday, April 06, 2009

Avoiding all the banners

Sometime you need to automate your activities by ssh into a remote host and sudo to a particular user to execute a command. Although all the authentication has been setup to be passwordless, the output include those extra banners (/etc/motd and /etc/issue) which you normally want to get rid of.

There is one nice trick that you may want to adopt. By crafting a unique string in your script, you can use that as your marker to separate the banners from your command output. So your ssh sudo output can pipe through awk to separate out unwanted banners.

unique="=-a-b-c-="

ssh chihung@$remote "sudo su - someuser -c 'echo $unique;somecmd'" 2>&1 | \
    awk '/^'$unique'$/ { start=1; next } start==1 { print }'

Make sure your $unique get substituted in your current shell by enclosing them in double quotes. In this approach, you do not have to worry about how the banners look like and you do not have to do grep -v some-banner-string

Labels: ,

Killing defunct processes in Solaris 9 and 10

Recently I found out that you can "kill" those <defunct> processes in Solaris 9 and 10. The command is preap. You can specify all the <defunct> process IDs in one command line or you can make use of xargs to construct the argument list on the fly

# uname -a
SunOS myhost  5.10 Generic_118833-24 sun4u sparc SUNW,Sun-Fire-V490

# ps -ef | grep defunct
  daemon 25694   338   0        - ?           0:00 <defunct>
  daemon  8726   338   0        - ?           0:00 <defunct>
  daemon  8523   338   0        - ?           0:00 <defunct>
  daemon 11023   338   0        - ?           0:00 <defunct>
  daemon 25420   338   0        - ?           0:00 <defunct>
  ...
# ps -ef | grep -c defunct
606

# ps -ef -o 'pid,comm' | awk '/<defunct>/{print $1}' | xargs preap

Labels:

Saturday, April 04, 2009

Benjamin Franklin on Systems Administration

Do you know how Benjamin Franklin relates to systems administration ?

Read up on this aritcle, 10 tips for sensible systems administration

I think I can relate the 10 tips to scripting too.

Labels:

Solutions for tracing UNIX applications

IBM DeveloperWorks has recently published an article on Solutions for tracing UNIX applications.

This 35-page article covers

  • Using truss and strace
    - truss, strace, pstack, pfiles
  • Dynamic tracing with DTrace
    - dtrace
  • Tracing network packets
    - snoop

Worth reading.

Labels:

Inspiring Quotes, Part 1

Got this email from "the other hat that I wear" and they promise to send part 2 in two weeks time.

Attitude determines altitude - Anonymous

A wise man will make more opportunities than he finds. - Sir Francis Bacon

Small opportunities are often the beginning of great enterprises. - Demosthenes

The man who removes a mountain begins by carrying away small stones. - Chinese Proverb

Man's mind, once stretched by a new idea, never regains its original dimensions. - Oliver Wendell Holmes, Jr.

The pessimist sees difficulty in every opportunity. The optimist sees the opportunity in every difficulty. - Winston Churchill

Don't ask for a light load, but rather ask for a strong back. - Anonymous

Full effort is full victory. - Mahatma Gandhi

Wise men speak because they have something to say, fools because they have to say something. - Plato

A wise man learns by the mistakes of others, a fool by his own. - Latin Proverb

The true measure of a man is how he treats someone who can do him absolutely no good. - Ann Landers

Happiness is not having what you want, but wanting what you have. - Anonymous

The grand essentials of happiness are : something to do, something to love, and something to hope for. - Allan K. Chalmers

Hope is the dream of a man awake. - French Proverb

He who has hope has everything. - Arabian Proverb

Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind. - Dr Seuss

Labels: