I like to think about how games work, in the case of Jenga, it is just physics!
But don’t you wish you could peel back reality and see what is happening with the physics from the inside? Well now you can, with the help of a Wii Balance Board.
I’m going to maintain all instructions on how to setup all the technical details on my wiki: http://wiki.xkyle.com/WiiJenga
Once you have it setup, you can see where the real center of balance is of your game, and you can tell how close it is to toppling over.
In reality, the balance board isn’t quite sensitive enough to very accurately detect the center of balance of the Jenga blocks, or detect how many Jenga blocks there are, but it is fun to watch:
What if I told you there was a computer out there, a small one, with gigabit ethernet, 4 USB 2.0 ports, runs on 5 watts, and serves as a great NAS (network attached storage) for your home. It can share files, serve media, be a router, make backups for you, host a lamp stack, be a mail server, etc. It can do whatever you can think up.
How much would you pay for such a neat little device? $100? $120? What if I told you that this device is ~$35. What a deal. Lose your P4 electricity guzzler and stick this on your shelf with some harddrives plugged into it.
Now the next question, what Linux distro should we use, and how does one go about installing it? After all, there is no keyboard ports, no display, no cdrom drive. No problem.
To hack this thing, all you need to do is connect to its internal serial port. Here are some instructions to hook up a serial port to the Seagate Dockstar.
Now, there are lots of distros, not too many that support the ARM processor. The stock OS is indeed Ubuntu 9.04, however my OS of choice for this hardware is OpenWRT. Openwrt is a very light, simple, linux distro, designed for embedded systems and routers. If you wish to follow my steps, here are some instructions on installing Openwrt on a Dockstar. I plan to buy a bunch of these and build some sort of super cheap SAN. I’ll let you know where it goes. The possibilities are only bounded by your imagination. (And I guess maybe the hardware)
Ever fumbled around your house looking for a Linux CD, but you can’t find it? Ever suspected that your ram was going bad, but you didn’t have a way to test it? Ever needed to backup files on a computer that had a dead and broken operating system? A solution to all these problems is a super cool tool called PXE booting. PXE booting allows you to load alternative operating systems over the network, without the need for cds, cdroms, etc!
Things you can do with a PXE server
Sound like something that you could benefit from? Setting up your own PXE boot environment is easy and Fun! Check out my presentation and then later my wiki page for notes, commands, and configuration snippets to get your own setup going.
In the XKCD comic dated 3/4/2010, the Collatz Conjecture presents the following scenario:
Well I don’t know if your friends will stop calling your or not, but I was curious about what the graph would actually look like. The graph in the comic looks like it was created with Graphviz, one of my favorite programs!
So I wrote a quick bash script to generate the approrpiate links for graphviz to interpret:
#!/bin/bash
echo "digraph \"xkcd\" {"
for NUMBER in `seq 1 100`
do
if [ $[$NUMBER % 2] -eq 0 ]; then #We are even
let OUTPUT=$NUMBER/2
else #Odd
let OUTPUT=$NUMBER*3+1
fi
echo "$NUMBER -> $OUTPUT"
done
echo "}"
So what does it really look like? Here:
There are lots of straggling links. This is of course only because I went to 100. Why not 1000? It is a little big… click Here.
Turns out with even more numbers we end up with even more isolated links, no big super chain.
If you would like to run this code for yourself, first make sure you have the graphviz package installed in your linux system. Then copy that code above into a script, say called xkcd.sh. Then run like so:
If you play any of these games, feel free to ally with me If aftershock bans me, no big deal
These are the types of games that make you log in often to check your status, and use your energy (otherwise it is wasted). The thing is, most of the decisions and things I do in these games are just to preocupy your time, I could write a program to do the simple things for me. So I did! Now only if I could run it periodically from a cronjob. You see, they require you to type in a CAPTCHA every time you log into the web interface, so for my program to work I have to manually log in first. But wait, the ipod app doesn’t require a captcha… if only I could run the app from the ipod, steal it’s auth cookie, then run my program it could be compeltely automated! Well the best way I could find to do this was to use the T-Plan vnc robot to do the required key presses, then let ssh and bash do the rest.
I also looked into using the Erica Utilities to start the game without the complexity of vnc, but I found they didn’t work on my platform with the 3.0 firmware. So now I can just sit back and let my robot level me up forever!
Here are some more technical details on the script itself if you are interested. Anyone who plays these games would find these features very desireable:
Recovers from raids
Repairs your buildings
Accepts all incoming ally invitations
Automatically uses all your fighting power to get at least 2exp for every fight, and choosing opponents that you can win against. (It automatically heals you if you need it)
Redeems combo/key/spell codes from a large number of websites to gain a huge amount of free, non-upkeep items. (And it posts your code everywhere when you have a new one)
Sends ally invitations to a huge list of available codes from a large number of code sharing sites to build up your command.
Goes through internal game pages to scrape profiles for ally codes to send more invites to.
Quits automatically when you reach the 50 invite 24 hour limit or if your cookie expires.
Deposits money in the bank
Of course you can change the order or the functions, and they are all optional. All the code is here. The code is just bash, using grep, sed, awk, html2text, cat, etc. You will want to edit the variables to meet your needs before you use it of course. You can check out the code with svn:
svn co http://dev.xkyle.com/aftershock
Explaination of commands:
aftershock.sh – Main script, takes the argument 1-5 for the particular game you are playing. Needs the -i argument if you need the cookie from the ipod instead of firefox
go-ipod.sh – Runs each game consecutivly by vnc’ing to the ipod, running the game, getting the cookie, then running the appropriate aftershock.sh instance
spawnall.sh – Runs an exterm for each aftershock game. Useful if you have logged into each game through firefox, and need the robot to just do everything
I will try to support people who genuily who want to run this program. It is GPL. Email kyle@xkyle.com if you need help.