RRDtool Tips and Tricks
The best tips are on page 2 and page 3:
Recipe for Success - Resolve the problems before anyone else finds them
... and talk about it - Being able is only half the story, the others must know too!
Labels: RRDtool
The Scripting Guy in the Lion City with a performance sense.
The best tips are on page 2 and page 3:
Recipe for Success - Resolve the problems before anyone else finds them
... and talk about it - Being able is only half the story, the others must know too!
Labels: RRDtool
Labels: computer science
The first module is Introduction to Parallel Programming. This 25 mins video provides a lot of tips to tackle performance tuning issues. If you often like to throw hardware at performance problems, you should watch this video with an open mind.
As the presenter mentioned, the next module will cover multi-core architecture. I will post the link once it is available.
Labels: HPC, performance, Sun
When cron exceeds the limit, the log (/var/cron/log) will report this and it will not be able to schedule any jobs until the queue size is lower than the limit
! c queue max run limit reached Thu Jul 2 21:22:00 2009 ! rescheduling a cron job Thu Jul 2 21:22:00 2009
To find out how many child processes running under the cron, we need to know the pid of cron. If your system runs Solaris container (zone), there will be more than one cron processes if you do ps -ef | grep cron. In order to exactly determine the pid of your cron, you need to specify whatever zone you are in to grep the process using pgrep(1). Once we have cron's pid, we can do a ps listing to find out all the child processes with such a parent pid.
#pgrep -x -z `zonename` cron 5847 #ptree 5847 5847 /usr/sbin/cron 13293 sh -c sleep 1000 13305 sleep 1000 13295 sh -c sleep 1000 13306 sleep 1000 13296 sh -c sleep 1000 13307 sleep 1000 ...... ...... #ps -ef -o 'pid,ppid' | nawk -v ppid=5847 '$2==ppid{++s}END{print s}' 100 #tail /var/cron/log ! c queue max run limit reached Thu Jul 2 21:29:00 2009 ! rescheduling a cron job Thu Jul 2 21:29:00 2009 ! c queue max run limit reached Thu Jul 2 21:29:00 2009 ! rescheduling a cron job Thu Jul 2 21:29:00 2009 ! c queue max run limit reached Thu Jul 2 21:29:00 2009 ! rescheduling a cron job Thu Jul 2 21:29:00 2009 ! c queue max run limit reached Thu Jul 2 21:29:00 2009 ! rescheduling a cron job Thu Jul 2 21:29:00 2009 ! c queue max run limit reached Thu Jul 2 21:29:00 2009 ! rescheduling a cron job Thu Jul 2 21:29:00 2009
If you are interested in cron queue size over time, you may want to put the above in a script and print out the queue size with timestamp. gnuplot is a very useful tool to visualise time-based data.
Labels: Solaris
Do you know that you can achieve a lot even if you are not the winner. "Just A Guy In A Garage" blogged about what's after netflix, although his score only ranked 18 in the leaderboard.
Labels: Netflix
According to man page of /usr/lib/rsh, the actions of rsh are identical to those of sh, except that the following are disallowed:
According to man page of /bin/rksh, the actions of rksh are identical to those of ksh, except that the following are disallowed:
Let's start to see how restrictive it can be:
#As you can see, your search PATH does not exist and therefore you have no access to any of the binaries. Also, you really cannot run anything with absolute or relative path. The only commands you can run are the builtin commands likePATH=/some/dir/do/not/exist /bin/rksh #ls /bin/rksh: ls: not found #cd / /bin/rksh: cd: restricted #/usr/bin/ls /bin/rksh: /usr/bin/ls: restricted #echo $PATH /some/dir/do/not/exist #../../../usr/bin/ls /bin/rksh: ../../../usr/bin/ls: restricted #pwd / #echo abc abc
echo and pwd. That's far too restrictive. In order to really limit the users to run only a subset of commands, we create a /rbin directory and copy (or hard link) binaries that are absolutely required. In this demo, I only provide ls, vi, more and grep.
#mkdir /rbin #for i in ls vi more grep do ln /usr/bin/$i /rbin/. done #PATH=/rbin /bin/rksh #ls /var/adm acct log messages.2 sm.bin utmpx aculog messages messages.3 spellhist vold.log exacct messages.0 pool streams wtmpx lastlog messages.1 sa sulog #more /etc/release Solaris 10 1/06 s10x_u1wos_19a X86 Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. Assembled 07 December 2005 #grep Solaris /etc/release Solaris 10 1/06 s10x_u1wos_19a X86 #date /bin/rksh: date: not found
I am sure you feel pretty convinced that you are really in control of what your users can and cannot run. Now all you have to do is to set their login shell and ensure /etc/profile set the corresponding PATH to the restricted directory (/rbin).
If you are not able to attend (like me 13,593 km away, below are the links to download some of the presentation material:
Labels: opensolaris
ls listing.
ls has a -b flag that is able to print those non-printable characters to be in the octal \ddd notation. It is possible to recursively list subdirectories using ls -R -b to find out file names with non-printable characters with \ddd octal string. Together with the -1 (minus one) option, we can print one entry per line of output. The output of ls -1Rb can be piped to a regular expression grep to single out those problematic filenames.
ls -1Rb | egrep '\\[0-7][0-7][0-7]|[\\ ]' will grab filenames with \ddd octal, blackslash or space.
You can even give those special characters some colour which I blogged about it before. Here is the script that will highlight these characters. ^[ means "Escape" and you need to type Ctrl-V followed by Esc to get that.
#! /bin/sh
ls -1Rb ${1:-.} | \
nawk '
/:$/ {
sub(":","")
d=$0
next
}
$0 != "" {
printf("%s/%s\n",d,$0)
}' | \
egrep '\\[0-7][0-7][0-7]|[\\ ]' | \
sed '
# non-printable character in octal \ddd
s/\(\\[0-7][0-7][0-7]\)/^[[31m\1^[[0m/g
# space
s/\([ ]\)/^[[42m\1^[[0m/g
# blackslash but not \ddd in octal
s/\(\\\)\([^0-7][^0-7][^0-7]\)/^[[34m\1^[[0m\2/g
'

Labels: shell script
If you want to find out what it can do, watch this introduction. I am sure you will be impressed.
You can even find out the details of genome sequence ( AAGCTAGCTAGC ) or plot this function ( plot sin(x*x+y*y) ):
Once upon a time, a very strong woodcutter asked for a job in a timber merchant, and he got it. The pay was really good and so were the work conditions. For that reason, the woodcutter was determined to do his best.by Stephen Covey, 7 Habits of Highly Effective People:His boss gave him an axe and showed him the area where he was supposed to work.
The first day, the woodcutter brought down 18 trees.
"Congratulations," the boss said. "Go on that way!"
Very motivated for the boss’ words, the woodcutter tried harder the next day, but he only could bring down 15 trees. The third day he tried even harder, but he only could cut 10 trees. Day after day he was bringing down lesser and lesser trees.
"I must be losing my strength", the woodcutter thought. He went to the boss and apologized, saying that he could not understand what was going on.
"When was the last time you sharpened your axe?" the boss asked.
"Sharpen my axe? I have no time to sharpen my axe, I have been very busy trying to cut trees..."
Labels: Reflection