Archive for Tutorial

Setting up a Raspberry Pi without a monitor

This tutorial presupposes that you’re using Raspbian Wheezy.

  1. Install Raspbian Wheezy on your SD card by following these instructions.
  2. Open the SD card’s root partition, the one not namedboot.
  3. Open /etc/networking/interfaces in a text editor.Find this line:iface eth0 inet dhcp

    Replace it with this:

    iface eth0 inet static
    address 192.168.1.100
    netmask 255.255.255.0

    This sets your static IP address to 192.168.1.100. Change that if you want. Don’t mess with the netmask.

  4. Open /etc/resolv.conf.Find this line:nameserver 192.168.1.1

    Replace it with this:

    nameserver 8.8.8.8

    This sets your DNS nameserver to Google Public DNS. There are other nameservers out there, but Google is robust.

  5. Eject your card and put it in your Raspberry Pi. Connect it to the same network as the computer you want to ssh into it from and power it on.
  6. ssh pi@192.168.1.100 or the appropriate IP address. Success!
  7. Do whatever else you want to do to your Pi.

Installing MediaGoblin on a HostGator shared server: Not Allowed

The following tutorial is a bastardized version of that given by MediaGoblin devs. It does not include setup for PostgreSQL. It does not include instructions on how to run MediaGoblin as a separate user, as you do not have permissions to do that on HostGator servers. MediaGoblin will run as your account. This process requires calls or chats to customer support. Prerequisites:

  • Shell access to your shared-host Linux HostGator account
  • Working knowledge of the shell

Steps:

  1. ssh -p 2222 accountname@yourdomain.com
  2. cd to the directory you want MediaGoblin to be set up in. This should be in public_html. If you’re in ~, Mediagoblin will be set up in ~/mediagoblin, and will not be visible to the web.
  3. git clone http://gitorious.org/mediagoblin/mediagoblin.git
  4. cd mediagoblin
  5. Contact customer support. Tell them that you would like to have a virtualenv set up in (output of pwd) on (output of uname -n). They will need to use the command virtualenv --system-site-packages . || virtualenv . You may have to escalate or file a support ticket.
  6. Once the virtualenv is set up, python and its associated files will be installed in ~/bin/
  7. ~/bin/python setup.py developThis step will fail with the following error:

    Running py-bcrypt-0.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-BWVzJ5/py-bcrypt-0.2/egg-dist-tmp-U3y69Y
    unable to execute gcc: Permission denied
    error: Setup script exited with error: command 'gcc' failed with exit status 1

  8. Given that this will happen, you’ll have to contact customer support again. Tell them that you experienced whatever error you got (most likely related to gcc) and you would very much appreciate it if they pretty please would run the setup script for you.

Update after the break. Read more

How to dualboot Linux with an extant Windows partition

Installing aircrack-ng on Ubuntu 12.04

If you want

aircrack-ng

on Ubuntu 12.04 or its derivatives, you’re going to have to compile it. Ubuntu’s repository doesn’t contain

aircrack-ng

for 12.04, because it’s no longer maintained upstream at Debian.

Simple instructions:

sudo apt-get install build-essential libssl-dev
wget http://download.aircrack-ng.org/aircrack-ng-1.1.tar.gz
tar -zxvf aircrack-ng-1.1.tar.gz
cd aircrack-ng-1.1

Now open common.mak with an editor and find the following line:

CFLAGS ?= -g -W -Wall -Werror -O3

Remove

-Werror

:

CFLAGS ?= -g -W -Wall -O3

Save the file. Still in the folder

aircrack-ng-1.1

, run this:

make
sudo make install

When you run make, there’ll be a lot of stuff scrolling past, but that’s okay. It should still work.

Installing CM9 on a microSD card, updated

Now using the latest and greatest microSD image. This post is an update of a previous post.

