Android and SNES? Oh my!
So a while ago (Dec 2012, so only a couple months :D) I posted a little picture of a setup I got working with my nexus 7.

I promised I would document how I did it for others, and so I’ll best to explain what / how I got it working but it’s been a long time since I did any sort of technical writing, so bear with me.
So what do you need? This is what I used, this is by no means the only way.
- Gamepad (I used one of the snes gamepads I bought from a local game store. There are tons of tutorials online on how to convert an old snes controller to a usb one)
- MicroUSB OTG Adapter – As linked
- Android Device that has OTG support. I know my Galaxy Nexus and Nexus 7 both support them.
- I used USB/BT Joystick Center in the end. Its pretty expensive, has some sort of online DRM (but seems to work offline, just can’t edit joysticks). I’ve heard you can do it with root/this app, but this is what I used for my un-rooted tablet. There is a demo version available that lets you test compatibility before spending the money.
- A “game” you want to run. I use SNESDroid for that
All in all I would say it’s not exactly a hard process. Joystick Center is expensive and a very dev-ie UI but it’s quite simple once you figure it out. It is essentially a tool to make drivers for your usb gamepad for your android device. It seems to do a good job at that.
Once you get everything hooked up and Joystick center installed and running, you need to make sure it finds the gamepad. It’s a bit finicky, especially if you have other USB apps installed. Once you have the app running and find the device you see something like:
Next you need to select that device. When that is done, you’ll see another row. This row confused me the most. It’s not that important other than the driver button on the left hand side. Once you’ve clicked/tapped the driver button, you’ll come across a screen kind like:
This would be the most important screen. It took me a few trues and a few videos to figure everything out but it’s actually quite simple.
First you’ll want to add your directional support. Since my gamepad has a dpad, I added a “stick” control. This is the second button on the right side of the big + indicator on the left side of the screen (confusing no?). My gamepad also has 8 buttons so I added 8 of those (first button next to +).
Now for each “feature” you will select them once at a time and configure it. It does’t matter at all which order you added/do things in.
First I selected my stick. On your gamepad move the dpad/control stick around. For every light / box that changes (from on to off or whatever) highlight it. I ended up having 16 boxes selected. After selecting move the dpad around again, you should see the stick box move around properly. Make sure to try out all directions.
Next comes the easy buttons. Select a button. Press a button on the gamepad repeatedly. Highlight any boxes that change. Repeat for next button.
By the time you are all done, any time you press an existing button or move the dpad, it should jump to the properly button in app. If that’s all correct, hit back. I would press “Exp” on the main screen to save your configs, but so far mine has never gone away.
Now fire up your game. For me SNES droid has the ability to remap keys. So I go into the settings and map each button press to a key.
So there you have it, now you can play games with your gamepad on your android device.
From what I read, you can actually use the app to map buttons to actual key presses, so its possible to play regular games, but I never exactly figured out how to do that (not needed for snes).
How to change from mate-terminal to xfce4-terminal
Mostly for my own purposes
mateconftool-2 --set /desktop/mate/applications/terminal/exec --type string "xfce4-terminal"
I’m not a big fan of mate terminal, seems to hurt my eyes, like xfce better, so this still makes the “launch terminal” shortcut work, but launch a different terminal.
Probably should switch it to use the debian standard “x-terminal-emulator”
Busy Week here
Got lots of things committed this week.
RetweetBot has been upgraded. It now has a ruby script to grab latest events from meetup.com group, and post them to twitter. It was a good excuse to learn ruby. Try out gems and some modules.
Redmine auto-watcher patch – Very minor patch to support redmine 1.32
Collectd write_graphite patch – We at $work are just starting to play with collectd/graphite and before the 5.1 release we were using an older python module. Dusted off my C to add a few config options to keep the new C version outputting the same as the old python version.
mongo-c-driver very minor patch (the most minor of them all) to fix Makefile to output proper .so files (and learned a bit more about how .so files work)
And lastly,
puppet-module-supervisor minor patch to the awesome module so puppet can manage our supervisor daemons.
Lots of open source work this week, I hope even more, its been too long.
How to output pretty json in puppet
It kept seeming like it should be straight forward. Various attempts by myself (mostly because I don’t know ruby) seemed to fail. I’m just leaving it here now that I figured out how to get it working so I can find it again (and hopefully help others).
init.pp
$config_data = { "foo" => "bar" }
template.erb
<%= require "json"; JSON.pretty_generate config_data %>
I found config_data.to_json wasn’t going to work for me because it seemed to output things in different orders each run.
(it was http://snippets.aktagon.com/snippets/412-How-to-pretty-print-JSON-data-with-Ruby that helped me figure this out)
Edit: While pretty, still doesn’t sort so puppet can update the config file each run :( I will figure this out.
Edit: After much trial and error, I ended writing my own library. https://gist.github.com/2287885
Git+push notification with Gitolite and Jenkins
Its so easy now to support jenkins+git with gitolite. No more having git polling per project and slamming the git server with ssh requests.
To install:
Edit .gitolite/hooks/common/post-receive file[1]
Add:
curl -s http:///git/notifyCommit?url=/${GL_REPO}.git
For me, my git prefix is: “ssh://git@git.kodekoan.com”
Its that simple.
[1] .gitolite/hooks/common/post-receive should be symlinked in every repo you have. I think you needed to set it up before you created a repo though)
Historical Livejournal
LJ Was mentioned a few times today, but mostly because one of the accounts I was holding got a delete notification. I started to search for some historical posts:
* http://news.livejournal.com/58116.html <– LJ Singles (I remember signing * up for it, but not finding local people)
* http://news.livejournal.com/57395.html <– meetup.com starting (I used to run the local LJ meetups)
* http://news.livejournal.com/45260.html <– the great LJ BBQ. I was one of only 2 canadians there, they kept making me say "Canadian" things
Amused I am
Terraria
Sometime during the last big steam sale (I think it was the summer sale) my roommate and I both picked up Terraria off of steam. I don’t think either of us played it for months. It was always on the to play list, but I was busy with other games, he was busy with Minecraft. So we just put it off.
Man was that a mistake.
I played it a bit one night waiting for a group to show up for another game. The group ended up canceling so I kept playing. Next thing I had known 3 hours had gone by, It wasn’t hard to get my roommate interested. It was a simple game with low requirements.
I quickly found and setup a multiplayer server for the two of us.
Fast forward a couple weeks. I get back from family trip/PAX to find my roommate has built a couple really sweet houses.
Got my friend Nigel playing on my server the last few nights. Last night My roommate and I went down to the lava areas to mine for Obsidian, after about an hour, we came back up, to find Nigel had been busy on his own house. I can’t wait to see what we do next. I think the group exploring is the most fun.
I have to say I know I’ve gotten my $10 worth (it was on sale, so actually less) probably a hundred times over so far.
I’ve always been annoyed there is no steam cloud support. You can’t switch between computers to play the same character/world.
Today I remembered that dropbox is a cheap and easy cloud save game support
junction "%USERPROFILE%\Documents\My Games\Terraria" Terraria |
Lacuna Expanse
With all the new recent games that have come out, across all systems, I keep finding it surprising that I’m playing a browser based (originally) mmo.
I describe the game as a merge of both simcity and any space trading sim. I’ve sucked in at least 2 coworkers, and a few others have tried this game out. I love the public wiki based help system, complete with a public tech tree. Its very cool how every ingame building and ship (and a few others) all make sure to have a wiki link which people can expand.
The game has a completely open jsonrpc based api. Which allows all kinds of fun tools to be created. I’ve seen one set of tools being created to generate nice solar system maps, and we’ve been discussing various other random tools at work.
I think its awesome how you are safe and can continue to do the single player experience of building your planet up, but the instant you send out colony ships and expand you are no longer protected. I now have 2 colonies and having a minor fight with one of my neighbors, and I can’t wait to see what other multi-player options there are.
So go ahead and join lacuna and send me (halkeye) a message hi.
Dragon Quest IX Completion Stats
Finally finished the game (DQIX) tonight @ 10:25pm…
Random notes and stats to remember this by:
beat the final boss in 5 or 6 rounds
my 2 gladiators did 1500 damage (at 50 tension) and nearly 2000 (at 50+double up)
it helped i didn’t use forbearance
so one guy didn’t get slaughtered
3 rounds for tension + 1 for magic mirror + 1 for double up + 1 to attack = 6 rounds
Stats:
Time Spent Playing: 122:29
Time Spent in multiplayer: 13:52
Battle Victories: 2869
Times Alchemy Performed: 103
Accolades EArnt: 120
Quests Completed: 37
Grottoes Completed: 24
Guests Canvassed: 79
Defeated Monster List Completion: 79%
Wardrobe Completion: 25%
Item List Completion: 51%
Alchenomicon Completion: 19%
mini medals: 59
Levels:
Goku – Lv.47
Cassie - Lv.47
Norbert – Lv 37
Stacey – Lv. 35
Debugging ssh+svn
Posting here in case anyone else needs to know.
Was trying to debug a ssh+svn connection. There is a very simple way to get debugging turned on:
$ export SVN_SSH="ssh -v " $ svn checkout svn+ssh://
Any other ssh commands can be put in that env variable too, so ports and such.





