Please note, before reading any further — the legality of anti-DRM tools varies from country to country. Do not do this if you live in one of those countries where it is illegal.
There are plenty of guides to stripping the DRM from ebooks in Windows or Apple computers, but few out there that tell you how to do it in GNU/Linux. This is doubly annoying, as there are no versions of the most popular ereading DRM tools for GNU/Linux, so even those who are OK with DRM in principle (and most GNU/Linux users aren’t) can’t read the DRM’d versions even if they want to.
I tried doing this two years ago, and hit a number of hideous problems, but things have become a little easier now, so it’s only annoyingly difficult. These steps should work for other Debianesque distributions, like Mint or Ubuntu, but Debian’s the only one I’ve tried it on.
First, the version of WiNE that ships with Debian has a bug which stops Python installing correctly. To get around this, first uninstall WiNE:
apt-get purge wine*
Now, go to the repository for the MEPIS distribution. Download the latest versions of WiNE (currently wine_1.4-1mcr8.5+1_i386.deb ) and WiNE-gecko (wine-gecko_1.4.0-1mcr85+2_all.deb ).
Then, as root, in the directory to which you have downloaded the files:
dpkg -i wine_1.4-1mcr8.5+1_i386.deb wine-gecko_1.4.0-1mcr85+2_all.deb
You have now installed a working version of WiNE.
Now, you need to install Python and Pycrypto in WiNE. Handily, these are packaged in this .rar file, which also contains the scripts you’re going to need.
Extract that file somewhere, then go to the directory you’ve extracted it to and, as your normal user, run:
wine msiexec /i python-2.6.2.msi
Follow the instructions in the window that pops up, and this should install python into your home directory, in ~/.wine/drive_c/Python26 . If it installs it somewhere else, change the rest of these instructions appropriately.
Next, as your normal user, still in the directory to which you’ve extracted everything, run:
Follow the instructions, and this should install pycrypto in your WiNE directory.
Now, you will want to remove the MEPIS version of WiNE and go back to the Debian version, because otherwise you won’t be able to update your system easily, so, as root, run:
apt-get purge wine*
apt-get install wine
You shouldn’t have to run anything else as root from this point on.
Now, get hold of a copy of Adobe Digital Editions. This can be downloaded from here (you have to use a direct download as otherwise Adobe’s website will detect your OS and stop you downloading it).
Follow the instructions and ADE will now be able to run under WiNE. Download a DRM’d book and open it — it should open automatically in ADE.
Copy the files aineptepub.pyw and ineptkey.pyw to the directory you just created.
wine python.exe C:\\inept\\ineptkey.pyw
A box should pop up saying “key successfully retrieved to adeptkey.der”.
wine python.exe C:\\inept\\aineptepub.pyw
A box will pop up, asking for an input directory and an output directory. For the input directory, choose “My Digital Editions” from your home directory, and choose anywhere sensible (like your desktop) as the output directory. Within seconds, you should have decrypted copies of all your DRM’d ebooks in the directory you’ve selected, called something like “Quantum_Computing_since_Democritus.jb.decrypted.epub” (assuming the book you decided to try this on is Scott Aaronson’s excellent new book on quantum computing) which can then be loaded in a program like calibre or copied to an ereader.
To decrypt books in future, all you’ll have to do is first open them in ADE and then run:
wine python.exe C:\\inept\\aineptepub.pyw
I suggest putting those two lines in a little shell script to save time.
(Almost all of the following is true)
I had to install Windows on a computer on Thursday, after ten years of using GNU/Linux almost exclusively (I’ve occasionally used Solaris or AIX for work stuff). The results convinced me that no matter how much people online talk about this Windows thing, it’s definitely not ready for the desktop.
Firstly, you actually have to *pay* for this thing. Not pay for support, like with Red Hat, but you actually have to pay for the actual software. And you don’t even get the source code with it, just a binary ISO.
There are so many choices, as well — Windows 8, Windows 7, Windows Vista, Windows XP Pro SP 2 — how is the average user meant to know which is the right one? This Windows thing will never get off the ground until there’s one clear option.
So I download Windows XP Pro SP 3, because that seems to be the most popular one, burn the CD, and stick it in the computer.
The installer is rubbish, especially the partitioner — it doesn’t even have fairly standard options like shrinking and enlarging existing partitions, you can just keep them or wipe them. But that’s OK — this is going to be the only OS on this machine. So it takes about an hour to do a simple format of a fairly small drive, before it starts installing.
The installer only creates a single account by default, which has full root access! That’s a good way of ensuring your user is going to wreck their computer…
So it completes its install, and I log in, and there’s no network, even though the ethernet cable is plugged in. No problem, I get a terminal open. Whatever shell they’re using is useless — it doesn’t even have tab-completion (it has C:\ at the prompt, so I’m guessing it’s csh), and ifconfig just returns some sort of error.
No worry, I try to open the config files in vim, so I can fix them manually. Turns out this antiquated piece of junk doesn’t even have vim on it! The only text editor that comes pre-installed is some GUI crap called Notepad, that’s like a really bad clone of gedit — it doesn’t even have syntax highlighting! What use is that?!
But it turns out anyway that you can’t fix your config files manually in Windows, because they’re in some kind of non-human-readable form. How ridiculously user-unfriendly can you get? Does this mean I actually have to learn how to manually edit binary blobs just to get stuff working?!
Fortunately, I get assistance. Apparently, Windows does have some diagnostic tools, but (get this!) you can’t just type the names in and have them work — you have to go through four or five nested menus to get to them. And you have to know which ones you want before you can get to them. If I hadn’t had an expert on hand, I’d have been stuck. You shouldn’t have to get expert help just to get your computer running!
Anyway, after a load of arcane GUI manipulation that I could make no sense of at all, we finally found out that (you won’t believe this, but I swear it’s true) Windows doesn’t come with drivers for the network card! I had to download them from the website — not of the operating system, like you might think, but of Dell, who made the computer! Thank God we had another computer there.
(Oh, and I only found this out after googling for the error message I’d been getting, and getting a ‘help’ page that wouldn’t tell me how to fix it because I wasn’t using the OS I was asking about!)
So I download these files and stick them on a USB stick. Apparently Windows doesn’t recognise a perfectly straightforward ext3-formatted thumb drive! So I reformat it on the GNU/Linux box I downloaded the files onto, into FAT32, and try again — it still thinks it’s not there. I end up having to format the stick on the Windows box, move it back to the GNU/Linux one, copy the files across, and then move it back again.
Then the ‘diagnostic tool’, which is meant to help you but is just some uninformative GUI, greys out the thumb drive when you try to search for the drivers, even though it asks you to select where it should look. Luckily, my Windows-expert friend knows you can also run these drivers separately and they’ll install themselves.
So we ‘double-click’ (what a ridiculous thing to have to do!) the files, and up pops about twelve pages of some ridiculous roll-your-own license that they expect us to read through! Why they can’t just use the GPL or a BSD license or something, I don’t know, rather than this ridiculous thing I can’t even be bothered to read. Nobody can possibly understand this stuff — how do they expect non-techy types to cope with it? Licenses should be simple.
Anyway, after clicking this thing, it installs! It doesn’t ask for the root password or anything! Click a GUI thingy and the next thing you know you’ve made an irreversible change to your machine’s configuration! That’s incredibly dangerous.
So now we’ve got the network drivers installed. I’m not even going to *try* to get the right video drivers installed, I’ll just leave everything on the screen embiggened, but I need to install a particular piece of software.
It turns out Windows doesn’t even have apt or yum installed! There are no software repos at all! If you want, say, VLC, you can’t just type apt-get install vlc and have it install itself, you have to actually visit a potentially-insecure website — a different one for every piece of software — and download something called an ‘exe’. Who understands all this techy jargon?! Why can’t they just have a nice, simple repo with all the stuff everyone needs, like vim and gcc and LyX and so on, like GNU/Linux distros do?
And finally, the machine keeps warning me that it’s unsafe, because I don’t have something called ‘virus protection software’ installed. A quick Google tells me something I should have known from the start — this whole Windows thing is simply a protection racket. You install it, and then it scares you into installing some other software you have to pay loads of money for, and if you don’t then some kid from Russia can get control of your machine and use it to send spam out! “Nice computer you’ve got here. Wouldn’t want anything to… happen to it…” Quite why people continue to pay money to these ‘virus’ people I don’t know. Personally, I won’t submit to blackmail in that way.
So there we go. Windows is conclusively not suitable for the desktop, and it never will be so long as it continues with these horribly user-unfriendly things. In this day and age you simply can’t go about having no driver support, or support for common file formats, and as for the whole software installation process and the virus thing, don’t get me started.
No, I’ll stick with my nice, simple, user-friendly Debian install, and leave this Windows thing where it obviously belongs, as a hobbyist’s OS for techies who like frustration.
Just a very quick tip for Linux users with iPods – you can use Spotify to sync music between your desktop and the iPod.
The reason I mention this is that my wife’s well-meaning parents got her an iPod for Xmas, and we quickly discovered that it’s not possible to plug a new iPod into a GNU/Linux computer and have it ‘just work’ (libimobiledevice, which sorts out syncing of older iPods, doesn’t yet have music syncing for iOS5, and nor does it have it planned for the next release). And while Apple have their iCloud thing which allows you to store stuff on their servers and then access it from an iOS device or web browser, to *upload* music to their cloud you need to use their proprietary software which doesn’t work on GNU/Linux.
We could, of course, run iTunes in WINE – except that downloading iTunes requires some Windows-only hackery that means you can’t do it from a browser running on GNU/Linux as far as I can tell.
This sort of thing is why I normally avoid both closed devices and non-free software, and why I have a loathing for Apple and all its workings that sends me into a blood-boiling rage whenever the name of Steve Jobs is mentioned. But happily, I have a single piece of non-free software installed on my machine, and that software provides a solution.
If you have a Spotify premium account (and it is *well* worth it if you don’t and you love music – unfortunately new accounts require a Facebook account (older ones didn’t), but there’s nothing to stop you creating a FB account with a disposable email address and never using it again if you don’t want an account there) and wireless internet you can do the following.
First, allow Spotify to see the local files you want to sync. You do this by going to edit->preferences and then clicking “Add source” under “Local Files”.
Next, create a playlist of those files.
Now connect your iOS device to the same wireless router your GNU/Linux box is connected to, and from the App store, download Spotify. Log onto Spotify with the same ID you use on the GNU/Linux machine. Within a few seconds, your iOS device should show up under ‘devices’. Click on it.
It will show a list of all your Spotify playlists, with a checkbox in the top left hand corner of each. Check the playlist you have created of your MP3s, and they will be copied across to your iOS device, where you can play them in Spotify (you can’t play them in iTunes this way, but you can play them).
While Spotify won’t let the same user play streaming music on multiple devices simultaneously, it *will* let the same user play *local* files on as many devices as you want, so this can be used for multiple iOS devices.
Unfortunately, for those of you who want to watch video, I know of no way to sync video between iOS devices and GNU/Linux computers, but this way works very well for MP3s.
(For those of you running OpenSolaris, one of the BSDs or some other odd OS, Spotify works extremely well in WINE on Debian, and I imagine it will work equally well on any OS on which WINE is supported)