Monday, December 9, 2013

Speed up a slow Android phone

Your Android smartphone/device is a computer. Like most computers, it can get slow after a while and benefit from a periodic cleanup. Here are some things you can do to speed up your Android phone if it's acting slow:

  1. Reboot
    Maybe this is obvious, but if you haven't powered off your phone in a while, go ahead and reboot it (or power it off and back on again).

  2. (Nexus and HTC One phones only) Try LagFix
    This only applies if you have a Nexus or HTC One phone and running Android less than 4.3. These devices have a very specific bug that causes lag and can be fixed by this app: LagFix (fstrim) Free (requires root). I wouldn't recommend running this for other phones; at best it will do nothing and at worst it could damage your phone.

  3. Undo any recent changes
    If your phone has only recently been acting slow, think about any recent changes you've made. Have you recently installed or updated certain apps? Have you recently received a software update? Any of these changes can slow your phone down. If it's an updated app, you can sometimes find old versions of apps online. If it's a software update, undoing it will be much trickier, but it is possible. If it is indeed the culprit, somebody's probably written up instructions on how to go back to the previous software version.

  4. Uninstall/disable unused apps
    Some apps actually run in the background whether or not you've opened them. Too many of these kinds of apps will definitely slow down your phone. Examples of apps that run in the background are apps that display notifications, whether notifications that are always present or notifications that show up from time to time. Aside from these, we could certainly all benefit from going through our apps from time to time and removing any we don't use any more.

    Some phones come with a lot of preinstalled apps that you don't use or want (called bloatware). These often can't be uninstalled, but they can be disabled starting in Android 4, which should at least keep them from slowing down your phone. To disable them go to Home  Menu System settings Application manager  All, select the app to disable, and click Disable.

  5. Greenify!
    I intentionally put this step after the previous step, because the first step really is to get rid of apps you're not using. But of course there are certainly some apps that you'll want to keep, and what if one of those is the culprit, running in the background and slowing your phone down? Thankfully there's a great solution: Greenify. It's an app that lets you control which apps run in the background. It doesn't kill them, but it hibernates them instead. Because of this, it does need root access.

    Side note: I mentioned that Greenify doesn't kill apps running in the background. This is because 
    killing apps can actually slow your phone down and use up your battery faster because then the apps will just start themselves back up. If you're using a task killer app thinking you're speeding your phone up or saving battery life, you're probably doing just the opposite. You should uninstall it right away, and instead follow the steps in this post if you're having issues.

  6. Remove some widgets
    Building on the previous point, there's a whole category of software that runs in the background: widgets. Any widget you have on your home screen is going to run in the background on your phone all the time. The more you have, the slower your phone can get. Remove a few and you may notice your phone runs faster.

  7. Don't use live wallpaper
    Live wallpaper is fun, but it's just creating extra work for your phone and using up your battery faster. Use regular wallpaper instead.

  8. Look at your SD card
    If your phone has a removable SD card, turn it off and remove it. See if that fixes the problem. If so, see what the speed class of the card is. If it's less than class 6, I'd recommend buying at least a class 6 card, especially if you've moved any of your apps to the SD card. If your phone has internal storage, which most recent phones do, you could even try running without the SD card. At the very least go through your SD card and clean up some of the unused files and folders. Apps have an annoying habit of putting things on there and not cleaning them up.

  9. Clear app cache
    Clearing the caches for your apps may help speed things up. If your phone is rooted and Titanium Backup is installed:
    1. Open Titanium Backup
    2. Go to MenuBatch actions
    3. Scroll down to Manipulate data → Clear cache for user & system apps and click RUN
    4. Click Select all and then click the green check mark in the upper right to begin the task

    If your phone isn't rooted and/or you don't have Titanium Backup installed, the process is a lot more tedious:
    1. On your phone, go to Home  Menu System settings Application manager  All
    2. For each application in the list, select it and click Clear cache. Yes, I told you it would be tedious. This should be good incentive to follow my previous suggestion at getting rid of unused apps :)

  10. Wipe cache partition
    This will probably only be available to you if you've rooted your phone. If you have, power it off, boot into recovery mode (varies by phone), and select the option to wipe the cache partition.

  11. Disable/uninstall apps one by one
    I've saved this one towards the end because it's going to be pretty tedious. If you've made it this far and your phone is still inexplicably slow, you can try disabling or uninstalling apps one by one and seeing if that changes anything.

  12. Factory restore
    I wouldn't recommend doing this more than once a year, because you're going to have to set your phone up from scratch after doing it, but just like formatting your computer and reinstalling everything, a factory restore can help speed up your phone. First, back everything up (I recommend rooting it and using Titanium Backup). Once you've backed everything up, you can do the factory restore by going to Home  Menu System settings  Backup and reset  Factory data reset (specific location varies by device). Again, in case you weren't paying attention, this will erase everything on your phone, so make sure you've backed up everything that's important first.

  13. Downgrade Android
    Sometimes the device manufacturers release software updates that end up making the phone slower. The solution in this case is to downgrade Android. This is not a trivial task, and will vary by device, so you'll have to Google this one. Honestly if you get to this point, you may just be better off buying a Moto G.

Tuesday, November 26, 2013

Moto G: A phone worth buying

A plethora of phones have come out over the years, but none have really been worth recommending. Until now. Motorola has just announced the Moto G. It's a mid-range phone that's going to cost less than $200 brand new and unlocked.

Can you buy a cheaper Android phone? Sure, but not with these specs, and not with such a recent version of Android. Can you buy a nicer Android phone? Sure, but you're going to pay at least twice as much, and most brand new unlocked phones cost over $500.

The great thing about this phone is it's everything you need, nothing more, at an incredible price. Features like:
  • Near-stock Android 4.3 with a guaranteed update to 4.4
  • Great battery life
  • A quad-core processor
  • Front and rear-facing cameras
  • FM radio
  • Multi-colored changeable backplates
Speaking of the backplates, here's an idea of the color selection:

The Moto G is available for order now, and starts shipping in a week or so. You can read more about it here:

Monday, November 25, 2013 has stopped

If you are getting the above error on your Android device, try the following to fix it:
  1. Go Home  Menu System settings Application manager  All
  2. Scroll down to Download Manager and click on it
  3. If it's disabled, click Enable to enable it
  4. If it's not disabled:
    1. Scroll down to Internet
    2. Click Clear cache
    3. Click Clear data
That should do the trick. If it doesn't, try narrowing down the problem:
  1. Go Home  Menu System settings Accounts  Google
  2. Under Accounts click on the account
  3. Check and uncheck each item in the list. One of them should trigger the error. Once you find that item, use the above instructions to clear the cache and data for that item, and that should fix the problem.

Sunday, November 24, 2013

Why I'll never buy a Kindle, or an eBook from Amazon or Apple

