Professional tables with LaTeX

I used to think that my LaTeX tables were quite nice.
I learned how to do it with the second edition of ‘The LaTeX Companion’ and, after getting used to the shitty syntax, just kept on drawing them in the same way.

Yesterday I found the booktabs package and it completely changed the way I feel on presenting tabular data.

The documentation alone raises a lot of questions and is enough to make you ask yourself weather you should be using a different approach.

I just changed more than 20 pages worth of typical-but-fucking-ugly-and-difficult-to-read-tables.

Give it a try. It may look awkward at first, but you won’t be disappointed with the end result.

OpenSolaris, iSCSI, and NTFS extend

Say you want to make a ZFS volume (on a box running OpenSolaris) available to some Windows machine thru iSCSI.
You can use either the nice new tools and interface from the COMSTAR project, or the “old” iSCSI Target Daemon. The zfs ‘shareiscsi’ property uses the iSCSI Target Daemon, so if you want/need some feature available only on COMSTAR, life just got complicated…

Now suppose you want to take advantage of ZFS’s volume resizing features. You’re expecting to be able to resize the formatted NTFS partition on the initiator side without to much of a fuss. This is true if and only if you decided not to use COMSTAR:
zfs create -V 2T pool/volume
zfs set shareiscsi=on pool/volume

Log in to the initiator, add the target, mount the volume, format the thing, and you’re set.

To resize it:
zfs set volsize=4T pool/volume
Then, if you’re using Windows 2008, Vista, or 7, just go to the storage manager, right click on the volume and choose ‘Expand’/'Shrink’. On previous versions of Windows you’ll need some third party software (Partition Magic, or something like that).

As an alternative, if you decide to be a smart ass (kind of like I did) and use COMSTAR anyway prepare yourself for a couple of hours of pain before returning to the iSCSI Target Daemon.
Now, the bad news is that the iSCSI Target is deprecated and planned to be removed from future releases. When COMSTAR is installed, the ‘shareiscsi’ property is not available. Without this property, volume resizing does not seem to work. When will Sun/Oracle put it back together?…

OpenBSD mpstat / pmap

Unfortunately, OpenBSD does not have mpstat. mpstat is pretty useful for me in linux. For those who do not know what mpstat does, mpstat provides data for various statistics on your available processor(s). You can look at data for every processor using mpstat -P ALL or individually issuing a mpstat -P #cpu (e.g. mpstat -P 1)

If you’re wondering which package to install, normally your distribution should have a package called sysstat that has it.

Anyway, I tried to look for it for OpenBSD, or something like it, but couldn’t find one so simple/nice. Hope you have better luck.

Another tool I really enjoy is pmap in linux, which, good news!!!, has a brother in OpenBSD called procmap. Almost the same thing and in all honesty, way better than pmap. You can guess what it does, just by reading the name: displays a process memory map.

procmap -p PID and you’re all set for a good trip into your process memory. Below is an example of a procmap to my sendmail server:

-bash-4.0# procmap -a -d -v -p 6847 | less
MAP 0xd72c5a48: [0x1000->0xcfbfe000]
        #ent=81, sz=36978688, ref=1, version=5605, flags=0x1
        pmap=0xd72c4460(resident=)
Start    End         Size  Offset   rwxpc  RWX  I/W/A Dev     Inode - File
 - 0xd723bd14: 0x3d4e000->0x3d54000: obj=0xd716f974/0x0, amap=0x0/0
        submap=F, cow=T, nc=T, prot(max)=5/7, inh=1, wc=0, adv=0
        (dev=0,0 ino=2416545 [/usr/lib/libwrap.so.4.0] [0xd716f974])
03d4e000-03d53fff      24k 00000000 r-xp+ (rwx) 1/0/0 00:00 2416545 - /usr/lib/libwrap.so.4.0 [0xd716f974]
 - 0xd723b9a4: 0x550e000->0x5599000: obj=0xd7284798/0x0, amap=0x0/0
        submap=F, cow=T, nc=T, prot(max)=5/7, inh=1, wc=0, adv=0
        (dev=0,0 ino=2417436 [/usr/lib/libc.so.51.0] [0xd7284798])
0550e000-05598fff     556k 00000000 r-xp+ (rwx) 1/0/0 00:00 2417436 - /usr/lib/libc.so.51.0 [0xd7284798]
 - 0xd723bc64: 0x75ad000->0x75b5000: obj=0xd7284548/0x0, amap=0x0/0
        submap=F, cow=T, nc=T, prot(max)=5/7, inh=1, wc=0, adv=0
        (dev=0,0 ino=2445976 [/usr/libexec/ld.so] [0xd7284548])
075ad000-075b4fff      32k 00000000 r-xp+ (rwx) 1/0/0 00:00 2445976 - /usr/libexec/ld.so [0xd7284548]
 - 0xd723becc: 0x8ea6000->0x8f8f000: obj=0xd716f8e0/0x0, amap=0x0/0
        submap=F, cow=T, nc=T, prot(max)=5/7, inh=1, wc=0, adv=0
        (dev=0,0 ino=2417437 [/usr/lib/libcrypto.so.18.0] [0xd716f8e0])