This aims to be a simple walkthrough for creating a bootable CyanogenMod 9 microSD card for the Nook Color, though it does assume familiarity with disk images, partitions, running text editors with administrative permissions and verygreen’s bootable SD card image.

  1. Acquire a microSD card compatible with verygreen’s size-agnostic image. Charge your Nook.
  2. Download generic-sdcard-v1.3-ICS-large.img.zip, and the latest CM9 nightly from Samiam303.
  3. Write Samiam303′s size-agnostic microSD image on your microSD card, following the instructions given by verygreen in the linked xda-developers thread. Do not put any CM7 image on the card.
    The reason for the change from Verygreen’s image to Samiam303′s image is because the size of the nightly encore build has grown past the 116 MB allowed by Verygreen’s image.
  4. After you have written the image to your microSD card, eject the card and plug it back in. You should see a partition named ‘boot’.
  5. Put the latest nightly file from Samiam303′s repository into the folder labeled ‘boot’. Do not unzip the file. Safely eject the card from your computer and insert it into your Nook.
  6. Turn your Nook on and wait for the image’s installer to work its magic. When the Nook turns itself off, turn it on to make sure that everything works.
  7. Once the nightly is installed, check that you are able to view wireless networks. Do not worry if you cannot connect. This will be fixed later. Power your Nook off and remove the microSD card. Insert the microSD card into  your computer.
  8. In the partition that has the ‘etc’ folder, go to etc/wifi/. Open ‘tiwlan.ini’ using a text editor running with administrative permissions. Find ‘WifiAdhoc = 1′ and change it to ‘WifiAdhoc = 0′. Save the file and exit the text editor. Reopen the file to check that it the ’0′ was saved. If it was not saved, then you need to figure out how to run a text editor in administrative mode. Credit for this fix goes to EAK128 on the XDA forums. This will allow you to connect to WPA- and WPA2-secured networks.
  9. Once it is correctly saved, safely eject the card and insert it in your Nook Color. Power on your Nook Color. Connect to WiFi.
  10.  If you want to install Google Apps, see Samiam303′s readme.txt post in his CM9 build repository. You may have to rename gapps-ics-*.zip to gapps-gb-*.zip because verygreen hardcoded the updater to look for a file with ‘gb’ in it.
  11. If you have apps backed up as .apk from CM7, you may be able to install them with ‘adb install’. ADB access is not enabled by default. You must enable it by going into Settings > Developer options and checking ‘Android debugging’.
Simple, eh?

Specific Credits:

Grabbing Amazon books for reformatting, pleasure

Creative Commons euphoria

I was referred to a book called Storyteller Uprising earlier today. The book’s about page intrigued me: it’s about how people’s increasing distrust of the legacy media is leading them to create new media.

The book’s website helpfully tells me how to get it:

  • Buy the paper hardcopy through Amazon
  • Buy the paper hardcopy from the university he works for
  • Buy the paper hardcopy from a web store that I was previously unaware of
  • Acquire the digital Kindle version from Amazon

At the bottom of the list, it says that the book is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs license. He’s distributing it for free, in other words. To quote the license:

You are free: to Share — to copy, distribute and transmit the work
Under the following conditions:
Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
Noncommercial — You may not use this work for commercial purposes.
No Derivative Works — You may not alter, transform, or build upon this work.

Since the author is distributing it under those terms, I should be able to find it for free somewhere online, download it, read it and if I like it, buy it.

Hey, it worked for Cory Doctorow and <a href="http://www.antipope.org/"Charles Stross. If I like Storyteller Uprising, I might buy a hard copy of it.

Enter Digital Rights Management

I can’t find the full text of Storyteller Uprising online, though. Having Creative-Commons-licensed material be unavailable feels wrong somehow, like having to pay for access to federal court records.

It’s free on the Kindle today, so I go to Amazon’s store and open it in the Amazon Cloud Reader, a in-browser app that supposedly caches your downloads for offline reading. I want to pull it out of my browser’s cache, reformat it to fit on my rooted Nook Color and read it there at my leisure.

Fun fact: Cloud Reader transmits the book’s contents as a series of encrypted strings inside JSONP containers. Here’s a sample of what’s in gz_frag1.jsonp:

loadFragment1({"fragmentData":"encrypted_text","fragmentMetadata":{"compression":1,"encryption":1,"id":1},"imageData":null});

There are 76 book fragments in this novel, each one with several tens of kilobytes of encrypted data taking the place of encrypted_text in the above code. There’s also a gz_fragmap.jsonp and a gz_skeleton0.jsonp, which appear to provide structure and decoding information to the Cloud Reader. The former helpfully mentions at the end that the book is in the mobi7 format.

Discouraged, I consider loading the web app on my Nook. The web app is clunky, though, and doesn’t fit on my Nook, even though my Nook is running Ice Cream Sandwich.

