Helpful shell shortcuts
So this may be a little basic, but I find myself using these two shortcuts quite a bit while at the shell. If you ever find yourself wanting to "reuse" the last argument in a command -- for example, here I move a file from one location into /var/tmp and I want to "cd" into /var/tmp without having to type it, use the shell variable !$... locutus:~ (svoboda)> dd if=/dev/zero of=/tmp/blah bs=1024000 count=1 1+0 records in 1+0 records out 1024000 bytes (1.0 MB) copied, 0.0109023 s, 93.9 MB/s locutus:~ (svoboda)> mv /tmp/blah /var/tmp locutus:~ (svoboda)> cd !$ cd /var/tmp locutus:/var/tmp (svoboda)> pwd /var/tmp If you wanted to "preface" your last command, you can throw anything you want into the shell followed by the !! shell shortcut…
$ read more →OpenSolaris IPS repository offerings growing
I'm really glad to see the OpenSolaris IPS repositories growing with the amount of available packages. Large network repositories of thousands of software packages make Fedora and Ubuntu the great, easy to use Linux distributions that they are. Extending the amount of packages available to OpenSolaris just builds upon this usability! A graph explaining the IPS repository structure, the forum post showing how to enable the pending repository, and a complete list of the 1708 pending IPS repository packages can be found here…
$ read more →Snooping loopback interfaces on Solaris hosts
One thing that I have always enjoyed about Linux is the ability to snoop traffic on loopback interfaces. This is extremely useful for debugging local communication problems, and the fact that you couldn't until recently do this on Solaris hosts was extremely annoying(especially in the world of zones!). I just read Peter Memishian's blog entry on the IP observability code that was recently putback into opensolaris, and low and behold you can now snoop loopback interfaces on Solaris hosts. This is awesome, and the ability to snoop by zone id is by far my favorite feature: The Solaris network stack just keeps getting better and better, and with the upcoming crossbow and IPMPng putbacks just around the corner, networking in Solaris will only get better…
$ read more →Viewing Solaris zone resource utilization
Solaris zones have been around for quite some time now, and provide low overhead execution environments for running application. Admins who need to understand how zones are utilizing CPU and memory resources typically turn to prstat, which provides the "-Z" option to view utilization by zone: While reviewing the Solaris zones mailing list last night, I noticed that Jeff Victor posted a link to a Perl script that can provide utilization data for zones. This script has a TON of potential, especially once it is able to report on network and disk utilization.
$ read more →Deciphering shell exit codes
I was recently debugging an issue with a shell script, and noticed that the shell was exiting with an exit code greater than 100 when it received a SIGTSTP signal: I was curious where the exit value of 146 came from, so I did a bit of digging. It turns out that when a shell exits due to an uncaught signal, the signal number is added to 128 and that is the value that is returned. So in the case above, the exit code 146 was returned. I digs me some random shell knowledge.
$ read more →