08ea6000-08f8efff     932k 00000000 r-xp+ (rwx) 1/0/0 00:00 2417437 - /usr/lib/libcrypto.so.18.0 [0xd716f8e0]
 - 0xd717ed68: 0xd72b000->0xd760000: obj=0xd716f7b8/0x0, amap=0x0/0
        submap=F, cow=T, nc=T, prot(max)=5/7, inh=1, wc=0, adv=0
        (dev=0,0 ino=2416541 [/usr/lib/libssl.so.15.0] [0xd716f7b8])
0d72b000-0d75ffff     212k 00000000 r-xp+ (rwx) 1/0/0 00:00 2416541 - /usr/lib/libssl.so.15.0 [0xd716f7b8]
 - 0xd717e8f0: 0xecca000->0xeccb000: obj=0xd72b6000/0x0, amap=0x0/0
        submap=F, cow=F, nc=F, prot(max)=5/5, inh=0, wc=0, adv=1
        ([ uvm_aobj ])
0ecca000-0eccafff       4k 00000000 r-xs- (r-x) 0/0/1 00:00       0 -   [ uvm_aobj ]
 - 0xd717e948: 0x1c000000->0x1c078000: obj=0xd716f690/0x0, amap=0x0/0
        submap=F, cow=T, nc=T, prot(max)=5/7, inh=1, wc=0, adv=0
        (dev=0,0 ino=2445996 [/usr/libexec/sendmail/sendmail] [0xd716f690])
1c000000-1c077fff     480k 00000000 r-xp+ (rwx) 1/0/0 00:00 2445996 - /usr/libexec/sendmail/sendmail [0xd716f690]
 - 0xd717edc0: 0x23d4e000->0x23d4f000: obj=0xd716f974/0x6000, amap=0x0/0
        submap=F, cow=T, nc=T, prot(max)=1/7, inh=1, wc=0, adv=0
        (dev=0,0 ino=2416545 [/usr/lib/libwrap.so.4.0] [0xd716f974])

I didn’t include a lot of detail in here for one simple reason… open your shell and start reading and experimenting!
man procmap/pmap and man mpstat are your friends ;)

Drobo – behind RAID

Listening to an increasing number of people babbling about “that amazing Drobo thingy“ is really starting to piss me off. It’s an expensive toy with a simple set of features that any CS major should be able to reproduce in a number of different (and cheaper) ways.

Now, I like numbers (as in facts, not that boring TV series) and having access to a Drobo, I ran a couple of tests. The Drobo is using four 1TB drives, connected to a Debian box, with the data being accessed through a CIFS share (mounted with ‘nounix’ because otherwise it is sloooooow(er)).

Here’s the quick “benchmark”:
jupiter:/drobo# dd if=/dev/zero of=foo count=100000 bs=1024
100000+0 records in
100000+0 records out
102400000 bytes (102 MB) copied, 93.9097 s, 1.1 MB/s
jupiter:/drobo# dd if=foo of=/dev/null count=100000 bs=1024
100000+0 records in
100000+0 records out
102400000 bytes (102 MB) copied, 14.3171 s, 7.2 MB/s

There was actually another (reader) process accessing the share in the background and that slowed things down a little bit. The same test with a single connection gives us an astonishing 9.7MB/s (writing) or 13.8MB/s (reading).
And just in case you are curious, the same ‘dd’ commands with 10 concurrent reading connections result on speeds of 2.3kB/s-2.6kB/s. I think it’s faster than a 3.5” floppy, but I’m not sure.

Someone told me “That’s the price to pay for redundancy”. If this is how you feel, please go and kill yourself.

The good news is: it would completely replace my old copy of Sedra and Smith’s “Microelectronics” as a paper weight on the flatbed scanner.

Emacs’ keyboard shortcuts

Well, I guess they leave a pretty bad first impression, but then…. they kind of grow on you (I already tried to use C-d on the WordPress text editor 3-4 times by now).

I just found this web page with quite a detailed explanation on the reason behind the “C-x M-c M-butterfly” combos , and thought it was worth sharing with the world.

The link at the bottom, to a page on modernizing Emacs, also raises a few interesting questions (although I happen to like the “*scratch*” buffer).

Eventlet

Linden Labs may have created something I really don’t like, Second Life, but they got something right. They created one of the few libraries that make my job easier.

Eventlet is not like Twisted or Tornado, or any other async library. It just works, it’s easier to understand and to adapt your code to.

Give it a try and you’ll probably be positively surprised.

Unfinished business

If there is one thing I dislike in software development (personal or professional) is unfinished projects. Not unfinished in the sense of  “in progress” but more in the sense of  “it will never ever see light”.

A lot of companies do that, mainly in order to protect themselves. I can’t really say anything there as one needs to think business-wise :)

What I don’t like are projects that I start and never finish for one reason or another. Need an example? This blog. Me and the other “grunt” here started to code a blog to live in this space that did exactly what we needed and no more or less. Until I stumbled with wordpress in our provider admin page. The thought arrived fast: “Do we finish coding the blog or just use what is known to work quite well (wordpress)?”

We decided to finish coding the blog _and_ use wordpress at least for the time being. Why the decision to finish the code? goto: first paragraph

telinit 6

The post that must exist… the stupid post where everyone starts…

Return top