How to programmatically enable and disable airplane/flight mode on Android 4.2+

Previously I wrote this other post about how to change system settings (like Airplane Mode) by directly manipulating the SQLite database file that stores them. It turns out that there's a better way.

Linux Command Cheat Sheet

A pretty nice compilation of some of the more important linux commands. Of course you'll need to get familiar with them to be of any use, but at least it's a good starting point for beginners.


For a couple of months now I experienced sudden freezes. It turned out to be an overheating issue. I've moved into a new flat and here I use WiFi all the time (vs. the previous setup, where the Mac got network via UTP). Apparently the WiFi module (AirPort ... which is an Atheros AR5418 chip in my case) generates tons of extra heat (even with no traffic at all Shock) and the factory fan control does not account for it properly. Using smcFanControl I can increase the lower boundary of the fan speed and avoid overheating.

How to set the email account for event invitation replies in Thunderbird/Lightning

If you receive an event invitation (from an Exchange Server), Lightning lets you accept or decline it and offers to send an Event Invitation Reply. The problem is that the email account used for sending this reply is picked a bit differently than users would expect. The account can be set in the calendar's properties. However if a user gets invitations from multiple sources (via multiple email addresses) into the same calendar, you cannot tell it to reply using the same email account that received the invitation. You can set this only on a per calendar basis. What a pity.

How to impersonate ("become") a package on the commandline in Android

The /system/bin/run-as command lets you execute a shell or a package as the owner of the package. But you've to be root or use ADB to use it. And the package has to be debuggable and user owned (i.e. system apps cannot be impersonated like this).

Ldd for ARM cross-compiler

Using Sourcery CodeBench Lite you can quite easily cross-compile tons of open-source projects for Android. But sometimes regardless of all your efforts, the compiled binary contains library dependencies. To list these dependencies, we regularily use ldd. The cross-compiler does not have an ldd script, but we can work around that by executing this instead:
arm-none-linux-gnueabi-readelf -a my_cross-compiled_executable | fgrep "Shared library:"

Fix problem with Snow Leopard Services menu building loop

"Having trouble with your Snow Leopard Services menu telling you that it’s building (but never finishing)? Here are a few things you can try..."

The very first tip (running /System/Library/CoreServices/pbs from the commandline) helped. It didn't even need root privileges or a reboot.

Identifying which Java Thread is consuming most CPU

In short: use top (with shift+H to show threads) to get the most CPU intensive threads, use jstack to get a thread dump from the JVM and look for the "nid=<threadid in hex>" value of your rogue thread in the dump.

MSGConvert: A .MSG to mbox converter

A Perl script to convert from Outlook's MSG format ("Composite Document File V2 Document" if you use file to check) into a MIME format that eg. Thunderbird can open (if you rename the *.mime file into *.eml).

Various ways to set environment variables in Ubuntu

It came to me as a surprise that recent Ubuntu versions store user-level locale selection (i.e. LC_* variables) in $HOME/.pam_environment. Eg. if you set some LC_* variable in your shell config (eg. $HOME/.profile), chances are that the contents of your .pam_environment file will override it for most GUI apps.

Syndicate content