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.

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’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

My year-old and not-terribly-technical post on Configuring FileZilla FTP to use active mode to resolve “425 Can’t open data connection” errors attracted the following spam comment.

After several failed attempts I managed to resolve the error.
Login as root and run the below command to test and check whether it works.

modprobe ip_conntrack
modprobe ip_conntrack_ftp

You can have iptables run the rules directly for you by adding the following script to the bottom of the file /etc/sysct.cont

IPTABLES_MODULES=&quot;ip_conntrack_netbios_ns ip_conntrack_ftp ip_conntrack_tftp&quot;

Once done restart iptables and confirm if the modules are loaded automatically using the below command

lsmod

Output should be as below.

Module                  Size  Used by
nf_conntrack_ipv4      11717  1
xt_state                6081  1
nf_conntrack           51977  2 nf_conntrack_ipv4,xt_state
nfnetlink               8281  2 nf_conntrack_ipv4,nf_conntrack

Hope this helps someone with the same problem in the future. I did for me.

For those of you wondering what this is all about, it sounds like some technobabble having to do with a linux firewall.

iptables is a user space application program that allows a system administrator to configure the tables provided by the Linux kernel firewall (implemented as different Netfilter modules) and the chains and rules it stores.
http://en.wikipedia.org/wiki/Iptables

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

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. http://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.

http://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

Sadly, it’s no longer easy to find the WMI Code Creator utility on microsoft.com. Thankfully, it’s still available on Download.com: http://download.cnet.com/WMI-Code-Creator/3000-2229_4-10731137.html

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. http://www.ardamis.com/
  4. http://www.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 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. The page itself would be hosted on a publicly accessible site, which is http://www.ardamis.com in the example, so that it can be accessed both from within and outside the corporate network.

JavaScript is used to load an image from a location on the company intranet. If successful, it establishes that the machine is on the internal network. The browser can then be redirected via JavaScript to an 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 = 'http://www.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 what shows up in Google, 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 and/or promote via linking additional pages that rank 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 contributes 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, they should be using the person’s name as the link text in the single link 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 they brandyourself.com profiles for people with more common names can push up 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.

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.