Category Archives: Nonsense

Repository for the uncategorizable.

November was a rough month for ardamis.com. What are JustHost’s thoughts on uptime?

The term uptime refers to the amount of time that the website will be accessible. It is important to remember that unforeseen events do occur and that uptime guarantees are not written in stone. That being said, however, any established web hosting provider worthy of your business will strive to guarantee no less than 99.5% uptime.

http://www.justhost.com/web-hosting-articles/2010/12/06/the-uptime-guarantee/

Here’s my Pingdom Monthly Report for 2012-11-01 to 2012-11-30 for ardamis.com. Boy, those 34 outages for a total of 6 hours and 45 minutes (0.94%) sure feels like a lot of downtime.

Uptime Outages Response time
99.06% 34 1665 ms

Downtimes

From To Downtime
2012-11-02 06:14:08 2012-11-02 06:29:08 0h 15m 00s
2012-11-02 07:19:08 2012-11-02 07:44:10 0h 25m 02s
2012-11-05 22:54:09 2012-11-05 22:59:08 0h 04m 59s
2012-11-05 23:09:08 2012-11-05 23:19:08 0h 10m 00s
2012-11-07 14:24:09 2012-11-07 14:34:08 0h 09m 59s
2012-11-10 11:49:08 2012-11-10 11:54:08 0h 05m 00s
2012-11-10 12:09:08 2012-11-10 12:14:08 0h 05m 00s
2012-11-10 13:44:08 2012-11-10 13:49:10 0h 05m 02s
2012-11-10 15:24:08 2012-11-10 15:29:08 0h 05m 00s
2012-11-10 16:24:08 2012-11-10 16:29:09 0h 05m 01s
2012-11-10 16:49:08 2012-11-10 16:54:08 0h 05m 00s
2012-11-10 22:29:08 2012-11-10 22:34:08 0h 05m 00s
2012-11-11 22:34:08 2012-11-11 22:39:08 0h 05m 00s
2012-11-12 17:54:08 2012-11-12 17:59:08 0h 05m 00s
2012-11-17 00:49:08 2012-11-17 02:59:08 2h 10m 00s
2012-11-18 14:19:08 2012-11-18 14:24:08 0h 05m 00s
2012-11-19 03:54:08 2012-11-19 04:04:08 0h 10m 00s
2012-11-23 15:09:08 2012-11-23 15:24:08 0h 15m 00s
2012-11-23 15:44:08 2012-11-23 15:49:08 0h 05m 00s
2012-11-23 16:49:08 2012-11-23 16:54:08 0h 05m 00s
2012-11-26 10:04:08 2012-11-26 10:09:08 0h 05m 00s
2012-11-27 07:54:08 2012-11-27 07:59:08 0h 05m 00s
2012-11-27 15:24:08 2012-11-27 15:29:08 0h 05m 00s
2012-11-27 20:29:08 2012-11-27 20:34:08 0h 05m 00s
2012-11-27 21:34:08 2012-11-27 21:39:08 0h 05m 00s
2012-11-27 22:19:08 2012-11-27 22:24:08 0h 05m 00s
2012-11-27 23:54:08 2012-11-27 23:59:08 0h 05m 00s
2012-11-28 06:14:08 2012-11-28 06:19:08 0h 05m 00s
2012-11-28 06:24:08 2012-11-28 06:49:08 0h 25m 00s
2012-11-28 06:54:08 2012-11-28 06:59:08 0h 05m 00s
2012-11-28 07:04:08 2012-11-28 07:24:08 0h 20m 00s
2012-11-30 06:44:08 2012-11-30 06:49:08 0h 05m 00s
2012-11-30 07:04:08 2012-11-30 07:29:08 0h 25m 00s
2012-11-30 12:04:09 2012-11-30 12:09:08 0h 04m 59s
Copyright © 2012 Pingdom AB

That’s just a really pretty sad report.

I have got to be better about catching my contract before it automatically renews. I’m looking at Lithium Hosting and a small orange as replacements, as they seem to be well-regarded by Ars Technica readers.

This post was originally written in October, 2012, and has been updated twice – first in January, 2013, while using “2012-12-16-wheezy-raspbian” and then again in February, 2014, while using “2014-01-07-wheezy-raspbian” – in all cases using the latest Raspbian release at the time and the latest versions of Emulation Station, RetroArch, and other software mentioned below. So, if you encounter instructions that don’t exactly jive with what you’re seeing, it’s probably because the software continues to change and my instructions have fallen out-of-date. If you get confused, please leave me a comment and I’ll try to help.

After playing around aimlessly a bit with my Raspberry Pi in 2012 (most recently, an install of the very nice RaspBMC), I thought of a useful purpose for it while showing my kids Super Mario Bros. and The Legend of Zelda running on the VirtualNES emulator on my Windows laptop. Before they get too spoiled on the Xbox 360’s graphics and sound, I want to get them some exposure to a few of the simple but influential 8-bit games from my childhood. At the same time, I don’t want my laptop to become the family’s gaming machine. We have a pretty massive TV and plenty of Xbox 360 controllers, so I figured I could throw the Raspberry Pi into the mix and come out with a neat retro gaming console.

Metroid running on my Raspberry Pi

Metroid running on my Raspberry Pi

As with all things Linux, the devil is in the details. Like, can you get the application to work with both video and sound, and are all of the peripherals fully functional? Add to that the uncertainty of the performance of Linux applications on the particular hardware limitations of the Raspberry Pi, and any simple-seeming project quickly develops into a series of hair-pulling and-now-this-doesn’t-work type obstacles. Case in point, a Google search as I began the project in October, 2012, turned up a number of people who had already thought of turning their Raspberry Pi’s into 80’s game console emulators, and it quickly became obvious that this wasn’t going to be a completely painless process.

This post on the Raspberry Pi forum from a few months earlier basically summed it up.

I have a NES emulator working without sound, using the Debian image, will only work running through console no LXDE

sudo apt-get install fceu
cd /usr/games
./fceu -input1 gamepad -inputcfg gamepad1 /home/pi/mario_bros.zip

Command above will map gamepad buttons to your keyboard, and load game image path you specify. Appears to work fine apart from no sound, I’ve had a few levels on Mario Bros.

Not tried with a joypad, I have a wireless xbox360 joypad that is discovered as a usb device, but have not had chance to try to get it working yet. It doesn’t work by default

http://www.raspberrypi.org/phpBB3/viewtopic.php?f=2&t=5874

Yikes! Emulation with no sound and keyboard-only input is considered a success! And then a reply to that already discouraging post makes the landscape seem even more bleak.

Oh yeah, that’s the one! I tried to use mednafen, but even disabling openGL so it would use SDL for graphics would only give me a blank screen. I’ve tried to find some console emulators that use openGLES but every time I find one, it turns out that it’s only available as a pre-assembled package for platform x.

http://www.raspberrypi.org/phpBB3/viewtopic.php?f=2&t=5874

Well, posts like those from people who certainly seem pretty well informed about console emulation would certainly dissuade most human beings from settling on this as a weekend project. But thankfully for us, plenty of people far smarter than I have been diligently working at converting their Raspberry Pi’s into something resembling a game console, and you and I can now directly benefit from their labor. I’m happy to report that I am getting decently playable NES emulation with sound (and slightly-less-satisfactory SNES emulation) from my Raspberry Pi after a few hours of struggle. And what with how quickly I’m willing to reformat the SD card with a different image (what? an update to RaspBMC?), I thought I should document my steps for posterity.