(Side lesson: Cloud Reader is providing me with the plaintext and ciphertext of the book, the decryption engine and the decryption key. In theory, I have everything I need to not only decrypt the book but to create an automated Cloud Reader download tool. The only thing lacking is knowledge of JavaScript, time, effort, and a willingness to violate the Kindle ToS. For more on this topic, read this Doctorow speech.)

The web approach has failed me. What to try next?

Using alternate platforms

I have a Nook Color running a development build of Cyanogen Mod 9, a custom version of Android’s latest version Ice Cream Sandwich.

Ice Cream Sandwich isn’t written to allow users access to certain types of files. These forbidden files include core operating system files and password databases, but they also include things like apps and app-secured files. Users can’t access those files. Amazon’s Kindle application does not take advantage of those security protections.

Instead, Storyteller Uprising was stored on the unprotected SD card, in the folder Android/data/com.amazon.kindle. I opened it with the free, community-developed e-book program Calibre. From Calibre I am able to transcode it as I will.

What’s the upside of this? Free book, now free of DRM shackles.

Success.

Legal Note

Hanson Hosein, the author of Storyteller Uprising, has released it under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License. Transcoding the work in question is allowed under section 3 of the CC-BY-NC-ND license applied by the author, specifically “The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats…”

Installing CM9 on Nook Color microSD

An updated version of this post is available here.

Now updated with gapps instructions.

This aims to be a simple walkthrough for creating a bootable CyanogenMod 9 microSD card for the Nook Color, though it does assume familiarity with disk images, partitions, running text editors with administrative permissions and verygreen’s bootable SD card image.

  1. Acquire a microSD card compatible with verygreen’s size-agnostic image. Charge your Nook.
  2. Download generic-sdcard-v1.3.img.gzupdate-cm-9.0-0-encore-emmc-sneakpeek1-fullofbugs.zip, and the latest CM9 nightly from Samiam303.
  3. Write verygreen’s size-agnostic microSD image on your microSD card, following the instructions given by verygreen in the linked xda-developers thread. Do not put any CM7 image on the card.
  4. After you have written the image to you microSD card, eject the card and plug it back in. You should see a partition named ‘boot’.
  5. Put update-cm-9.0-0-encore-emmc-sneakpeek1-fullofbugs.zip into the folder labeled ‘boot’. Do not unzip the file. Safely eject the card from your computer and insert it into your Nook.
  6. Turn your Nook on and wait for verygreen’s installer to work its magic. When the Nook turns itself off, turn it on to make sure that everything works.
  7. If everything works, power your Nook off using the power button. Remove the microSD card from the Nook and insert it into your computer.
  8. Four partitions will appear. Put update-encore-YYYYMMDD.zip from Samiam303′s repository in the ‘boot’ partition. Do not unzip the file. Safely unmount the microSD card and insert it into your Nook.
  9. Read this step in its entirety before completing it. Boot your Nook into recovery mode by pressing the power button until the screen flashes, releasing the power button, then holding the power and ’n’ buttons until the message ‘Booting into Recovery…’ appears beneath the Cyanogen logo. If it fails to boot into recovery, wait for the nook to boot fully before powering it off and trying again.
  10. Once the nightly is installed, check that you are able to view wireless networks. Do not worry if you cannot connect. This will be fixed later. Power your Nook off and remove the microSD card. Insert the microSD card into  your computer.
  11. In the partition that has the ‘etc’ folder, go to etc/wifi/. Open ‘tiwlan.ini’ using a text editor running with administrative permissions. Find ‘WifiAdhoc = 1′ and change it to ‘WifiAdhoc = 0′. Save the file and exit the text editor. Reopen the file to check that it the ’0′ was saved. If it was not saved, then you need to figure out how to run a text editor in administrative mode. Credit for this fix goes to EAK128 on the XDA forums. This will allow you to connect to WPA- and WPA2-secured networks.
  12. Once it is correctly saved, safely eject the card and insert it in your Nook Color. Power on your Nook Color. Connect to WiFi.
  13.  If you want to install Google Apps, see sam’s readme.txt post in his CM9 build repository. You will have to rename gapps-ics-*.zip to gapps-gb-*.zip becauseverygreen hardcoded the updater to look for a file with ‘gb’ in it.
  14. If you have apps backed up as .apk from CM7, you may be able to install them with ‘adb install’. ADB access is not enabled by default. You must enable it by going into Settings > Developer options and checking ‘Android debugging’.
Simple, eh?

Specific Credits: