I am looking for cheap, shared web hosting because the downtime and customer support I’m getting with JustHost is intollerable (and well documented). I’m willing to pay about $10/month for hosting, and I don’t ask for much other than reasonable uptime. I have a blog (ardamis.com) that gets about 1000 visits per day, a few other sites that barely get any traffic, and a small photo gallery that I share only with family and friends. I don’t stream or make available for download any video or audio files, but I do want to be able to upload all of my personal photos and use my web host as an off-site backup. I have an account with Drop Box, but I have gigs of photos, so I would have to purchase extra storage, and I kinda want to keep the Drop Box stuff separate. I’ve also considered using Google Drive, but I have enough photos that I would need to purchase additional space.

I’m currently paying $108/year for hosting and an additional $19.99/year for a dedicated IP address. I’m willing to pay a little more, but not terribly much more.

Before JustHost, I was a GoDaddy customer for something like 5 years, and there was almost no downtime. Customer service was incredibly, suprisingly good and the reps were always knowlegeable and effective. I left because I didn’t like the proprietary admin panel that GoDaddy has developed and wanted to keep my domain registrar and my web host at separate companies. But really, there was nothing wrong with GoDaddy’s hosting at the time, that I could tell.

The problem with researching new web hosts is that unbiased information (if it’s out there) is buried under tons of completely untrustworthy garbage sites that sell reviews and rankings. If you look for personal recommendations based on experiences with multiple hosts, it is extremely hard to tell from the obscure bulletin board threads whether the posts come from shills or actual customers. Even if one finds posts that appear to be from genuine customers, their descriptions of their experiences are usually subjective, anecdotal, and not comparative.

This post, then, is just my notes on what I’ve found while researching my next web host.

No Host

One option would be to not go with a hosting company at all and just use Amazon EC2 to self-host my blog. I have seriously considered doing this, but by some accounts, it’s actually more expensive to run an EC2 instance than purchase shared hosting. And I don’t really want to become my own linux administrator. As much as I enjoy occasionally tinkering with Ubuntu, I just want my sites to run smoothly and for someone to keep the server up-to-date and to fix problems for me quickly if something breaks.

Bluehost

http://www.bluehost.com/

Everyone has heard of Bluehost. They’re huge. Their tagline is “Trusted by Millions as the Best Web Hosting Solution”. So there you have it. Maybe you want to be one of their millions of customers.

According to the builtwith.com profile for ardamis.com, the site’s hosting provider is not JustHost but BlueHost! If that’s the case and they’re really the same company, or associated in any way at all, there is no way I’m going to switch to BlueHost.

Their website has terribly low production values, for being such a huge company. They have a crappy stock photograph of a dude with a headset providing customer support, below the text “We specialize in customer service. Call or Chat!” I do not want to live chat with this dude, or anyone else. I probably don’t need any customer service from my hosting company unless they screw something up, so prominently featuring your support phone numbers make me wonder if they get tons of calls.

They do have cPanel, which is nice, as I am wary of proprietary admin panels after using GoDaddy for years.

They also offer unlimited domains, unlimited storage, unlimited bandwith, unlimited email accounts, and a free domain. They also offer custom php.ini files and SSH access. And they do all of this for just $6.95/month for 1 year.

It actually sounds pretty decent, on paper. But one does get the sense that they are completely driven by the bottom-line, and that your site is going to be jammed into an already crowded server.

HostGator

http://www.hostgator.com/

HostGator is the other huge discount web hosting company, competing with BlueHost and GoDaddy for what I picture to be the same sort of confused customers or WordPress blog/Google Adsense scammers.

Like with BlueHost, I’m immediately turned off by the website, which is just ugly as all get out and also conspicuously promotes Live Chat support with a stock photograph of a girl with a (wired) headset. The pricing for the hosting plans is also a bit misleading, as all of the pricing shown is discounted 20%, which discount is only valid for the first invoice.

