projects | github | twitter | rss | contact
July 2018

Adventures in Open Source

posted to writings on jul 5th, 2018 with tags crystal, nerd, openbsd, and ruby

In the past couple weeks I contributed to a bunch of different open source projects in different ways and I thought I'd write about some of them.

I switched from Dropbox to Syncthing a while ago and so far it's been pretty great. I run it on my macOS server in the basement which mirrors everything on its large disks, and also on my various laptops where I selectively sync certain directories that I need.

Continue reading 1,507 words...

June 2018

Fetching node status from AirPort APs

posted to writings on jun 12th, 2018 with tags apple, nerd, netbsd, and ruby

Seven years ago, I hacked together some code to update my Ecobee WiFi thermostat temperature depending on whether I was home. While my newer Ecobee thermostat has room occupancy sensors that make this tracking automatic, back then I had to poll my WiFi access point through SNMP to look for my phone's MAC address in its table of associated clients.

Recently I needed to do something similar to pass to my Z-Wave controller but it seems that Apple has removed SNMP support from its Airport Extreme firmware some time ago.

Continue reading 599 words...

November 2017

Switching from 1Password to Bitwarden

posted to writings on nov 17th, 2017 with tags firefox, nerd, openbsd, ruby, and security and commented on 20 times

I've been using an OpenBSD laptop as my workstation a lot more lately, probably because most of my hardware just works now and I don't have to think too much about it. The touchpad works when I touch it, I can be confident that when I close the lid, the laptop will fully suspend and then fully resume again when I open it, WiFi works all throughout my house (although it's not terribly fast), and my web browser is fast and stable. What amazing times we live in.

In the past, one thing that frequently kept me going back to my Mac, aside from iOS and Android development, was 1Password. I have a ton of logins for websites and servers, and because my browsers are all configured to clear cookies for most websites after I close their tabs, I need frequent access to passwords synced across my laptops and phones, and 1Password has great apps for all of those except OpenBSD.

Continue reading 1,534 words...

April 2015

Creating a BBS in 2015

posted to writings on apr 2nd, 2015 with tags nerd and ruby, last updated on mar 28th, 2015

Although it fooled nobody, yesterday for April Fools' Day, Lobsters users that normally saw a boring list of story titles and links were greeted with a BBS-style interface to the site complete with story and comment browsing, private message reading and sending, and a multi-user chat area.

The BBS remains active at https://lobste.rs/bbs (you can login as "guest").

/images/notaweblog/2015-04-02-welcome.jpg

Continue reading 2,748 words...

April 2012

Counting Pull-ups

posted to writings on apr 25th, 2012 with tags fitbit, nerd, openbsd, and ruby

I'm a big fan of my Fitbit pedometer because it does most of its work without any interaction. I clip it onto my pocket and it counts my steps and flights of stairs as I walk throughout the day, then automatically, wirelessly uploads the data to Fitbit's website whenever I'm within range of its USB dongle plugged into one of my computers. The whole thing works without having to think about it or plug anything in. The battery lasts for about a week, and when it finally runs low, my low battery notifier sends a message to my phone through Pushover telling me to put it on its charger for a few hours.

To add to my step data, I got a Withings scale last year which logs my weight and BMI on Withings' website automatically every time I step on the scale. Fitbit's website syncs this data from Withings, so now I'm able to track my steps, flights of stairs, weight, and BMI, all automatically, all on Fitbit's website. I use this data mainly as a motivation to walk more and not get fat, just as my Wii Fit motivated me to exercise every day by tracking all of the data. When I know my Fitbit is counting my steps, I'll avoid hopping on the bus or train to get home and just walk. A few times I've left the house and upon noticing my Fitbit wasn't there, walked all the way back and got it just so the steps I was going to take that day would "count".

Continue reading 873 words...

March 2012

Building Pushover

posted to writings on mar 16th, 2012 with tags android, ios, iphone, nerd, pushover, ruby, and superblock

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,047 words...

August 2011

An Ecobee Automation Hack

posted to writings on aug 29th, 2011 with tags apple, ecobee, nerd, and ruby

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. Also, while Ecobee's website touts its "green" features and energy savings, working from home has always meant being unable to use automated work/home schedules and instead having to hold the same temperature all day. 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,116 words...

April 2010

Properly stopping a SIP flood

posted to writings on apr 11th, 2010 with tags asterisk, nerd, openbsd, ruby, security, superblock, voip, and work

At about 9am yesterday morning, I noticed on the 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 831 words...

September 2009

ruby, snow leopard, and dl

posted to writings on sep 3rd, 2009 with tags mac, nerd, and ruby

more snow leopard breakage: ruby compiled for a 64-bit processor crashes when doing certain calls through the dl module.

the gd2 ruby module (which just dlopen's the gd2 c library) calls gd2's gdImageStringFTEx function which crashes the ruby interpreter. apparently this is an old issue that is still unfixed in the ruby shipping with snow leopard (1.8.7p72; why so old apple?) or any 1.8.7 for that matter. even after ripping out the old ruby and installing the latest patchlevel (174), it still crashes:

Continue reading 159 words...

May 2009

benchmarking cpus for no good reason

posted to writings on may 21st, 2009 with tags nerd, openbsd, and ruby

adding integers 10 million times shouldn't take that long, should it?

openbsd 4.5 amd64 - 2.4ghz intel core 2 duo (thinkpad x200) - ruby 1.8.6 p368

Continue reading 347 words...

February 2009

static files with apache 2 + mod_proxy + mod_rewrite + mongrel + rails

posted to writings on feb 22nd, 2009 with tags apache, nerd, openbsd, rails, and ruby

corduroy does everything over ssl and because of that, it was noticeably slow on my openbsd laptop with firefox 3. using tamper data, i was able to observe that firefox was not caching any of the stylesheets or javascript files, so on every page load it would have to re-fetch these few files (one of them being prototype at a hefty 28kb post-gzip). that ultimately seemed to be a quirk in firefox on openbsd since the same setup with the same version of firefox on my mac was caching them fine and safari was as well.

with the help of rails' stylesheet_link_tag et al. appending urls with "?1214348293", i was able to use apache's ExpiresActive to force very long expiration times on these static assets:

Continue reading 626 words...

January 2009

syncing itunes music with the android g1

posted to writings on jan 26th, 2009 with tags android, g1, mac, nerd, and ruby

i finally got around to putting music on my g1 and wanted a simple way of synchronizing an itunes playlist with a directory on the g1's sd card while it was connected over usb, just like my iphone used to once it was docked.

i found synctunes which is free (though not available on the author's site anymore for some reason) but it didn't preserve any directory structure on the destination and just lumped all of the files into one big directory.

Continue reading 364 words...

December 2008

god god

posted to writings on dec 7th, 2008 with tags nerd, openbsd, rails, and ruby

i'm using god on openbsd (kqueue) to monitor a dozen mongrel processes for various rails sites on one of my servers. i started using it just to have a simple way of restarting each collection of processes when i need to load new code or just start them when the machine boots up. eventually, i added cpu and memory checks to kill processes that go stray for too long, which doesn't happen that often.

however, now the task that constantly uses too much memory and cpu is... the very task that is supposed to be watching for tasks using too much memory and cpu.

Continue reading 198 words...

May 2008

stop the world, i want to get off

posted to writings on may 7th, 2008 with tags activerecord, FUCKFUCKFUCK, rails, and ruby

activerecord, your default and static :force => true setting has fucked me over for the last time.

i don't understand why anyone would make a default option eat all of your database tables.

Continue reading 91 words...

April 2008

full tilt boogie

posted to writings on apr 9th, 2008 with tags activerecord, corduroy, quickbooks, rails, ruby, superblock, and work

"we" have been working pretty hard lately on corduroy, a web-based billing system for small businesses. the live demo site is available showing off its features and functionality and the signup system will be ready shortly to start taking subscriptions.

i started writing corduroy years ago out of a personal need for a billing system for superblock. i tried quickbooks and hated it; all i wanted was a simple system for making professional-looking invoices and keeping tabs on my accounts. so, i quickly ditched quickbooks and started writing a web-based system in ruby on rails which i have been using ever since.

Continue reading 399 words...