I've long stayed away from buying an Amazon Kindle or buying eBooks on Amazon or Apple. I recently read something that sums up my own reasons for doing so really well. Rather than rewrite it, I'm just going to copy and paste the whole thing:
Here’s a quick and dirty summary of what ADEPT EPUB is and why it’s important (footnotes at the bottom for extra stuff that isn’t required knowledge but is still interesting).
The first thing you have to understand is that the vast majority of ebooks sold in the United States are encumbered with DRM. This is done at the publisher’s or rights holder’s request.(1)
EPUB is a standardized format developed by the IDPF for reflowable electronic documents. The specification is open for anyone and everyone to use, and it has thus been adopted as the standard format for ebooks by everyone except Amazon (more on that later). On top of the standard file format, Adobe developed a roughly standardized DRM schema called ADEPT that allows a consumer to unlock an ADEPT EPUB for use on any device that supports the format, regardless of where the book was purchased.
As of right now, every ebook vendor that sells DRM encumbered ebooks in the United States exceptAmazon and Apple use a form of ADEPT EPUB DRM on their ebooks.(2) This includes Barnes & Noble, Kobo, Google Play, Sony, Smashwords, and dozens of other smaller vendors. Apple uses EPUBformatting for their books, but encumbers them with a proprietary DRM (“Apple Fair Play”). All ADEPTEPUB ebooks can be used on any reading device or app that supports the format.
Amazon is the only major vendor that does not use EPUB format for their ebooks. They instead use an older format, Mobipocket, encumbered with a proprietary DRM to create the .AZW format. The DRMschema for .AZW is a trade secret of Amazon – no other vendor has access to the encryption codes and thus can not legally sell books in .AZW format.
The advantages to ADEPT EPUB over .AZW should be immediately apparent.
1. Nonexclusivity- If I own a NOOK or Kobo ereader I have the ability to shop at any vendor who sells books in ADEPT EPUB format. So if Google Play is having an awesome sale and a book I want is far cheaper than I could get it at BN, I can simply buy the book from Google and load it onto my NOOK.(3) This is not possible with a Kindle device. Since Amazon uses a proprietary DRM that they do not share, it is impossible for another vendor to sell a DRM encumbered ebook for Kindle owners. Buying a Kindle ereader means you have a single choice for who you buy your books from – forever.
2. Portability- Just as with shopping around for books, ADEPT EPUB users can shop around for devices. I personally own one of the old NOOK Simple Touches, and my girlfriend is strongly hinting that I’m going to be getting an upgraded model with a light for Christmas. I have a choice for what device I want to buy – if I’m not enamored with this new NOOK model I can happily go buy a Kobo Aura HD or a Sony PRS and transfer all the books I have previously bought onto the new device. This, again, is not possible with a Kindle. If I was a Kindle owner I could only buy a new Kindle device or have to give up every book I had previously purchased.
3. Futureproofing- One of the main reasons I hear people on the internet don’t want to buy a NOOK device is because they are “not sure if BN will be around in 10 years”. With ADEPT EPUB books this isn’t a problem at all. All the books you’ve purchased can still be easily read on any other compatible device. So even in the unlikely event that BN goes under, I can purchase a nice new Kobo or Sony or whatever else have you and still read my books. Amazon, while dominant now, could eventually face the same pressures that BN is seeing today. If Amazon did fold someday in the future, the proprietary .AZWbooks would be useless on any other device. And that isn’t even dealing with their incredibly draconianDRM schema that prevents the user from legally backing up their own books.(4)
EPUB is a major point in favor of going with vendors other than Amazon (and Apple) when buying ebooks. It is a standardized and open format that lets vendors compete on price, experience, and extras, without hurting the consumer with locked-down systems. It should be the main selling point of devices like a NOOK, and yet it is never once brought up in any of the articles on The Verge (and rarely elsewhere, sadly).
And that is why I’m going to keep bugging them until they acknowledge it.
(1) As of right now there is only a single imprint of one of the “big five” publishers that doesn’t use DRM on their ebooks – Tor/Forge, an imprint of St. Martin’s Macmillian. The “big five” publishers – Random House Penguin, Harpercollins, Hachette, St. Martin’s Macmillian, and Simon and Schuster – are responsible for roughly 85% of the trade books published in the US. There are smaller publishers that choose not to use DRM, famously Baen and O’Riley, but they are small and cater to niche markets.
(2) BN technically doesn’t use ADEPT DRM, rather opting for the BN Social DRM. However, the only difference is the encryption code – BN Social uses a credit card number, while ADEPT uses an Adobe account ID. The two DRM schemas are completely interoperable and thus can be treated as the same format.
(3) Loading an ADEPT EPUB book onto a different brand ereader requires going through a free computer program called Adobe Digital Editions, which unlocks the DRM on the ebook for a device. It is also the software used for library lending for devices without access to the Overdrive/3M library apps.
  • Amazon’s DRM schema encrypts each file with a different unlock code for each device. So even if I have a Paperwhite, a Nexus 7 with the Kindle app, and a PC with the Kindle app all buying books from the same account, the files will only function on the device they were downloaded on. I can not, for example, download the book onto my PC through the app and then sideload it onto my Nexus – the Kindle app on the Nexus will not unlock the book because the encryption code is different despite both being tied to the same account. It makes it legally impossible for a Kindle owner to back up their files on their own – they have to rely on Amazon’s magnanimity, which has hurt consumers in the past.
Lastly, I’m well aware of how patently easy it is to strip DRM and convert ebooks using programs like Calibre. However, at the moment this is still illegal in the United States. I in no way endorse the use of DRM (it’s a stupid anti-consumer technology), but I do accept the world as it is right now.
Source: Barnes & Noble's new Nook GlowLight is lighter, faster, and full of ideas

Friday, November 8, 2013

Flashing your BIOS in Linux using a USB flash drive

