Tuesday, November 29, 2011

Amazon Releases The Kindle's Source Code.

In a very cool move, Amazon has released the source code for their Kindle devices. I've already downloaded the source code for mine and look forward to poking through it starting tonite.

Now here's to hoping they'll also accept patches to fix problems or add new features in a true open source model!

Tuesday, November 22, 2011

Downloading Library Books To The Kindle

Last year when my wife gave me my Kindle for Xmas, one of the things that I was disappointed over was that my local library didn't support the Kindle for e-lending. I'm a little late with the news, but that's apparently changed! As of September, 2011, OverDrive now supports the Kindle as a platform for loaning books.

Of course, this doesn't mean that all books are automatically available for the Kindle. But it does mean that I can now borrow titles that are available through my local library and have them automatically delivered to my Kindle! That's a huge win for the platform, which I've really grown to love over the past year.

Now to get more than just certain romance and fiction titles to be made available. I would love to be able to borrow Carl Sagan's books or pretty much anything from the sciences and mathematics sections at the touch of a button...

Thursday, November 10, 2011

Batman: Arkham City Games Disappeared (Lost Save)

After my problem with getting the game, now it appears I'm going to have trouble playing it as well. It appears there's a serious bug in "Batman: Arkham City" related to saving the game data and retaining in between game sessions.

The first time it hit me I was annoyed. I had gotten to a certain point in the game (big boss fight with Solomon Grundy) and had saved my game. When I came back later and tried to play some more I was told that my downloaded content was corrupted and I needed to delete and reinstall. So I went to the system settings for my 360 and deleted the downloaded content. Starting the game up, it redownloaded and applied them fine.

But when I got into the game, there were no saved games. All of the slots were empty. So I assumed I mistakenly deleted my saved game data. But I didn't: I deleted DLC only.

So I started the game over again. I love the Batman and kind of dig this game (though not as much as the original for some reason). I got past the point where I was the first time around, moved on to the next mission and finished it. Then I saved off and took a break.

Now, two days later, I go to play. The first thing it says is there's new content to download. So I download it and it applies quickly.

But when I got into the game, there were AGAIN no saved games. All of the slots were empty.

So I google and find that this isn't just me that's having a problem.

Monday, November 7, 2011

TypeError: can't convert Module into Integer (error in Ruby native extension)

For about 1/2 an hour today I was stuck on a single error:

TypeError: can't convert Module into Integer

The code in question was:

static VALUE qpid_receive(VALUE arg_timeout)
  int timeout =  FIX2INT(arg_timeout);

  // do some work with the timeout value

  return Qnil;

If I commented out the line that called FIX2INT() then the error went away. But for the life of me I couldn't figure out the problem.

Then I realized my error.

After googling the error message and finding no solutions, I realized I was missing an argument. Every native extension method must have, as the first argument, a VALUE argument that is a reference to the current execution context in Ruby.

So after changing the method signature to be:

static VALUE qpid_recieve(VALUE self, VALUE arg_timeout) { ... }

the error went away.

Tuesday, November 1, 2011

Using cryptsetup to encrypt a USB drive.

This morning I received an email from the Fedora Project reminding me that this month we're expected to do a password and SSH key refresh. So that got me to thinking about how I securely store my keys separately from my laptop. I do keep a copy of the keys in an password-encrypted zip file stored on my hope server and backed up onto a separate drive, but want to do something in addition to that to keep things more secure.

So I decided to break off a section of my 4GB thumb drive, make it an encrypted drive, and store the keys there as well. Following are the steps I used to do just that.

So I did a Google search and found this page, which got me through most of what I needed to do. But a few steps that didn't work included naming the partition itself.

On the page the author recommends doing:

/sbin/e2label /dev/mapper/cryptmap “Brad’s Files”

However, for me, this failed consistently (on my system the mapper is /dev/mapper/cryptmcp). What I had to do instead was refer to the partition by its UUID instead:

/sbin/e2label /dev/mapper/udisks-luks-uuid-ec00b89c-8a65-4fa5-8a9d-de0b7ecc5efa-uid500 "McPierceSecure"

Disconnecting and reconnecting the drive, entering my password and now the device is mounted with the correct label.

Accessing The Drive As A User

When that was all done, I found I wasn't able to write to either partition as my regular user. To fix that, just run the command:

sudo chown mcpierce:mcpierce /media/McPierceSecure

Verify by unmounting, removing then re-inserting the drive.