Monday, February 27, 2017

Spring, 22 days Early

Yesterday, Shira and I did some running and hiking on the Potomac Heritage Trail near Riverbend Park.

Everywhere you looked you saw bursts of green drinking in the shower of unobstructed photons. It's only a matter of time before the trees catch up and again reduce the forest floor to a shade only environment. Until then, however, patches of green are thriving. It's quite the sight to see.

Weekly Discoveries: An Epic Breakup Song, A Never Give Up Anthem and a Mighty Fine Waltz

Last week's most clever music video has to be Dearly Departed by Shakey Graves. Sure it's dark, but it's also hilarious and really well done.

I'm loving the sound of The Avett Brothers, but I'm so confused. The imagery from their videos is 1970's, yet they've only been around since the 2000's. Why would anyone aspire to look like My Dad's generation? (No offense Dad; you looked great back in the 70's).

Also included in this most recent set of discoveries: a Waltz. Not sure I've ever found myself rocking out (OK, probably more chilling out) to a Waltz, but there you go.

Listen to them all here.

Friday, February 24, 2017

Chess in a Hurry | Cheat Sheets for Playing Chess Now

On past trips to Boston, our nieces and nephew have seen the over-sized chess set that's situated in the hotel where we often stay. They've expressed interest in playing, but we've never done so. While I had some hazy sense of how to play, I always thought of chess as a complex game and one that would be too hard to explain to them. This past weekend, however, I had a chance to play chess with a 7 year old and it finally clicked for me: this is fun stuff! I finally had a chance to see past the minutia, and started enjoying the actual game.

While all this was fresh in my head, I wanted to collect up some simple resources I could be armed with next time I had the chance to play chess. Here's what I came up with:

Just yesterday, as David and I finished up a run I noticed an over-sized chess board just crying out for us to play. With the above resources at hand, there's no excuse for not diving in and playing.

Wednesday, February 22, 2017

30 Seconds to More Identifiable Luggage

What follows isn't a life hack, clever trick or road warrior tip. What follows is common sense.

All things being equal, I'm glad to check my bag when traveling. The last few times I've flown, I've considered ways to optimize identifying my bag . In my mind's eye, I could imagine 3D printed, Raspberry Pi luggage tags, with a QR code or NFC tag embedded. Instead of all this nonsense, for our last trip, I hastily tied a strip of orange fabric to each handle of the bag. Here's an action shot:

It was ugly, and perhaps a candidate for /r/RedneckEngineering, but boy did the technique work. When I our bag was pulled aside and tucked into a corner at baggage claim, I still had no problem identifying it from a distance. And had I needed to ask a baggage handler to look for the bag, it would have been straight forward to send them after the one with bright orange flagging tape on it.

Simplicity for the win. Why didn't I do this years ago?

In hindsight, I recall that years ago my grandparents (Z"L) had a yellow ribbon tied around their car's radio antenna to help them find it in a parking lot. At the time I thought, oh how cute. Now I realize (a) they were smart, and (b) I'm old.

Tuesday, February 21, 2017

Weekly Discoveries: Some Sad Songs, Some Rocking Songs and One Classic Piece of Poetry

I found Aquilo's Silhouette to be a remarkably touching song, with a powerful video to match. I'd never heard of the group Aquilo, and was hooked by half-way through this first song.

And no doubt about it, this is how you sell perfume. I won't claim to 'get it,' but it's an impressive performance regardless.

And speaking of not getting it, I have no idea what's going on in this Korean music video. But I'm really impressed that they made a video that's optimized for portrait viewing on a cell phone. That's some clever work, right there. It reminds me of the Facebook Live ads that take the defect of people shooting video in the wrong orientation, and embrace it as part of the product's brand.

I know it's hardly a 'discovery' for anyone (what with 20 million views and all), but I really do get a kick out of Sia's Move Your Body video. She's created quite the playful little story arc, all while paying tribute to the 80's.

Watch all the discoveries here:

Thursday, February 16, 2017

Tiny but Surprisingly Hot - A Tea Light Powered Stove

Whether it's for back-country use, power outage preparedness or just to indulge the Pyromaniac Boy-Scout within, I've experimented with a number of portable stove designs. While doing some research I got curious: could you power a stove on tea lights alone?

Obviously, one tea light won't do much. But what if you had a whole bunch?

Step 1. Check YouTube. And what do you know, here's proof that you can cook with tea lights.

Step 2. Buy and eat 4 cans of tuna. The simplest 'stove' I could think of was a sheet of aluminum foil, a few empty tuna cans, the tea lights and a pot on top.

Step 3. Try to cook an egg! I organized 5 tea lights and 4 tuna cans and lit it all up:

I pre-heated a frying pan for 5 minutes and then cracked an egg into the pan:

I covered the pan and checked in a few minutes later:

And to my surprise, the egg was partially cooked.

Ultimately, I let the experiment run for about 18 minutes. And when I was done, I had an overcooked egg:

So the process was slow, but definitely effective.

Step 4: Improvise a crock pot. Cooking eggs is fun and all, but I wanted to step things up a bit. I filled a casserole dish with about 3 cups of water, lit the same 5 candles, covered it, and let it 'cook.'

At nearly 4 hours, 3 out of the 5 candles had burned out. The water was almost 160°F. From a quick Google search I see that a crock pot on low cooks at around 190°F. So I wasn't quite there, but I was too in the neighborhood.

I have to say, I'm really impressed by these results. With almost no effort, and about 70 cents worth of fuel, I was able to nearly approximate a slow cooker. If I added a few more candles, and swapped them out at 3 hours and 45 minutes, I could probably have a functional slow cooker.

The final test is to actually make a more complex dish using this setup. Alas, I don't have time for this experiment today, but I will keep my eyes out for the right recipe to give this a shot with. And then we can find out just how bad an idea this is.

Wednesday, February 15, 2017

Junk In My Trunk: The Car Kit v1.0

This past weekend a friend mentioned that she was equipping her car with an emergency kit, and knowing my love of all things preparedness, was curious what was in mine. I rattled off some items, but it's been too since I've really considered the question. Not checking in on this sort of thing regularly leads to driving around assuming you don't have something, but do, or worse, assuming you have something but don't.

Besides, we have a relatively new car, so it makes sense to do an inventory and make sure it passes muster.

Before I dive into a tour of the goodies, here's a few points of philosophy to consider. First, you'll see that for all my chatter about preparedness, I actually try to keep things fairly lean. You could easily fill up your car's trunk with items based on What-If scenarios. I try to pick specific scenarios I want to be ready for, and leave the rest to improvisation.

Second, I'm not a fan of redundency. If I can carry something in my man-bag, I'll choose that over carrying it in my car. And I can find a way to carry it on my key-ring, I'll choose that over my man-bag.

Finally, I hate storing batteries and other perishable items in my car kit. Inevitably, they go bad due to heat, cold or time.

OK, let's get to it.

First up, the driver and passenger side Oh $#!? Handles have Res-Q-Me's zip-tied into place. The Res-Q-Me is a vehicle escape device, and according to YouTube they work. Given how cheap, small, effective and valuable they are, I'm fine putting them in the car even if they never get any use.

Next up, there are a few essentials in the glove box. Mainly, a Swiss Army Knife, tissues, a tire pressure gauge and some heavy duty produce bags. The produce bags are used as puke bags. I speak from experience when I say they work, and work well.

And finally to the trunk:

Items include: a backpack with emergency gear (more on that below), jumper cables, sun screen, bug spray, and a picnic blanket. The sun screen, bug spray and picnic blanket are for when we arrive at a hike or other outdoor activity and realize we've forgotten some essential. The jumper cables are self explanatory. And here's the contents of the emergency bag:

Items include: a large plastic drop cloth, which among dozens of other uses, is handy for dealing with messy passengers or cargo. A neutral colored sweatshirt, which actually gets quite a bit of use when we show up to restaurant that has the AC cranked way up. There's a bunch of glow sticks, which provide a battery free form of light. There's one of my Version 2.0 Hiking Kits, which provides first aid essentials, among other things. The cord, duct tape, towel and garbage bags are multipurpose items.

There's a 15' piece of 1 inch tubular webbing, which is rated to 4,000lbs of force. I imagine this could be useful for an improvised/temporary tow-rope if need be.

There's a zip lock baggy with toilet paper, an extra Bic lighter and a compass. Without a compass, how are you going to possibly flee the zombies?

Finally, there's an AMK emergency bivvy. Every once in a while we get a nasty enough storm that people are forced to shelter in place in their cars. It's unlikely, but at times like that, the bivvy could be pretty dang essential.

Not shown are 6 tea light candles rolled up in a large square of heavy duty aluminum foil. The candles are a battery free source for heat and light.

Finally, this was useful exercise for me if only to familiarize myself with the latest Acura flat tire solution: a tire repair kit:

Gone are the days of discovering that along with a flat tire, you also have a flat spare. Whoo!

So, let's review: tool to help extricate yourself in a catastrophic car accident? Check. Vomit bag for a car sick kid? Check. Jumper cables to deal with a dead battery? Check. Tire repair kit to deal with a flat? Check. Supplies to make it through a miserable night on GW Parkway awaiting rescue? Check. Duct tape and a pocket knife to conquer all other challenges? Check and check.

Safe travels!

Tuesday, February 14, 2017

The Surprisingly Simple Way To Control Your Home From an Acura ILX

Like any self respecting 40 year old geek, I've got a heap of defunct hardware that I've collected over the years. I keep said pile around because I have dreams of finding just the right bit of ancient tech to perfectly solve a problem. Usually, this doesn't happen, but I like to keep the dream alive.

Last week I was fiddling around with detecting radio signals of in-home devices. It occurred to me that our Acura's have always come equipped with HomeLink buttons, designed to remotely operate a garage door. We don't have a garage, much less a garage door opener, so we've never used this feature. Yet, what if I hijacked these signals and instead of opening a garage door, I detected them using an SDR dongle connected to a Raspberry Pi. I could then use the Pi to control other devices in our home.

Sure, it would be a significant effort to hack this together, but when I was done, I'd have my home and car connected.

I started Googling around, and to my amazement came across discussion of X10 and HomeLink integration. X10 is an ancient (at least since I was in college, in 1998) standard for remotely controlling lights and appliances. Back around 2000, I was on a total X10 kick, and tried various configurations to automate our apartment at the time. Eventually, we settled on remotely controlling a single light in the bedroom, which we use to this day. Every night before bed, we hit the X10 controller to turn off the last light in our bedroom.

Suddenly, this was all starting to make sense: the X10 probably broadcasts on a similar frequency to a garage door opener. That's probably a required standard. And HomeLink doesn't know anything about the signal it's setting, it just allows you to record a given signal and it will re-broadcast it. I didn't need to hand craft a Raspberry Pi solution. I needed to connect up an X10 lamp module, remote and transceiver. That's about $75 worth of hardware. But fortunately for me, I already owned all of these components. To the Defunct Hardware Pile!

It took some digging, but I found all three components and plugged them in. In our front room, I plugged the transceiver into one outlet, a lamp module into another outlet, and a lamp into the lamp module. I put fresh batteries in the remote and to my surprise, the light turned on and off in response to the remote. Whoo!

I then headed out to my car and followed the instructions here to train the HomeLink buttons in my car to send X10 signals. My guess is that the procedure is no different than training a garage door opener, or any other device. The only moment of confusion came when the HomeLink button I trained only turned the lamp on. But that actually made sense, because the X10 remote has one button for turning things on, and one button for turning things off. I simply trained another HomeLink button to be the 'off' switch for the lamp, and that worked as expected.

Who would have thought that 17 year old tech would pair perfectly with the latest Acura ILX?

The project that I thought would take weeks of effort to organize was implemented in about 15 minutes. All that's left to do is purchase a reasonably nice looking lamp we can put in our front hall, and to program Shira's Acura RDX. Then when she pulls into the driveway on a dark winter night, she can turn on a light in the house with a simple button press.

(Hey look, I accidentally made my wife a geeky Valentine's Day gift. Oh defunct hardware pile, what would I do without you?!)

Monday, February 13, 2017

Weekly Discoveries: Tin Whistles, Hang Drums and a Home Made Cup-of-Soup Ramen

I don't get it: how can this hang drum video have 22 million views? I mean it was good, but 22 million views good?

And here's a novel take on Barbecue: Food of the Enslaved: Barbecue. Think of it as better food through understanding history.

And finally, unexpected music video of the week goes to I Love You More Than You Love Yourself, which portrays the Lisa Nowak story. The artist behind the song explains:

The video is based on NASA astronaut Lisa Nowak. What drew you to her story?

Austra: I was kind of upset with the way her story has been portrayed. There’s a photo of her in her NASA spacesuit, looking very wholesome and happy. I found it so insensitive that there was no regard for the fact that she was a NASA scientist who went to space before the age of 30. She’s a total genius! Lisa had a breakdown, and I don’t think there was any compassion for mental health at all in her story and in the (media) narrative (surrounding it), so we wanted to try, in some ways, to give her a bit of justice.

Check out all the videos:

Thursday, February 09, 2017

The Signal Beacon In Your Pocket

Yesterday's experiment listening to nearby gas and water meters got me thinking about tapping into other devices that emit radio signals. One such tiny device is the clicker on my car's key fob. This is more technically known as a Remote Keyless System, and operates on the well known frequency of 315Mhz.

Visualizing these signals is almost trivial. I kicked off SDR Touch, tuned it to 315Mhz and pressed the clicker. Here's a screencast showing the result:

As you can see, clicking the key fob causes a noticeable burst of activity.

So now what?

Capturing this data is easy enough, and analyzing it shouldn't be too difficult either. Here's someone who did just this. And once you've analyzed it, it seems like it would be simple to write some code to detect this signal and take action. I can imagine a Raspberry Pi + SDR Dongle sitting around waiting for my key fob clicks.

It also doesn't take much imagination to see nefarious uses of both capturing and re-sending these key less entry signals. But I'll leave those exploits to others.

I can imagine a more MacGyver'y type hack where your key fob is turned into a signal beacon. It plays the role transmitter, while SDR Touch is the receiver. Let's say you wanted to signal someone in the next room. If your accomplice has SDR Touch open, then a simple press of your car's remote is all it would take to send them a message. Just agree ahead of time on what the pattern of bursts mean, and you're all set. Think 007 on the very cheap.

Finally, it's worth noting that these short range, 315Mhz transceivers are actually dirt cheap. Consider this one on sale on Amazon for $5.00. I could imagine swapping out the foot pedal in my last project with one of these transceivers. Then I could have a key fob clicker that controlled emacs. How cool would that be?!

Wednesday, February 08, 2017

The Very Chatty Gas Meter

I tend to think of Software Defined Radio as a dirt cheap, and extremely portable way to listen to radio chatter. However, it's far more generic than that: it can pick up a whole range of radio signals, and with the right decoding software, pull useful data out pf thin air. For example, you can pull down real time flight info or weather satellite imagery. And my latest discovery: you can discover your home's power usage.

There's a catch to this, though. You need the right type of power meter, specifically one that broadcasts your usage data to anyone who's listening. While this sounds like an esoteric requirement, it's actually quite sensible. Power companies use this style of meter to replace walking house-to-house to collect data, with a driving through your neighborhood instead. This strategy of using low power transmitters as a way to streamline data collection is a brilliant hack in its own right. It's far cheaper than hooking up every meter to the Internet (though, I assume we'll get there), and far less labor intensive than going door to door.

If you have such a meter, you just need the right software to tune your SDR dongle and interpret the data being sent over the air. Here's just such a tool. I spent about 20 minutes trying to get this setup on Windows and then gave up. I then grabbed my Linux box and had it running in a few minutes.

You kick off rtl_tcp in one terminal, rtlamr in another, and then you wait.

After a minute or two, it spat out a Standard Consumption Message (SCM) to the screen. Whoo! Over about an hour, it issued all of these lines:

$ ./util/go/bin/rtlamr | tee ~/tmp/x.out
11:14:47.876424 decode.go:82: CenterFreq: 912600155
11:14:47.876562 decode.go:83: SampleRate: 2359296
11:14:47.876576 decode.go:84: DataRate: 32768
11:14:47.876587 decode.go:85: ChipLength: 72
11:14:47.876600 decode.go:86: PreambleSymbols: 21
11:14:47.876611 decode.go:87: PreambleLength: 3024
11:14:47.876621 decode.go:88: PacketSymbols: 96
11:14:47.876630 decode.go:89: PacketLength: 13824
11:14:47.876640 decode.go:90: Preamble: 111110010101001100000
11:14:47.876649 main.go:93: GainCount: 29
{Time:2017-02-08T11:18:17.611 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:18:32.111 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:19:18.164 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:19:47.163 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:21:02.161 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:21:35.106 SCM:{ID:XXXX6390 Type:11 Tamper:{Phy:00 Enc:00} Consumption:   47785 CRC:0xFA19}}
{Time:2017-02-08T11:21:47.161 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:22:47.106 SCM:{ID:XXXX6390 Type:11 Tamper:{Phy:00 Enc:00} Consumption:   47785 CRC:0xFA19}}
{Time:2017-02-08T11:23:32.659 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:25:48.156 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:26:50.601 SCM:{ID:XXXX6390 Type:11 Tamper:{Phy:00 Enc:00} Consumption:   47785 CRC:0xFA19}}
{Time:2017-02-08T11:26:59.101 SCM:{ID:XXXX6390 Type:11 Tamper:{Phy:00 Enc:00} Consumption:   47785 CRC:0xFA19}}
{Time:2017-02-08T11:29:05.098 SCM:{ID:XXXX6390 Type:11 Tamper:{Phy:00 Enc:00} Consumption:   47785 CRC:0xFA19}}
{Time:2017-02-08T11:30:47.650 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:31:02.150 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:32:17.149 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:33:32.147 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:34:17.146 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:36:02.644 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:36:02.644 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:37:19.588 SCM:{ID:XXXX6390 Type:11 Tamper:{Phy:00 Enc:00} Consumption:   47785 CRC:0xFA19}}
{Time:2017-02-08T11:38:18.142 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:41:50.583 SCM:{ID:XXXX6390 Type:11 Tamper:{Phy:00 Enc:00} Consumption:   47785 CRC:0xFA19}}
{Time:2017-02-08T11:43:17.636 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:43:32.136 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:44:47.135 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:46:02.135 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:46:47.132 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:48:32.630 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:50:48.127 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:52:47.126 SCM:{ID:XXXX6390 Type:11 Tamper:{Phy:00 Enc:00} Consumption:   47785 CRC:0xFA19}}
{Time:2017-02-08T11:55:47.621 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:56:02.121 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:56:32.120 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:57:17.119 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:58:32.118 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:59:17.117 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T12:01:02.615 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T12:03:18.112 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T12:08:17.606 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T12:09:47.104 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T12:11:02.103 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T12:11:47.102 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T12:13:32.600 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T12:15:48.098 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T12:16:53.985 SCM:{ID:XXXX3239 Type:11 Tamper:{Phy:00 Enc:03} Consumption:    3082 CRC:0xCFC1}}
{Time:2017-02-08T12:16:55.151 SCM:{ID:XXXX3808 Type:11 Tamper:{Phy:02 Enc:03} Consumption:   17074 CRC:0x8213}}
{Time:2017-02-08T12:16:58.039 SCM:{ID:XXXX1202 Type:13 Tamper:{Phy:02 Enc:00} Consumption:   20251 CRC:0x315C}}
{Time:2017-02-08T12:16:58.652 SCM:{ID:XXXX0624 Type:11 Tamper:{Phy:00 Enc:03} Consumption:   23587 CRC:0x1B9F}}
{Time:2017-02-08T12:17:01.540 SCM:{ID:XXXX8036 Type:11 Tamper:{Phy:00 Enc:03} Consumption:   26157 CRC:0xA931}}
{Time:2017-02-08T12:17:02.818 SCM:{ID:XXXX6800 Type:11 Tamper:{Phy:00 Enc:03} Consumption:    7179 CRC:0xE748}}
{Time:2017-02-08T12:17:03.984 SCM:{ID:XXXX3239 Type:11 Tamper:{Phy:00 Enc:03} Consumption:    3082 CRC:0xCFC1}}

Using the protocol and meter docs I see that I'm picking up Gas and Water meters.

The meters bolted to the side of my home have various identifier looking values, none of which appear to match up those I've discovered. That may mean I'm looking at the wrong identifier on the side of the house, or more likely, it means I'm hearing my neighbor's smart meters.

Perhaps if I let this run long enough, I'll pick up some data associated with my home. And then it's only a quick shell script away from tracking and graphing this data.

I have to say, this is a truly eye opening experience. Your utility usage data is just floating out there, waiting to be grabbed and analyzed. All you need is a $20 USB dongle and some basic hacking skills. That's both cool and terrifying, no?

Monday, February 06, 2017

Weekly Discoveries: Chillstep, Reason #1 To Avoid Prison and a Monster 200 Mile Race

This last week I went in search of some new country music, and found aural gold in Stripes by Brandy Clark. It's clever and catchy, what more can you ask for? From there, I found a whole slew of scored woman songs that I adopted as my own power ballads for the week.

Apparently, we're doing this fishing thing all wrong in DC. Check out these guys as they pull monster fish out of the Potomac. Oh, and they're not at some exotic distant location, but are steps from DC Memorials.

And here's Somewhere Over the Rainbow played on an old saw using a violin bow. You've got to hear it to believe it.

I watched (well, mostly listened to) Kerry Ward complete the Bigfoot 200, and I still can't comprehend his accomplishment. That's over 200 miles of near continuous running through crazy terrain. At the end of the video talks about meeting up with his buddy Sammy Hassan who casually remarks that at mile 42 his "left IT band went." Basically, he ran over 150 miles on an injured leg. That is essentially super human. What an amazing testament to human accomplishment.

Finally, I tripped over this Blackmill album, and fell in love. I'm not even sure what this genre would be called. I've seen it referred to as both Chillstep and Drumb and Bass. Doesn't matter what you call it, it's remarkable stuff. So chill, yet so interesting. Next time you've got a multi-hour task needing to get done, press play on this video and get to work.

View the entire playlist

Friday, February 03, 2017

3shrink'ing on a Mobile Device

3shrink is working well in a desktop context, so it was time to spread the love to mobile. Specifically, I wanted to be able to take a resource on my mobile phone and quickly generate a 3shrink code for it. This turned out to be straightforward to do in Tasker.

Much of the heavy lifting is done by AutoShare, a Tasker plugin that links Tasker profiles to your phone's share menu. I used geek mode to allow 3shrink to play nicely with Tasker's HTTP Get action. Finally, I created a Tasker Scene which displays the code, domain and content encoded as a window overlay.

Here's an example of 3shrink'ing a YouTube video:

And here's an example of 3shrink'ing arbitrary text:

You can see these codes work by visiting the relevant URLs: http://projx.3shrink.com/ALN and http://projx.3shrink.com/DN3.

By naming the AutoShrink command intelligently, I can programmatically derive the correct domain from %ascommand. This allows me to have a single 3shrink Tasker Profile which handles any number of domains.

The trickiest part of this project was dealing with the inherent messiness behind Android sharing. AutoShare exposes 3 different variables: %assubject, %astext and %asfiles, which correspond to the subject, text and files being shared. There's no set standard for what will appear in each of these variables. YouTube, for example, stores the video name %assubject and the video URL in %astext. Taptalk, seems like it does the same thing, storing post titles in %assubject. However, it chooses to set %astext to the URL to the post followed by a space, followed by the post title again.

My solution was to examine %assubject %astext as one large string, and if a URL is detected, extract it, otherwise fall back on returning the whole mess. Here's the JavaScriplet that implements this logic:

var text = 
  (local('par1') === 'undefined' ? '' : local('par1')) + " " +
  (local('par2') === 'undefined' ? '' : local('par2'));

var text = text.replace(/[\n\r ]+/g, " ").trim();

var matches = text.match(/(http[^ \n\r]+)/);
if(matches) {
  setLocal('result', matches[1]);
} else {
  setLocal('result', text);
}

I can't tell you how helpful it was to be able to write this code as a JavaScript rather than implementing this using clunky Tasker commands. Of course this solution isn't perfect, as it's biased towards URLs. But generally, if there's a URL in the sharing context that's what I want to capture within 3shrink.

For now I'm completely ignoring %asfiles, though eventually, I'll want to account for this variable as well. For example, I can imagine having a collection of photos I want to share with someone, and 3shrink would reduce all these files to a simple 3 character code.

Up next is to reverse the process: that is, adding support for typing in a 3shrink code and expanding that to the URL or content.

However, for now, this is certainly a step in the right direction. There's just something awesome about being able to share a video, album or article on a Post-It note containing 3 characters:

Wednesday, February 01, 2017

Foot Powered macOS Monitor Hopping

We interrupt this emacs hack for an OS X hack.

Yesterday, after making progress with the Trinket Pro, I grabbed the foot pedal, wire strippers and athletic tape of all things, and connected everything together:

Yes, this is a pathetic build. No, I don't care. I loaded the Trinket with this small program:

#include <cmdline_defs.h>
#include <ProTrinketKeyboard.h>
#include <ProTrinketKeyboardC.h>
#include <usbconfig.h>


const int PIN_SWITCH = 0;    // Trinket pin to connect to switch 
const int LED        = 13;
int   pressed        = 0;
void setup()
{
  pinMode(PIN_SWITCH, INPUT_PULLUP);
  TrinketKeyboard.begin();  // initialize keyboard library
}

void loop()
{
  TrinketKeyboard.poll();
  if (digitalRead(PIN_SWITCH) == LOW)  // If the foot switch grounds the pin
  {
    if(pressed == 0) {
      TrinketKeyboard.pressKey(0, KEYCODE_F8);
      TrinketKeyboard.pressKey(0, 0);  // release key
      pressed = 1;
    }
  } else {
    pressed = 0;
  }
}

Note the use of pressed variable. It's needed to keep the board from sending a stream of key presses when its held down.

With the program above in place, pressing the foot pedal is equivalent to pressing F8 on the keyboard.

My plan was (and is) to wire this into emacs in an intelligent way. Also, I need to find a way to have the pedal respect the current modifier keys. That is, if I'm holding down shift, then it should send Shift + F8. But all that aside, once I had working pedal, I knew which annoyance I wanted to fix first.

OS X's support for multiple desktops is quite solid. If a screen has focus, it's trivial to use key combinations to navigate among desktops. What doesn't have an obvious solution is jumping the focus between screens. This is the sort of thing I found requests for, but not an obvious solution. Here's one I rigged up.

First off, I grabbed Keyboard Maestro, a piece of software mentioned in my search for a solution. Keyboard Maestro looks quite sophisticated and getting my bearings was non trivial. From poking around I learned two important pieces of information. First, the variable %CurrentMouse% contains the coordinates of where the mouse is. Second, when I'm on the 'left' screen, the x-coordinate is negative. Using these facts, I was able to rig up this rule:

By detecting the presence of the minus sign, I can tell which screen I'm on and warp the mouse to the other monitor. Finally, this is all connected to F8, which is sent by the foot pedal.

I can't tell you how gratifying this solution is. Now, when I'm on the right screen, I no longer need to remove my hands from the home row, but can just tap my foot to warp myself to the left screen. And I'm only a foot press away from being back to the right screen. It's so cool.

Tuesday, January 31, 2017

Adventures in hardware hacking: adding foot pedal support to emacs

A few months back I came across this video showing how to control a DSLR with a foot pedal. This re-ignited a long time project I've wanted to try: adding foot pedal control to emacs. How cool would it be to control emacs with not only 10 fingers, but your feet!

Looking more into this, I learned that such an idea was both totally doable and relatively inexpensive. Here's a recipe for exactly what I'd need to realize this dream: USB Foot Switch. The parts were easy enough to order off of Adafruit's website. I'd needed only a $7.00 foot switch and a $10.00 microcontroller.

The instructions promised a build time of less than an hour, however, I was skeptical. My area of expertise is in the software side of things, so clipping wires, soldering and such seems awfully intimidating.

To get around this, I decided to follow the instructions in reverse. First I'd program the chip. Then I'd see if I could get the keyboard behavior working. Then I'd plunge into the soldering side of things. It would take longer, but I'd get to start in my comfort zone.

I figured the best place to start was to get the hello world of programs running on the Trinket Pro chip, an LED blinker. To accomplish this, I followed the tutorial here.

Being an emacs snob, I completely skipped over the IDE instructions and jumped right into using AVRDude. Heck, a simple brew command line installed avrdude. I was on a roll. And then things came to a screeching halt when my attempts to use avrdude gave me various error messages. I googled for solutions, but it was beginning to look hopeless.

So, plan B: I returned to the IDE Instructions. While I had a couple of false starts, the instructions were really quite accurate. Everything seemed to work. I loaded up the blinker program:

int led = 1; // blink 'digital' pin 1 - AKA the built in red LED

// the setup routine runs once when you press reset:
void setup() {
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);

}

// the loop routine runs over and over again forever:
void loop() {
    digitalWrite(led, HIGH); 
    delay(1000);
    digitalWrite(led, LOW);
    delay(1000);
}

Hit the upload button, and poof, I successfully loaded the program into the chip. It was so effortless that I actually dug around and turned on verbose messages just to confirm that it was truly working.

There was only one problem: the program appeared to load, yet the LED on the board didn't blink. What the heck?!

On a whim, I brought up the pin-out of the Trinket Pro 5v:

Upon closer inspection I realized that the red LED I was after was labeled as #13. Aha! I updated my program to set 'led' to 13 and uploaded it to the device. And just like that, I had a blinking Trinket. Whoo!

OK, so I can get my code to run on the Trinket. Next up to was to do something with the keyboard library. I altered my blinking program to be like so:

#include <cmdline_defs.h>
#include <ProTrinketKeyboard.h>
#include <ProTrinketKeyboardC.h>
#include <usbconfig.h>

const int PIN_SWITCH = 0;    // Trinket pin to connect to switch 
int led = 13;

void setup()
{
  pinMode(led, OUTPUT);
  TrinketKeyboard.begin();  // initialize keyboard library
}

void loop()
{
  TrinketKeyboard.poll();
  digitalWrite(led, HIGH);
  TrinketKeyboard.print("Hello World!"); // use for string instead of char
  delay(5000);
  digitalWrite(led, LOW);
  delay(3000);
} 

Along with toggling the LED, it spits out the text Hello World every 8 seconds.

I pushed the program the Trinket, and lo-and-behold, it worked! Now, it was a particularly useful program, but it did show that I was able to get the Trinket to simulate a keyboard action.

The final task I wanted to try was to have the board generate Hello World in response to a circuit being closed. After all, the switch is just a fancy way of grounding pin #1. At this point, any hardware geek would have busted out their soldering iron and gotten to work on finishing this project. But I wasn't quite ready to go there. I grabbed a few short lengths of wire and crudely attached them to the board by winding them into place:

I then installed the following program on the Trinket:

#include <cmdline_defs.h>
#include <ProTrinketKeyboard.h>
#include <ProTrinketKeyboardC.h>
#include <usbconfig.h>

const int PIN_SWITCH = 0;    // Trinket pin to connect to switch 
const int LED        = 13;
void setup()
{
  // Set button pin as input with an internal pullup resistor
  // The button is active-low, they read LOW when they are not pressed
  pinMode(PIN_SWITCH, INPUT_PULLUP);

  TrinketKeyboard.begin();  // initialize keyboard library
}

void loop()
{
  TrinketKeyboard.poll();

  if (digitalRead(PIN_SWITCH) == LOW)  // If the foot switch grounds the pin
  {
    TrinketKeyboard.print("Hello World!"); // use for string instead of char
    digitalWrite(LED, HIGH); 
    delay(3000);
    digitalWrite(LED, LOW);
  }
}

With the Trinket plugged into my Mac via the USB cable, I ever so carefully touched the two exposed wires together. And to my amazement, Hello World blurted out on the screen. I tried again. And again. Success!

The end of the project is now in sight: I need to wire in the foot pedal switch and update the program to send a keystroke rather than a chunk of text. And then I need to figure out what bit of magic I want emacs to do when I hit the foot pedal. Hopefully that will be the hardest part.

Man, this Arduino hacking stuff is fun!

Update: While I had visions of using the pedal to power emacs, my first real use was a macOS hack.

Monday, January 30, 2017

Appioo African Bar and Grill

This past weekend we had a real treat: we got to try Ghanaian food for the first time. And best of all, we had friends of ours from Ghana to help lead the way. The restaurant was Appioo African Bar and Grill, and we all walked away quite satisfied.

While vegetarianism isn't a common practice in Ghana (or so we were told), the restaurant has an excellent selection of veggie choices. I tried a veggie version of Waakye, while Shira had Nkontombre (spinach stew). The kids also went for Waakye, though they included various meat selections.

Shira's dish was reminiscent of Ethiopian cuisine, whereas the rice and beans of Waakye corresponded more to Mexican food. I was surprised to see that the food was served without bread (such a universal staple in so many countries) but our Ghanaian friends weren't surprised by this, apparently that's par for the course.

My meal was tasty, but the fried plantains were by far the big winner. Though, who doesn't like fried bananas?

We're truly lucky to live in an area where you're only a 15 minute drive from a brand new cuisine. Our server couldn't have been more nice or more helpful. Next time you're looking for something a little different head over to Appioo and enjoy!

Weekly Discoveries: Bipolar Sunshine, Houndmouth and a Medicine Chant

A big thanks to friends for the Houndmouth recommendation. And how about that one armed trash bag technique?

Yesterday I had my 3rd Yoga class experience, which explains the 3 hours of Yoga music on the list. The class is absolutely fascinating and compares and contrasts well with my Krav experience. Either way, I'm back to feeling like an uncoordinated oaf. At least I'm getting some new musical inspiration from the class.

Enjoy!

Thursday, January 26, 2017

Packt Publishing's Free Book Of Day, Command Line Edition

My friend Nick recommended I check out Packt Publishing's free eBook of the day. To my surprise, the books offered there are the real deal. Today's book, for example, is Learn Penetration Testing with Python, a book I find interesting, but couldn't justify forking over actual cash for.

Now I suppose most people would simply bookmark the page and move on with their life. But for some reason, perhaps the technical nature of the site, I figured I could use this as a hacking opportunity (a hackertunity, if you will). Specifically, I wanted a command line tool that would echo to me the current free offer.

I give you: packtfree:

#!/bin/bash

##
## command line utility to retrieve the current free
## book from packt publishing
##

url=https://www.packtpub.com/packt/offers/free-learning

clip_url () {
  echo -n $url | clip
}

while getopts ":uc" opt ; do
  case $opt in
    u) echo $url ; exit ;;
    c) clip_url ;  exit ;;
    \?) echo "Usage: `basename $0` [-uc]" ; exit ;;
  esac
done

clip_url
curl -s $url | pup  '.dotd-main-book-summary h2, .dotd-main-book-summary div:nth-child(4)'

And running it produces:

$ packtfree
<h2>
 Learning Penetration Testing with Python
</h2>
<div>
 Utilize Python scripting to execute effective and efficient penetration tests
</div>
$ packtfree -u
https://www.packtpub.com/packt/offers/free-learning

One non-obvious feature is that running packtfree places the URL to the free book on the system clipboard. This makes it easy to switch to a browser of my choice and paste it if I want to redeem said book.

While this is a pretty obvious example of over-engineering a problem, it does address a challenge that I really haven't had a good answer to. What's the best way to work with HTML data on the command line? For text, you've got sed, awk and countless other old school Unix utilities. For json, the clear winner is jq. But what about HTML / XML?

In the past, I've used tools like w3m to convert HTML to text and hack away from there. But that's always a compromise.

Doing a fresh search for this challenge turned up pup, which is a fantastic command line tool for extracting and manipulating HTML. It's exactly what I was searching for, and unlike some XML tools, had no problem working with the real-life content over at packtpub.com. Nearly the entire script above is setup, with the main functionality being this sweet one-liner:

curl -s $url | pup  '.dotd-main-book-summary h2, .dotd-main-book-summary div:nth-child(4)'