These instructions are specific to Ubuntu and Ubuntu derivatives (like Xubuntu and Elementary OS), but they should work on just about any version of Linux. Just modify the steps for installing GParted and UNetbootin as necessary:

  1. Get the current version of your BIOS by running this command in a terminal:
    sudo dmidecode -s bios-version

  2. Find the BIOS update file for your computer. These are generic, but should point you in the right direction:
    1. Get the exact make (Lenovo, ASUS, Dell, etc) and model of your computer. The model will be a combination of letters and/or numbers and is either somewhere on the top or bottom of your computer.

    2. Open a browser and go to the website for the manufacturer of your computer.

    3. There should be a support section where you can navigate to the drivers/downloads for your computer. You'll probably have to search for your computer using the model number you looked up.

    4. From there, find the BIOS update file for your computer. If it's the same version as what you already have installed, you're already up-to-date and you can stop. Otherwise download it. If it comes as a .zip file, open it and extract the .exe file from it that's used to do the actual BIOS update.

  3. Get a USB flash drive that you don't mind erasing. If necessary, copy everything off of it first.

  4. Now, we'll use GParted to erase your flash drive to prepare it:
    1. Install GParted
      sudo apt-get install gparted

    2. Open GParted. If nothing happens, try opening it by typing this into the terminal:
      sudo gparted &

    3. On the upper-right side of the screen, select your flash drive. In the Mount Point column, it should have something starting with /media. Be very careful that you choose the correct drive in this step! If you don't, you could wipe your whole hard drive and lose everything. If you're unsure, you should probably ask for help. is a great place to get help.

    4. Right-click on any partitions, and click Unmount. Then right-click them again and click Delete.

    5. Right click in the large box at the top that says unallocated and click New.

    6. Change File system to fat16 and click Add.

    7. At the top, click the green checkmark to apply all operations, then click Apply. Remember, this will fully wipe your USB drive!

    8. When it's finished, click Close and exit GParted.

  5. Next, we'll use UNetbootin to make the USB drive bootable:
    1. Before you'll be able to use UNetbootin, open the file explorer, right-click on the USB drive, and click Mount.

    2. Install the latest version of UNetbootin
      sudo add-apt-repository ppa:gezakovacs/ppa
      sudo apt-get update
      sudo apt-get install unetbootin

    3. Open UNetbootin

    4. For Distribution, select FreeDOS

    5. At the bottom, make sure Type is USB Drive

    6. Click OK

    7. When it's finished, click Exit

  6. Go to your USB drive in the file manager and copy the BIOS update .exe file that you downloaded earlier.

  7. Now, you'll need to figure out how to boot to the USB drive. Normally this is done by pressing a special key at the boot screen (the first screen that comes up when you turn your computer on) to open a boot menu. Common keys are: Esc, F1, F2, F10, Enter. You may have to press Esc first to then see which key you need to press. If all else fails, Google it :)

  8. Once you've figured out how to boot to the USB drive, with the USB drive still plugged in, reboot your computer, and boot from your USB boot drive.

  9. At the UNetbootin menu, press Enter

  10. At the FreeDOS boot menu, select FreeDOS Safe Mode and press Enter

  11. Now change to the C drive by typing:

  12. Get the name of the .exe file you copied by typing:

  13. You should see a list of files, and one should have EXE in the second column. Flash your BIOS by typing the name of that file that's listed in the first column. For example:

  14. Once it's finished, turn off your computer, remove the USB drive, and turn it back on.

  15. Get the version of your BIOS again, and this time it should show the new BIOS version:
    sudo dmidecode -s bios-version

Tuesday, October 22, 2013

Using WebEx desktop sharing on Ubuntu 64-bit

Edit: for the most up-to-date solution, see my answer here:


After much trial and error, I was able to get WebEx desktop sharing working in 64-bit Ubuntu just by installing a few packages (I confirmed this works on Ubuntu 14.04 and 12.04, but I imagine it would work on other versions as well):

  1. Remove unnecessary packages that cause conflicts:
    sudo apt-get -y remove icedtea-7-plugin:i386 icedtea-netx:i386

  2. Install 32-bit Java, a necessary 32-bit library, the Java plugin, and Firefox (WebEx doesn't support Google Chrome on Linux at the moment):
    sudo apt-get install openjdk-7-jre:i386 libxmu6:i386 icedtea-7-plugin firefox

  3. Make sure the correct Java plugin is configured:
    sudo update-alternatives --auto

    If for some reason that doesn't do the trick, you can try this instead:
    sudo update-alternatives --set /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/
Close and re-open Firefox, and WebEx desktop sharing should work.


Technically WebEx requires 32-bit Java running on 32-bit Firefox for desktop sharing to work on Linux (‎). But for some reason the above method worked, although it does throw errors (if you open Firefox from the command line). If for some reason there are problems with the above method, you can try installing 32-bit versions of Firefox and the Java plugin. Here are a couple of different methods:

If you're like me and primarily use Google Chrome, the easiest thing to do is to just install 32-bit Firefox and the 32-bit Java plugin from the Ubuntu repositories (note that this will remove the 64-bit version of Firefox that comes with Ubuntu 64-bit):

  1. Install the 32-bit versions of Firefox and the Java plugin (and an additional necessary library):
    sudo apt-get install firefox:i386 icedtea-7-plugin:i386 libxmu6:i386

  2. Change the default Firefox plugin to the 32-bit one:
    sudo update-alternatives --set /usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/
Even if Firefox is your primary browser, you probably won't notice a difference in using the 32-bit version of Firefox. But if you really do care, here's how to install 32-bit Firefox without uninstalling 64-bit Firefox:

  1. Install the 32-bit Java browser plugin and an additional necessary library:
    sudo apt-get install icedtea-7-plugin:i386 libxmu6:i386

  2. Download 32-bit Firefox (the default downloads are currently 32-bit)

  3. Extract the download
    tar xvf firefox-X.X.tar.bz2

  4. Make sure the binary is 32-bit
    file firefox/firefox

    It should say something like:
    firefox/firefox: ELF 32-bit LSB executable

  5. Change the default Firefox plugin to the 32-bit one (don't worry, we'll fix this so you can still use the Java plugin in your 64-bit Firefox):
    sudo update-alternatives --set /usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/

  6. Re-link the 64-bit plugin for 64-bit Firefox (adjust the path to your version of Java as necessary):
    cd /usr/lib/mozilla/plugins
    sudo ln -s /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/

  7. Whenever you want to run the 32-bit Firefox for WebEx, cd to the path where you extracted it and run it (or create a link)
    cd /path/to/firefox
    ./firefox &

  8. To make sure it worked, in the address bar go to about:plugins and verify that the Path contains i386 (it should work if it also contains amd64, but only if i386 comes first. If not, double-check you did the above steps correctly).
One additional note: these solutions still seem to fail the Java plugin verification page, but even the 64-bit version seems to fail. I'm guessing it's missing a library, but whatever it is it wasn't necessary for me to get WebEx working.

Friday, September 20, 2013

The best podcast app for Android: AntennaPod

It's about time! I've been looking for a decent Android podcast app for a while. The only ones I've seen up to this point are either:
  • Free but really lousy
  • Decent but cost $7
But my search is finally over.

Say hello to AntennaPod. It has all you'd need and want in a podcast app, plus it has a nice, clean interface, no ads, and it's free. There really isn't much more to say. Check it out, and if you like it, send the developer a buck or two.

Here's what the interface looks like so you can see for yourself:


Saturday, September 7, 2013

Try out Xubuntu/Xfce from a normal Ubuntu installation

I've blogged before about Xubuntu/Xfce, but what if you've already got regular Ubuntu installed and want to try out Xubuntu without reinstalling? Thankfully, it's actually pretty easy, and you can have it up and running in a matter of minutes:

  1. Install Xfce and the settings to make it look like Xubuntu (if you prefer it to look more like vanilla Xfce instead of Xubuntu, leave out xubuntu-default-settings):
    sudo apt-get install indicator-application-gtk2 indicator-sound-gtk2 xfce4 xfce4-datetime-plugin xfce4-indicator-plugin xfce4-terminal xubuntu-default-settings

  2. Log out

  3. Click the icon to the right of your username and select Xubuntu Session (you can also choose Xfce session if you want vanilla Xfce)

  4. Type your password and log in
That's it! Now, you can customize Xfce to your liking. These are all optional of course, but they're some of the customizations I prefer:

  1. Disable dock auto-hiding
    1. Click on the Xfce icon (it looks like a mouse head) in the upper-left side of the screen

    2. Go to Settings --> Settings Manager --> Panel

    3. In the dropbox a the top of the window, change to the dock panel (probably Panel 2)

    4. Uncheck Automatically show and hide the panel

  2. Remove any empty icons in the dock by right clicking on them --> Remove

  3. Hide default desktop icons
    1. Xfce menu --> Settings --> Settings Manager --> Panel --> Icons

    2. Under Default Icons, uncheck any icons you wish to hide

  4. Remove the duplicate login screen entry
    1. If you prefer the Xubuntu look and feel and want to get rid of the Xfce Session entry, run this command:
      sudo mv /usr/share/xsessions/xfce.desktop /usr/share/xsessions/xfce.desktop.bak

    2. If you prefer the vanilla Xfce look and feel and want to get rid of the Xubuntu Session entry, run this command:
      sudo mv /usr/share/xsessions/xubuntu.desktop /usr/share/xsessions/xubuntu.desktop.bak

  5. Change the default file manager and terminal
    1. Xfce menu --> Settings --> Settings Manager --> Preferred Applications --> Utilities

    2. File Manger --> Nautilus

    3. Terminal Emulator --> GNOME Terminal
If, for some reason you accidentally chose Xfce Session (or Xubuntu Session) and it messed up your layout for the other, you can run this command to completely wipe your Xubuntu/Xfce settings and restore it to the default layout:

rm -rf ~/.cache/xfce4 ~/.config/xfce4

Just remember you will lose any customization you may have made to Xubuntu/Xfce.


Wednesday, September 4, 2013

MP3s ripped from CDs in Ubuntu have incorrect track length

If you rip a CD in Ubuntu 12.04+ using the default program provided for this (Rhythmbox), the track lengths will be incorrect. This is because by default, Ubuntu will rip your mp3s using VBR, but it doesn't add the VBR headers.

Rather than go into the details, here's the easiest way to fix it:
  1. Install vbrfix by running this command in a terminal:
    sudo apt-get install vbrfix

  2. Now CD to the folder where the mp3s are that you need to fix:
    cd /path/to/mp3s

  3. Run this command to add the VBR headers to the mp3s:
    find . -type f -iname '*.mp3' -exec vbrfix {} {} \;

  4. Vbrfix seems to leave behind a couple of temporary files, so clean them up:
    rm vbrfix.log vbrfix.tmp
Another option would be to change the default preset to make it CBR. You can read more about doing that here: How do you edit the “Preferred Format” settings in Rhythmbox? Something like this ought to do the trick (change the bit rate as desired):
You can read the details of the problem at this bug report:
Rhythmbox does not add VBR headers when ripping CDs to MP3

Wednesday, August 28, 2013

No cover when uploading to Google Play Books

If you upload a book to Google Play Books in EPUB format and one of these things happens:

  • The cover isn't showing up
  • The cover looks like the above image
  • The book doesn't open/gives you a 404 error
Here are some things to try:

  1. First of all, wait! Google has to extract the cover from the file, and for some reason it can take a long time for it to show up. I would recommend waiting at least an hour, if not longer. Yes, this might seem like way too long, but I've seen it take that long.

  2. If you're absolutely sure it isn't working, you can try to fix the cover using Calibre:
    1. Download Calibre, install it, and use it to open the EPUB file
    2. If the cover doesn't show up in Calibre:
      1. Right-click → Edit metadataEdit metadata individually
      2. Click Download cover
      3. Select a cover and click OK
      4. If no cover is found, find a cover online, and then from the metadata window in Calibre, click Browse to browse to the cover and add it.
      5. Click OK
    3. If the cover does show up in Calibre, the EPUB file may be corrupt. To fix it:
      1. Right-click → Convert booksConvert individually
      2. Output format → EPUB
      3. OK
    4. Save the file
      1. Right-click → Save to disk → Save to disk
      2. Select a location to save the EPUB to
    5. Remove the file you previously uploaded to Google Play Books
    6. Upload the modified EPUB to Google Play Books. It will be located in a subfolder in the location you specified in the previous step. You just want the EPUB file; you can ignore the other files.

  3. If the cover still isn't showing up, you can try to manually repair it.
    1. Download Sigil, install it, and use it to open the EPUB file
    2. Fix the cover according to the guidelines in the following blog post:
      Best practices in ePub cover images by Keith Fahlgren
    3. Once you're done, upload the modified EPUB to Google Play Books

  4. If the book won't upload at all, the cover may not be the problem
    1. Validate the EPUB using the validator here:
    2. Modify the EPUB using Sigil or another EPUB editor, and keep validating it until there are no more errors
    3. Try uploading it to Google Play Books again

Saturday, August 24, 2013

Import playlists into Google Play Music

I've already covered getting playlists out of Google Play Music, but what if you want to import your playlists into Google Play Music? The easiest way to do this would probably be to get your playlists into iTunes or Windows Media Player and use Google's Music Manager to sync your playlists.

Being a Linux user, that's not the best option for me, so I came up with another way. This one's not for the faint of heart, so be sure you've got some time on your hands and lots of patience. Here we go:

  1. Just like my method for exporting playlists from Google Play Music, importing them will require a rooted Android device. The exact method for doing this varies by device, so you'll need to Google it.

  2. This may seem obvious, but first of all you need to make sure all of your music is in Google Play Music. It can take a while, so if you haven't done this you should probably get crackin. These links should help:

  3. Remove any music stored on your Android device's internal memory or SD card. This isn't absolutely necessary, but if you don't do this, any music in the playlists you wish to import that's on your device may not get added to Google Play Music playlists in the cloud.

  4. Get the playlists to import. This step will vary widely depending on where the playlists are coming from. You'll want your data file to contain the following fields:
    1. Playlist name
    2. Artist
    3. Title

    Based on the tools I've used to import data into a Sqlite database, I'd recommend that the data is in one of these formats:
    • A text file where each row is on one line, the fields are separated by a unique character (like the pipe symbol: |), and the fields aren't quoted. For example:

      Folk|Gregory Alan Isakov|Dandelion Wine
      Folk|Gregory Alan Isakov|That Moon Song
    • A Microsoft Excel XML file. You don't need Excel to create this; free programs such as LibreOffice Calc work fine.

  5. Make sure all of your tracks and playlists on your Android device are synced with Google's servers. I've already documented this; see step 1 in my post on exporting playlists from Google Play Music.

  6. Optional, but strongly recommended: back up Google Play Music. My app of choice for doing this is Titanium Backup (the free version will suffice, although I think it's worth paying for).

  7. Get the Google Play Music database file (music.db). The instructions for this are also in my post on exporting playlists from Google Play Music (step 2).

  8. Open the music database file. You can use a tool such as Sqliteman, or you can use the sqlite3 command in a terminal, like so:
    sqlite3 /path/to/music.db

  9. Import your playlists into the database file. This is where it gets fun!
    1. Create temporary tables
      create table "temp" ("Playlist Name" text, "Artist" text, "Title" text);
      create table "temp2" ("Playlist Name" text, "Artist" text, "Title" text, "ClientPosition" integer primary key autoincrement);

    2. Import the data. This will vary depending how your playlists are formatted and what program you're using. If you're using Sqliteman:
      • In the menu go to Database --> Import Table Data...
      • Table to Import Into --> select temp
      • File to Import --> Search... --> browse to your playlist file
      • Select an appropriate separator under Column Separators
      • Under Preview, you should see three columns with playlist name, artist, and title
      • Click OK

      If you're using the sqlite3 command:
      • Define the separator between fields. If it's a pipe (|), you can skip this step. For example, to set the separator to a dollar sign:
        sqlite> .separator $
      • Then import the file (things will be easier if the file name doesn't have spaces):
        sqlite> .import /path/to/playlists.txt temp

    3. Before we actually import the playlist entries, this query will show you what's actually going to get imported:
      select temp."playlist name", temp.artist, temp.title from music join temp on music.artist=temp.artist and music.title=temp.title;

    4. If some of your songs don't show up in the above query, then they either aren't in Google Play Music, or the artist or title aren't spelled the same. If you want at this time, upload or rename any missing music. If you decide to fix any missing music, you'll have to start over at the step above where you make sure the music on your Android device is synced with Google's servers.

    5. Copy the data from the temp table to the temp2 table (the temp2 table is my hack to keep the playlist order):
      insert into temp2 ("playlist name", artist, title) select * from temp;

    6. Now, we're finally ready to create the playlists. If you already have playlists in Google Play Music with the same names as the ones you're importing, you can skip this step. Here's the query (the _sync_dirty part is what tells Google Play Music that the data needs to be synced to the cloud):
      insert into lists ("Name", "_sync_dirty") select distinct "Playlist Name", '1' from temp2;

    7. We've created the lists, now we need to import the data into them:
      insert into listitems ("MusicId", "ListId", "ClientPosition", "_sync_dirty") select as musicid, as listid, clientposition, "1" from music join temp2 on music.artist=temp2.artist and music.title=temp2.title join lists on "playlist name";

    8. Clean up after ourselves:
      drop table temp;
      drop table temp2;

  10. Just to be safe, turn off internet on the Android device (whether it's wifi or data)

  11. On the Android device, kill the Google Play Music app by going to the home screen --> Menu --> Settings --> Application manager --> scroll down and click on Google Play Music --> Force stop

  12. Copy the music.db file you modified back to the device's SD card

  13. Copy the music.db file from the SD card back to /data/data/

  14. This part can be tricky. Copying music.db back will probably mess up the permissions, which means at this point if you were to open the Google Play Music app, it would probably crash. To fix the permissions, you need to either use the command line or use a file explorer app that's capable of modifying the permissions. For these instructions, I used File Explorer by NextApp with the Root Add-On:
    1. Long-press on one of the other files in the folder, like music.db-journal --> Permissions
    2. Make a note of the Owner and Group
    3. Now long-press on music.db --> Permissions
    4. Click on Owner --> App --> change it to the same owner as the other file you just looked at. You'll see a Google Play Music icon beside the owner, which will confirm you're picking the right one.
    5. Repeat the same thing for the group.
    6. This isn't completely necessary, but you can also uncheck all of the boxes in the Exec column, and uncheck the Global box in the Read column. In the bottom left it should say Octal: 0660.
    7. Click OK --> OK.

  15. Phew, we're almost there! Now open the Play Music app, and go to Playlists. Scroll down and you should see the playlists you imported (if you don't, make sure you're viewing All Music instead of music On Device). Open the playlists, and you should see all the songs you imported.

  16. Lastly, if everything looks good, go ahead and connect your device to the internet again, and follow the step you did above on making sure your music's synced with Google's servers.

  17. To make sure your playlists are on Google's servers, go to and your playlists should be there. If they don't show up, don't worry. Give it some time, try syncing from the Play Music app again, and refresh the page. It can take a little bit to sync.

Monday, August 19, 2013

The best alternative to Astrid Tasks

Update: see here for a better alternative: The best task/to-do app for Android

Yahoo recently purchased the excellent Astrid Tasks app and discontinued its development. I've looked high and low, and the best alternative to Astrid Tasks appears to be (drum roll) ...

Astrid Tasks.

Yep, there really aren't any good alternatives. I've tried:

  • Checkmark To Do & Task List
  • GTasks
  • Task List by taskos
  • Wunderlist
and more, and none of them have what makes Astrid so great. In particular, Astrid is great because it has a nice, clean interface but it is also very powerful under the hood. It has features like hiding tasks until a certain date, or repeating them based on when they were completed (as opposed to when they were due), which I haven't found in any other apps. in particular seems popular, but I have no idea why. It lacks functionality that I would consider basic to a task/to-do app like snoozing for a precise amount of time or repeating tasks at a precise interval.

So my recommendation: stick with Astrid Tasks. Now that it's been shut down, it won't be receiving any more updates. But it still works great. It was already an excellent app, not really lacking anything. It will no longer sync with, but it still syncs with Google Tasks.

The latest version of Astrid for Android is 4.6.5, which you can download from here if you've previously installed Astrid:

If you've never installed Astrid before, you can download the latest version from here, since the previous URL won't work for you:

The latest version for iOS appears to be 2.6.2.

Sunday, August 11, 2013

Dell iDRAC: The Virtual Media native library cannot be loaded

If you get the above error when trying to open the virtual media on a Dell iDRAC console session (Virtual Media --> Launch Virtual Media) and you're running 64-bit Linux, you may need to install 32-bit Java. Here's what I did on Ubuntu 12.04:

  1. First of all, I happened to run into this issue on an iDRAC that was running old firmware, so before continuing, I'd recommend updating to the latest firmware if possible and seeing if that fixes the issue.

  2. If that didn't fix it or you're unable to update to the latest iDRAC firmware, install 32-bit Java on your workstation:
    sudo apt-get install openjdk-6-jdk:i386

  3. Next, download the viewer.jnlp file from the iDRAC web interface by clicking the link to launch the virtual console/viewer. If the viewer.jnlp file you downloaded has a really long name, you might want to rename it to make the next step easier.

  4. Open the viewer.jnlp file with the 32-bit javaws (Java Web Start) binary:
    /usr/lib/jvm/java-6-openjdk-i386/jre/bin/javaws /path/to/viewer.jnlp

Wednesday, August 7, 2013

Typing Arabic vowels/diacritics on Android

If you would like to type Arabic vowels/diacritics/harakat on Android, you first need a keyboard that supports it. I've tried most of the keyboards available, and I've listed the ones that fit the bill. Most surprisingly, my keyboard of choice (Swype) doesn't support Arabic diacritics. Guess it's time to switch!

The first thing you'll need to do for all of these keyboards is install Arabic in the settings for each keyboard, which is normally accessible by going to Home --> Menu --> Settings --> Language and input. Once you've installed Arabic, you'll need to switch to Arabic language while using the keyboard.

Google Keyboard (pictured)

To type Arabic diacritics, long-press the period key near the lower-right.

Google Keyboard is free, lightweight, and probably the best out of the options I tried. In a move against Android fragmentation, Google is modularising Android by making a lot of new features available through the Play Store, meaning it matters a lot less what version of Android you're running. The Google Keyboard is one of the results of this modularisation.


Long-press the apostrophe/single quote key near the lower right to access diacritics.

SwiftKey is a solid keyboard. It isn't free, but it's gone on sale periodically.

GO Keyboard

There's a button near the bottom left that has a doubled fatha symbol. Long-press it to access other diacritics.

This one's pretty good and it's free, although it does feel a little bloated and several of the options will prompt you to install additional GO-branded software.


Tap the button that brings up numbers and symbols. From there you should see a "1/6" button. You'll need to tap that five times until it says "6/6", and from there you'll see the diacritics.

This was probably my least favorite. The interface felt cluttered, and having to go through six keypresses just to get to the diacritics was annoying. In addition, some of the time the 1/6 button said 1/3 instead, meaning I couldn't get to the diacritic page. It seemed that happened mostly when switching between other keyboards.

Friday, August 2, 2013

Import Catch notes into Evernote

If you haven't heard, Catch Notes is shutting down at the end of the month. It was one of the nicest note taking apps for Android. There are a lot of alternatives out there. In most cases I opt for whatever Google has to offer, and in this case they have a note app of their own called Google Keep, but it only allows you to organize notes by color instead of Catch's useful spaces and tags. I don't know about you, but trying to find a note by a particular color alone is incredibly useless for anything other than eye candy.

It seems the best alternative is to finally join the masses who are using what's pretty much the king of cross-platform note-taking: Evernote. If you export your Catch notes by the end of this month, you'll be able to easily import them into Evernote. Here's how:

  1. Go to this link, log in, and download the Zip Archive File of your Catch notes:

  2. Unzip the file somewhere. It will contain a folder for each Catch Notes space you had.

  3. Download the Evernote desktop app from here:

  4. Open the Evernote desktop app. Log in or create a new account if you don't have one already.

  5. Go to File --> Import --> Evernote Export Files...

  6. Browse to the location where you extracted the Catch Notes zip archive file. Open one of the folders for one of your Catch Notes spaces, and select the notes.enex file to import it.

  7. When it asks you if you want to place the notes into a synchronized notebook, click Yes.

  8. The notes will be imported into an Evernote notebook, which is essentially the same as a Catch Notes space. The notebook will be called Imported Notes. Right-click on it, click Rename, and give it the same name as the Catch Notes space you imported.

  9. Repeat the previous four steps to finish importing the rest of your Catch Notes spaces into Evernote. You can probably skip importing the All Notes notebook to avoid importing duplicates.

  10. In Evernote, your default notebook is called something like username's notebook. In Catch, the default was called Notes. If you want, move all your notes from the Notes notebook into the default Evernote notebook, or vice-versa. You can then delete one of them. If you want to change your default notebook, right-click on a notebook --> Properties --> check Make this my default notebook.

  11. At the top of the Evernote desktop application, click the Sync button to sync your new notebooks to the cloud.

  12. Install the Evernote app:
  13. Open it up, sign in, and all your notes from Catch should be there.
Farewell, Catch. We'll miss you!

Wednesday, July 31, 2013

The failed Apple experiment

The setup

I've long admired Apple products from afar. With the switch to OS X (based on Unix) and Intel processors, my interest was further piqued. The stability and security of Linux with a clean UI and consistent UX make Macs a very attractive choice. The problem: price. At two to three times the cost of equivalent PCs, Mac prices simply aren't competitive.

But I began thinking. If Mac hardware really is better (as most Apple fanatics would attest), I could buy a used Mac for about the same price as a new PC, and it should last me nearly as long. Boy, was I wrong.

Warning signs

Being frugal, I thought I'd save as much money as possible by buying a late-model first generation Macbook Pro. I quickly realized this wasn't a good idea when I discovered there was a design flaw that caused the graphics to fail. Apple covered the issue for four years beyond the date of purchase, but most of these were more than four years old by this point.

So I opted for an early-model second generation Macbook Pro instead. It was nearly--but not quite--four years old, but the laptop I was replacing it with was an HP that was over seven years old. So the Macbook was a step up in every way: it was newer, faster, and better quality. If I got seven years out of an HP, sureley I could get five more years out of the Mac. I was abruptly awakened from this dream.

The first few weeks it was incredible. The build quality was astounding, and I immediately fell in love with OS X. It worked flawlessly, and being a Linux fan I loved that BSD was running under the hood and I could do much of my work in the terminal without too many adjustments.

The first straw

One day I powered it on and realized my wifi wasn't working. I clicked on the wifi icon at the top of the screen only to be greeted by:

WiFi: No Hardware Installed
That's odd; I was pretty sure I had wifi hardware the previous day. I tried a few things and it started working again, but the problem came back with more and more frequency. Then the entire laptop would completely freeze. I googled the issue, and finding tens of thousands of results, I combed through them and tried everything in the book. After a while it became apparent it was a hardware flaw. The only resolution I was able to find was to disable the wifi hardware, and buy a USB wifi adapter, which wasn't a good solution considering it only has two USB ports.

The second straw

Not too long after that I turned the Macbook on and it took a very long time to boot, nearly 15 minutes. It showed a progress bar on the screen during this time. I found out this indicates an issue with the hard drive. To make matters worse, I opened the cover to the compartment that houses the battery and the hard drive, and the hard drive was less than two years old, meaning it had already been replaced once. Great--broken wifi and a failing hard drive. My impression of Mac hardware was quickly worsening.

The last straw

As if it couldn't get any worse, I was using the laptop on battery power one day when all of a sudden it turned off. It didn't shut down; it completely lost power. I turned it on again, and the battery still had most of its charge left. I was originally impressed that I was getting 2-3 hours of use out of a nearly four-year-old battery in between charges. But now, the laptop would completely lose power even when the battery had plenty of charge. It could happen at 50% battery capacity, or 90%. The battery still has less than 100 cycles on it (Apple says it should last for 300), but it's now effectively worthless. Yet another apparent hardware flaw. Unfortunately Apple replacement parts are just as overpriced as Apple products; they want $130 for a new battery.

The last resort

The computer was way out of warranty, but I thought if I reached out to Apple they might fix the two issues that were evident hardware design flaws (the wifi and the battery) and not a result of normal wear and tear. First I tried chatting with their support, but they want $20 just to chat with them regarding a computer that's out of warranty. I called; same thing. Finally I took it to an Apple store, where they did a free diagnostic. But after the diagnostic the only thing they offered was to fix it for a price that's higher than the computer's worth.

Lesson learned

So I'm left with a laptop that I can only use if it's plugged in, I only have one available USB port, and the hard drive might be on it's way out. It's evident my Apple experiment was a failure. Oh well. At least I learned my lesson. It's the first and last Apple product I will ever own. I can get a brand new Thinkpad for less than I paid for a used Macbook Pro, and I'll stick with Linux. Dear Apple: let me know when you start selling OS X for PCs. Until then, goodbye.

Thursday, July 25, 2013

Xubuntu vs Lubuntu (Xfce vs LXDE)

While looking around for alternatives to Ubuntu, I stumbled upon two lightweight derivatives of Ubuntu: Xubuntu and Lubuntu. They're both derivatives of Ubuntu, which means they get the same great up-to-date packages, community support, and can benefit from PPAs. Plus they're both lightweight enough to be run on older computers, which is a nice change of pace from regular Ubuntu, whose Unity interface is too bloated to run well on older machines.

Lubuntu is a little more lightweight than Xubuntu, but on closer inspection it's clear that Lubuntu's advantages end there.

Here are some reasons why Xubuntu is the better choice:

  • Xubuntu is more mature; it's been around since 2006, whereas Lubuntu was introduced in 2010.
  • Related to the previous point, Xfce (the desktop environment which Xubuntu is based on) is more mature and has been around much longer than LXDE (which Lubuntu is based on).
  • LXDE is largely developed by one person, whereas Xfce has a large and robust development team.
  • Every two years Ubuntu releases an LTS (Long Term Support) version. Xubuntu follows Ubuntu in providing LTS releases, but Lubuntu doesn't.
  • Xubuntu has an integrated settings manager, but Lubuntu doesn't.
  • Lubuntu is a little too bare bones and requires more work to configure and customise (Sources: 1 2 3)
  • This is mostly a matter of opinion, but Xubuntu/Xfce looks better (and I'm not the only one that thinks so). It also looks more like GNOME 2.
Of course you are free to use whatever desktop environment you like. My goal is just to help you make an informed decision.

Oh, and the screenshot at the top is Xubuntu :)

Monday, July 15, 2013

Running Android Jelly Bean (4.1) on a Galaxy S Advance

The Samsung Galaxy S Advance (I9070) is a nice phone.  It's one of the very few Android phones that has a reasonable screen size (just 4 inches--the same as the iPhone 5) but's also fairly powerful with a dual core processor.  The only problem is that it only has 768 MB of RAM, which should be enough for Android JB (Jelly Bean 4.1), but Samsung's build of JB is pretty poor, and performance suffers.

One solution is to keep the phone on (or downgrade it to) Android Gingerbread (2.3), but who wants to run a 2+ year old OS?  So here's how to have your cake (or Jelly Bean, as it were), and eat it too:

  1. Back up your phone
    This process is going to wipe everything on your phone, so I'd recommend backing up anything you'd like to keep. I won't go into detail on this, but I generally recommend rooting and using Titanium Backup.

  2. Upgrade to Jelly Bean
    The easiest way to do this is through Samsung's own Kies software. If you get a message saying Kies is unable to update the firmware on the device, it can still be done, but will take a little bit of work. I recommend the instructions here: Galaxy S Advance Receives I9070XXLQG Android 4.1.2 Jelly Bean Update [Manually Install]

  3. Clear the cache
    This is something I like to do to ensure a clean install after an upgrade:
    1. Power off the phone
    2. Boot the phone into recovery mode by pressing and holding volume up, home, and power buttons together (you can let go once you see the I9070 screen)
    3. Select wipe data/factory reset
    4. Select wipe cache partition
    5. Select reboot system now

  4. Root the phone
    This has also been thoroughly documented elsewhere, so I won't reinvent the wheel: How to root Galaxy S Advance on I9070XXLQG Android 4.1.2 Jelly Bean [Tutorial]

  5. Install Cocore kernel
    This helps mitigate some of the slowness you'll notice when upgrading to Jelly Bean.  This takes a couple of steps, but overall is pretty easy:
    1. Download the temporary ClockworkMod (CWM) recovery to the SD card from here: [Recovery] CWM [JB Compatible]
    2. Download the latest CWM Cocore kernel from here: CoCore-E-Refresh
    3. Reboot into recovery mode using the steps given above
    4. Select apply update from external storage, browse to the temporary CWM file, and install it. When it's finished it will automatically load the temporary CWM.
    5. From the temporary CWM, select install zip from sdcard, browse to the Cocore kernel, and install it
    6. Select reboot system now to reboot

  6. Disable/uninstall bloatware
    Another reason Samsung's build is so slow is that it comes with tons of junk, which uses up the majority of the phone's RAM. Getting rid of it is a huge help:
    1. From the home screen, go to Menu --> Settings --> Application manager, then swipe right until you get to the All tab
    2. Open each of these apps, and click the Disable button, or you can optionally skip this step and go to the next step and use Titanium Backup to completely uninstall these apps:
      • ChatON, ChocoEUKor, Clock (digital), Clock (funky), Clock (modern), CoolEUKor, Dual Clock (analogue), Dual Clock (digital), Helv Neue S, Memo, Microbes, Mini Diary, My Files, Polaris Viewer 4.1, RoseEUKor, S Note Provider, S Planner, Samsung account, Samsung Apps, Samsung Backup, Samsung Backup Provider, Samsung Browser SyncAdapter, Samsung Calendar SyncAdapter, Samsung Cloud Data Relay, Samsung Contact SyncAdapter, Samsung Push Service, SNS (with the facebook icon), Weather Widget, Weather Widget Main, Yahoo! Finance, Yahoo! News
    3. If you wish to further disable bloatware, install Titanium Backup, and uninstall the following apps (or you can freeze/disable them using Titanium Backup Pro):
      • AllShare Service,, Memo, Mobile print, Music Player, OmaDrmPopup, SamsungAppsUNA2

  7. Install calendar and file manager
    We removed Samsung's crummy calendar and file manager apps, so install Google Calendar and the file manager app of your choice (I like OI File Manager since it's lightweight and open source)
Well, it takes a bit of work, but you should now have a smooth-running Jelly Bean on your Galaxy S Advance.  Enjoy!

Monday, July 8, 2013

An open letter to Android smartphone manufacturers

Dear Android smartphone manufacturers,

Android's got a bad rap, and it's your fault.  You have built some really amazing phones, but you've also built a ton of really crummy ones, and quite frankly, we don't want to buy them.  Your focus is all wrong.  But I have some suggestions:
  1. Battery life
    If we have to charge our phones more than once a day, we're going to be dissatisfied, period.  This doesn't mean it should be able to play HD video for 24 hours, but a modern smartphone should be able to handle moderate use without having to be charged more than once a day.

  2. Stock Android
    When is the last time you heard someone say how much they love HTC Sense (HTC's customized version of Android), or Samsung's TouchWiz?  Don't even get me started on Motorola's Motoblur.  The answer is never.

  3. Smaller screen sizes
    We want phones we can use with one hand.  I think the ideal phone screen size is somewhere between 4 inches (iPhone 5) and 4.3 inches (Galaxy S2).  I have the latter, and it's big enough that I can't reach the opposite top corner of the screen without shifting the phone in my hand.  I definitely wouldn't want anything bigger.  And guess what?  Smaller screens use less battery!  It's win-win.

  4. Fewer models
    Don't build 100 different phones.  The real competition is Apple, which builds just one phone a year.  No need to go that extreme, but make just 2 or 3 models, and don't bother building a "low-end" phone; the profit margins are going to be too low and it will just muddy your brand.  Also, only release new phones once a year.  Releasing a new phone every month only devalues the high-end phone that you just released.  Plus it frees up resources to make sure your phones are stable, and so you can actually push out the latest versions of Android to your customers, which is a huge complaint among Android owners.

  5. No gimmicks
    Why would you dare add some completely unnecessary feature to a phone if we never asked for it, it's going to make the phone cost more, and/or it's going to decrease battery life?  Here are just a few gimmicks we don't care about, off the top of my head:
  6. Durability
    If you want to throw in features, give us a feature that will benefit us, like a phone that's water resistant or isn't going to completely shatter when dropped from a short height.

  7. Less bloatware
    No, I don't want Slacker Radio, UNO, a crippled GPS navigator, or some trial office suite.  I know a lot of this is dictated by the carriers, but I feel like the manufacturers don't try very hard either.
Want to differentiate yourself?  Build a solid phone, with no gimmicks, and stock Android.  That'll be enough differentiation.  If you really want to shake things up, build some cool apps.  S Health, for instance, has been a huge hit with Samsung users.

Wednesday, March 13, 2013

Spotify Linux woes


I recently (okay, almost 2 months ago) updated Spotify on my Ubuntu Linux machine, and the new version is having lots of problems:
  • Dragging from search results into a playlist crashes spotify

  • Dragging items to the top or bottom of a playlist crashes Spotify

  • Artist radio isn't working (or it's taking so long to load that I gave up waiting)

  • Searching doesn't display instant search results like it used to
My solution: downgrade spotify. Here goes:
(Note: I'm running Ubuntu 12.04 64-bit. If you're using 32-bit Ubuntu replace "amd64" in steps 3 and 6 with "i386". If you're using a different version of Ubuntu or a different flavor of Linux, you're on your own.)

  1. First, completely quit spotify. Make sure you click on the icon and click Exit if it's in the system tray

  2. Run this command in a terminal to make sure you've got the problematic version of Spotify:
    dpkg -l spotify-client
    The output should include this line:
    ii spotify-client Spotify desktop client

  3. Download the previous version of spotify by running this command in a terminal:

  4. Uninstall the current version:
    sudo dpkg -r spotify-client

  5. Move the cache folder out of the way:
    sudo mv ~/.cache/spotify/ /tmp

    Note: if you don't do this, you might get this error when running spotify:
    Missing Dependencies
    Framework compatible with bridge-desktop (version 0.7.0) does not exist.

  6. Install the previous version:
    sudo dpkg -i spotify-client_0.8.4.103.g9cb177b.260-1_amd64.deb

    If you get this error:
    dpkg: error processing spotify-client (--install):
    dependency problems - leaving unconfigured

    run this command to fix it by installing any missing dependencies:
    sudo apt-get -f install

  7. To keep spotify from being upgraded again to the broken version, run this command:
    grep -r /etc/apt/sources.list* | egrep -v "\.(save|distUpgrade):deb" | cut -f 1 -d :

  8. The previous step should output one or more files. Edit them and put a pound sign (#) in front of any occurrences of this line:
    deb stable non-free

    Like so:
    #deb stable non-free
Now spotify should work, at least as well as it did before ;)

Wednesday, January 23, 2013

Enforcing Active Directory password history when resetting passwords using PHP

The code:

$ctrl1 = array(
    // LDAP_SERVER_POLICY_HINTS_OID for Windows 2012 and above
    "oid" => "1.2.840.113556.1.4.2239",
    "value" => sprintf("%c%c%c%c%c", 48, 3, 2, 1, 1));
$ctrl2 = array(
    // LDAP_SERVER_POLICY_HINTS_DEPRECATED_OID for Windows 2008 R2 SP1 and above
    "oid" => "1.2.840.113556.1.4.2066",
    "value" => sprintf("%c%c%c%c%c", 48, 3, 2, 1, 1));
if (!ldap_set_option($ds, LDAP_OPT_SERVER_CONTROLS, array($ctrl1, $ctrl2))) {
    error_log("ERROR: Failed to set server controls");

$result = ldap_mod_replace($ds, $dn, $entry);


There are a couple of ways to reset Active Directory passwords using LDAP:
  1. A delete operation on the unicodePwd attribute immediately followed by an add, which is a password change

  2. A modification of the unicodePwd attribute, which is considered an administrative password reset
When doing the latter, password history requirements may not be enforced. Apparently this is expected behavior. The solution is a server control:
  1. First, the control must be available on the server. It's present in Windows Server 2008 R2 Service Pack 1 and above. It can also be installed in 2008 R2 using this hotfix:

  2. Next, the client must use the control to tell the AD server to enforce password history requirements.
If you happen to be doing this in PHP, the solution for the second part is the code I've posted. The tricky part was to get the BER encoding for the value correct.

I put both controls (the new one as well as the deprecated one) in my code and also didn't set the iscritical flag (which defaults to false) in order to make the code as flexible as possible.

In case you're looking to implement a solution to reset AD passwords using PHP, you may find these helpful:

Tuesday, January 22, 2013

RHEL 6 kickstart maps first hard drive to /dev/sdc

I was installing RHEL 6 on a Dell PowerEdge R610, and for some strange reason the first drive was mounted as /dev/sdc instead of /dev/sda. I saw someone else had the same issue on CentOS 6:

The solution: disable the iDRAC virtual media. I had to press Ctrl-E to get into the DRAC menu when it prompted me during the boot process, then I had to arrow down to Virtual Media Configuration and change the Virtual media setting from attached to detached.

Or from the iDRAC web interface: System --> Console/Media --> Configuration --> Virtual media --> Status --> change to Detach --> Apply

Now the first drive is mapped as /dev/sda again.