Another thing I really dislike is that there are three tiers of shared hosting, named “Hatchling Plan”, “Baby Plan”, and “Business Plan”. I just can’t see myself signing up for the ridiculously named “Hatchling Plan” or “Baby Plan”. Which is probably by design so that people like me upgrade to the more respectable and grown-up sounding “Business Plan”.

They do offer a single free website transfer for shared hosting, whether or not the site being transferred uses cPanel.

Lithium Hosting

http://www.lithiumhosting.com/

I first heard about Lithium Hosting while reading the ars technica article How to set up a safe and secure Web server, which also mentioned A Small Orange.

Their site looks pretty good, but it’s a little bit too template-like, and I felt that a quick glance on themeforest.net would turn up about a dozen hosting reseller templates for which the layout and stock placeholder text is an almost exact match. For example, the tagline on their home page is “Why we’re not the best host in the world.” Yeah, that sort of false modesty smells just a bit too contrived here. I was almost ready to sign up with Lithium Hosting, but the cookie-cutter stuff gave me enough pause to keep looking.

One of the things that I didn’t like is that they offer a free month coupon code, but it doesn’t work when you configure your cart to pay a year-at-a-time. Another thing I didn’t like was the $36/year cost of a dedicated IP address – $5 to set up and then $3 per month thereafter. It seems like the price on dedicated IP addresses has dramatically increased in the months since all the breathless news reports about the world running out of IPv4 addresses. They also charge an extra $60/year for shell access via SSH. That’s pretty shameful.

Bailing out of the cart just before purchase doesn’t cause a window to pop up an lure you back with a discount, as I fully expected to happen.

I checked out their Facebook page and the most recent post was from a guy who’s website was down. Two other recent posts were about downtime.

At the end of the day, Lithium Hosting just seems too much like a hosting reseller itself than a company that will be around for years.

A Small Orange

http://asmallorange.com/

I first heard about A Small Orange while reading the same ars technica article How to set up a safe and secure Web server that mentioned Lithium Hosting.

My first impression of the site was that it looked pretty much exactly as I wanted my hosting company to look. Again, I’m being pretty superficial here, but I want to be happy with my choice and if the company’s outward appearance is cruddy then I’m not going to be as satisfied. I want to be certain that I made the best choice, and a crappy, thrown-together-looking site injects a small amount of doubt. The site clearly sets out the costs of the different hosting plans, and I knew I would be looking at shared hosting first. There are five tiers of shared hosting, the least expensive being $35/year for 250 MB storage and 5 GB bandwidth. Basically, the only differentiating factor between the different levels of shared hosting is the amount storage and bandwidth. The standard features for all shared hosting accounts include:

  • Unlimited Parked and Addon Domains
  • Unlimited Subdomains
  • Unlimited POP3/IMAP Mail Accounts
  • Unlimited MySQL Databases
  • Unlimited FTP Accounts
  • Automated Daily Backups
  • cPanel
  • Automatic Script Installation (Softaculous)
  • Jailed shell upon request
  • FTP and SFTP access
  • Cron jobs for scheduled tasks
  • 99.9% uptime guarantee

A Small Orange uses CloudLinux as the server OS.

OK, yes, there is still a Live Chat button, but it’s this inconspicuous little green tab at the left side of the window that states “live help”. That’s it.

I checked out their Facebook page for recent posts, and they were almost entirely positive, with a good amount of interaction from the admin. The page claims that the company is home to 45,000 web sites, which might be exactly what I’m looking for, without even knowing it.

One of the things that convinced me to go with them was the Inc.com write up of CEO Douglas Hanna in America’s coolest College Start-Ups 2012 and the Duke Chronical article Hanna makes juicy profits with A Small Orange. Hanna worked at HostGator for two years in customer service, so one could reasonably expect that he knows what customers want in affordable hosting.

I have also found a ton of coupon codes for A Small Orange (just Google it) for either $5 or 15% off your order.

saveme$5
saveme15%
save_$5
save_15%

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.

After playing around aimlessly a bit with my Raspberry Pi (most recently, an install of the very nice RaspBMC), I thought of a decent 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 game machine. We have a pretty massive TV and plenty of Xbox 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 regular Linux applications on the particular hardware limitations of the Raspberry Pi, and any simple-seeming project quickly develops into a series of and-now-this-doesn’t-work obstacles. Case in point, a Google search 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 sums 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