pup is definitely going in my command line toolbox.

Look at that, Packt books are already teaching me something, and I didn't even have to read one.

Wednesday, January 25, 2017

A Most Satisfying Treat

There's something profoundly satisfying about cracking open a fresh coconut. Maybe it's the fact that step one involves going into the basement to retrieve a hammer and awl (and step two involves dousing said tools in Everclear to make them at least somewhat sanitary). Or maybe it's that solid cracking sound. Either way, today's treat was both fun to open and tasty to eat.

The jury is still out on my taste for coconut water. On one hand, the slightly sweet taste is good, and the fact that it has health benefits is a nice bonus. On the other hand, it does taste like warm dishwater, so there's that.

I recall my first run-in with coconut water. It was in Punta Cana, 7 years ago. I was psyched that I scored a coconuts with a straw being offered by the resort. I took a big 'ol pull, only to be met with an off-tasting liquid. I recall thinking: surely people don't actually drink this stuff, do they? I've grown since then.

It seems like everyone has their own hack for accessing coconuts. Ultimately, it was these two videos that got me access to the one above. The first video is quite exhaustive, while the second video is a quicker and easier method. Either way, the results are more or less the same.

Happy Cracking!

Tuesday, January 24, 2017

Review: Show Your Work

I learned about Show Your Work from a bag dump of all places. Fortunately, the library had it, so it was easy enough to get my hands on.

For reasons I can't fully explain, I started off reading the book with a bit of a negative attitude. Who was this Ausin Kleon character to dispense pithy bits of wisdom; every chunk he offered up I mentally tried to find fault in.

And then at around page 40 it hit me: nearly every bit of advice he was offering was something I was already doing and fully believed in. Have a place on the web that's not connected with a social network? Check. Share your discoveries with others, instead of hording them. Check. Read obituaries. Check (see rule #1). Share every day. Check. And so on. It's almost scary how much of Kleon's advice I can get behind. In a number of cases, he gave voice to a habit or behavior I intuitively knew was a good thing but hadn't found the words to express.

For someone like myself who attempts to blog every work day, Share Like An Artist is both confirmational as well as inspirational. I already know the value of publishing every day, but with Share Like An Artist I have a few fresh approaches I can take to finding meaningful content. He also provides solid guidelines to help you keep from publishing junk, something that's awfully easy to do on the web. I found the diagram on page 124 to sum up the challenge well:

(Under Sharing - Hoarder)
(Smart Sharing - Contributor)
(Over Sharing - Spammer)

Perhaps it was the short, anecdote filled nature of the book that started me off on the negative path. This sort of book is intentionally short and readable, but that can also come off as flimsy and disposable.

In many respects, it reminds me of a discussion I had about The Dip a number of years ago. I found that tiny volume to be nearly life-altering. Yet the person I was chatting with dismissed it as nothing more than an obvious, lengthy, blog post. Quick books like these may be easy to dismiss, but in both The Dip and Share Like an Artist, there really is quite a bit of value packed into relatively few pages.

Both books are worth reading and re-reading.

Now, go share something.

Monday, January 23, 2017

A Hacker's Guide To The Dip

While searching around for an old post, I discovered this draft I originally composed on 6/26/2007. Nearly everything written below I still agree with. I can't imagine why I didn't publish this back in 2007.


Seth Godin's latest book, The Dip is a must read. In it, he describes the typical flow of a project: things start off fun and exciting, and overtime, become difficult. The fun goes away and all that's left is the work. This stage of the project is called The Dip. Seth's book explores this concept and makes valuable recommendations for dealing with it.

It occurred to me that most large programming projects fit this model to a tee. If you take on a complicated enough project, whether it's for business or pleasure, you're going to hit a stage where it's simply not much fun anymore. Here are some of my preferred ways to deal with this fact of life. I'd love to add yours to the list, so mention them in the comments. Thanks!

A Hacker's Guide To the Dip

  • Expect It. This is a key point in Seth's book: projects are going to have a dip associated with them, so decide up front if you are ready to go through it or not. If not, quit while your ahead.
  • Embrace It. This was a fairly surprising idea that Seth presented: The Dip is actually a very good thing. Long story short, it will keep out all your competitors. If you are struggling like heck to get a cross platform UI to work, then, the good news is, so are your competitors. Pick a tricky problem and nail it. If you've got a big dip, then you've got plenty of protection against other hackers.
  • Have Fun. I admit it, I like to program in Scheme because it's fun. That's not the only reason I do it, but when facing the fact that I've got plenty of hours of programming ahead of me, it's nice to start off with something that's just plain fun. Chuck Moore, the inventor of Forth has even advocated a fun-down approach to programming (see chapter 3 of Thinking Forth).
  • Little Victories. Rather than facing the huge goal of a finished and shipped project, setup small victories that you can accomplish. These may be things as simple as saying: I'm getting Tomcat setup today. Fight The Dip by making itty bitty dips that you regularly beat.
  • Write Only Mode. What to do when you're working on some tricky aspect of a project and more requirements start flooding in? This only makes The Dip larger. For this, I typically create a Wiki and start documenting each request. I don't think, evaluate or prioritize them - I just record them and continue on with what I'm working on. When I've gotten to my next victory and am ready to face more of The Dip, I can go back to the list.
  • Demand Flow. Flow is that intoxicating state where time seemingly stops and work just gets done. It's glorious. The Dip disappears during flow. Make sure you setup an environment which is conducive to flow - this means no interruptions and a long stretch of time program. Not every programming session can be like this, but you should plan for a significant number of these.
  • Tune Your Dev Environment. No serious project can get accomplished until the environment is there - this means a trivial code-compile-test loop, source control, deployment is automated, and lots of other details. If there's any roadblocks to basic development, The Dip will get you big time.
  • Share Your War Stories. When the going gets tough, and it will, it's handy to have a community you can share your frustrations with. By sharing your progress and getting ideas, you'll be reminded why the heck you started this crazy project in the first place. It will help you get and stay motivated.
  • Sharpen Your Tools. When The Dip starts really getting steep consider taking a step back and optimizing your tools. Sure, you've got the basic environment there, but are there things you're doing with 4 key strokes you could do with one? Are you adding the same header to every file, so why not get your editor to do that work? An improvement in your tool set will help increase your momentum and take away yet another roadblock to your success.
  • Program Yourself Out Of It. When things get arduous ask yourself why that is? Perhaps you're writing class after class which looks more or less the same. Time to break out the code generation tools. By taking a step back and looking at the problems behind your problems, you can have a big impact on making the development fun again.
  • Visualize A Solution. When I have a bit of free time, I'll often work visualize in my head how I'm going to program a solution to some problem. I'll run through in my head which classes I'm going to create and how they'll connect. If I'm lucky, I'll actually discover a problem and re-work the design before I even write a line of code. By having the solution in your head before you even sit down, the programming session goes much smoother and The Dip is held at bay.
  • Don't Force It. I can recall my first big project I worked on. I needed to free up some memory, so I traced through hundreds of lines of code adding in various calls to free(). It felt wrong at the time, but I just pushed through it. The next I realized I could have changed a single point in the source code instead of the hundreds that I did by moving up the stack one level. I learned my lesson - if it doesn't feel right, don't do it. The solution will come to you, don't rush it.
  • Eat. Sleep. I find that my outlook on life is dramatically effected by the amount of sleep I've had and my blood sugar. Every night of bad sleep I have in a row makes my outlook on life just a bit dimmer. And then, when I finally do get a good night sleep, poof, everything is great again. Know your body, and know when you should and shouldn't be doing battle against The Dip.
  • Run. For me, there's nothing that clears my head like a jog. I find that I can work out problems while huffing and puffing that stumped me in front of a computer. This works for me, find out what activities work for you, and give your brain a chance to process.
  • Stick With It. There's no secret to this - just keep programming like mad. And before you know it, you'll be through The Dip and onto the good stuff.

Friday, January 20, 2017

Weekly Discoveries: The Giving Tree, a bit of jazz and a most remarkable violinist

This week in music I stumble on a bit of jazz, and a remarkable guitar street performance. But the most unusual find has to be Lindsey Stirling's work.

Lindsey's video that I linked to has 4 million views - so it's not as if she's an undiscovered talent, it's just that I've been apparently living under a rock.

Lindsey's schtick is that she's a violinist. And dancer. And singer. And, she chooses to use her talents to make the most non-traditional violin, dancing and singing work possible. I can't say that I love her music, but I do love what she's accomplished. I can just imagine her telling her friends, yeah, I'm going to be a rock star solo violinist. Sure you are Lindsey, sure you. And that's what she is. Good for her!

In the non-music videos, there's a sweet bottle opener build, and proof that you can cook over tea light candles.

Happy inauguration day! When you've had enough political coverage, give these tunes a listen!

Thursday, January 19, 2017

Web Based Protocol Handlers: The fastest user experience in the shortest amount of dev time

Firefox's Web Based Protocol Handler support has to be one of its hidden gems. Once a handler is registered, you gain especially quick access to specific content on the web. For 3shrink, this means quick access to the URL behind the 3 letter codes the site produces.

For example, to visit the URL behind the code PQW I need only type the following in my browser bar:

  grow:pqw

The protocol handler serves as the complement to the 1 click bookmarket, insuring that both growing and shrinking a URL is as streamlined as can be.

Best of all, implementing a Web Based handler couldn't be simpler. You need only make a call to: navigator.registerProtocolHandler. Here's the code that powers the register protocol handler link on 3shrink:

<?php
/*
 * A PHP file for rendering the code needed to install a web
 * based protocol handler.
 */
$domain = item_domain();
$code = <<<EOF
(function() {
  var proto = prompt("Protocol? (ex: grow)");
  navigator.registerProtocolHandler(proto, 
                                    "http://$domain/grow?i=%s",
                                    "$domain Handler");
})()
EOF;

$code = esc_attr($code);
?>
<a href="javascript:<?= $code ?>">Install Firefox Protocol Handler</a>
(<a href="https://developer.mozilla.org/en-US/docs/Web-based_protocol_handlers">Huh?</a>)

Note how the code above prompts the user to enter the protocol name. That way, you could have personal and business and point them to two different 3shrink domains.

When you click to register a protocol, you'll a sort of pop-up bar message thingy:

The first time you use the protocol (that is, enter: grow:...) you'll be prompted to select the handler. While you're at it, select the checkbox so you're not nagged about this again:

One gotcha: attempting to access a protocol containing only numbers fails. For example:

  grow:347

