Creating a Debian Rescue Usb Drive in Mac OS X

This guide will get you a USB stick running debian that you can use to boot into rescue mode. Well, you could also use it to install from, but that’s not what I care about.

  1. Do the following, while modifying the version string to whatever the latest release is in the second url (both places!): cd ~ wget ftp://ftp.debian.org/debian/dists/stable/main/installer-amd64/current/images/hd-media/boot.img.gz wget http://cdimage.debian.org/debian-cd/6.0.6/amd64/iso-cd/debian-6.0.6-amd64-businesscard.iso

  2. Procure a USB stick, at least 1GB in size

  3. Plug it in. Run the following to see what device name the stick was assigned.:

     $ ls -l /dev/disk*
     brw-r----- 1 root operator 1, 0 Jan 19 11:10 /dev/disk0
     brw-r----- 1 root operator 1, 1 Jan 19 11:10 /dev/disk0s1
     brw-r----- 1 root operator 1, 3 Jan 19 11:10 /dev/disk0s2
     brw-r----- 1 root operator 1, 2 Jan 19 11:10 /dev/disk0s3
     brw-r----- 1 root operator 1, 4 Jan 19 11:10 /dev/disk1
     brw-r----- 1 root operator 1, 0 Jan 30 12:15 /dev/disk3
     brw-r----- 1 root operator 1, 1 Jan 30 12:15 /dev/disk3s1
  4. Find the device that has a creation time of “just now”. Obviously, which device you use may be different than mine. Run the following:

     diskutil unmountVolume /dev/disk3
  5. Now you copy the boot.img onto the drive. Please note that I am using rdisk not disk in the device name, but the number is the same. Also note that you can destroy your entire computer if you put the wrong rdisk device name here, so uh… don’t do that:

     gunzip boot.img.gz
     sudo dd if=boot.img of=/dev/rdisk3
  6. Remove your USB stick, and then plug it right back in.

  7. Copy the iso file onto the drive. Just drop it right in the root of the drive. No, it doesn’t matter if you use the finder or the cp command. Sheesh.

  8. You’re done! Plug that little guy in, and select “advanced options” on the first menu, then “rescue mode”. Follow the prompts, blah blah. Do whatever you need to.

Fast, Clean, Lightweight Blogging

Now, I’m not exactly a shining example of actual blogging - I get distracted by real life way too easily. However, on the technical side, I think I have a fairly good setup. Here is how you would duplicate it. I assume barebones linux knowledge and the ability to read carefully.

  1. Get a server. You can get a free account from Amazon’s AWS and even a free instance for a year (a “micro” in their parlance, which is more than sufficient for a small blogging platform). You could also get a virtual machine from Fatboxes.com - I hear they’re pretty good. As it turns out, it doesn’t really matter which distribution you choose - CentOS, Debian, whatever. If you’re more comfortable with one than the other, have at.

  2. Install the software we’ll be using to make things fast. Varnish and Lighttpd. For any reasonable distro, that should be as simple as a quick:

    apt-get install varnish lighttpd

    Varnish is a very simple beast. The entirety of the config you need is:

    backend default {
        .host = "127.0.0.1";
        .port = "8080";
    }

    Put that in /etc/varnish/default.vcl and start varnish. You might also check /etc/default/varnishncsa, set VARNISHNCSA_ENABLED to 1, and start the varnishlog service.

    Lighttpd is almost as simple. From the default config file, /etc/lighttpd/lighttpd.conf, set server.port to 8080. Everything else should be correct out of the box. Once you change that, start the lighttpd service. At this point, you should be able to hit port 80 on your server with a web browser, and get a default page in response. Last step is to chown /var/www/ to your user:

    sudo chown user:group /var/www
  3. Fork your own copy of octopress on github and then clone a copy on your local computer somewhere:

    git clone https://github.com/[your username here]/octopress.git
    bundle install # This installs all the gems and whatnot you need
    rake install  # This creates all the config files, directories, etc., you need

    You now need to modify _config.yml and Rakefile in the root of the new repo. They are well-documented with comments, and should be easy enough to figure out. Things you want to keep an eye out specifically are:

    # From Rakefile
    ssh_user       = "dbishop@hostname"
    document_root  = "/var/www"
    
    # From _config.yml
    url: http://gnuconsulting.com/
    title: geekery
    subtitle: of all stripes
    author: David Bishop
    simple_search: http://google.com/search
    description: General geekery, a dash of politics, and more.
  4. Add your first post by running:

    rake new_post 'Hey, I'm blogging!'

    That will create a file along the lines of source/_posts/2013-01-13-hey-im-blogging.markdown. Edit that in your favorite text editor (vim, natch), using Markdown to format your text.

  5. Once your precious prose is how you want it, it’s time to publish:

    rake gen_deploy

    And I’m sure that all went swimmingly with no errors. You’re welcome!

Tor Gets a Clue

Just a quick note that Tor, a genre-heavy imprint of Macmillan, will start releasing their titles without DRM. As someone who has books that are locked into Kindle, iBooks, and even the Nook, this is fantastic news. A good take on this is available from Charlie Stross.