An 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 would certainly dissuade most human beings from settling on this as a weekend project, but thankfully, 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 obstacles. 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 find what looks like a possible fix, I often find myself searching for help on how to implement the fix, which 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 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 happen across this post and 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’m assuming you’re running Windows here), get the latest release of Rasbian from the Raspberry PI Downloads page, extract it, and install it to your SD card using whatever method you’re comfortable with. In Windows 7, I’ve successfully used win32diskimager more than once, but it will complain at me every time. This post was written while using “2012-12-16-wheezy-raspbian”, the latest release at the time.

Connect the Raspberry Pi to a TV or monitor, connect a USB keyboard (my superstitous nature makes me connect it to the bottom USB port), and connect an ethernet cable. You can also connect your wired Xbox controller or Xbox 360 Wireless Gaming Receiver now, if you like. Boot up the Raspberry Pi and use the raspi-config utility (it should run automatically at the first boot) to a) enable the SSH server, b) change the memory split to 50% of the total memory (set it to 128 MB for the original Model B boards with 256 MB memory, and to 256 MB for the upgraded version of the Model B boards with 512 MB memory), c) if you are not using a UK keyboard, change the keyboard layout to US or whatever is appropriate, and d) expand the root partition to fill the SD card. Choose finish and allow the Raspberry Pi to reboot. Note the IP address of the Raspberry Pi, which is reported in the lines just before the logon prompt.

I also overclock it to the Modest setting (800MHz), but you can play with this to meet your needs. You can also bump up the memory split to allocate 192 MB to the GPU, but it hasn’t been necessary in my experience. If you need to run the raspi-config utility again, open a terminal (Alt+F1 through Alt+F6) and enter
sudo raspi-config
there. I don’t recommend changing the setting to boot straight into the GUI, as the Emulation Station and RetroArch stuff that comes later is best launched from the command prompt immediately after logging in and offers something of a GUI anyway.

2. Back on the Windows computer, download PuTTY, which will allow you to access the RPi command prompt from your Windows computer across your LAN. Launch PuTTY, connect to the RPi using its IP address, and log in (username: pi and password: raspberry). The best thing about accessing the RPi via PuTTY is that you can copy command lines from your web browser in Windows and paste them into the PuTTY window, saving you from typing in lots of unfamiliar Linux commands.

3. In the PuTTY window, update the package lists from the repositories and retrieve 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
and then reboot the RPi with
sudo shutdown -r now

5. Reconnect to the RPi with PuTTY and follow the instructions at RetroPie-Setup: An initialization script for RetroArch on the Raspberry Pi to install RetroArch for the Raspberry Pi. You can leave the options for installing components at their defaults, but I generally deselect some of the cores that I don’t want or that I expect won’t work very well on the RPi. The installation will take a few hours, but the fewer emulator cores you choose to install, the faster it will go. Reboot at the end of the RetroArch installation.

6. Copy your ROMs into the appropriate, console-named subfolder under /home/pi/RetroPie/roms/ on the RPi. You can put them on a flash drive and transfer them to the RPi via command line or in X, or you can use WinSCP to copy files from a Windows machine to the RPi across the network, which is the method I prefer to use. (WinSCP can, to some extent, also allow you to edit config files on the Raspberry Pi, which you’ll need to do from time to time.)

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 games, by entering
emulationstation
at a terminal prompt using the USB keyboard (it 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’m not sure I actually want this behavior at each boot and so continue to launch it myself.

Ridley

Ridley

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

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 trying to map all of the buttons on my old Logitech MX510 mouse, but I digress…)

For one thing, a wired (and potentially wireless) Xbox 360 controller isn’t going to automatically work, and unless you’re content using the keyboard in games, you’re going to want to get it working ASAP. You can connect the controller, and you may get the ring of lights to pulse, but you’ll need to crank up xboxdrv before you can do anything with it, as xboxdrv is how the RPi talks to the Xbox 360 controller. I strongly recommend reading through the list of xboxdrv switches, as I spent a long time trying to figure out why the triggers and analog sticks weren’t mapping until I went back and RTFM.

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
and 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.

Now that 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 in LXDE, which is the graphical interface on the Raspbian distribution, but I’m trying to get better with vim, so I’m going to use it in this case. In PuTTY, enter
cp ~/RetroPie/configs/all/retroarch.cfg ~/RetroPie/configs/all/retroarch.cfg.bak
to back up the default RetroArch configuration file, and then
vim ~/RetroPie/configs/all/retroarch.cfg
to open the file in vim. It’s good to get some idea of the options and their defaults, I think, 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. Exit the file by typing
:q
and hitting Enter.

Back on the USB keyboard attached to the RPi, log in and enter
cd ~/RetroPie/emulators/RetroArch/tools
to navigate to 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 “~” to enter a logical negation symbol “¬” instead. The tilde in a path is expanded to be the current user’s home directory, and the logical negation symbol is not.) Enter
./retroarch-joyconfig -o p1.cfg -p 1 -j 0
to fire up the utility and then 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, otherwise, it is just echo’d to the screen.) If you mess up, just keep pressing buttons until the utility exits and then enter
./retroarch-joyconfig -o p1.cfg -p 1 -j 0
again to start over.

When you’re done, you should have a new p1.cfg file at ~/RetroPie/emulators/RetroArch/tools. The contents of this file is what will eventually tell the Emulation Station, RetroArch and each of the various system emulators how to interpret the commands coming from your 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

(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.)

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

In a hurry to get to Mother Brain

In a hurry to get to Mother Brain

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 (HDMI, wired controller or Xbox 360 wireless gaming receiver, etc.)
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. reboot the RPi (sudo shutdown -r now from a terminal) and log in as the ‘pi’ user
4. at the prompt, enter emulationstation to launch the front-end
5. use an analog stick or D-pad on the Xbox 360 controller to browse the ROMs (use right and left to browse the different systems) and one of the buttons to launch a game.

And you definitely should 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 fine, the audio out through the analog jack is decidedly not fine. Well, the sound starts off fine, but within 20-30 seconds it starts becoming increasingly choppy and a few moments later I’m ripping off the headphones. I Googled this a ton, and eventually changed retroarch.cfg to use the options recommended at https://github.com/petrockblog/RetroPie-Setup/wiki/Sound-Issues by uncommenting and/or editing these lines in the file (again, with vim):

audio_enable = true
audio_out_rate = 44100
audio_driver = sdl

You can also try setting the experimental “audio_rate_control” to false and/or the “audio_latency” to 128.

I had read a bit about ALSA and very little about SDL, but from what I can tell, it boils down to ALSA (which is in alpha on the Raspberry Pi) should be faster than SDL once ALSA is working completely, but for right now, we’re better off using something else, and that something else seems to be SDL.

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

Great !!

Great !!

Tweak

And while you’re editing retroarch.cfg, you may want to map a controller button to exit the game and return to the Emulation Station GUI. The Esc key on the keyboard does this, by default.

Because I had mapped so many strange buttons to the silver Xbox guide button during my trial-and-error period, I was able to easily identify the number assigned to it in retroarch.cfg, and that number happened to be 8. So, to make the Xbox guide button on my controller exit a game and return to the Emulation Station menu, I added a line to the bottom of retroarch.cfg:

input_exit_emulator_btn = "8"

There is a very real risk that a misplaced thumb will hit the guide button instead of Back or Start and boot me out unexpectedly, but you may consider it an acceptable trade-off. On the other hand, it may be a better idea to map the guide button to save the game state (by default, the F2 key does this).

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.

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)
F8 – take a screenshot (saved to the ROM’s directory)
F9 – mute audio

While in the Emulation Station GUI (such as it is):
Arrow keys – navigate through ROMs and systems (consoles)
Enter – launch the selected ROM
F1 – restart or shutdown the Raspberry Pi (once you enter this menu, you’re kinda stuck unless you hit F4)
F4 – terminate Emulation Station and return to the command prompt