One of the most frustrating things about doing anything in Linux after living in Windows is that it rarely works as smoothly as you would expect and it takes some patience to get past the hurdles. On top of that, when you turn to Google for help, forum threads typically assume the readers will have more than a passing familiarity with the Linux file structure, command line input, Make files, and the like. Once I eventually track down something that looks like a possible fix, I often find myself searching for help on just exactly how to implement the fix, which advice frequently turns out to be out-of-date and no longer applicable.

So, for those of us who are not going to know how to chmod +x a shell script without some hand-holding, here are the steps I’ve followed so far, that are hopefully detailed enough that you end up with a working RPi game console instead of a smashed bit of PCB and some seething frustration. At times, I assume that you’re still using the ‘pi’ user account, but if you’re not, you’ll probably be able to recognize where you need to substitute your new account. If you can see where I’m definitely doing stuff horribly wrong, please leave a comment and I’ll try to make it better.

Learning a few new tricks here

Learning a few new tricks here

Steps to set up the SD card and configure Raspbian with the necessary software

1. On your main computer (I’ll go out on a limb and assume you’re running Windows here), get the latest release of Rasbian from the Raspberry Pi Downloads page, extract the image file, format your (4 GB or larger) SD card using SD Formatter 4.0 and write the Raspbian disk image to your SD card using win32diskimager. I’ve used win32diskimager successfully more than once, but it will complain at me every time.

Connect the Raspberry Pi to a TV or monitor (I greatly prefer the HDMI out, but the composite output is fine if that’s all you have), connect a USB keyboard (my superstitious nature makes me connect it to the bottom USB port), and connect an Ethernet cable to your router because 1) the Raspberry Pi will need Internet access during setup and 2) your life will be easier if the Raspberry Pi can also talk with a computer on your home network. You can also connect your wired Xbox controller or Xbox 360 Wireless Gaming Receiver dongle thingie now, if you like. Power on the Raspberry Pi and use the spacebar, tab, arrow and enter keys to navigate through the raspi-config utility (it should run automatically at the first boot) to

  1. expand the root partition to fill the SD card
  2. change the internationalization options – language, timezone, and keyboard – as appropriate (this actually is important)
  3. enable the SSH server (in Advanced Options)

Choose finish and reboot the Raspberry Pi by typing the command:

sudo shutdown -r now

And then hitting Enter. Each time I specify a line of input, like the one above, hit the Enter key at the end to execute it.

After the Raspberry Pi restarts, write down its IP address, which is reported in the lines just before the login prompt.

I typically overclock my Raspberry Pi to the Modest setting (800MHz), but I don’t know if this makes any difference, so you can play with this to meet your needs. I run the original Model B board with 256 MB memory, and while it’s sometimes recommended to bump up the memory split to allocate 192 MB to the GPU, it hasn’t been necessary in my experience. If you need to run the raspi-config utility again to change any of these settings, open a terminal (Alt+F1 through Alt+F6) and enter

sudo raspi-config

I recommend against changing the setting that causes the Raspberry Pi to boot straight into the desktop, as the Emulation Station and RetroArch stuff that comes later is best launched from the terminal immediately after logging in (and not from a window within X) and offers something of a GUI anyway.

2. Back on the Windows computer, download PuTTY, which is an application that will allow you to access the command prompt on the RPi (RPi is easier to type, so I’ll be using this shorthand frequently) from your Windows computer across your home network. Launch PuTTY, connect to the RPi using its IP address, and log in (username: pi and password: raspberry). A great thing about accessing the RPi via PuTTY is that you can send command lines to the RPi by copying them from your favorite web browser in Windows and pasting them into the PuTTY window, saving you from typing in lots of unfamiliar and sometimes lengthy Linux commands.

3. In the PuTTY window, get Raspbian up-to-date by updating the package lists from the repositories and retrieving new versions of existing packages with

sudo apt-get update && sudo apt-get upgrade -y

4. Still in the PuTTY window, install GIT, vim, xboxdrv, and other useful software with

sudo apt-get install -y git vim dialog xboxdrv

Then reboot the RPi with

sudo shutdown -r now

5. Because the next part – installing RetroArch, the console emulators, and Emulation Station – takes a long time, I recommend either a) using the USB-connected keyboard on the RPi or b) using the screen command (here’s a good introduction to screen) if you are connecting to the RPi with PuTTY. I mention this because if your PuTTY session drops, the shell in which the commands are running will terminate and interrupt any running process. If this happens, you will have to run the setup script again (but you won’t necessarily know how far along it got before it terminated).

Whichever way you choose to connect, follow the instructions at RetroPie-Setup: An initialization script for RetroArch on the Raspberry Pi to install RetroArch for the Raspberry Pi. I would recommend using the source-code based installation, as it’s unclear how often the binaries are compiled. You can leave the options for installing components at their defaults, but I generally deselect the cores (the console emulators) that I don’t want or that I expect won’t work very well on the RPi. The installation may take hours, but the fewer emulator cores you choose to install, the faster it will go. Reboot at the end of the RetroArch installation.

6. The next step is to copy your ROMs into the appropriate, console-named subdirectory under /home/pi/RetroPie/roms/ on the RPi. There are a few different ways to do this. You can put them on a FAT-32 formatted USB flash drive and then transfer them to the RPi via command line, or you can launch the desktop with startx and drag-and-drop them, but I find that it’s much easier to use WinSCP to copy files from a Windows machine to the RPi across the network. (You can also use WinSCP to copy config files between the Raspberry Pi and your Windows machine, where you can edit them in a more familiar text editor. More on this later.)

Contrary to the advice below, at least for NES ROMs, both the .nes and .NES file extensions are acceptable. But if you’re having problems with ROMs for other systems, you may consider looking at the extensions.

Make sure that the extensions of your roms are lowercase and correspond to those given in /home/pi/.emulationstation/es_systems.cfg. You can show the content of that file with “cat /home/pi/.emulationstation/es_systems.cfg”.
http://www.raspberrypi.org/phpBB3/viewtopic.php?t=13600&p=155809

Note: In my experience, if you have chosen not to install most of the emulator cores, you will need to put at least one ROM in at least one console emulator’s ROMs directory in order for Emulation Station to start up successfully. I ran into a problem when I chose not to install any cores except for NES, and then tried to start Emulation Station for the first time before I copied any NES ROMs to the RPi. Instead of the Emulation Station starting up the gamepad configuration wizard, I got only a black screen with a small white dot in the center and spent hours thinking that something was wrong with Raspian/Emulation Station/Retroarch/the RPi itself, etc.

This dot is the “fake” SDL window ES uses to get input. Actual rendering is done through OpenGL ES. If all you see is this dot, then odds are something went wrong initializing the OpenGL ES surface. Are you sure you’re running at least the 192/64mb memory split?
https://github.com/petrockblog/RetroPie-Setup/wiki/EmulationStation

That takes care of the basics. Now you can launch the Emulation Station, which is the front-end we’ll be interacting with, to choose between different game systems and within them, different individual games, by logging into the RPi using the USB keyboard and entering

emulationstation

Emulation Station does not like to be started from an SSH connection. Manually starting Emulation Station each time is optional, as it is possible to launch the Emulation Station automatically at start up, though I use the RPi for a few different things so I don’t actually want this behavior at each boot and just launch it myself if I’m there to play a game.

The first time that you launch Emulation Station, it will guide you through setting up either a keyboard or controller for navigating between the various consoles and launching games. These settings are saved to a config file named es_input.cfg and located in the hidden directory at ~/.emulationstation/es_input.cfg. (Files and directories with names that begin with a dot are hidden, so they won’t show up with a regular ls command, but they will show up if you use ls -a and they are displayed by default in WinSCP.) If you ever want to go through the wizard again to set up a keyboard or controller, delete that file and launch Emulation Station.

If you want to modify es_input.cfg by hand, it’s easy enough to transfer it to your Windows computer using WinSCP and open it in a text editor. One advantage of editing the file is that you can run through the wizard twice – configuring a keyboard the first time and a controller the second – and create two es_input.cfg files that you then splice together in a text editor to create a single file so that you can navigate through Emulation Station by either the keyboard or the controller. This is what my es_input.cfg file looks like, with mostly intuitive controls for the keyboard and an Xbox 360 controller:

<?xml version="1.0"?>
<inputList>
	<inputConfig type="keyboard">
		<input name="a" type="key" id="13" value="1" />
		<input name="b" type="key" id="8" value="1" />
		<input name="down" type="key" id="274" value="1" />
		<input name="left" type="key" id="276" value="1" />
		<input name="menu" type="key" id="303" value="1" />
		<input name="pagedown" type="key" id="281" value="1" />
		<input name="pageup" type="key" id="280" value="1" />
		<input name="right" type="key" id="275" value="1" />
		<input name="select" type="key" id="32" value="1" />
		<input name="up" type="key" id="273" value="1" />
	</inputConfig>
	<inputConfig type="joystick" deviceName="Microsoft X-Box 360 pad">
		<input name="a" type="button" id="0" value="1" />
		<input name="b" type="button" id="1" value="1" />
		<input name="down" type="axis" id="1" value="1" />
		<input name="left" type="axis" id="0" value="-1" />
		<input name="menu" type="button" id="6" value="1" />
		<input name="pagedown" type="button" id="5" value="1" />
		<input name="pageup" type="button" id="4" value="1" />
		<input name="right" type="axis" id="0" value="1" />
		<input name="up" type="axis" id="1" value="-1" />
	</inputConfig>
</inputList>

You can compare the contents of my file to your own in order to get an idea of what buttons are mapped to stuff I’ve never actually used in Emulation Station, like the Page Up and Page Down commands.

Ridley is easy, like this tutorial

Ridley is easy, like this tutorial

Your Raspberry Pi now has all the necessary software to emulate games and accept input from your Xbox 360 controller. It’s now time to…

Configure the controller for games

Once you have those components installed, it’s time for the next step in any Linux project: discover what’s not working. (I have a long, involved tale about the many futile hours I spent trying to map all of the buttons on my old Logitech MX510 mouse, but I digress…)

Back in 2012, a wired (and potentially wireless) Xbox 360 controller wouldn’t automatically work, and unless you were content using the keyboard in games, you wanted to get it working ASAP. You could connect the controller, and you might get the ring of lights to pulse, but you would need to crank up xboxdrv, a userspace driver for Xbox controllers, before you could do anything with it.

As of 2014, Xbox controller support is integrated into Emulation Station and RetroAarch, but if you are curious about how we did it in the good old days, I strongly recommend reading through the list of xboxdrv switches, particularly if something doesn’t work as expected or if you need to figure out why the triggers and analog sticks aren’t mapping.

Even though the controller and the RPi are talking, you need to configure RetroArch to work with it. It is certainly possible to do all the text file editing and copying by using the included Leafpad editor in LXDE, which is the graphical interface on the Raspbian distribution, or in your editor of choice on your Windows computer while transferring the files back and forth with WinSCP, as I normally do, but this is a rather geeky project so I feel that I should at least mention the text-only vim editor that you can run within a terminal, and so I’m going to use it briefly in this case. In the PuTTY window, enter the following code to create a back up copy of the default RetroArch configuration file that is used by all of the console emulators:

cp ~/RetroPie/configs/all/retroarch.cfg ~/RetroPie/configs/all/retroarch.cfg.bak

Then open the live file for editing in vim with:

vim ~/RetroPie/configs/all/retroarch.cfg

I think it’s good to get some idea of the many options within RetroArch, so I really recommend looking through this file, as you may need to come back later and tweak it to resolve problems with sound in games. When you’re done looking around, exit vim without saving the file by typing

:q

Then hit Enter. See, nothing to it.

Back on the USB keyboard attached to the RPi, log in and enter

cd ~/RetroPie/emulators/RetroArch/tools

This puts you in the directory containing the retroarch-joyconfig utility that you’ll use to set up the controller. (If you’re getting an error message about files or directories not being found, you may be using a US keyboard but the RPi is still set to a UK keyboard layout. This would cause the tilde key “~” on the keyboard to enter a logical negation symbol “¬” instead. The tilde in a path in Linux is expanded to be the current user’s home directory, and the logical negation symbol is not. Re-read step 1 for instructions on how to launch the raspi-config utility to change the keyboard layout.)

Launch the retroarch-joyconfig utility with the line:

./retroarch-joyconfig -o p1.cfg -p 1 -j 0

Follow the instructions to push the buttons and move the sticks/triggers/dpad. (The -o switch causes the output to be sent to a file, p1.cfg, otherwise, the output is just echo’d to the screen, which is interesting but doesn’t help us set up RetroArch.) If you mess up, just keep pressing buttons until the utility exits and then start all over again by relaunching the utility with the same command line.

Xbox 360 controller

Xbox 360 controller (click to enlarge)

When you’re satisfied that you have pushed all the right buttons, you should have a p1.cfg file located at ~/RetroPie/emulators/RetroArch/tools. The contents of this file is what will eventually tell RetroArch and each of the various system emulators how to interpret the commands coming from the primary, first controller, but it needs to be appended to the end of that retroarch.cfg file first. To do this, enter:

sudo cat p*.cfg >> ~/RetroPie/configs/all/retroarch.cfg

The end of my retroarch.cfg file looks like this, after I appended the p1.cfg file to it and then further edited it by hand to add some extra commands for exiting the emulator and saving and loading gamestates (one of the best things about playing games on an emulator is that you can save the current state of the game at anytime, and later resume from that point in time, so you don’t need to rely on in-game saves).

input_player1_joypad_index = "0"
input_player1_b_btn = "1"
input_player1_y_btn = "3"
input_player1_select_btn = "6"
input_player1_start_btn = "7"
input_player1_up_axis = "-7"
input_player1_down_axis = "+7"
input_player1_left_axis = "-6"
input_player1_right_axis = "+6"
input_player1_a_btn = "0"
input_player1_x_btn = "2"
input_player1_l_btn = "4"
input_player1_r_btn = "5"
input_player1_l2_axis = "+2"
input_player1_r2_axis = "+5"
input_player1_l3_btn = "9"
input_player1_r3_btn = "10"
input_player1_l_x_plus_axis = "+0"
input_player1_l_x_minus_axis = "-0"
input_player1_l_y_plus_axis = "+1"
input_player1_l_y_minus_axis = "-1"
input_player1_r_x_plus_axis = "+3"
input_player1_r_x_minus_axis = "-3"
input_player1_r_y_plus_axis = "+4"
input_player1_r_y_minus_axis = "-4"

# Hold the back or select button (6) while pressing another button for 
# special actions, like...
input_enable_hotkey_btn = 6

# ...the Xbox Guide button (8) to exit the emulator
input_exit_emulator_btn = 8

# ...the left bumper (4) to save the game state to the current slot
input_save_state_btn = "4"

# ...the right bumper (5) to load the game state from the current slot
input_load_state_btn = "5"

Note to self: I need to update this tutorial with instructions on how to configure multiple controllers.

Each console emulator can have its own retroarch.cfg file that overrides the settings in the default file at ~/RetroPie/configs/all/retroarch.cfg. For the NES emulator, the retroarch.cfg file lives at ~/RetroPie/configs/nes/retroarch.cfg (in a /nes/ directory under /configs/, at the same level as /all/). If you are using an Xbox 360 controller and don’t configure the NES retroarch.cfg file specifically, the B and A buttons will be reversed from the original controller layout, and you’ll have to use the D-pad (which is not great) instead of the left analog stick.

In case you don’t remember the button layout of the NES controller…

NES controller

NES controller (click to enlarge)

So, I would strongly recommend dropping the following file into ~/RetroPie/configs/nes/retroarch.cfg for a better experience.

# All settings made here will override the global settings for the current emulator core

# The original Nintendo controller has the B button on the left and the A button on the right
# which is reverse of the Xbox 360 button layout.  Your ten-year-old self wants you to fix this
input_player1_b_btn = "0"
input_player1_a_btn = "1"

# It would be nice to be able to use the left joystick as well as the D-pad in Nintendo games
# but it seems to be an either-or situation, because only the _axis buttons are honored
input_player1_up_axis = "-1"
input_player1_down_axis = "+1"
input_player1_left_axis = "-0"
input_player1_right_axis = "+0"

Now you should be all set to play NES games using the Xbox 360 controller with pretty intuitive controls. The Xbox 360 controller-to-Nintendo controller mappings are as follows: the left analog stick replaces the D-pad, the A and B buttons are the B and A buttons, the Back button is the Select button, and the Start button is the Start button.

In a hurry to see Mother Brain again

In a hurry to see Mother Brain again

The Super Nintendo controller has four buttons, like the Xbox 360 controller, but the X/Y and A/B buttons are reversed. If you’re going to be emulating SNES, you’ll most likely want to make an SNES-specific retroarch.cfg file for that game system, too.

This is my best-guess for a Super Nintendo retroarch.cfg, without actually having tested it yet.

# All settings made here will override the global settings for the current emulator core

rewind_enable = false

# The Super Nintendo controller's button layouts are the reverse of the Xbox 360 controller
input_player1_b_btn = "0"
input_player1_y_btn = "2"
input_player1_a_btn = "1"
input_player1_x_btn = "3"

# It would be nice to be able to use the left joystick as well as the d-pad in Super Nintendo games
# but it seems to be an either-or situation, because only the _axis buttons are honored
input_player1_up_axis = "-1"
input_player1_down_axis = "+1"
input_player1_left_axis = "-0"
input_player1_right_axis = "+0"

OK. The controllers should now work as expected in games. So…

Get impatient and try playing a game

Assuming you haven’t had any insurmountable problems with the directions above, you should be able to get into a game in a few simple steps:

1. plug everything into the RPi (USB keyboard, HDMI output to TV/monitor, and a wired Xbox 360 controller or Xbox 360 wireless gaming receiver dongle)
2. turn on the Xbox controller (if you need to link the controller with the dongle, you may have to reboot once this has been done before the RPi will see it)
3. power on the RPi (or reboot with sudo shutdown -r now from a terminal) and log in as the ‘pi’ user
4. at the prompt, type emulationstation to launch the Emulation Station front-end
5. use the arrow keys on the keyboard or the left analog stick on the Xbox 360 controller to browse the game systems and ROMs and the Enter key or A button to launch a game system or game.

And you should definitely pat yourself on the back for getting this far.

But your game probably won’t have sound.

Wrestle with the sound

I’m using a pair of headphones plugged into the analog jack, and while many people report that the game’s audio when output through HDMI is generally fine, the audio out through the analog jack was decidedly not fine with the default settings back in October, 2012. The sound would start off fine, but within 20-30 seconds it started becoming increasingly choppy and a few moments later I was ripping off the headphones. I Googled this a ton, and eventually used the options recommended at https://github.com/petrockblog/RetroPie-Setup/wiki/Sound-Issues by uncommenting and/or editing these lines in the retroarch.cfg file. Depending on your experience, you can do so using vim or your text editor via WinSCP:

audio_enable = true
audio_out_rate = 44100
audio_driver = sdl

I had read a bit about ALSA and very little about SDL, but from what I could tell, it boiled down to ALSA (which was in alpha on the Raspberry Pi in late 2012) should be faster than SDL once ALSA is working completely. If ALSA is not working completely or if the RPi is under considerable load, we are better off using something else, and that something else seems to be SDL.

When I rebuilt the RPi in 2014, I still had to modify the audio settings in retroarch.cfg, but I found that ALSA worked fine. The settings I’m currently using are:

# Enable audio.
audio_enable = true

# Audio output samplerate.
audio_out_rate = 44100

# Audio driver backend. Depending on configuration possible candidates are: alsa, pulse, oss, jack, rsound, roar, openal, sdl, xaudio.
audio_driver = alsa

Using these settings also avoids the warning message visible in the console when RetroArch exits while the sound is misconfigured:
RetroArch [WARN] :: Audio rate control was desired, but driver does not support needed features.

If the volume in games is too low, and you are using ALSA, you can increase it at the terminal prompt with the command:

amixer sset PCM,0 90%

I have both an Xbox 360 and my Raspberry Pi hooked up to the same TV via HDMI, and 90% volume on the Raspberry Pi seems to match the volume of the Xbox pretty closely, so that I don’t need to turn the TV up or down when I switch consoles.

So that’s it, you should be able to play those old NES games now, with the glorious, mesmerizing 8-bit sound, but with the far more comfortable Xbox 360 controller.

The Esc key on the keyboard will exit the game and return to the Emulation Station GUI, by default, and if you’ve used my retroarch.cfg file above, you can do this with the controller by holding the Back button and pressing the silver Xbox Guide button.

Great !!

Great !!

What else?

The keyboard is still convenient for saving and loading game states, and I don’t know if all of the functions can be mapped to buttons on the controller (it sounds like it’s not possible), so it stays within reach for now. To enable keyboard shortcuts to save and load save states, uncomment the following lines in retroarch.cfg.

# Saves state.
input_save_state = f2
# Loads state.
input_load_state = f4

# State slots. With slot set to 0, save state name is *.state (or whatever defined on commandline).
# When slot is != 0, path will be $path%d, where %d is slot number.
input_state_slot_increase = f7
input_state_slot_decrease = f6

While playing a game:
F2 – save state to current slot (defaults to slot 0)
F4 – load state from current slot (defaults to slot 0)
F6 – decrease the save slot (defaults to slot 0)
F7 – increase the save slot (defaults to slot 1)

Other useful features can be enabled in retroarch.cfg by uncommenting the lines:

# Mute/unmute audio
input_audio_mute = f9

# Take screenshot
input_screenshot = f8

While playing a game:
F8 – take a screenshot (saved to the ROM’s directory by default, but this is configurable)
F9 – mute audio

The rewind feature in RetroArch is also awesome, and allows to you literally rewind the game – going back in time a few seconds so that you can replay it differently. This comes at a CPU and storage cost, so you may or may not see a performance hit when rewind is enabled. To enable rewind, uncomment the line:

# Enable rewinding. This will take a performance hit when playing, so it is disabled by default.
rewind_enable = true

While in the Emulation Station GUI (such as it is):
Arrow keys – navigate through ROMs and systems (consoles)
Enter – launch the selected ROM
F1 – adjust the settings (including the master volume), restart or shutdown the Raspberry Pi
F4 – terminate Emulation Station and return to the command prompt in the terminal

Recently, themes for each console have been developed for the Emulation Station, which I think everyone who saw it in 2012 would agree really needed a designer’s touch. I would recommend experimenting with the ES Scraper utility, which should download themes for the consoles and boxart for your games automatically.

So that’s that. I’m playing Final Fantasy and Super Mario Bros. 3 for the first time in years, and it’s pretty neat.

Outstanding problems

