Archive for May, 2010
I don’t have much to say about the loss. Henry Sieff was a brilliant network, security engineer and friend.
Recently I was building a ZenPack for Zenoss. The ZenPack included an Event Command which executed a custom script. I wanted to store the custom script in the ZenPack and I didn’t want to do anything other than have proper script dependencies in place for it to work.
${here/ZenPackManager/packs/ZenPacks.community.YOURZENPACK/path}/libexec/yourscript.sh ${dev/manageIp}
Custom scripts can be placed in $ZENHOME/ZenPacks/ZenPacks.CompanyName.Package/Zenpacks/CompanyName/Package/lib but if you want them to be executable place them in libexec.
Thanks to Matt Ray for telling me how to properly path the Event Command and the note about scripts in libexec getting the executable bit set, the docs I found only specified the lib directory.
I came across a new blog (seems to have come on-line in March) http://www.epoxyjournal.com. One of the entries was about how to clear command history. Everyone has inadvertently pasted or typed something into the wrong shell. Sometimes its worthwhile to clean up after yourself and sometimes its not. I figured I would offer a suggestion for the times you want to avoid having your embarrassing moments in your ~/.bash_history.
Instead of blowing away your entire current buffer with history -c you can redirect it to another file, flush the buffer to the file, clean it up then append it to your ~/.bash_history. Sure its more work then abandoning your history but insert Godwin’s Law.
So it might look something like this.
$ echo some long one liner you want to preserver $ echo something embarrassing $ export HISTFILE=~/tmphistfile $ history -a $ grep -v embarrassing ~/tmphistfile >> ~/.bash_history # re-point your history file to the right one, or just exit the shell
Matt Simmons thought a little oops utility would be nice. So here is my shoot from the hip attempt, haven’t extensively tested it but I think it works.
#!/bin/bash # wipe your history of lines that match the input # Usage: oops <embarrassing string> TEMPHIST=$(mktemp) export HISTFILE=$TEMPHIST history -a grep -v $1 $TEMPHIST >> ~/.bash_history history -c rm $TEMPHIST HISTFILE=~/.bash_history history -r
I just downloaded EMC Networker client for a 32bit linux box. The file I downloaded was nw74sp5_linux_x86.tar.gz. Of course when I go to extract it ….
# tar zxvf ../nw74sp5_linux_x86.tar.gz gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error exit delayed from previous errors
Umm not in gzip format ….
# tar xvf ../nw74sp5_linux_x86.tar.gz linux_x86/ linux_x86/lgtoclnt-7.4.5-1.i686.rpm linux_x86/lgtolicm-7.4.5-1.i686.rpm linux_x86/lgtoman-7.4.5-1.i686.rpm ...
They are only on their 3rd episode, but its been good listening so far. If your into networking check it out. http://packetpushers.net/

Identica
Twitter
LinkedIn