Will take you to: http://grow.com:347/ - not what I wanted. The fix for 3shrink is to use any letter prefix. So you can type:

  grow:x347

I'm amazed I haven't found more uses for web based protocol handlers. For advanced users, you can offer a terrifically fast user experience at almost no cost in terms of development time.

Wednesday, January 18, 2017

Adventures in Landscaping

For the past few years, as I've hired someone to cut our lawn, I've wondered aloud to Shira what it would take to have some "real" landscaping done to our property. What if we brought in a pro, instead of just hiring someone to cut the grass. This year, I finally got off my butt and decided I'd try to get this answer. My first stop: I searched for landscapers on Yelp and sent out a few contact-us requests.

And this is where I learned my first lesson: there's a difference between someone who does landscaping and a landscape designer. Despite what I thought was a clear request ("hey, can you draw me up a design / recommendation for our property?") every person I contacted showed up ready to give me a price to cut my grass. Yeah, that's not really what I wanted.

Just as I was beginning to think that my request only made sense if you owned a 7 acre estate, I got a lead to an individual over at Merrifield Garden Center. I poured out my story about our tiny lawn, and how I'd been curious about what a professional would do to improve the property. Turns out, I was talking to the right gal. She explained to me that she'd be glad to assess our property, sketch up a plan, and of course, put together a proposal to get work done. There was a nominal fee to have her come out and write up the plans, which I was actually glad to hear about: I wanted to pay someone to think this through, versus showing up to my property and recommending their first impression.

A few weeks later, I had the plan in my hand I was so curious about. It called for quite a bit of hardscaping in the back yard, due to the amount of shade we get back there. It also had a clever selection of plants that would look good throughout the year, be low maintenance and be sized to our property. Heck, she even included an especially fragrant plant to cover an additional sense. In other words, she did things all the things a classic landscaper designer is supposed to do.

I now had my plan and a proposal to implement it. As I considered what to do with it, Shira stepped in and took control. Turns out, we could save a few bucks doing the work in the winter time. And before I knew it, we had a crew of folks demo'ing our front walkway. In the span of 2 weeks, I watched as our entire property was overhauled from blah to looking great.

I have to say, Merrifield did a top notch job. The designer who worked on the plans was at the site every day, tuning things as need be. Any concerns Shira or I had were quickly addressed. Overall, I couldn't be more impressed.

Want the name of our landscape designer? I'd love to provide it. Just hit me up at: contact.ben.simon@gmail.com and ask.