Dual Boot, Dual MAC

My desktop machine runs a Linux/Windows dual boot. It runs Linux 90% of the time, with Windows only used for playing games.

Rather than have to remember which operating system is running at the time, I decided to forcibly make Windows use a different MAC address. This means that I can now assign each machine a different hostname in DNS. Checking which operating system is running is now as simple as pinging the hostname corresponding to the operating system.

You can change this is both Linux and Windows, but I decided to keep my main operating system using the machine's original MAC address. Changing this in Windows involves editing a value in Device Manager:

Monitor Sleep on Screen Lock

I lock my screen when I know I'm popping away from the computer for a few minutes. It therefore makes sense to place the screen(s) in sleep mode while I'm away.

On Linux, I use this handy script from a fellow called Marco. I've packaged it up for Debian and Ubuntu users to make it easier to install, and can be downloaded from here.

On Windows, I use this little program from a fellow called Kevin.

Create a keyboard shortcut to each and use that as your new lock screen shortcut. It makes a big difference if you use dual monitors like me. :-)

USBasp Windows 7 x64

USBasp is an open source USB in-circuit programmer for Atmel AVR microcontrollers. The last time the USBasp website was updated, no support was available in Windows 7 x64. This was due to Windows 7 x64 requiring a digital signature for all drivers.

Things have since changed, and the most recent build of libusb-win32 runs flawlessly on Windows 7 x64. This enables the USBasp to communicate with the computer.

avrdude is the software used to communicate with the AVR microcontroller. To obtain the latest version of avrdude for Windows, download winAVR, or alternatively, grab the binary from here.

You can then program your microcontroller from the commandline, or alternatively use avrdude-GUI as an interface.

Interfacing foobar2000 with LCD Smartie

If you use a LCD display on Windows, you are probably using LCD Smartie to control it. Unfortunately, LCD Smartie currently provides no easy way to interface with the latest versions of foobar2000. There were a few tricks you could do in the past which worked well, but most of these have died as versions changed and plugins were no longer updated. However, what does still work is emulating a Winamp API by using foo_vis_shpeck. foo_vis_shpeck is a plugin designed to allow you to use Winamp visualisations in foobar2000.

When you have Shpeck installed, head to the Shpeck configuration, where you can chose what tags you wish to display on the LCD screen. I want display the %artist% and %title% on my display, so ensure to have them in the current track title formatting.

Shpeck Title Formatting Configuration:

%tracknumber%. [%artist%' || ']%title%

Next step is to download and install LCD Smartie to C:\Program Files\ or C:\Program Files (x86)\ on a x64 machine. You will also need to download the Split Title plugin and install it to the LCDSmartie/plugins directory. Once you have that done, replace your config.ini file with this version, and tweak the parameters to suit your needs.

You should now be see the song title and artist on the LCD screen when you run LCD Smartie and foobar2000.

I've gone a step further to create a .bat file which I can run from inside foobar2000 using foo_run. Open notepad and paste the following into it and save in the foobar2000 directory called lcdsmartie.bat

   @echo off
   START ../LCDsmartie/LCDsmartie.exe -totalhide
   :END

You can now create a new foo_run service pointed at lcdsmartie.bat. Put that icon on the toolbar, and you can now launch an invisible version of LCD Smartie to control your LCD.

If you don't have a LCD display, you can always make your own using an Arduino and a HD44780 LCD. :)

SSH SOCKS Proxy

SSH is a method of connecting two computers securely. The protocol also supports tunneling of traffic inside the SSH connection. This enables us to setup a secure mini VPN in seconds. I run a SSH server on my router at home, which I use when I'm using internet connections I do not trust, or when I want to access devices behind my firewall.

user@client:~$ ssh server-D 1080

Now set your SOCKS proxy to localhost:1080 in your browser:

If you are using Windows, this can be done using either Cygwin or PuTTY.
The configuration for PuTTY is shown below.

:!: Bear in mind, that while all your traffic is now proxied, your DNS lookups are not. :!:
If you are using Firefox, consider setting network.proxy.socks_remote_dns to true in about:config to force Firefox to send DNS lookups to the remote proxy.

If you are not using Firefox consider tunneling your DNS lookups, or look to a better VPN solution such as OpenVPN or PPTP over SSH.