Recently, themes for each console have been developed for the Emulation Station, which I think everyone would agree could really use a designer’s touch. The theme files can be downloaded from aloshi.com/emulationstation, and some simple instructions can be found in the readme of the Emulation Station project at github at https://github.com/Aloshi/EmulationStation/blob/master/THEMES.md.

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.

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 restore as long as I stayed within a game. Resolving this problem was one of the reasons I rebuilt the whole thing from scratch in late January, 2013. 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.

But my problem was sadly not resolved with the rebuild, and in some ways is actually worse after the rebuild. Not only can 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 get a black box (possibly with black letters, rendering the text impossible to read) whenever I trigger 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 is rather disappointing for games that I had played 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 SOL until I get it figured out.

The NES theme, at least, seems a little goofy. It looks like the game titles are supposed to be listed on the right-half of the screen, but they are centered instead.

When I launch a NES game, I get two warnings in the terminal:
RetroArch [WARN] :: ORGB155 pixel format is deprecated, and will be slower. For 15/16-bit, RGB565 format is preferred.
RetroArch [WARN] :: [GL]: Stock GLSL shaders will be used.

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…

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:UsersPublicDocuments 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, 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

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: \ComputerNameShareName
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: \loomerc$

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 needed to insert a short delay between two processes, so I whipped up a little VBScript that accepts an argument in seconds and then sleeps for that amount of time. If no argument is passed, it sleeps for 3 seconds. It writes to the Application event log before it sleeps and after it wakes.

Usage: sleep.vbs 5

It could be better, sure, but I’m humble about it. It doesn’t validate that the argument is an integer, for example. But it does the trick when used correctly.

sleep.vbs

Option Explicit

'Accepts input in seconds and converts the input to microtime, then sleeps for that long

Dim WshShell
Dim strEventInfo
Dim intSeconds, intMicrotime

Set WshShell = CreateObject("WScript.Shell")

If WScript.Arguments.Count > 0 Then
	intSeconds = WScript.Arguments.Item(0)
Else
	intSeconds = 3
End If

intMicrotime = intSeconds * 1000

LogEvent "The sleep.vbs script is sleeping for " & intSeconds & " seconds."

'Sleep briefly to allow processes to finish
WScript.Sleep intMicrotime 

LogEvent "The sleep.vbs script is done sleeping."

'******************************************************
'* Subroutine: LogEvent(strEventInfo)
'*   Creates a Windows Event Log information entry with the specified text
'******************************************************
Sub LogEvent(strEventInfo)
	WshShell.LogEvent 4, strEventInfo
End Sub

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

The VBScript code below creates a text file in your %TEMP% directory using datestamp and timestamp data as part of the file name. The file name uses the following format: YYYYMMDD-HHMMSS.txt.

It seems like I am forever writing log files for my VBScript projects, and this is a pretty good way of giving them meaningful and generally unique file names. Extend it to suit your purposes.

Option Explicit

'#########################################################
'##  Initialize global variables and objects
'#########################################################

Dim WshShell
Dim strSafeDate, strSafeTime, strDateTime, strLogFilePath, strLogFileName

Set WshShell = CreateObject("WScript.Shell")

strLogFilePath = WshShell.ExpandEnvironmentStrings("%TEMP%")

strSafeDate = DatePart("yyyy",Date) & Right("0" & DatePart("m",Date), 2) & Right("0" & DatePart("d",Date), 2)

strSafeTime = Right("0" & Hour(Now), 2) & Right("0" & Minute(Now), 2) & Right("0" & Second(Now), 2)

'Set strDateTime equal to a string representation of the current date and time, for use as part of a valid Windows filename
strDateTime = strSafeDate & "-" & strSafeTime

'Assemble the path and filename
strLogFileName = strLogFilePath & "" & strDateTime & ".txt"

'Create the file and write a line of text to it
CreateLog strLogFileName, strDateTime

