Sunday, October 03, 2010

Internet services I recommend

I'm a happy consumer of Internet services. Besides buying products from Amazon, iTunes, Google and other giants, I also subscribe to a bunch of small service providers that prove their competence and respect for consumers. It's only fair that I give them some praise and recommend their services to whoever might find this post.

  • rsync.net is a remote storage site that provides flexible data access like SSH, WebDAV and obviously rsync. They are a bit pricy but offer nice features like Git support. The problem is I can't use them to backup all of my MP3 bought from iTunes and Amazon, because of their price. And I've been using github.com for private git repositories, so I'll probably cancel my subscription with rsync.net sometime soon. I'm still looking for another cheap per-byte general purpose backup provider. This is a commodity service and features are not *that* important. So there is a chance I'll be stuck with Amazon S3 or Google Docs (which doesn't support access to upload via API, unless you are a premium subscriber or something).
  • github.com is a Git hosting site. All cool kids are using GitHub. These guys really know what their are doing. The UI is very well polished and they know what developers need, which is evident from recent feature additions such as the Pull Request 2.0. They offer free hosting for open source projects and you can pay a small fee for private repositories.
  • rimuhosting.com offers Linux virtual private servers. I've been a customer for a long time and worked for them as a Linux tech guy for about a year. Their prices are a bit high but their support really kick-ass. If you are afraid you might brake your system during an upgrade and need some help to fix it, or may get stuck setting up a mail server, RimuHosting is for you.
I'll add more stuff to this list as I remember about them.

Monday, September 27, 2010

German to English dictionary in the Kindle

I wanted to read books in German in my Kindle, but because I don't know any German, I need a dictionary. If that's what you want, a dictionary for German that works in the Kindle, then download this:
Long version:

I went through a lot of problem converting the StarDict dictionary of German to English. It really took me days. So let me dump the process here, roughly:
  • download the stardict file. I believe the extension is .xdxf
  • use pyglossary to convert it to a tab-separate text file
  • use tab2opf from this dude to convert the text file into an OPF set of files (.opf plus a bunch of HTMLs)
  • go to http://www.mobipocket.com/dev/ and download the proprietary "kindlegen" tool
  • use kindlegen on the .opf file. If all goes right, you'll get a .mobi file at the end.
After that, put the mobi file in the Kindle (I use Calibre for that) and make it the default dictionary, by going to Home, then Menu, Settings, then Menu, then Change Primary Dictionary.

There's a big catch. They clearly tune the Kindle to use as less power as possible. So it makes sense for the English language to save a few CPU cycles by skipping dictionary lookups when the word starts with an uppercase letter in the middle of a phrase. Like for example if in this phrase: "I think Amazon sucks at making internalized products". In English, a dictionary lookup for "Amazon" doesn't make sense.

As you, a smart reader, knows, the German language uses capitalized letters for all nouns. So it's effectively impossible to lookup the meaning of for example Weihnachten (christmas). The only workaround I could think it's to edit the content of the book and search all capitalized letters by lower case ones.

Or, alternatively, stop wasting time tuning the Kindle and go study German so you don't need a dictionary in the first place :-).

UPDATE: Thanks to helpful suggestions from Ea and stehk from MobileReads, I changed directions and decided to buy a better dictionary that actually works with all inflections, and is much better overall. The process was very complicated, but here's the outline:
  • buy the book from mobipocket.com (this one is good, thanks stehk!)
  • download their mobile reader. Because I don't have Windows, I had to setup it up using "msiexec mobireadersetup.msi"
  • run the reader.exe from wine
  • find your way through their hideous interface to login, download and activate your books
  • make sure you can open that book from their reader
  • go to the list of ebooks in the reader program, right+click and take a look at the properties, to see where the file is now. From outside Wine, copy that file to somewhere you know. Like /var/tmp
  • Go to mobipocket.com and find the PID of your "device". Device in this case it's actually the "Windows" Mobipocket Reader.
  • Use MobiDeDRM to decrypt your book. As explained here. If you keep getting "invalid PID checksum" errors, try a different version of the script. Sample command:
    • python mobidedrm.py pons_gross_de2.prc pons.prc 'KYJZGSJ$HC'
      • (this is a fake number. Note that I enclosed the PID with single quotes)
      • (this command can take several minutes depending on the book size. It took about 10 minutes for this 20MB dictionary)
