So, there is this function named glXProcGetAddress() that will return the memory address of an OpenGL function. Here is what it gives for 3 function names when compiled for 64-bit:
$ ./test64
glTexSubImage2D = 0x7fbc98e80b00
glProvokingVertex = 0x7fbc98e82760
glBogusFunctionName = (nil)
But this is what the binary says on 32-bit:
$ ./test32
glTexSubImage2D = 0xf774c880
glProvokingVertex = 0x8b33008
glBogusFunctionName = 0x8b33038
LOLWUT?
Okay so turns out the ia32-libs package in Debian is just a little bit outdated. So I hack upgraded it by manually pulling in the OpenGL stuff from the i386 packages. Its a little better now:
$ ./test32
glTexSubImage2D = 0xf7745db0
glProvokingVertex = 0xf7747a10
glBogusFunctionName = 0x8bba008
glProvokingVertex now has a more reasonable looking memory address. I find it more than a bit disturbing that a bogus function name does not return NULL, but according to someone in #winehq thats just fine by the spec. I still can't run Eve under Wine though. Turns out Eve requires S3TC, which is a bit patented and my open source video drivers don't support it.
Well given my previous rants on the subject of cable TV (1, 2, 3) I guess I should share my $0.02 on the latest FCC stupidity.
The truth is that I don't care anymore, I canceled Cable TV back in November and haven't missed it at all. As far as SOC goes, I can't say this is suprising given the FCC's complete disregard for their mandate to ensure that the cable tv system remains open. For those just tuning in, this is not just wishful thinking on my part. The Telecommunications Act of 1996 and the FCC Report and Order that implements the TCA both state this as a goal.
The FCC only granted a limited wavier to the SOC ban, but I doubt it will stay limited for very long.
So a few of the networks I have access to require me to SSH into a specific machine to gain access to the network. Previously I used a command like this:
ssh -t bastion.example.net ssh internal.example.net
Now SSH has long had a ProxyCommand so that it could route its traffic through the standard I/O of another program. The trouble is that SSH itself was not capable of acting as this other program. Then I saw this in the OpenSSH 5.4 release notes:
* Added a 'netcat mode' to ssh(1): "ssh -W host:port ..." This connects
stdio on the client to a single port forward on the server. This
allows, for example, using ssh as a ProxyCommand to route connections
via intermediate servers. bz#1618
Here is the .ssh/config file for those who are lazy:
Host internal.example.net
ProxyCommand ssh -qW %h:%p bastion.example.net
Now I can log in with just:
ssh internal.example.net
Bonus? scp works over this just fine.
I was finally persuaded to fix my webcam. The cam had been running through the qc-usb driver and a little xawtv utility. The trouble is that qc-usb is v4l and that doesn't work with the newer kernels. The nice thing about the xawtv plugin was that it automatically scp'ed the image to my webserver for me.
The new v4l2 layer of the kernel has built in support for my webcam, but I had trouble finding a [bold]command line[/bold] utility to power it. So many webcam apps will just try to pull in gnome :( I eventually went with fswebcam. I no longer scp images to my webserver, I setup Apache's mod_proxy to pull the image from another webserver (lighttpd) on the box the webcam is attached to. Seems to be working quite well so far. The init script wrapper I made for fswebcam doesn't quite have a working stop target yet though.
I'm considering rewriting my website in Python instead of PHP. The last major rewrite, going from MySQL to PostgreSQL, was definitely worth the effort. Not so sure Python has benefits over PHP though.
Amazon EC2 just rolled out a new instance type called a spot instance. So the short version is that each hour Amazon sets a spot price based on current supply and demand. Users of EC2 can have instances run as long as the price is beneath a spot limit that they set.
So I checked the recent spot pricing for an m1.small machine in the us-east zone and its between $0.025 and $0.035 per hour. This same machine as an on-demand instance (the original type) is $0.085. Now Amazon's goal is clearly to monetize their idle CPU time by offering a low cost option for data analysis work. But, if we make one little assumption we can use it to get a discount for on-demand instance.
So what do you think the chances are that Amazon has capped the spot price at the normal instance price? If they did, then you could just convert all your on demand instances to spot instances with the spot limit set to the normal price. That way your instance always stays up and you get a discount when the spot price is lower!
This only works for on demand instances though, a 3-year reserved instance is $0.041/hr and a 1-year reserved instance is
$0.056/hr for that same machine type. Depending on where the market goes, its probably a safer bet to keep those reservations.
Update: On a side note, I wonder if Amazon will actually bill me $0.052 for the two $0.026 instances I started for a moment while playing with it. I've always wanted to write a check to my credit card company for $0.06
I really wish Apple would allow focus follows mouse in OSX outside of just Terminal.app and X11.app. Even Windows supports it, the setting is available in TweakUI.
Lots of people say I'm crazy when I talk about focus follows mouse and I eventually learn they think focus means which window is on top. So let me clarify:
Focus means which window gets keyboard input.
Focus does not mean which window is on top.
The confusion comes from the fact that OSX and Windows automatically put the window with focus on top, this is actually called autoraise. Autoraise and focus follows mouse are related features that should both be configurable. As you can see in the following screenshot, TweakUI allows autoraise to be enabled or disabled if focus (called activation) follows mouse is enabled.

Why won't Apple give us the ability to enable focus follows mouse and disable autoraise?
The VBox 3.1 changelog noted something about disabling the dock on OSX. So I did some googling, eventually found a shareware app that could also do it. I reverse engineered that and found these:
defaults write com.apple.dock orientation -string bottom
defaults write com.apple.dock pinning -string end
defaults write com.apple.dock autohide -bool true
defaults write com.apple.dock tilesize -float 1e-17
Why would I pay $14.95 for that?
For the curious the legitimate values for those keys are:
defaults write com.apple.dock orientation -string [left|bottom|right]
defaults write com.apple.dock pinning -string [start|middle|end]
defaults write com.apple.dock autohide -bool [true|false]
defaults write com.apple.dock tilesize -integer [1-256]
The OSX Preferences GUI only allows tilesizes from 16 to 128 and doesn't allow setting the pinning value.
I updated my desktop to the 2.6.32 kernel today and was greated with a pleasent suprise. I have 3d acceleration with the open source radeon X driver now! I stopped using the closed source fglrx driver a few months ago because ATI dropped support my laptop's graphics card. This kind of pissed me off because that card isn't even 3 years old yet.
I'm not sure if it was the new graphics layer in the 2.6.32 kernel or an update to Xorg that I hadn't restarted X for that did it. Regardless of how it happened, it is awesome. I tried enabling KMS support too, but I need the 1.7 release of Xorg for that I'm still on 1.6.
I've been getting my quake3 fix today...
My friend linked mathematica into an IRC channel, so I started playing with commands like Run[], FilePrint[], etc., You know, the ones that let you run system commands:
14:27 <@mjgardes> if you get your ssh key in there, what will you do with it?
14:27 < NUXI> im not sure
14:28 <@mjgardes> it's behind NAT
14:28 < NUXI> math: "ssh-rsa *snip" >> /home/math/.ssh/authorized_keys
A little bit later (after he hardens it more) something occurs to me:
15:12 < NUXI> math: FilePrint[FromCharacterCode[{33}] <> "bash -c
'echo;/sbin/ifconfig eth0'"]
15:12 < math> eth0 Link encap:Ethernet HWaddr 00:16:d4:dd:e4:c2
15:12 < math> inet addr:192.168.0.37 Bcast:192.168.0.255 Mask:255.255.255.0
15:12 < math> inet6 addr: 2001:5c0:1103:1400:216:d4ff:fedd:e4c2/64
Scope:Global
15:12 < math> inet6 addr: fe80::216:d4ff:fedd:e4c2/64 Scope:Link
15:12 < math> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
15:12 < math> RX packets:1141505 errors:0 dropped:0 overruns:0 frame:0
15:12 <@mjgardes> crud
Isn't that a lovely IPv6 address?
nuxi@nobel:~(130)$ ssh math@2001:5c0:1103:1400:216:d4ff:fedd:e4c2
Last login: Tue Dec 8 13:30:55 EST 2009 from babylon.chroma on pts/8
math@merle ~ $
I win!