'******************************************************
'* Subroutine: CreateLog(strLogFileName,strEventInfo)
'*   Creates text file containing a line of text
'******************************************************
Sub CreateLog(strLogFileName,strEventInfo)
	'http://msdn.microsoft.com/en-us/library/5t9b5c0c(v=vs.84).aspx
   Dim objFSO, objTextFile
   Set objFSO = CreateObject("Scripting.FileSystemObject")
   Set objTextFile = objFSO.CreateTextFile(strLogFileName, True)
   objTextFile.WriteLine(strEventInfo)
   objTextFile.Close
End Sub

Easy peasy.

Microsoft has a nifty tool called Orca.exe that lets you directly edit options within msi installer files and msp patch files.

Orca.exe is a database table editor for creating and editing Windows Installer packages and merge modules. The tool provides a graphical interface for validation, highlighting the particular entries where validation errors or warnings occur.

This tool is only available in the Windows SDK Components for Windows Installer Developers. It is provided as an Orca.msi file. After installing the Windows SDK Components for Windows Installer Developers, double click Orca.msi to install the Orca.exe file.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa370557(v=vs.85).aspx

Orca.msi was originally included in the Windows Installer 4.5 SDK, which is no longer available as a stand-alone download. Orca.exe version 5.0.7693.0 and other tools for working with msi files are part of the Microsoft Windows SDK for Windows 7 and .NET Framework 4 (or for previous versions, try the older Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1). The package that includes Orca.msi is available as an a la carte selection from the Microsoft Windows SDK web installer. Proceed through the web installer wizard and then select only the “Debugging Tools for Windows” under “Common Utilities” for the minimum install. Orca.Msi will be saved to “C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\”.

If you prefer a massive download just to get a 2 MB executable, the entire Microsoft Windows SDK is available as a 1.4 GB ISO from Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1 (ISO).

Should Windows 7 be old news to you, you can try the Windows Software Development Kit (SDK) for Windows 8. (I have no idea what’s in there.)

Notes on using CertMgr to install a wireless certificate from the command line

CertMgr

http://msdn.microsoft.com/en-us/library/windows/desktop/aa376553(v=vs.85).aspx

CertMgr is available as part of the Windows SDK (Microsoft Windows Software Development Kit), which you can download from http://go.microsoft.com/fwlink/?linkid=84091.

The Microsoft Windows SDK for Windows 7 and .NET Framework 4 was published on 5/19/2010.

The CertMgr.exe is included among the Security Tools in .NET Framework Tools.

http://msdn.microsoft.com/en-us/library/d9kh6s92(v=vs.71).aspx

After the Windows SDK Installer launches, you are able to select which components to install. The default installation is 1.7 GB. If you choose to install only the Tools option in the .NET Development group, the installation is reduced to 197 MB.

32-bit CertMgr.exe will be installed to: C:Program FilesMicrosoft SDKsWindowsv7.1Bin
64-bit CertMgr.exe will be installed to: C:Program FilesMicrosoft SDKsWindowsv7.1Binx64

To use CertMgr, the user must be a member of the Administrators group on the system and run the command from an elevated command prompt.

Installing Test Certificates

http://msdn.microsoft.com/en-us/library/windows/hardware/ff547646(v=vs.85).aspx

The same switches can be used to import the wireless certificate.

-

Exporting and importing a wireless network profile

Netsh Commands for Wireless Local Area Network (WLAN) in Windows Server 2008

http://technet.microsoft.com/en-us/library/cc755301(v=ws.10).aspx

Manually configure the wireless network on a machine

Export the wireless network profile from the machine
Open an elevated command prompt
netsh wlan show profiles
(This will display the profiles on interface Wireless Network Connection)
netsh wlan export profile name="homenet" folder="C:UsersOliverDownloads"
(Where homenet is the profile name obtained above and the folder is the destination where the XML file containing the settings will be saved)

Import the wireless network profile to a new machine
Open an elevated command prompt
netsh wlan add profile filename="C:UsersOliverDownloadsWireless Network Connection-homenet.xml"
(Where the XML file is the settings file from the export above)