Category Archives: Uncategorized

From Zero to Root in Sixty Minutes: Kindle Keyboard

If you ever wanted to do this, rooting is for you. This exhaustive tutorial documents the precise instructions for rooting the old e-Ink Kindles, such as Kindle Keyboard 3. A MOBI version of this tutorial is available for download, in case your Internet connection cuts out.

Photo: Kindle 3 running Pokemon Yellow

Requirements

  • Kindle Keyboard v3 or lower. Kindle Fire and other devices have their own root tutorials.
  • Kindle battery should be at least 1/2 charged, for applying updates.
  • A WiFi access point, such as a home router, for connecting to the SSH server that will run on the Kindle.
  • Desktop SSH client such as OpenSSH or PuTTY.
  • A Python installation, for running the root password recovery script.

Recommended

  • Some familiarity with running command line instructions
  • A reliable Internet connection for Googling troubleshooting articles
  • Backing up your ebooks, on your desktop computer, online, or elsewhere; in case your Kindle is bricked.

Step 1: Jailbreaking

Jailbreaking allows custom utilities to be installed on the Kindle, running as if they were officially supported background services.

  1. Download and extract the zipped jailbreak files.
  2. Write down your Kindle serial number and firmware number, available in Menu -> Settings -> Device Info.
  3. Match your serial number to your Kindle model name and version.
  4. Match your firmware version to an update… .bin file.
  5. Connect your Kindle to your desktop computer with a micro USB to USB cable.
  6. Drag & drop the update… .bin file onto the Kindle drive. The file should be placed in the main drive directory, not inside a folder.
  7. Apply the update with Menu -> Settings -> Update Your Kindle.
  8. The device will reboot and attempt to install the jailbreak update. If the update fails, double-check your firmware version and consider using a different update… .bin file.
  9. If your Kindle ever receives an official Amazon firmware update, you will need to repeat the jailbreaking process all over again.

Step 2: Install Kite

