Clockfort's Tech Blog

… updated whenever a new project comes along

If you’re trying to use Teensy-Loader on recent Fedora builds (12 & 13)

If you’re trying to use Teensy-Loader on recent Fedora builds (12 & 13)
You’ll need to get:

gtk2.i686

gtk2-engines.i686
(Solves “Gtk-WARNING **: Unable to locate theme engine in module_path: “clearlooks”")

PackageKit-gtk-module.i686
(Solves Gtk-Message: Failed to load module “pk-gtk-module”: libpk-gtk-module.so: cannot open shared object file: No such file or directory)

libcanberra.i686
libcanberra-gtk2.i686 (Solves Gtk-Message: Failed to load module “canberra-gtk-module”: libcanberra-gtk-module.so: cannot open shared object file: No such file or directory)

Except for canberra, most all of these packages are in the default install of i686 Fedora builds, just not in the x86_64 ones.

You’ll also want:
sudo yum -y install avr-binutils avr-gcc avr-libc avr-libc-docs avr-gdb avra
in order to actually compile C code for the Teeny board itself.
(GDB is optional, but nice to have, frankly)

Backup Software Cache Management

So, normally, backup software is going to read 90+% of your machine’s hard drive, and push that data over the network to someplace else.

However, in the process of doing this, it is going to steamroll your operating system’s filesystem cache.

There are two improvements that can be had here, in my reckoning, and I’ve seen neither in implementation.

1) Have the backup software back up the files that are in the operating system’s cache FIRST. Not only does this mean that important, often-changed files get priority, it means that backups will be slightly faster, as this data will come from memory, rather than from the disk.
This would probably require some way of getting at a list of what files the kernel/caching-daemon/whatever has in memory, which I’m not sure exists at the moment.

2) Have the backup software use a different way of accessing the disk such that the file caching daemon does not cache the files that the backup software is reading. This way, rather than steamrolling over the carefully-laid out filesystem cache of the system’s most often and/or most recently used files, the uncommon never-accessed-normally files don’t suddenly get pushed into filesystem cache when the backup software accesses them. This would lead to general system speedup, as “better” files from disk would be cached, rather than rarely-used junk.
This could be as simple as adding an oflag option to the kernel (i.e. fcntl.h in linux) that says “don’t cache this please”, and then using this when calling the open function in the backup application.

… Just some musings I had while talking to Russ on our way driving to California.

Undocumented Feature in IOS 11.2

I found an undocumented feature in Cisco IOS 11.2.
The command “show interface description” exists in newer versions, so I typed it in out of habit. Even though it doesn’t tab-complete it, or know what that option to the sh int command is, it still works… Albeit badly, and it gives terribly formatted output (All on one line, no spaces between names, no blank spaces where unlabeled ports are, etc)

It still works though! :-)

Makes me wonder how many undocumented features exist in versions of IOS earlier than they are supposedly “released”.


drpepper#sh ver
Cisco Internetwork Operating System Software
IOS (tm) C2900XL Software (C2900XL-HS-M), Version 11.2(8.10)SA6,
MAINTENANCE INTERIM SOFTWARE
Copyright (c) 1986-1902 by cisco Systems, Inc.
Compiled Fri 15-Feb-02 09:47 by devgoyal
Image text-base: 0x00003000, data-base: 0x0020E278
...(rest of output truncated for brevity)
drpepper#sh int ?
FastEthernet FastEthernet IEEE 802.3
Null Null interface
VLAN Switch VLAN Virtual Interface
accounting Show interface accounting
crb Show interface routing/bridging info
irb Show interface routing/bridging info
link-trap Show interface traps on no link

drpepper#sh int desc
Blacktea LinkCSH UplinkJolt ManagementRESNETRESNETRESNETRESNET

Game of Life

I got very bored in a far-too-easy networking class and ended up coding a very memory efficient version of Conway’s Game of Life.
Of note, it uses bit-twiddling/bit-packing to access individual bits on byte-accessible memory for the gameboard, and it uses a sort of buffer-thing to further reduce memory usage, rather than push temporary changes into an entire other temporary game board. I just made it up as I went along. The idea behind being this memory efficient is so that I can plop this on a microcontroller (possibly CSH’s Big Infosys?) and just let ‘er rip on a LED matrix :-)

Source is up at http://github.com/clockfort/Life/

NFS Blocksize Optimizations

I decided to redo the NFS setup I previously had on my ol’ Itanium2 machine.

How to test to see which NFS block size is right for your setup:

#Testing write speeds:
mount hostname:/remote_folder/ /mnt/local_folder/ -o rw,wsize=1024
time dd if=/dev/zero of=/mnt/local_folder/write_test bs=16k count=16k
umount /mnt/local_folder/
#Testing read speeds:
mount hostname:/remote_folder/ /mnt/local_folder/ -o ro,rsize=1024
time dd if=/mnt/local_folder/write_test of=/dev/null bs=16k
umount /mnt/local_folder/

Go through and change wsize and rsize to 1024, 2048, 4096, 8192, 16384, 32768. MAKE SURE to unmount after every test, as otherwise caching may cause you to see erroneously high speeds for subsequent tests.

