Building Pushover

On March 7th, 2012, I announced the launch of Pushover, a simple mobile notification service with device clients available for Android and iOS. I kept some notes during the development process, which mostly occurred in the evenings and weekends around my other work.

I had been using Notifo for a year or so to receive push notifications on my phone from my custom network monitor, but last year the free service announced it was shutting down. When I switched back to my Android phone a few months ago, I was unable to download Notifo's Android app which never made it out of beta.

Continue reading 4,264 words...

On Android

The source code to Android 4.0, nicknamed Ice Cream Sandwich, was made available last Monday. For developers of Android ROMs like my Blandroid project, these source code releases enable us to release our own modified versions of Android to users that prefer to use our software on their phones. The source code to the previous major version, Android 3.0, was not made available1 and was only given to certain tablet manufacturers like Motorola.

Continue reading 2,824 words...

An Ecobee Automation Hack

I've had an Ecobee thermostat in my house and now in my apartment for a number of years. It's a touchscreen thermostat equipped with 802.11 wireless that can be remotely adjusted and monitored from Ecobee's website as well as iPhone and Android applications. While the expected use case might be monitoring the temperature of one's home while at work, I often lazily use the phone applications while at home when I'm too cold to get out of bed to turn the heat up. With some Ruby code and SNMP, I am now able to automatically detect when I am home and when I leave the apartment, and adjust the temperature automatically.

Continue reading 1,099 words...

A Man-in-the-Middle Attack in the Wild

Last night I tried to visit one of the websites that I host on one of my dedicated servers, and to my surprise, I saw this instead of the usual content:

My first reaction was that the gzip compression had possibly broken on my server, or that it was a weird compatibility issue with Firefox 6.0 to which I had just upgraded. I enabled Firefox's Web Console to see what was actually being received (highlighting mine):

Continue reading 978 words...

On Tinfoil Hats

Some time in 2010, Google, Adobe, and "dozens of other high-profile companies" were hacked by the Chinese government. The attack was done through a previously unknown vulnerability in Internet Explorer and considered to be highly sophisticated. The attackers copied intellectual property of these companies and accessed Gmail accounts of human rights activists.

Rather than directly hack into the accounts of those activists, the entire e-mail provider was compromised.

Continue reading 1,427 words...

Pipe Event Plugin for Adium

Back when I used OpenBSD on my laptop and Pidgin for instant messaging, I wrote a D-Bus script to watch incoming messages and forward any to my cell phone that were received while my screen was locked. The script forwarded messages to Prowl's web API, which would forward them to my iPhone using push notifications.

The last time I switched back to a Mac desktop, I had to switch back to Adium and lost the ability to selectively forward messages. While Adium does have an event action to run an AppleScript, there's no way of passing the actual event text to the script, so it has to talk back to Adium and try to find the newest message. The only option was to generate Growl notifications for all messages and then configure Growl to forward them to Prowl. I got fed up with that pretty quickly, so I modified Adium to create a new event type for "messages received while away". That way I could have the Growl notification only on that event, so I would only get messages forwarded while away. That worked better, but it prevented me from being able to go away while still at my computer without getting a bunch of messages queued up on my phone.

Continue reading 550 words...

Properly stopping a SIP flood

At about 9am yesterday morning, I noticed on my server monitor that the CPU utilization of one of my servers was abnormally high, in addition to a sustained 1mbit/sec of inbound traffic and 2mbits/sec of outbound traffic. syslog messages from Asterisk showed it to be a SIP brute force attack, so I dropped the offending IP (an Amazon EC2 instance IP) into /etc/idiots to block it and went back to my work.

A while later, I noticed the traffic still hadn't died down, so I reported the incident to Amazon and my server's network provider. No luck on either front; Amazon just sent back a form reply stating the incident was forwarded to the EC2 instance's owner (yeah, seriously) and the network provider said they wouldn't bother adding an ACL to their border equipment unless it was needed to protect their entire network. With the IP blocked on my server, the CPU utilization had died down and it was no longer sending out reply traffic, but I was worried about the inbound garbage traffic counting towards the server's monthly bandwidth cap.

Continue reading 832 words...

Restoring Case-sensitive HFS+ Volumes with Time Machine

I've always formatted my Mac OS partitions with case sensitivity enabled, which usually means formatting a new system and re-installing Mac OS X as soon as I get it. After installing the 10.6.2 update, I lost my system menu bar icons and was forced to restore from a 10.6.1 backup made the day before.

Following Apple's instructions, I booted to the Snow Leopard installation DVD, chose the "Restore System from Backup" option and thought I was on my way. About 50% into the recovery, the recovery application crashed:

Continue reading 820 words...

Watching the Web Discover goingtorain.com

The buzz around and traffic to goingtorain.com is slowing down now and I'm amazed how many people responded positively and thought it was actually useful.

While talking to Dave about it yesterday, he remarked something along the lines of, "of all the awesome, useful shit you've ever made, the thing that finally became famous was this stupid little site."

Continue reading 886 words...

Making Mutt Useful Offline

I've been using mutt as my MUA for over 8 years now. Long ago I would ssh to my server and run it on local Maildirs, but as soon as I started using smartphones and multiple computers I had to switch to an IMAP+SSL setup. Mutt's header_cache option has long made accessing large mailboxes snappy, and the recent message_cachedir option available in 1.5 makes browsing through messages with attachments equally snappy over IMAP.

A useful side effect of message body caching is that it provides an offline copy of entire mailboxes which get synchronized automatically and can easily be read in Mutt as a local mailbox… well, almost.

Continue reading 379 words...

My history with OpenBSD

I received an e-mail asking me how I got started with OpenBSD, so I thought I'd write the answer here in case anyone else wanted to read it.

I started using OpenBSD in 1998 (version 2.3 or 2.4) to host a BBS that I was running. I chose OpenBSD because of its security record and because I was getting fed up with Linux (Slackware) at the time. I think the machine was a Pentium 75 or something, and OpenBSD worked quite well on it. During the course of building the BBS, I had to install some 3rd party software, so I got interested in OpenBSD's ports system to make installation of that software cleaner. I submitted some ports to the ports@ mailing list and got them committed by other developers. I tested others' ports and supplied feedback where I could. I hadn't done much unix development back then, so writing simple makefiles for ports was an easy way to get involved.

Continue reading 1,175 words...

acpithinkpad

I started working on an ACPI driver this evening to make my ThinkPad X61 work better under OpenBSD. I just finished it and so far it matches on the IBM0068 ACPI HID device, checks it for the appropriate version, enables the Bluetooth device (which is required before the hardware toggle switch can power it on and let the ubt0 device show up), and sets up a callback to run whenever a special button (e.g., Fn+F[1-9], brightness, ThinkLight, etc.) is pressed. I'm pretty sure it will work on most other ThinkPads but I haven't tried it on my X40 yet.

I mapped out all of the events that get generated, which on my X61 Tablet include the screen rotating around, the lid opening and closing, and even the pen being ejected from its little slot. When the brightness buttons (Fn+Home and Fn+End) are pressed, it sends a CMOS command through ACPI to actually adjust the screen brightness accordingly, so now it's working just like my X40 did on its own. Being able to turn the brightness down when on battery is the main reason I wrote this.

Continue reading 401 words...

November 24th, 2007

Friday afternoon I decided to install a package on one of my OpenBSD servers, but it was from a recent snapshot and the snapshot I was running on the server was too old to run it. No problem, I'll just upgrade the server. a usually quick task; just drop a new kernel into /, reboot, untar the new disk sets over /, run mergemaster and reboot again.

Remotely rebooting servers that are 350 miles away is always a nerve racking experience. You reboot it, your SSH connection drops, you start a ping waiting for it to reply as you visualize it booting up and thinking about how long each piece usually takes. Occasionally something takes longer than normal and you start to panic, but before you reach whoever you need to reach, it starts responding and suddenly a wave of relief comes over you and you resume your work.

Continue reading 1,638 words...

August 18th, 2007

I had to install an OpenBSD firewall at a customer's office yesterday and wanted to check that all of their VoIP phones still worked afterwards. Since everyone had left the office by the time I got there, it was a bit tricky testing all of the phones at the same time by myself.

I thought about writing a little routing snippet on the Asterisk server so I could dial a number at each phone and it would just play music until I hung up, but I wanted to make calls out to a PSTN number to double the bandwidth going out of the PBX server and make sure the voice quality was ok.

Continue reading 329 words...