Kite is an application launcher that creates shortcuts on the Kindle home screen, used in Step 4: Install a Home Screen App (“Kindlet”).

  1. Apply the kite update just as you applied the jailbreak update.
  2. Kite will create home screen launchers for any shell scripts placed in YOURKINDLEDEVICE/kite/. Launchers will appear as ordinary PDF books, but kite will ensure that they actually open as apps.
  3. Shell scripts should be ASCII-encoded, with Unix (LF) line endings, have executable (chmod a+x somescript.sh) and prefaced with a standard shebang (#!/bin/sh).

Step 3: Setup the SSH server

An SSH server allows you to run commands and transfer files remotely onto your Kindle from another computer.

The usbnet update hack enables a secret debugging mode that treats the Search bar as a debugging console for entering commands. A brief ~usbNetwork command starts a Dropbear SSH server running on the Kindle, allowing for remote root shells. While the search bar allows root commands to be run with ~exec, typing potentially dangerous commands on an e-Ink screen is less than ideal, so we use SSH.

Note that the debugging console is mutually exclusive with the Kindle operating as a removable USB drive; you can’t do both at the same time.

  1. Apply a usbnetwork update just as you applied the jailbreak update.
  2. When the device finishes rebooting, open  YOURKINDLEDEVICE/usbnet/etc/config for editing with a text editor.
  3. Replace the line K3_WIFI=”false” with K3_WIFI=”true”. This enables the SSH server over WiFi, much easier to use than SSH over USB. Save the changes to the config file.
  4. Reboot the Kindle for the changes to take effect.

Once the SSH server is configured this way, it can be enabled and disabled at will:

Enabling the SSH Server

  1. Connect the Kindle to the same WiFi network as the SSH client will be using.
  2. Write down the Kindle’s IP address. The IP Address is listed in the secret 711 menu, accessed by Settings -> 711 (or Alt+U Alt+Q Alt+Q). The IP address is on the second page (Next Page Button).
  3. You may want to test the network connection between your desktop computer and your Kindle. The Kindle blocks ping requests, but it does respond normally to arping. For example, in Mac OS X:
    $ brew install arping
    ...
    $ sudo arping YOUR.KINDLE.IP.HERE
    60 bytes from 90:a4:de:da:18:fb (192.168.1.74): index=0 time=65.683 msec
    60 bytes from 90:a4:de:da:18:fb (192.168.1.74): index=1 time=89.113 msec
    60 bytes from 90:a4:de:da:18:fb (192.168.1.74): index=2 time=118.289 msec
    ...
  4. On the Kindle, turn on the special debug mode by typing ;debugOn in the Search box and pressing the Enter key. To confirm that everything is working at this point, you can type ~help (or `help on Kindle 2 and below) to see a list of debugging commands. Assume Kindle 2′s always use backtick (`) instead of tilde (~).
  5. Switch from USB drive mode to USB debug mode by typing ~usbNetwork and pressing Enter.
  6. Determine your root password via kindle-root-password.py. Example:
    $ python kindle-root-password.py A0A0A0A0B0B0B0B0C0C0
    fiona754b
  7. On your desktop computer, connect to the Kindle SSH server.
    $ ssh root@YOUR.KINDLE.IP.HERE
    fionaTHERESTOFYOURPASSWORDHERE
    Welcome to Kindle!
    
    #################################################
    #  N O T I C E  *  N O T I C E  *  N O T I C E  #
    #################################################
    Rootfs is mounted read-only. Invoke mntroot rw to
    switch back to a writable rootfs.
    #################################################
    
    [root@kindle root]#
  8. Enter mntroot rw to enable read-write support.
  9. Use scp or pscp to copy over apps. Kindle programs are typically installed in /mnt/us.

Disabling the SSH Server

  1. Entering ~usbNetwork in the Kindle Search bar will toggle the SSH server back off, as well as restoring normal USB file transfer ability.
  2. Enter ;debugOff to turn off the debugging commands for now.

Step 4: Install a Home Screen App (“Kindlet”)

Once kite and usbnet/ssh are setup, installing a new application and configuring a home screen shortcut are as easy as editing shell script files.

  1. For example, use scp to copy fbgnuboy into /mnt/us/.
  2. Copy a rom such as pokemon-yellow.gb (you’re on your own) to /mnt/us/.
  3. Create a shell script pokemon-yellow.sh with executable permissions and either drag & drop into the kite/ folder (remember to toggle ~usbNetwork back off to restore USB file transfer).
    #!/bin/sh
    
    /usr/bin/killall -stop cvm
    /mnt/us/fbgnuboy /mnt/us/pokemon-yellow.gb
    /usr/bin/killall -cont cvm
  4. kite will automatically create a dummy PDF book called pokemon-yellow.sh.pdf on the home screen. When opened, the “book” automatically runs the shell script, starting Pokemon Yellow.

Photo: Kindle 3 running Pokemon Yellow

Currently, there is no sound support in the emulator. But it’s still pretty amazing that this is even possible. Feel free to reply to the MobileRead Game Boy forum thread if you have any questions or comments.

Fix for Command line text editors not opening properly in Windows

Command line editors such as nano and vim may have trouble opening properly in Windows, either showing spurious text or quitting with a message like ”Error opening terminal: dumb.”

Try setting %TERM% to “cygwin”.

Google Redirect Virus Removal using ComboFix

redirect metaphorIf clicking on search results often yields spurious results, your computer is likely infected with a virus.

 

First, try:

  • Verifying that your DNS server is not set to a manual address for a fake DNS server.
  • Verifying that your browser is not using a proxy address for a fake proxy server.
  • Verifying that your nonplug-and-play device drivers does not include TDSServ.sys.
  • Scanning your computer for infections using Malware Bytes.
  • Restoring your master boot record using fixmbr (found on Windows installation CDs, as well as the third-party ms-sys package for Debian/Ubuntu).

If all of the above fail to remove the virus, try ComboFix. The user interface isn’t great; it restarts your computer three times without even a warning, but it did fix the problem for me.

Fixing Dual Boot Audio Problems

muteIf you’re using something like Windows 7 x64 Professional on a MacBook Pro, and you’re having audio problems, you’ll want to update your Boot Camp drivers.

Problems

  • Sound only works 50% of the time, for any application (e.g. YouTube)
  • Mic muted 100% of the time (e.g. Skype)
  • Have to reinstall sound driver every couple of reboots

Solution

First update to Boot Camp 3.0. You’ll have to pirate it; Apple doesn’t even provide it as a download, though it officially comes with every Snow Leopard installation disc. You also have to update incrementally (v2.0 -> v3.0 -> v3.1 -> v3.2 -> v3.3), because the Apple installers don’t work that well.

Continue updating to version 3.1. Install Skype and do an echo test. If that doesn’t fix your audio problems, then update to 3.2, or even 3.3.

League of Legends

So. Much. Fun.

Sign up

Sound sometimes unavailable in League of Legends

Suggested Fix:

Control Panel -> Hardware and Sound -> Sound -> Speakers -> Properties -> Advanced -> Uncheck “Allow applications to take exclusive control if this device”

Panera Login Fix

If you’re having trouble loading the Panera captive portal login site, set your network preferences to obtain DNS information automatically instead of manually.

Control -> Network and Internet -> Network and Sharing Center -> Change Adapter Settings -> Right-click relevant adapter, usually Wireless Network Connection -> Properties -> Internet Protocol Version 4 -> Properties -> Obtain DNS server address automatically

Simon Already Did It!

Science and industry are bubbling with exciting new computational techniques. Parallel processing, quantum computing, GPU processing, software transactional memory. Proof-of-concept programming languages are mushrooming, but Simon already did it.

Simon Peyton Jones’ crazy academic language Haskell can do all of these things. The Hackage repository has packages for parallel processing, quantum computing, GPU processing, and software transactional memory. If there’s a buzz on some new computational technique, Haskell already did it. It’s an incredibly flexible prototyping system.

How does Haskell do all of these things when typically, each of these techniques is explored using an extremely limited prototype language? Haskell is a functional language with powerful domain specific language capability; you no longer need to trade research papers in a dozen languages when it’s easy to prototype an experimental language within Haskell.

DSLs are featured in Lisp; what makes Haskell so special? The secret sauce is declarative programming: In Haskell, the coder describes the computation to be performed, and the Haskell compiler decides an optimal way to perform the computation. Imperative programming is eschewed in favor of pure functional programming: mapping, composition, recursion. By using single assignment and avoiding state, Haskell gains flexibility in how it executes code.

Haskell does event driven computing, concurrent computing, matrix computing, even lazy computing, by isolating imperative code in monads. There are monads for pseudorandom number generation, monads for I/O, monads for multithreading. The accelerate package for behind-the-scenes GPU computing is just a monad that turns Haskell vector manipulations into CUDA, executes it on a GPU, and returns the Haskell-typed result.

The final ingredient is generalized abstract data types. When you create a data type to model something in the real world (employee IDs, aquarium fish, highway traffic, etc.), Haskell can derive how to print and parse the models from text files to live objects and back. It can determine on its own how to compare and sort sequences of data. Finally, Haskell can automatically manipulate arbitrarily complex collections of data (databases of employee IDs, store rooms of aquarium fish, graphs of graphs of graphs of highway traffic). A bloom filter of schoolmates? No problem.

There is no longer a need to learn Unified Parallel C, QCL, CUDA, libev, or MATLAB. Haskell already did it; just learn one language that can handle all these paradigms and paradigms yet to be invented. There are many free online tutorials that enable you to use graduate level techniques with an undergraduate’s knowledge. Haskell’s language prototyping flexibility makes C look like Brainfuck: you’ll still succeed, but wouldn’t you prefer to do it with more robust, more expressive tools?

Why I use Rust

Lambdas! And decent docs.

USB Obsolescence

no usb signUSB flash drives used to be the hot new thing, but like all computer hardware, they’re now phasing out. You may have received a shiny new thumb drive on Christmas day. Here’s why you probably returned the plucky stick back to the store.

10. You have Dropbox, Ubuntu One, or some other free file hosting service and no longer need to ferry files by sneakernet.

9. You have a laptop, smart phone, or other portable computer. Some geeks take pride in running full operating systems off of thumb sticks. It’s more trouble than it’s worth.

8. You have a portable music player. While you could install CoolPlayer+ and other portable apps onto your USB drive, your iPod already functions as one, with a built-in player.

7. You have an ereader device or app. PDFs can go on USB drives, but what better way to enjoy them than on a Kindle or iPad?

6. You can’t remember what a gigabyte is. Some people deal in terabytes now. Anything less is pitiful; how else would you store your digital movie collection?

5. USB transfer is too slow for your needs. Another endorsement for Dropbox: It uploads and downloads unusually quickly for a free service.

4. WiFi + Shared folders / DropCopy / netcat.

3. BD-RE.

2. Viruses, privacy, it’s so easy to lose that tiny thing, where oh where did I put it last?

1. The Internet, or as hipsters say, “the cloud”.

The USB protocol is here to stay, in some form or other. It’s tremendously convenient to be able to connect various and sundry devices through the same port. But USB flash drives can only lose as cloud storage space becomes cheap as free and the Internet becomes ubiquitous.