Additional performance boosters:
Use “async” and “noatime” options when mounting your remote NFS directory. Async can be a little dangerous, as the data is not immediately flushed to disk on the server, but if the server is rather reliable, it shouldn’t be a problem. “noatime” prevents the access time for the files accessed over NFS from being updated. POSIX says you should update the access time every time you read a file, but doing a write operation to a disk every time you need to read from a file is time-costly and, frankly, rather silly from a performance perspective.

If you can, allow jumbo packets between the two machines you are using NFS between. Beware, however, that these oversized packets must be supported by the server, the client, and every network switch and router in-between in order for that to function properly. If you know for sure that is the case, then go for it, and you’ll probably see an increase in throughput, as the nfs packets (especially the larger ones) will be fragmented into far fewer IP packets. Also beware that other vendors implementations of NFS differ than Linux’s slightly, for instance Apple OS X clients seem to only be able to connect to NFS servers with “insecure” as an /etc/export option for that particular NFS directory.

Test Machine Specs:
2x 1.5GHz Itanium2 processors
10GB ECC DDR
3x 74GB 15k RPM U320 SCSI drives in RAID5
Gigabit ethernet

I am somewhat confused as to why my own NFS write performance is so appalling, while the read performance approaches the theoretical maximums of a gigabit ethernet connection.
Any advice on improving write performance over NFS would be much appreciated.
Graph of NFS throughput vs blocksize

(Graph is here if you’re reading this post without images)

An Ideal EeePC Firefox Setup

I propose that this is the best Ubuntu Netbook Remix Firefox setup ever.
Uses:

Simply binding both of these plugins to activate with the left alt key is working out deliciously well. It’s a small screen, but with some tweaks like these, the lack of real estate isn’t as much of a problem, and I can continue enjoying the crazy portability that is my EeePC 1000HE, and not have to scroll through every webpage to get down to the information I want to read. Plus, it looks pretty sexy with the new minimalist-themed Google :-)

(Screenshot is here if you’re reading this post without images)

VirtualBox: Don’t pretend you’re anything but a desktop VM product

Edit: As of 2010, Sun has corrected themselves and now state that OpenBSD is only supported with virtualization processor extensions enabled.

VirtualBox, while I like the interface and it has a few features that are lacking in VMWare and other virtualization products, has many issues.
First off, it doesn’t quite implement the x86 instruction architecture perfectly.
Secondly, this is terrible:
VirtualBox Trouble Ticket #192
VirtualBox Trouble Ticket #639

Basically, Sun has insisted for years that VirtualBox emulates OpenBSD perfectly and yet, it has been completely broken for years and they have not only not fixed the bugs in their own application, but have also not stopped insisting that it works just fine. Theo has posted a rant or two about how Virtualbox’s emulation sucks, and how he has wasted time tracking down non-existant bugs because of users repeatedly filing bug reports for segfaulting software when it is in fact just VirtualBox’s shitty emulation; I’m starting to see why he has this opinion.

Seriously, do not use VirtualBox to emulate OpenBSD (or !any! Unix other than Solaris). Everything is broken. Go try QEMU or VMWare.
But, if you want to try it anyway, here’s the settings you’ll NEED to have. Other settings are left up to your own options.:

General
OS type: OpenBSD
System
VT-x/AMD-V: Enabled*
PAE/NX: Enabled
Nested Paging: Disabled
Display
Video memory: 32MB
Hard Disks
IDE Controller Type: PIIX4
Network
Adapter: Intel PRO/1000 T Server

*obviously this is not possible if your host OS/CPU does not support it. OpenBSD segfaults less with it enabled. It runs(…ish) with it disabled.

tl;dr: VirtualBox is an excellent desktop virtual machine software, especially with its new features, like its 3D-rendering pass through technologies, and many-CPU SMP support. It is a terrible server virtual machine software, and is buggy, cannot run any unix distribution properly, except Sun’s own Solaris 10 kool-aid.

Maybe our Routers can meet and have lunch some time? No? Fine.

Here’s to you, blog viewers of this last month. I’m fairly sure this isn’t the normal OS distribution… You guys are awesome. :-)

Initially I thought the OpenBSD must have been me, as I run it on my router (yay pf!), but then I realized I don’t even have a browser installed on it… really can’t have been me, I guess. You know what that means? There are at least two users of OpenBSD! Alright! Party!

Chart of visitors to this blog

C: This is Java, Right?

Writing code for this OS class reminds me of why I only write C++/java/ruby nowadays, rather than C.

Here’s a snippet from the top of one of my main files… I do enjoy making C languages that it is not!

// Look, I really like C++; I'll be needing these :-)
#define true (1==1)
#define false (!true)
typedef int bool;

//Debug mode toggle
const bool DEBUG_MODE=true; //See? Already using 'em!

Apparently ITS hasn’t changed their pay structure in a very, very long time

(15:09:56) Andy Potter: Friday night the 3rd turns into 2x holidy pay at the stroke of Midnight. Make sure they don’t screw you.
(15:10:19) Me (AIM): Hmm, 2x holiday pay with C-Shift adjustment = $$$$$$$$$
(15:10:55) Andy Potter: what is C shift these days? before it was only .50 /hour
(15:11:24) Me (AIM): 50 cents an hour
(15:11:26) Me (AIM): inflation is awesome
(15:11:42) Andy Potter: Its been that since 1982
(15:11:46) Me (AIM): … nice.

… Gorram it.