Android Alarms Icon

Saturday, January 15, 2011 categories: a855, mobile, motorola droid

I've been having some trouble with my phone, since early December. There have been phantom inputs, random scrolling, and unresponsive areas of the touch screen on my Motorola Droid A855. I could temporarily resolve the issues by applying even pressure across the touch screen, but that's certainly not a long term solution.

And so I called up Verizon support (*611) and the person had me explain what was going on, and I tried my best to suggest that the factory reset wasn't going to solve my problem. Nevertheless, low tier support, following the script, factory reset here I come. Then spent the rest of the day trying to restore my configuration. Which was an ultimately futile effort, as I ended up killing the market application as it apparently hung trying to reinstall all of my applications. Which resolved the problem, and allowed for manual installation of the various ones I still wanted. (At least it preserved the list of formerly-installed applications!)

Regarding other pieces of data, I was not so lucky. Apparently various applications store data in /data/data/<APP>/databases/<DB NAME>.db which is a sqlite database. This tidbit comes in handy later, but /data/data/* is on the NAND and is wiped clean during the factory reset. Goodbye SMS messages (but they are safely in GMail thanks to SMS Backup). Goodbye history of called numbers, and thus the handy favorites list. Goodbye my list of Shazam "tagged" songs that I might have wanted to sift through some day. And goodbye Angry Birds progress.

I think some of that stuff should be backed up onto the SD card in some signed format (if the concern is tampering) and sucked back in after the reset.

Little did I know that I would be even more annoyed by the lack of an "Alarms" shortcut in the applications drawer. I didn't realize how handy it was until it was gone, like most truly useful and under-appreciated things I suppose. So began the quest of complaining to my fellow Droid-wielding coworkers. One of which also happened to have the coveted "Alarms" shortcut still on his Droid's desktop.

A Google search led to most of the answer. However, upon first try that did not work. I wasn't sure how to access the database, and even after reviewing the recommended applications in the market, they required root access to edit other applications' database -- which makes perfect sense. Which led to a long road of understanding the current root escalation techniques, and ultimately to psneuter. The "trick" is pretty cool, if you take a look at the source.

With that in place, and after learning that /data/local/tmp is writable (the SD card doesn't work because setting permissions doesn't work there) I was off to the races.

adb pull /data/data/com.android.launcher/databases/launcher.db
sqlite3 launcher.db
sqlite> .tables
android_metadata  favorites
sqlite> .mode line
sqlite> .headers on
sqlite> select * from favorites where title like '%clock%'
_id = 18
title = Clock
intent = #Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.google.android.deskclock/com.android.deskclock.DeskClock;end
container = -100
screen = 3
cellX = 0
cellY = 1
spanX = 1
spanY = 1
itemType = 0
appWidgetId = -1
isShortcut =
iconType = 0
iconPackage =
iconResource =
icon =
uri =
displayMode =
sqlite3> update favorites set title='Alarms',intent='#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000component=com.google.android.deskclock/com.android.deskclock.AlarmClock;end' where _id=18;
sqlite3> .quit

It took a few tries to get the intent component value right (the post from earlier didn't have a value that worked for 2.2.1) but now it works! And I'm quite happy to have that special purpose icon back. As trivial as that may seem.

After moving to my replacement phone, I had to use the SD card as an intermediary in order to make editing the database work. That seems very strange to me, but was mentioned somewhere else as well. With no cp (?!?) I had to resort to cat /data/data/com.android.launcher/databases/launcher.db > /mnt/sdcard/launcher.db; mount it on my computer; and then edit it with sqlite3. Finally, used cat to overwrite the old file, and my 'Alarms' shortcut survived a reboot.

This post is going to be a collection of links and information, to organize the information I gathered for a project. The goal of the project being to create a temperature monitoring system that could be setup and plugged into a network connection. Ideally then have that monitoring device be accessible over the Internet.

My initial information gather suggested that something like an Arduino + Ethernet Shield would be a good base device, or maybe a plug-style computer (like the SheevaPlug or Pogoplug). I also looked at the Netduino Plus briefly, and may look at it in the future.

Reasonably accurate temperature sensors are available as Dallas 1-wire bus devices, which seemed like a reasonable way to go since they can be read over RS-232 using a fairly simple circuit. There are also, apparently, 1-wire to USB bridge chips available (even supported in Linux). One such bridge is used in the LinkUSB, which is a convenient form factor that is supposed to work with long runs of twisted pair cable to connect the sensor, and abstracts the interface to an RS-232 based protocol. Dallas 1-wire seems to support the lengths of cable I would need.

I also looked quite a bit at RS-485. It would be another option, but I think there would be more implementation cost. The sensors that I saw were rather expensive. But FTDI offers convenient adapters for about the same cost as the LinkUSB. Looks like Sparkfun has some even cheaper!

I'll add another post if I ever execute this project.

Other references:

SLUG Mini-Presentation on SSH Tips/Tricks

Friday, September 17, 2010 categories: linux, slug, ssh

I was asked if I could take the time to do a short, mini-presentation on SSH for a Siouxland Linux Users Group (SLUG) meeting. Like most things, it got put off until about a week before, and then put off until the week of the meeting. At least I started getting things ready the night before... Anyway, I figured I could put up here what I covered. Good excuse to post I guess.

For basic information, I covered syntax:

ssh host -l user
ssh user@host

Using scp and sftp to transfer files:

scp a slug02:
scp slug02:b ./
sftp slug02

Port Forwarding:

-D 12345
-L 12345:host:port

Optionally using less encryption for file transfers:

-c blowfish
-c none

And mentioned using compression for X forwarding, but didn't setup a VM with X running to demonstrate X forwarding:


Then, for more advanced topics, I talked about how ~/.ssh/config and what can be put in there.

For example, setting ControlMaster for connections to use a single SSH connection for multiple sessions:

Host *
   ControlMaster auto
   ControlPath /tmp/%r@%h:%p

I couldn't recall the syntax to disable ControlMaster for a specific connection from the command line, but it is:

ssh -o ControlMaster=no slug02

Creating a basic connection shortcut:

Host s1
   HostName slug01
   User user1

As well as showing that the various settings that can be used here are found in ssh_config(5), and the earlier command line parameter analogs for the file:

   LocalCommand blah
   DynamicForward 8080
   LocalForward 12345 otherpc:3389
   LocalForward 12346 otherpc:80

I also mentioned fail2ban and denyhosts as ways to protect your SSH server from unwanted brute forcing. I personally use denyhosts, and showed how it populates /etc/hosts.deny with the rogue failures, as well as how white listing in /etc/hosts.allow can be done.

I think it was a reasonably successful mini-presentation.

I've had my Motorola Droid A855 for a while now, and am quite happy with my "smart phone" / PDA / email "thing." However, yesterday I was charging it through my computer, and rebooted. Little did I know, this would lead to an hour of misguided troubleshooting. This was suggested to me as a well known fact, but I could only find one clear mention of this problem (not that I scoured the internet too hard, but if it was very well known I would think it fairly easy to find).

That aside, I awoke to find a system update on my Droid. This was to go from 2.2 (FRG01B) to 2.2 (FRG22D), which "officially" supports installing Flash (10.1) via the Market. Which I promptly tested on YouTube and with a flowplayer example page.

The Flash Player seemed to drop frames on YouTube, with the full YouTube application being a much nicer user experience.

I also made sure to set plugins to "on demand" just in case flash ads are going to slow down the browsing experience.


I would have also linked the QR code (generated via Google's chart API) but WordPress seems to want to convert market://search?q=pname:com.adobe.flashplayer in to simply com.adobe.flashplayer when in the href of an anchor. Fun times.

Link and QR code fixed.
Now visible from any browser!

This last week a coworker was trying to manually manage which revisions were being built by our continuous integration system. However, doing so without a complete understanding of exactly how to approach the problem. Not to mention the fact that the continuous integration system provides a mechanism to specify the revision as a parameter for the build.

In an effort to minimize the amount of interaction required, as well as to apply a level of control, my coworker was supplying the build system with a URL like https://<server>/<repo>/!svn/bc/<revision>/<path> which is what a Subversion client that supports HTTP/DAV to access repositories uses to retrieve specific revisions, as well as other revision information. This failed with a very angry exception, that the URL didn't support the REPORT verb (well, it kind of said that).

As it turns out, there are -- quite understandably, a number of special URLs for accessing various pieces of information about the history of items within a repository. These "private" URLs are currently defined in http://svn.apache.org/repos/asf/subversion/trunk/subversion/mod_dav_svn/dav_svn.h and the comments seem to suggest that they are extensions above and beyond DAV.

The Subversion Book discusses mod_dav_svn, and even mentions that the '!svn' part can be changed with the SVNSpecialURI configuration directive. Other than that it doesn't really say much about the special URLs. All of this suggests that these URLs should not be used explicitly. Without digging too much further, that's the conclusion I came to anyway. Was fun to read about though.