pkgxtra

Tuesday, Aug 2. 2005  –  Category: Code, OpenSolaris

a while ago i wrote a stupid little shell script called pkgxtra that lets me easily list files owned by a package (either by .pkg filename, or package name (like SUNWcsl)). it also provides a shortcut to see which package owns a given pathname/filename.

here it is, in all its glory:

#!/bin/bash

show_help() {
        echo "usage: $0 [-lfp] ";
        echo "  -l  lists files belonging to package";
        echo "  -f  lists files contained in .pkg file";
        echo "  -p     show package owner of ";
}

while getopts "lpfh" flag
do
        if [ "$flag" == "l" ]; then
                MODE=0;
        fi
        if [ "$flag" == "p" ]; then
                MODE=1;
        fi
        if [ "$flag" == "f" ]; then
                MODE=2;
        fi
        if [ "$flag" == "h" ]; then
                show_help
                exit 1;
        fi
done

shift $(($OPTIND - 1))

if [ "$#" -eq "0" ]; then
        show_help
        exit 1;
fi

case "$MODE" in
        0)      pkgchk -l $1|awk '/^Pathname/ {print $2}';;
        1)      pkgchk -l -p $1;;
        2)      pkgchk -l -d $1|awk '/^Pathname/ {print $2}';;
esac

NUMA observability tools

Tuesday, Aug 2. 2005  –  Category: Code, OpenSolaris

I’m happy to see Sasha put up code and binaries for the NUMA observability tools I helped write tests for.

These are really cool utilities to help observe memory placement and optimise “advise” for programs to tweak where they place their memory on NUMA systems. Really cool stuff…

skippy

Wednesday, Jul 27. 2005  –  Category: Code, OpenSolaris

so i’ve been using skippy for a while now on my Linux laptop. i read on [moinak's]( http://blogs.sun.com/roller/page/moinakg?entry=whenthetaskbarisnot) blog that he had to make a slight modification for Solaris… turns out this isn’t necessary under Xfce since Xfce supports the XGrabKey call.

only problem is that skippy doesn’t support Xsun’s xinerama extension. doh. i make a quick hack to wrap the Xorg Xinerama extensions, and now it works great!

you can grab my skippy-0.5.0.Xsun.tar.gz tarball and try it out. i’ve tested it on Solaris 10/SPARC under Xfce.

libgtop on Solaris 10

Monday, Jul 25. 2005  –  Category: Code, OpenSolaris, OpenSource

If you are trying to compile libgtop on Solaris 10, you will notice that a bunch of the sysdeps/solaris files won’t compile, specifically sem_limits.c, shm_limits.c, and msg_limits.c. You’ll probably see errours about shminfo, etc. etc.

This is because many of these interfaces were unstable and obsoleted in Solaris 10 in favour of the (much better) rctladm interfaces. In short, you can get use getrctl to get those interfaces now.

You can read some forum msgs on dbForums regarding it.

or look at the Solaris 10 Tunable Parameters Reference Manual for a complete list of what was obsoleted.

I’ve made a patch to libgtop-2.8.3 which should fix this (it does for me, anyway). As usual – this is not an official Sun-endorsed patch in any way, form, shape, blah blah blah. Your mileage may vary.

converting m4a to mp3

Monday, Nov 29. 2004  –  Category: Code

ripped a bunch of CDs on Wendy’s laptop with iTunes, which saved them in m4a format. i see gStreamer supports the m4a format, but i’d rather have it in mp3 just for uniformity.

i know i know, “you should just switch to ogg”

anyway:

perl -e ‘foreach $file (ls *.m4a) { chomp $file; $newfile = $file; $newfile =~ s/.m4a/.mp3/; faad -w "$file" | lame -b 192 - "$newfile"; }’

i know this could be written as a much shorter shell script, but i know perl better than shell scripting, and this works under my linux system – so i’ll stick with it.


Recent posts