I have no words to describe how disgusted I am with all of this. First, we all know how stupid DRM is, in so many levels. It just makes the lives of honest dudes more difficult (I'm freaking BUYING the book and not distributing it). But worst of all, AMAZON OWNS MOBIPOCKET.COM!!! And I'm having to DE-DRM their own ebooks so I can read them on my Kindle!!!!!1

Are you also angry? Than use inkmesh.com or a simular search engine to find *other* ebook stores that sell books compatible to the Kindle. Don't buy everything from Amazon. Besides all, they seem to be doing predatory prices too, which is bad for all consumers in the long term.

Thursday, September 16, 2010

how to liberate O'Reilly books acquired from the Android Market

this post may be useful to people out there trying to read on a Kindle the O'Reilly books they acquired from the Android Market

O'Reilly is a competent, decent and not-evil publisher of technical books. They know that DRM only causes pain to good costumers, because bad customers will find other ways to access/steal their books. I therefore feel respected as a customer and retribute by buying lots of e-books from them :-).

The cheapest way to get e-books from O'Reilly is, besides the very unfriendly O'Reilly Safari bookshelf, to buy them via Android Market. Books acquired in the Market come bundled with a crippled version of Aldiko. Most of the time, that's good enough. But, there are two problems:

  • I want to have a backup of the books that I legally acquired. If in X years I don't have an android phone anymore, or maybe if I lose access to my gmail account, I won't be able to re-download the books.
  • I believe it's legal and fair that I should be able to read this book in other devices that I own. Recently I bought a Kindle, and it become my main ebook reading device. I don't think it's reasonable to expect that I'm going to buy those books all over again, this time from the Amazon Kindle book shop.
Optionally, I could have bought these books from the Amazon Kindle bookstore and read them using the Amazon Kindle for Android. That's not ideal, though. First, it's more expensive. Second, these books are DRM protected and I would only be able to read them using a Kindle software. I don't want that.

So instead, I found a way to copy the DRM-free O'Reilly books that I bought from the Android Market. It's simple:
  1. Install ASTRO file manager from the Android Market
  2. Open ASTRO, go to Tools and Application Manager/Backup
  3. Select the applications referring to the books, then hit backup. The ".apk" files will be copied to your sdcard.
  4. Connect the phone via USB to a computer and copy the files from the /backups directory. Alternatively, use ASTRO itself to "Send" the apk from /sdcard/backups to your email, then download it to your computer.
  5. The APK files are really zip files. If you want, you can simply backup these apk files. That's what I do.
  6. If you want to open the book in another device that reads epub books, then unzip the apk file, enter the directory called assets, then zip the contents of this directory into a .zip file. Rename the zip file to .epub, and you're done.
good luck!

Saturday, July 04, 2009

My preferred Android applications

I bought an HTC Magic a few weeks ago. One of the its coolest thing is the sheer number of apps in the Android Market. There are actually too many and finding the good ones requires lots of searching and testing. These are the ones I use the most so far:

- Wapedia, which greatly optimizes the wikipedia display for mobile devices.
- Pixelpipe, to upload media to Flickr easily.
- QuickDic German, by Thad Hughes (a googler, by the way)
- AnkiOnline. Not actually an app, but a mobile-friendly web site that is always synced with my desktop Anki database. I use it to study german vocabulary while commuting. Pretty cool.
- NewsRob, a Google Reader client (suggested by Cesar from Pinguis Moveis)

Soon I'll hopefully expand this list with an I app I wrote myself, but I've been very lazy lately, so who knows.

Sunday, June 14, 2009

Sometimes I miss doing Linux end user support work

Last October I set an Ubuntu desktop for Carla's family. We live very far away from them, so it was important that their system was resilient, otherwise it wouldn't last long. They are all beginners in this internet thing, so installing Windows for them would have been a bad idea.

And I was right. Things ran pretty smoothly, we talked via Skype very often, with no signs of virus or crashes. I even found this file in their system:
clica-aqui.exe (click-here.exe, in Portuguese)

After many months of usage everything was still working fine, until the computer stopped booting.

Helping them from the phone was a challenge. They had to read the error messages in English for me (and they don't understand this language), while we tried to fix GRUB. In the end I assumed the hard disk was just dead.

I asked my good friend Marcelo Lemos for help and he burned an ISO image of Ubuntu and sent them by mail. I live in Switzerland and it would take ages for the package to get there. The customs in Brazil are a black hole.

The CD got there after a couple days but, of course, since the worst case scenario always apply, the computer was not set to boot via CD-ROM, so we had to fix that - all by phone, while the girls spell each CMOS setup word for me.

Now the Ubuntu Live CD system was finally up, I logged in via a reverse SSH connection (I gave them commands via Gmail that they would run via terminal) and fixed the filesystem errors. But the kernel still showed too many I/O errors from that hard disk. The only safe thing to do was to backup their remaining personal files somewhere while the system is still up, then reinstall everything with a new hard disk.

I needed a safe place to send all their stuff but my amazing friends and former colleagues at RimuHosting do not offer the cheapest disk space plans, unfortunately. So I remembered that a RimuHosting customer once said great things about rsync.net (awesome name, by the way), and I gave them a try.

I ordered a one-year 4Gb quote with them and my account was setup in a few minutes, even before I send them the payment, which is really awesome. I got all login details by mail, and started rsync'ing everything right away. Pretty neat. So it turns out that rsync.net is a decent secure offsite backup service that I strongly recommend so far. They even have servers here in Zürich :-).

The rsync is still running inside a screen(1) session as I write this, and it's going to take a while to finish. I just hope the disk is not too damaged and that it copies the most important files. Otherwise how would they live without the clica-aqui.exe?

So much adrenaline! Only end-user support work gives me that. I miss that a little bit.





NOT!

Tuesday, June 09, 2009

Fixed my first bug in C++. PROFIT!

I'm still trying to learn C++ by fixing bugs. Well, the bug I wanted to fix in Ekiga had already being solved upstream (should I be happy or sad?), but I had fun trying to debug it anyway.

Luckily I found another one to fix today. After 1h30m playing around with gdb and adding debug messages everywhere, I fixed a bug in Gnote where preferences were not being set unless you restarted the program.

The biggest challenge was to find out that all code was written already, it just wasn't working. I initially thought I'd have to write the callback methods myself, but then I saw references to "gconf...notify" in the code, which would normally be enough.

Reading the gconf API docs was sufficient for me to find the culprit. 2-liner patch submitted ;-).

Monday, June 08, 2009

Having fun while trying to learn C++

I've been trying to learn C++ lately. I read a few chapters of a few books, but I got tired of just reading so now I am trying to fix bugs in free software out there.

The first step was to install Ubuntu on the Macbook Pro that I use. Second step was to find useful software written in C++ that needs small bugs fixing.

First I tried to fix a bug in gnote, but I wasn't persistent enough and the lead developer fixed the bug himself after many days without any update from me. The lesson learned here is do not just propose a fix a go walkabout. Stick to it until the end.

Now I'm trying to fix an bug in Ekiga. Actually, I think the bug is in the libopal, but I'm not so sure. The symptom is a segmentation fault in SIPHandler::SendRequest() and it only crashes when I set an outbound SIP proxy. Maybe I'm setting an invalid proxy, but well, it shouldn't be crashing.

Let's see how far I'll go this time.