Some games, or maybe all games that scroll from top to bottom, but certainly Final Fantasy and Dragon Warrior, tend to artifact at the top and bottom of the screen when walking north and south on the world map. I haven’t begun to try to tinker with the video settings in order to alleviate this problem, but I imagine the fix is in there somewhere.

I seemed to be having a problem restoring from save states when I built my first RPi/RetroArch box back in early October, 2012. If I changed to a different emulator (and possibly to another game within the same emulator), I lost the ability to later load from a save state. The load would fail. I could, however, successfully save and load game states as long as I stayed within a single game. It doesn’t seem to be a very common problem, however, as I’ve only found one thread that describes exactly my initial problem, and that was for RetroArch on the PS3: http://forum.themaister.net/viewtopic.php?id=231. In that thread, the OP pinpoints the problem to changing emulators, after which the save state files cannot be loaded. To my mind, this indicates the problem lies outside the save state files themselves. Resolving this problem was one of the reasons I rebuilt the whole thing from scratch in late January, 2013.

But sadly, my problem was not resolved with the rebuild and in some ways was actually worse after the rebuild. Not only could I neither save nor load states in games with save state files created before the rebuild, but now, instead of the save/load message that is typically output to the screen as yellow letters, I just got a black box (possibly with black letters, rendering the text impossible to read) whenever I triggered a save or load. After I renamed or deleted the old savestate files in the ROM’s directory, I was able to create a new save state without issue and load it.

This was rather disappointing for games that I had been playing for awhile and was relying on the save state, but I guess I can live with starting over.

A possible work around to this problem, for games that support saving in-game, is to use the rewind feature instead of save states to undo mistakes as soon as they happen, and then rely on the in-game saves. For games that don’t support in-game saves, I guess I’m S.O.L. until I get it figured out.

I was having a few problems with xboxdrv and wireless controllers, in the early days. When using the USB Xbox 360 Wireless Gaming Receiver for Windows through a USB hub, approximately 60 seconds after launching xboxdrv, xboxdrv will crash and I’ll get an error stating [ERROR] USBController::on_read_data(): failed to resubmit USB transfer: LIBUSB_ERROR_NO_DEVICE followed by Shutdown complete. This doesn’t happen when using a wired controller or when the USB Xbox 360 Wireless Gaming Receiver for Windows is connected directly to the USB port on the RPi, so maybe a powered USB hub would produce a better experience. I’ve also heard that the Xbox 360 Wireless Gaming Receiver for Windows draws a lot of power, so it may be a good idea to get it working through a powered hub anyway.

I remember her hair differently...

I remember her hair differently…

You can stop reading now. Everything below this point are my notes on how things used to be done.

The manual way of starting up xboxdrv for a single controller is to just run

sudo xboxdrv --trigger-as-button --silent

at the command prompt each time you turn on the RPi, but you could start this up automatically, too. If you don’t run it with sudo, you’ll get an error: USBController::USBController(): libusb_open() failed: LIBUSB_ERROR_ACCESS. The creator’s proposed workaround is to add the current user to the ‘root’ group, which I’m not terribly keen on, so I’d be content with just continuing to run it with sudo. If you want to see your joystick axis and button press information output to the console, just run sudo xboxdrv without the –silent switch, but this eats up some CPU, so use the –silent switch when you’re going to be playing games.

The automatic way of starting up xboxdrv for a single wireless controller is to add the command to /etc/rc.local, which is a file that runs (like a script) at the end of multi-user boot levels (think: before a user logs on). It makes sense to start up xboxdrv automatically, particularly because we want to pass some arguments that would be annoying to type each time. While connected via PuTTY, start by backing up /etc/rc.local with

sudo cp /etc/rc.local /etc/rc.local.bak

Open /etc/rc.local using the vim text editor with

sudo vim /etc/rc.local

Arrow down to the line immediately before exit 0, hit the Esc key, and type or copy and paste

xboxdrv --dpad-as-button --trigger-as-button --wid 0 --led 2 --deadzone 4000 --silent &

then hit Enter, and type

sleep 1

Hit Esc again, type

:wq

Then hit Enter to save the changes and exit the editor. Reboot the RPi again, and now you should see that the Xbox 360 driver is up and running even before the login prompt appears. How’s that for awesome?

(The official instructions in the Using a single controller section of the xboxdrv manual at http://pingus.seul.org/~grumbel/xboxdrv/xboxdrv.html don’t seem to apply to the RPi at this point, as the xpad driver isn’t loaded and the upinput and joydev modules are loaded during boot.)

If you want to be even more slick and automatically start up support for up to 4 controllers, check out https://github.com/petrockblog/RetroPie-Setup/wiki/Setting-up-the-XBox360-controller.

(I initially had some problems with analog joysticks and triggers not registering in the retroarch-joyconfig utility until I started passing the –trigger-as-button switch when launching xboxdrv. However, even when the analog sticks are mapped by retroarch-joyconfig, I don’t have the use of them in NES games like Metroid, and that’s mostly OK by me, except that the dpad on the Xbox 360 controller has always seemed horribly sloppy to me, even in Xbox games. For some reason, the analog joystick movements would be picked up by xboxdrv if I omitted the –trigger-as-button switch, but not by the retroarch-joyconfig utility. The problem with the triggers is that without the –trigger-as-button switch, each trigger pull and release counts as two analog axis movements. This is desired for games where the trigger acts as a brake or gas pedal, but NES and SNES games have little or no use for this. Analog joysticks behave the same way, throwing tons of input at the slightest movement when the NES really just needs to know when it’s been pushed and released. It’s possible to turn the analog sticks off entirely by passing xboxdrv the –dpad-only switch, but what I really want is to accurately control NES games with the far more reliable left analog stick – something I’m still working on.) Update: the workaround for this is to use a NES-specific retroarch.cfg file that maps the left analog stick to the same buttons as the dpad – leaving you without a dpad in NES but with the left-analog stick.

(If you get an error “Couldn’t open joystick #0.”, it probably means that xboxdrv needs to be restarted first.)

This post is a collection of some of the more commonly used command line utilities when doing basic troubleshooting in a Windows domain environment.

To open a command window within a directory from Windows Explorer, hold the Shift key and right-click on the directory, then choose “Open command window here”.

cd

Displays the name of the current directory or changes the current folder.
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true

Used within a command window to change the current active directory, allowing navigation through the computer’s mapped drives and their directory structures.

Usage:

cd
Displays the current directory path.

cd
Moves to the root of the current drive.

cd /d e:
Moves to the E: drive from another drive. It’s also possible to move to a different drive by typing only the drive letter followed by a colon, ex: D:

cd..
Moves to the parent directory of the current directory (move up one directory toward the root).

cd “People to sue next”
Moves from the current directory into the subdirectory named “People to sue next”. A handy trick is to just type the first few characters of the directory name, and then hit the tab key to auto-complete the rest of the directory name from the first alphabetical match found, and even wrap it in double quotes if it contains spaces. For example, the same command as above can by typed: cd peop <tab>

If the current directory contains multiple matches for the characters typed, hitting tab again will cycle to the next match.

The tab method can be used more than once, to chain together a series of directories. For example, to move to the C:\Users\Public\Documents directory from a command prompt at the root of C:, one can type: cd u <tab> p <tab> d <tab> <tab> <enter>

dir

Displays a list of a directory’s files and subdirectories.
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/dir.mspx?mfr=true

Usage:

dir
Displays the directories and files in the current directory.

dir /s
Displays the directories and files in the current directory and all sub directories.

Dir can also be used to search for a file, and in many cases it works better than the Windows Explorer search.

dir c:\findme.txt /s
Displays a list of all instances of a file named “findme.txt” on the C: drive. It’s also possible to navigate to a location, such as the root of C:, and type: dir /s findme.txt to search that location and all subdirectories for a file named “findme.txt”.

Wildcards are allowed in the form of an asterisk. For example, type: dir c:\*.doc /s to search the C: drive for all files with a .doc or .docx extension (I’m not sure why it also locates .docx files, when there is no wildcard specified at the end of the extension, but it does).

Another command line utility for searching for files is where, but the syntax is slightly more complicated.

gpupdate

Refreshes local and Active Directory-based Group Policy settings, including security settings.
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/refrgp.mspx?mfr=true

If you absolutely must reapply all settings, you can use the /force switch. After reading about the difference between gupdate and gpupdate /force, I now feel that gupdate is sufficient to reapply group policy nearly all of the time, and the /force switch shouldn’t automatically be used.

Usage:

gpupdate
Reapplies group policy.

gpresult

Displays Group Policy settings and Resultant Set of Policy (RSOP) for a user or a computer.
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true

Usage:

gpresult /r
Displays RSoP summary data, which includes the last time group policy was applied, from which server group policy was applied, and the groups for which the current user is a member.

gpresult /h gpreport.html
Generates a report of the applied group policy settings and saves it in HTML format as a file named gpreport.html. When generating a report as a user that is not a local administrator, either supply a full path to a valid location for gpreport.html, or navigate to a location (like the Public Documents directory) before running the command, or else the utility may be unable to create the report due to insufficient rights to the current directory.

ipconfig

Displays all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS) settings. Used without parameters, ipconfig displays the IP address, subnet mask, and default gateway for all adapters.
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ipconfig.mspx?mfr=true

Usage:

ipconfig
Display the computer’s IP address and default gateway, for each network adapter.

ipconfig /all
Displays full TCP/IP information, including the MAC address, DHCP server, and DNS servers, for each network adapter.

net use

Connects a computer to or disconnects a computer from a shared resource, or displays information about computer connections. The command also controls persistent net connections. Used without parameters, net use retrieves a list of network connections.
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/net_use.mspx?mfr=true

Usage:

net use
Lists all of the computer’s connections (mapped network drives).

net use e: \\ComputerName\ShareName
Maps the E: drive to the ShareName shared resource on the ComputerName computer. To map the local E: drive to the C: drive (which is a hidden share) of a remote machine named Loomer, type: net use e: \\loomer\c$

net use e: /delete
Removes the connection currently mapped to the local E: drive.

If you are connecting to a network share that your regular account does not have rights to access, you will be prompted for a username. You will need to also supply the domain, ex: domainusername

nslookup

Displays information that you can use to diagnose Domain Name System (DNS) infrastructure.
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/nslookup.mspx?mfr=true

Usage:

nslookup <ipaddress or computername>
Queries the local computer’s default DNS name server for information on the specified IP address or computer name. Supply either piece of information and nslookup will return both pieces. It’s also possible to specify a particular DNS name server to be queried, which is useful when troubleshooting whether DNS is propagating/replicating correctly.

ping

Verifies IP-level connectivity to another TCP/IP computer by sending Internet Control Message Protocol (ICMP) Echo Request messages. The receipt of corresponding Echo Reply messages are displayed, along with round-trip times. Ping is the primary TCP/IP command used to troubleshoot connectivity, reachability, and name resolution.

You can use ping to test both the computer name and the IP address of the computer. If pinging the IP address is successful, but pinging the computer name is not, you might have a name resolution problem.
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ping.mspx?mfr=true

Usage:

ping <ipaddress or computername>
Makes four attempts to contact the computer at the specified IP Address or with the specified computer name, and reports back whether the machine could be contacted and the time taken for the request to travel to the remote computer, be acknowledged, and the acknowledgement received by the local computer.

ping <ipaddress or computername> -t
Repeatedly attempts to contact the remote computer until interrupted by pressing Ctrl+Break or Ctrl+C. This is sometimes called a persistent ping.

systeminfo

Displays detailed configuration information about a computer and its operating system, including operating system configuration, security information, product ID, and hardware properties, such as RAM, disk space, and network cards.
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/systeminfo.mspx?mfr=true

The systeminfo command also reveals installed hotfixes and some information about the computer that isn’t readily available in Device Manager or other MMC Snap-ins, such as the BIOS version.

Usage:

systeminfo
Displays information about the local computer.

systeminfo /s computername /u domainuser
Displays information about a remote computer named computername.

systeminfo /s computername | find “System Model:”
Retrieves information about a remote computer named computername, but pipes the output of systeminfo to the find command, which returns only the line containing the string “System Model:”. This output in the command window shows only “System Model:” followed by the model of the remote computer.

The systeminfo report can be sent to a text file, ex: systeminfo > systeminforeport.txt

Bonus commands

getmac

Returns the media access control (MAC) address and list of network protocols associated with each address for all network cards in each computer, either locally or across a network.
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/getmac.mspx?mfr=true

Usage:

getmac /v
Shows MAC addresses for the local computer.

getmac /s computername /u domainusername /v
Shows MAC addresses for a remote computer named computername while authenticating as a different user.

(Need to test this.)

msg

Sends a message to a user (this may be turned off in many environments). Run msg /? for usage information.

Ardamis.com is on the map – the internet map, that is! /knee-slap

The internet map is a graphical representation of a site’s relative traffic, with over 350 thousand sites are represented. It’s unclear where the data comes from, but it’s flattering to be included.

The Internet Map

The Internet Map

Ardamis.com’s location puts it in a cluster of tech-related sites, right next to apachefriends.org and not too distant from php.net.

While not quite as wickedly awesome as The Scale of the Universe 2, it’s worth spending a few minutes exploring.

I’m not an electrician, and my understanding of the Code is admittedly flimsy, but I believe that it’s illegal to use 3-prong grounding receptacles on 2-wire circuts (which is the arrangement that exists in most of the rooms in our house). I’m also fuzzy about whether doing any work at all, even to just replace outlets and ground them, requires that I replace the wiring with proper 3-wire, such as Romex. That uncertainty not withstanding, I’ve decided to take it upon myself to begin improving the situation by replacing all of the open ground receptacles with new receptacles and ground them to the box. Thankfully, Chicago has long required solid metal conduit, which ought to provide the ground, though I’m finding that there just isn’t a ground wire at all in many of the boxes. I suspect that someone came along 20-years ago and replaced the 2-prong outlets with 3-prong grounded outlets, and just didn’t ground them. In the worst-case scenario, where a ground wire to the box still doesn’t effectively ground the receptacle, my plan is to install a 3-prong GFCI outlet (which I understand will need to be labeled No Equipment Ground on the cover plate).

To make sure I don’t mess up too badly, I’ve been reading up on residential wiring, and have watched quite a few videos on how to replace outlets. One of the best videos I’ve found was by Joseph Matson, a 35-year union electrician. He mostly does woodworking videos, but his video on how to install an electrical outlet is absolutely top notch.

I found the use of tails out from the receptacle to be genius. Sure, it adds some bulk, but the advantage of giving current a means of bypassing the receptacle obviously outweighs the nuisance of stuffing a few extra inches of wire and some wire nuts into the box.

The only thing I wished he addressed in the video is the final touch of wrapping of the outlet in elecrical tape to cover the terminal screws. I still do this because this is how I was taught decades ago by my electrician uncle. I understand that it was used more when metal boxes were standard, to prevent the terminal screws from coming into contact with the side of the box, but I feel it’s still a neat way to tidy up at the end.

Mr. Matson also has a tutorial on how to install a single pole electrical switch, and replacing a few of the light switches may become my next project. (I’m partial to those switches that firmly snap into one position or another with a near-silent thwap.)

I happen to have two rolls of electrical tape and a handful of receptacles and solidly thwapping switches laying around, so all I really need is some 6-inch lengths of 12 AWG wire for the ground wire and some 1032 ground screws. But as long as I’m shopping, I may as well stock the larder and also get some tough-looking lineman’s pliers like Joe uses.

My Home Depot shopping list:

Irwin 9.5 in. North American Lineman’s Pliers $16.57
Ideal Green 12 AWG Solid Pigtails with Screws (5-Pack) $2.97
Southwire Romex SIMpull 25 ft. 12-2 NM-B Wire $16.44
Ideal 76B Red Wire Nuts (100-Pack) $7.98

Sure, Wbemtest.exe is pretty neat, and it gets points for being built-in. http://blogs.technet.com/b/chad/archive/2012/03/08/tip-45-wbemtest-the-underappreciated-tool.aspx

Microsoft's Wbemtest.exe displaying a WMI query

Microsoft’s Wbemtest.exe displaying a WMI query

But when it comes to building WMI queries for use in scripting languages, Microsoft’s WMI Code Creator is even slicker. https://technet.microsoft.com/en-us/magazine/2006.01.utilityspotlight.aspx

The WMI Code Creator tool allows you to generate VBScript, C#, and VB .NET code that uses WMI to complete a management task such as querying for management data, executing a method from a WMI class, or receiving event notifications using WMI.
https://technet.microsoft.com/en-us/scriptcenter/dd823314.aspx

Microsoft's WMI Code Creator displaying a WMI query and VBScript

Microsoft’s WMI Code Creator displaying a WMI query and VBScript (click for full-size)

The tool also allows you to browse through the available WMI namespaces and classes on the local computer to find their descriptions, properties, methods, and qualifiers.
https://www.microsoft.com/en-us/download/details.aspx?id=8572

The WMI Code Creator utility can be downloaded from microsoft.com at WMI Code Creator v1.0.

For years, ardamis.com has had a Google rankings nemesis in ardamis.gr. For much of the time that I’ve spent watching the results for the search phrase ‘ardamis’, ardamis.com has consistently ranked #1, and ardamis.gr typically landed in second or third place. But at some point in 2011, and my recollection is that this was occurring pre-Panda, ardamis.gr moved to the top spot and has stayed there since.

Google search results for ardamis on March 15, 2012

Google search results for ardamis on March 15, 2012

The top 10 results returned for ‘ardamis’ as of March 15, 2012, while not signed in to Google, connecting from Chicago, IL, using IE9:

  1. http://www.ardamis.gr/
  2. http://www.ardamis.gr/index.php?lang=en
  3. //ardamis.com/
  4. //ardamis.com/2005/08/11/xampp-apache-namevirtualhost/
  5. https://twitter.com/#!/ardamis
  6. http://www.tripadvisor.com/Hotel_Review-g285708-d274279-Reviews-Ardamis_Hotel-Monemvasia_Peloponnese.html
  7. https://github.com/ardamis
  8. http://www.greeka.com/peloponnese/monemvasia/hotels/monemvasia-ardamis/index.html
  9. http://www.linkedin.com/company/ardamis
  10. http://www.facebook.com/pages/ardamis/90788288272

I can’t really explain why a post from 2005 on configuring a setting in Apache would be the second best page on the site, but I guess I’ll take it. My properties do pretty well, for what isn’t a highly competitive phrase. Items related either to ardamis.com or me personally appear in positions 3, 4, 5, 7, 9, 10.

I’ve done some comparing of these two domains, and I am still unsure why Google is currently favoring ardamis.gr.

Location

I felt pretty confident that geography and Google’s focus on local search would mean that North American users would be returned results that favored ardamis.com, so long as they were not obviously searching for travel information about Greece. But this isn’t proving to be a safe assumption. Even more strange is that it’s the Greek language version of the page that Google is ranking first, even before the English language version. This promotion of a foreign-language page is very odd.

Metrics

Google Toolbar Page Rank (I know, I know, but it’s one of many metrics I’ll use) shows ardamis.com getting a 5 and ardamis.gr getting a 3. I won’t make too much of this, but I wanted to point out that the toolbar PR is not equal.

I ran the list of URLs on the first page of Google through the Open Site Explorer to get a better sense of how strong the pages and domains were, and ardamis.com comes out on top.

URL Page Authority Domain Authority Links
www.ardamis.gr/ 45.29 34.3 433
www.ardamis.gr/index.php?lang=en 23.65 34.3 33
www.ardamis.com/ 74.06 69.38 149621
www.ardamis.com/2005/08/11/xampp-apache-namevirtualhost/ 42.18 69.38 29

As the table shows, the home page at ardamis.com has significantly more Page Authority than the home page at ardamis.gr, the ardamis.com domain has more Domain Authority than ardamis.gr, and ardamis.com has 300 times the number of inbound links. (Although, the vast majority of inbound links come from footer links in the various WordPress and Plogger themes I’ve designed. See below.)

Author attribution

The pages on ardamis.com all contain verified authorship markup linking them to my Google Plus profile, and I get my profile picture next to my pages in the results.

I don’t detect any author markup on ardamis.gr.

Structured markup

The pages on ardamis.com contain structured markup (HTML5 microdata as described at schema.org and hCard microformat). The Rich Snippets Testing Tool returns no warnings for ardamis.com. Rich snippets from the pages at ardamis.com are displayed as part of the page data in Google’s results.

The page at ardamis.gr does not contain authorship or rich snippet markup.

Site links

In July of 2009, ardamis.com had a Toolbar Page Rank of 6 and 3 one-line sitelinks, before later disappearing. Then, in October of 2010, the sitelinks returned for awhile before disppearing again. I last noticed the sitelinks in January of 2011.

(I would point out that the site still shows sitelinks when searching for my name.)

Inbound links

I’ve developed and released a WordPress theme and a few Plogger themes, and put links back to ardamis.com and the theme’s post in the footer. These links have helped the home page gain nearly 2 million inbound links, with the Apricot WordPress theme’s page gaining nearly 1.5 million and the most popular Plogger theme’s page gaining just over 70,000. That’s a lot of links.

Page Speed

Google’s Page Speed Online tool awards ardamis.com a Page Speed Score of 96 (out of 100), while ardamis.gr gets a score of 68 (out of 100).

I have put quite a bit of effort into optimizing the performance, and I’m pretty happy with a 96.

Panda

Post-Panda, I combed through ardamis.com and weeded out the posts that I was unsure about.

Other domains

I also own ardamis.net and ardamis.org, and have one-page placeholders at these domains with links back to ardamis.com

Conclusion

At this point, I wonder if ardamis.com is suffering a penalty somewhere. Maybe all of those footer links are actually hurting the site.

Or maybe the combination of a country code top-level domain and a real geographic location is just incredibly powerful when compared to a random word attached to a .com domain.

Here’s an example script demonstrating how a publicly accessible home page can leverage JavaScript to detect whether a machine is on a corporate intranet and then redirect the browser to an intranet page.

In the example, http://alephstudios.com acts as the corporate intranet site that is not accessible from outside the company’s network, and //ardamis.com acts as the publicly accessible site, which can be accessed both from within and outside the corporate network.

The browser is set to use a page on the public //ardamis.com site which includes some JavaScript that attempts to load an image from a location on the company intranet. If the image can be successfully loaded by the browser, we have establishe that the machine is on the internal network. The browser can then be redirected via JavaScript to an appropriate intranet page. Otherwise, the browser is redirected to an Internet page.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Intranet Detection Script</title>
<script type="text/javascript">
<!--

var internalURL = 'http://alephstudios.com';
var publicURL = '//ardamis.com';
var detectionCounter = 0;
var detectionTimeOut = 5;
var detectionImage = 'http://alephstudios.com/testing/intranet/transparent.gif?' + (new Date()).getTime();
var detectionElement = document.createElement('img');
detectionElement.src = detectionImage;

function detectIntranet() {
    detectionCounter = detectionCounter + 1;
    //  alert('Attempt ' + detectionCounter + ': Sniffing intranet connection by loading an internal resource at ' + detectionImage);
    if (detectionElement.complete) {
        if (detectionElement.width > 0 && detectionElement.height > 0) {
            //      alert('Attempt ' + detectionCounter + ': The intranet resource was loaded!');
            window.location = internalURL;
        } else {
            //      alert('Attempt ' + detectionCounter + ': The intranet resource could not be loaded!');
            window.location = publicURL;
        }
    } else {
        if (detectionCounter < detectionTimeOut) {
            setTimeout("detectIntranet()", 1000);
            //      alert('Attempt ' + detectionCounter + ': Still trying to load: ' + detectionImage);
        } else {
            alert('Attempt ' + detectionCounter + ': Gave up trying to load: ' + detectionImage);
            //	  window.location = publicURL;
        }
    }
}

window.onload = function () {
    detectIntranet();
}

//-->
</script>
</head>

<body>
</body>
</html>

Setting up an intranet detection/redirection page as the browser’s home page allows IT to display an intranet page while the device is on the network and an Internet page when the device is off the network.

BrandYourself is a site with a very good idea – helping people gain a bit of control over the pages that their names rank for in Google. I first read about it in an article explaining why such a service may be useful at TechCrunch, which caught my eye due to my interest in SEO.

I have my own site (you’re on it), and I feel I know enough about SEO to have some influence over what shows up in a Google search for my name, but I was curious about what they were doing and wanted to see if they had any tricks I could learn. I created a profile and a links page to help promote my resume (2nd page on Google) and my GitHub profile (3rd page). After viewing the source code, I’ve determined that BrandYourself isn’t doing anything wrong, but I feel the execution misses a few things. It’s obviously designed for people who have a limited number of web presences, and probably no presences that they completely control (ie, they don’t have their own sites), but do have one or two accounts on sites like Facebook or YouTube where they can post information.

The main idea of the site is to create additional pages, and/or promote existing pages, that rank highly for your name. It is an opportunity to add another page to Google’s index, but one that is designed to rank well for a single phrase – your name.

While BrandYourself claims to have a deep understanding of SEO, many of their techniques are very beginner – url, title tags, h1 tags, etc. Using a phrase in these places is a safe and proven way to rank for that phrase, although there is no guarantee that a page that does this will outrank a page that does not. Using a phrase in various places on a web page are among the ‘on-page factors’ that Google looks for when determining the relative importance of a page. They claim that 3-5% keyword density (the amount of text on a page that is comprised of keyword phrases) is the target, but at first glance a not-very-completely filled-out profile page seems to easily exceed that density for my name. The links page in particular looks rather sparse and spammy.

Other factors contribute to rank as well. ‘Off-page factors’ are mainly links to that page from other pages, and these links carry significant weight. BrandYourself doesn’t seem to be doing any linking internally from profile to profile, or from profile to school/career/location hub. At the very least, I feel they should be using the person’s name as the link text in the single link pointing from the links page to the profile page. They encourage users to create inbound links (also called backlinks) to their page on BrandYourself, but don’t appear to link out from it, other than to a Links page that contains the links to your other profiles (ex. Facebook, LinkedIn, etc.).

Each account is given a URL that is a subdomain of brandyourself.com. My page is oliverbaty.brandyourself.com. That’s not bad, but I’m curious to see what happens when two people with the same name sign up. It’ll also be interesting to see if the brandyourself.com profiles for people with more common names can rise to the first page of the SERPs. The external pages you choose to promote, including your other social profiles, are displayed on a separate page on your personalized subdomain.

Interestingly, each subdomain has a robots.txt file, but not a sitemap.xml file. It does have its own 404 page (that sends a 404 HTTP status header), and the page will echo back the path part of the URL you pass it (url encoded, of course).

The interface is pretty slick, with lots of nice Ajax effects that one would expect from a startup today. There’s a little bit of badge-earning, but no big deal.

I already rank pretty well for my name, but there is always room for improvement. When I Google myself, about half of the results on the first page are profiles that I have some control over.

Oliver Baty | LinkedIn
www.linkedin.com/in/oliverbaty
(my profile)

Ardamis
www.ardamis.com/
(my site)

Oliver Baty | Facebook
www.facebook.com/oliver.baty
(my profile)

Oliver Baty (@ardamis) on Twitter
twitter.com/#!/ardamis
(my profile)

Oliver Baty - Google+
https://plus.google.com/113392027226542020317
(my profile)

Oliver Baty (1862 - 1941) - Ancestry.com
records.ancestry.com/
(not me)

Oliver Baty in Oak Park, IL | Miami University Of Ohio | Profile at ...
www.peekyou.com/
(about me)

Internet Archive Search: creator:"Oliver Baty Cunningham Memorial ...
www.archive.org/
(not me)

Oliver Baty Cunningham Memorial Publication Fund [WorldCat ...
www.worldcat.org/
(not me)

Oliver Baty Cunningham Memorial Pu Fund - Barnes & Noble
www.barnesandnoble.com/
(not me)

Maybe it will take off later. The TechCrunch article states that BrandYourself had nearly 6,000 sign-ups between March 8 and March 17, so that’s pretty good. A Google search on March 20 for site:brandyourself.com returns “about 8,760 results.”

As of March 20, a Google search for site:brandyourself.com oliver baty returns no results. Two days later, my profile page and my links page were both in Google’s index. This was probably helped along by the links to those pages at the beginning of this article. As of March 22, a Google search for my name, without being signed in to Google, shows my BrandYourself profile page as the 10th result.

I’ve been a fan of the simple and effective Windows 7 USB/DVD Download Tool for quite awhile, and have often used it to create a bootable USB flash drive for installing Windows 7.

But I recently ran into a problem with a flash drive after connecting it to my Xbox 360 and using it to move my profile. The Xbox 360 must have made some change to the MBR on the flash drive that the WUDT didn’t like, because it was unable to format the drive.

The WUDT would begin to format the drive, then report:

We were unable to copy your files. Please check your USB device and the selected ISO file and try again.

Windows 7 had no problems formatting the drive, but something was obviously missing from the process.

A quick search in Google turned up the solution. The formatting done by Windows 7 or the WUDT wasn’t cleaning the MBR and partition table.

To thoroughly format the drive so that it can be used by the WUDT, open an elevated command prompt and enter the following commands, using the drive number of the USB drive reported in list disk for the value of select disk #.

diskpart
list disk
select disk #
clean
create partition primary
select partition 1
active
format quick fs=fat32
assign
exit

For the curious, here’s a more detailed explanation of the clean command:

Removes any and all partition or volume formatting from the disk with focus. On master boot record (MBR) disks, only the MBR partitioning information and hidden sector information are overwritten. On GUID partition table (GPT) disks, the GPT partitioning information, including the Protective MBR, is overwritten; there is no hidden sector information.
http://technet.microsoft.com/en-us/library/cc766465(v=ws.10).aspx

I would expect that the MBR and partition table would need to be cleaned after formatting a drive for booting Mac OS X, too.

Credit: http://4sysops.com/archives/windows-7-usbdvd-download-tool-wudt-is-unable-to-copy-files/