What Is Personal Leadership Brand
Labels: Reflection
The Scripting Guy in the Lion City with a performance sense.
Labels: Reflection
A simple CGI script is able to do the job. Basically it ignores x- & y-grids/ticks/labels and legends
echo "Content-tyep: image/png" echo "" /usr/bin/rrdtool graph - \ --start -${2:-1d} \ --imgformat PNG \ --lower-limit 0 --upper-limit 100 --rigid \ --width=125 --height=30 \ --x-grid none \ --y-grid none \ --title "$host" \ --color=BACK#ffffff \ --color=CANVAS#ffeee5 \ --color=GRID#7F7F7F \ --color=MGRID#B8B8B8 \ --color=ARROW#FF0000 \ DEF:usr=$rrd_cpu:usr:AVERAGE \ DEF:sys=$rrd_cpu:sys:AVERAGE \ DEF:wio=$rrd_cpu:wio:AVERAGE \ DEF:idle=$rrd_cpu:idle:AVERAGE \ DEF:mtotal=$rrd_mem:total:AVERAGE \ DEF:mused=$rrd_mem:used:AVERAGE \ CDEF:gbtotal=mtotal,1024,/ \ CDEF:gbused=mused,1024,/ \ CDEF:gbfree=mtotal,mused,-,1024,/ \ CDEF:percent=gbfree,gbtotal,/,100,* \ AREA:usr#dddd00:\ STACK:sys#dd0000:\ STACK:wio#ff8a60:\ STACK:idle#e2e2f2:\ LINE1:percent#0000ff: \ GPRINT:gbfree:LAST:"Mem\:%5.1lf/" \ GPRINT:gbtotal:LAST:"%5.1lfGB"
Labels: RRDtool
Labels: DTrace
Watch this movie clip (fast forward to 08:40) to find out the resemblance
praudit -l
. Here is a sample script to 'chop' them into individual files based on day. With this simple script, now you can handle audit log with ease.
IFS_orig=$IFS cd /var/audit praudit -l 2009052803069.20091009095022.myhost | while read line do IFS="," set -- $line d=$7 IFS=$IFS_orig set -- $d ymd=$1 echo $line >> $ymd.txt done
Labels: Solaris
cal
command to display the calendar and pipe it to awk to pick up the last number from the last non-empty line.
$cal October 2009 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 $cal | awk 'NF>0{n=$NF}END{print n}' 31 $cal 2 2012 February 2012 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 $cal 2 2012 | awk 'NF>0{n=$NF}END{print n}' 29
Labels: shell script