VIsual C++ 2005 Express

I’ve recently found myself needing to generate binaries for Windows NT4 (don’t ask). At work, we’ve settled on using MinGW for building our C++ binaries and I’ve struggled to generate binaries that run on Windows NT without any missing modules.

In order to make things simpler, I thought that I might try downloading Visual C++ 2005 Express, as that was the last version that supported generating NT4 binaries. Later versions are XP and above only. If I’m not mistaken Visual Studio 2012 only targets Vista and above out of the box; XP support was returned after much pressure.

I couldn’t a download link to Visual Studio 2005 Express on the Microsoft website. Instead, I found the following link to the Visual C++ ISO (hosted at Microsoft) that still appears to work. 

http://go.microsoft.com/fwlink/?linkid=57034

It’s still valid, so grab a copy before it disappears forever.

Wireless Networking on Windows 2008 R2

I’ve just spent 30 minutes trying to get my new wireless card working under Windows 2008 R2. I had installed the drivers that came with the card, the card was visible under Device Manager but I could not connect to a wireless network.

It turns out that Windows 2008 R2 doesn’t include wireless LAN support unless explicitly enabled. So to rectify this, bring up Server Manager->Add Features->Wireless LAN Service and all the tools for connecting to a wireless network are installed.

Improving Ubuntu 12.10 Performance

Unity 2D was retired in Ubuntu 12.10. The new fallback desktop for low spec machines is Unity 3D with software rendering (the LLVM pipe). I’m do not know why anyone thought this would be a good idea as old machines without 3D capable video cards are somewhat unlikely to be powerful enough to perform 3D rendering on the CPU, but that’s for another day.

In order to make Ubuntu 12.10 work well in a VM, you need to ensure that the guest additions are installed and 3D rendering is enabled. This is trivial in VirtualBox, but there is a snag. You have to manually load the VirtualBox video driver. To do this, add `vboxvideo` without the quotes to /etc/modules. Restart the machine and everything feels faster.

Making Ubuntu default to using the USB sound card

The nVidia video card in my machine also gets registered as a sound card. There appears to be a high definition audio (HDA) chip on it that gets automatically detected and made default.

To get sound through my USB sound card, I’ve had to add the following to /etc/udev/rules.d/00_local.rules:

# Default to using additional (USB) sound cards when they are available.
KERNEL==”pcmC[D0-9cp]*”, ACTION==”add”, PROGRAM=”/bin/sh -c ‘K=%k; K=$${K#pcmC}; K=$${K%%D*}; echo defaults.ctl.card $$K > /etc/asound.conf; echo defaults.pcm.card $$K >>/etc/asound.conf'”
KERNEL==”pcmC[D0-9cp]*”, ACTION==”remove”, PROGRAM=”/bin/sh -c ‘echo defaults.ctl.card 0 > /etc/asound.conf; echo defaults.pcm.card 0 >>/etc/asound.conf'” 

Any new applications that launch will default to using the USB sound card.

Why can’t anything be simple?

Lubuntu touchpad configuration

While minimalism is good, too much minimalism can be a real drag. Lubuntu doesn’t come with a touch pad configuration app, so you’ll have to work with the command line.

To get an idea of the options you can configure, run the following command: 

synclient -l

Edge scrolling and two finger scrolling is enabled by default. This is overkill on my laptop, and edge scrolling is especially troublesome as my touchpad is tiny. I noticed that the mouse cursor was jumping all over the place while I’m typing. After a little digging, it turns out that this is because palm detection is disabled by default and thus the touchpad is responding to my palm. 

We fix this by running the following command in the terminal:

synclient PalmDetect=1 VertEdgeScroll=0

To persist these settings across restarts, edit the autostart configuration file by issuing the following command:

gksudo leafpad /etc/xdg/lxsession/Lubuntu/autostart

Add the following line to the end of the file:

@synclient PalmDetect=1 VertEdgeScroll=0

And we’re done. Sit back and enjoy your newly configured sensible touchpad behaviour.

 

Finder sucks

I don’t spend much time on a Mac, but when I do I’ve always been underwhelmed by Finder. These are two of my main gripes:

  1. Why is there no easy way of viewing hidden files? There is no keyboard short cut, menu item, or even preference to toggle this functionality. Feeling thick, I turned to Google. Turns out you have to hack around in the terminal to enable this functionality! 
  2. Why is the Home folder not easily accessible? When you launch Finder, you’re taken to “All My Files”. In the side panel, there are 6+ navigation options with things like Desktop, Documents, Air Drop (eh?), Applications, Pictures, Movies, etc but no Home. Thus if you were foolish enough to store your work in a folder called Projects, you’ll be left scratching your head as to how you’d get to it. Never fear, the keyboard combination CMD+SHIFT+H to the rescue. If you thought Finder was bad, wait till you see the file open/save dialog. No Home button for you there, so you need to remember the magic CMD+SHIFT+H keyboard short cut or you’re never going to see your documents again. Nevertheless, I’m happy to report that Google provided a fix.

I have never used a file manager (Windows Explorer, PacmanFM, Nautilus) that didn’t provide an easy way to accomplish the mentioned tasks. Why are they missing from Finder? Why?! Do they have focus groups down in Cupertino?

PostgreSQL and frequently updated tables

How to avoid performance degradation on frequently updated tables in PostgreSQL.

http://dba.stackexchange.com/q/21014/10190

nVidia driver on Ubuntu 12.04

For whatever reason, the “Additional Drivers” tool on Ubuntu refuses to install the binary nVidia driver on my machine. Thus I have to do it manually via the following commands.

sudo apt-get install nvidia-current-updates nvidia-settings-updates

 

Binary Radeon Driver on Ubuntu 12.04

The “Additional Drivers” tool that ships with Ubuntu has always been unreliable. I’ve never been able to successfully install the binary Radeon drivers, and have had to resort to installing it manually every time!

The instructions are based on what was presented at https://help.ubuntu.com/community/BinaryDriverHowto/ATI

sudo apt-get install libqtgui4 dh-make dh-modaliases execstack lib32gcc1 libc6-i386

sudo sh amd-driver-installer-12-4-x86.x86_64.run –buildpkg Ubuntu/precise

sudo dpkg -i –auto-deconfigure *.deb

sudo aticonfig –initial

Building a Zero MQ application on OS X

I’ve been trying to build a self-contained app bundle that uses Zero MQ on OS X. After spending a day with py2app on OS X, these are the steps I had to take.

  1. Install homebrew. http://mxcl.github.com/homebrew/
  2. Then install the latest version of Python via home brew. This is necessary as py2app doesn’t makes a partially redistributable apps if you’re using the system python.
  3. Install Zero MQ via home brew.
  4. Install pyzmq and py2app, using the easy_install that’s installed via home brew. This is normally located in /usr/local/share/python.

To generate an app bundle, ensure you add the flags –package zmq or else the resulting app bundle will not run. I’m told this is because py2app may occasionally require a helping hand with resolving dependencies.