Monday, September 26, 2016

Paisley, Conway and Good Friends on a Boat

Man, what a weekend. It started off with a surprise from Shira: tickets to see Brad Paisley in concert. In many respects, Brad Paisley is my favorite artist. I just visited YouTube and had no problem ticking off 18 songs that I thoroughly enjoy from him. Here, give them a listen. Country music is all about story telling and clever word play, and many of Paisley's songs nail this.

So yeah, seeing Brad in concert was a big deal. As if just being there wasn't enough, Shira bought tickets in the 100 section - we were soooo close.

The concert was great, and he played most of the songs I was hoping he would (though Little Moments, Mona Lisa and of course Waiting on a Woman would have been welcome additions). He tacked on plenty of guitar solos and signed autographs and otherwise interacted with the crowd while playing, all of which to me, added up to some impressive skills. But then again, what do I know. Maybe it's not that hard to play a guitar with a banana?

There were two warm up acts, Maddie & Tae and Tyler Farr. I didn't know either by name. I did recognize one of Maddie and Tae's hits, Girl in a Country Song, which to me is a solid country song. And Tyler Farr's voice is distinctive enough that I recognized a few of his songs, a number of which I've been enjoying on the radio. Farr did a truly powerful version of Hello Goodbye, a song that hadn't entered my consciousness till I heard him belt it out. Well done. Though I could have done without his comment, enough of that sissy crap, that seemed to undercut the song a bit. Though I get transitions are tough, and I'm sure he's still mastering how to go from his slow stuff to his rowdy stuff.

I can't help but feel a little like a fish out of water at a country concert. What, with being a Jewish city boy and all. I may not have had the cowboy boots or hat, but there was one thing that me and the rest of the guys at the concert could agree on: cargo shorts rock. Whoo!

All in all, the concert was great.

The other highlight of the weekend: taking a day cruise on a friend's sail boat. It was just about the perfect day to be on the water: clear skies, sunshine, yet cool enough that we didn't cook. I say just about, because there was only one thing missing: the wind. We did a bit of sailing with the meager wind offered, but spent most of our time motoring around. We ended up stashing ourselves in a little cove and using both a dinghy and a kayak to explore the area. That was truly a fun time, with amazing views, interesting birds and a family apparently trotlining for crabs to watch. There's just something magical about sitting on a boat, noshing snacks and kibitzing with friends. Fun times!

As if all that weren't enough, we even squeezed in a 4 mile hike in the Conway Robinson Memorial State Forest. While the chunk of forest isn't exactly huge, it was great to get out in nature. The signage along the trail explains how the forest is managed, and by managed, I mean strategically cut down. I suppose it's all about thinking long term and trying to shape growth for the long term good. Or it's pure hubris on man's part. Either way, it was a delightful hike.

Now I need a weekend to recover from my weekend. Yeeeehawwww!

Update: Oh, and here's some audio clips captured from the concert. Enjoy!

Friday, September 23, 2016

Well that was fun: take a virtual bike ride through Oklahoma

You'd be forgiven if you thought that a bike tour through Southern Oklahoma wasn't exactly a riveting adventure. And you'd also be wrong. I thoroughly enjoyed EverythingWillBeNobel's trip report of his 5 day adventure; the photos, the stories, they're truly fantastic. Here, give it a read:

The trip underscores that what makes for a memorable experience isn't picking the perfect destination and having a flawless execution. It's about embracing the good, laughing at the bad, and coming home with a story to tell.

And while you're on the site, check out Amanda Delecore's story of her first solo tour. It's a powerful take on the challenges of truly mastering a skill. No YouTube video or blog post could ever prepare her for that first solo night in the woods, nor could they give her the confidence she earned by making it through that first fearful night.

This all makes me want to grab my bike and ride.

Thursday, September 22, 2016

Kitchen Renovation 2016 | Past the point of no return

This morning we had a kitchen:

This evening we have an open space:

This project just got real.

It boggles the mind that taking apart a kitchen, clearing out a dining room and knocking down the wall between is a 2 man, 1 day job. Now putting it back together again, that's a little bit trickier. But still, wow.

I guess this kitchen renovation project is officially on!

Tuesday, September 20, 2016

Just Hanging Out | The 3 Minute, $10, Improvised Hammock

Here's a fun (and seemingly easy) outdoor project to try: Make a Hammock in 3 Minutes. The idea is to use a 60x126" tablecloth as the body of the hammock, a couple of loops of rope to whip the ends, and a few minutes of your time to assemble the setup. Give it a watch:

For $10 in supplies, it's hard to go wrong with this project. And worst case scenario, you have a massive tablecloth you can use, well, on your table.

I love idea of co-opting formal tablecloths for outdoor use. You just never know where handy supplies are going to come from.

Monday, September 19, 2016

More Ratpoison Tweaking: Quick Access to any Program

I'm continuing my journey to optimize ratpoison. My latest tweak: binding keys that bring up specific programs. For example Windows + e now pops emacs front and center.

I accomplished this by enhancing the rpwin script I'd previously created. Here's the latest version:

#!/bin/bash

## A shell script for capturing / switching / deleting / etc.
## ratpoison window configurations

RATPOISON=ratpoison
RP_SNAPSHOT=$HOME/.rp.snapshot


usage() {
  echo "Usage: `basename $0` {capture|restore|goto}"
  exit 1
}

rp_cmd() {
  $RATPOISON -c "$@"
}

case "$1" in
  capture)
    if [ -n "$2" ] ; then
      loc=$2
    else
      loc='default'
    fi
    touch $RP_SNAPSHOT.$loc
    rp_cmd sfdump > $RP_SNAPSHOT.$loc
    ;;
  restore)
    if [ -n "$2" ] ; then
      loc=$2
    else
      loc='default'
    fi
    if [ -s $RP_SNAPSHOT.$loc ] ; then
      rp_cmd "sfrestore `cat $RP_SNAPSHOT.$loc`"
    else
      echo "Refusing to restore an empty snapshot"
      exit
    fi
    ;;
  goto)
    win=`rp_cmd windows | grep -i "$2" | sed 's/[^0-9].*//' | head -1`
    if [ -n "$win" ]; then
      rp_cmd "select $win"
    fi
    ;;
  *)
    usage
    ;;
esac

The above script includes a new sub command: goto. To use this new command, I added the following bindings to my .ratpoisonrc:

definekey top s-o exec rpwin goto Gimp
definekey top s-e exec rpwin goto emacs

And just like that Windows + o pops up Gimp and Windows + e pops up emacs. I'm loving the ability to quickly save and restore window configurations, and I find that this new 'goto' capability works well with it. The standard configurations cover most cases and the quick jump lets me get to programs I use less frequently (like Gimp) or need more often (like emacs).

Friday, September 16, 2016

Name that Bug: Pretty, Harmless and Deadly

Check out this fine looking fellow:

To my naive eye, he has the markings of a wasp, yet the legs of a grasshopper. He's obviously part of a CIA plot to create super bugs...

Or, he's a Megacyllene robiniae a type of beetle that has seemingly mastered bio mimicry. As explained here:

Your observation that this Long Horned Borer Beetle, the Locust Borer, Megacyllene robiniae, is a Yellow Jacket mimic is quite astute. The mimicry is probably most effective when the Locust Borer is feeding on the pollen of goldenrod because predators would tend to avoid what looks like a stinging insect despite the Locust Borer being perfectly harmless.

And sure enough, just a couple yards away was a stand of goldenrod.

So while this guy looks like he could sting you, he's actually harmless. That is, unless you're a black locust tree. Then these insects, known as Locust Borers can cause a heap of problems due to their preference for tunneling into this type of tree. Hard to believe that something so small and harmless can wreak havoc on a tree, but there it is.

Here's another unexpected sighting. Check out these snapshots:

It's hard to see, but floating just below the surface is a massive turtle. I've seen plenty of turtles along the Potomac, but nothing this large before. I shall call him Nessy.

And what would a walk in the woods be without a few photos of pretty flowers? So here you go.

Thursday, September 15, 2016

A Perfect DC Evening

David and I hit Fletcher's Cove for a relaxing fishing and kibitzing session. While I only caught one teeny tiny fish, it was still great just to be outdoors on a perfect September evening.

If we're keeping score, I think the mosquitoes are winning. They took far more bites out of me than I got out of the fish. Still, fun times!

We fished the canal and the dock at Fletchers, and saw plenty of fish at both locations. We just don't have the skill to extract said fish. But knowing they are there is probably half the battle. Right? Maybe?

Wednesday, September 14, 2016

A Patriotic Mystery

While driving along route 395, next to the Pentagon, I noticed a small collection of American flags planted in the grass.

Are they an improvised 9/11 memorial? A mini patriotic Stonehenge? Detritus from 4th of July fireworks watchers? It's a mystery. I'm just glad I didn't get detained while snapping these photos.

Tuesday, September 13, 2016

How Not To Make Pokeweed Ink

Around here, pokeweed is everywhere. And this time of year some of the plants are beginning to produce tempting clusters of purple berries. There are two things you need to know about these berries: First, they're terrifically poisonous (to us) and second of all, they make great ink. Ever since I learned the latter, I wanted to give it a try.

Last night, while on a walk, I carefully snipped off a cluster of purple berries and carefully placed them into a Ziplock bag. This morning, I cautiously squished the bag and lo and behold, I had a bright liquid to work with:

Next up, I knew I needed to strain the mixture. My plan: grab a swatch of old old t-shirt and use it like a cheesecloth. Because I had comparatively little liquid to work with, I used an empty tea candle base as the ink well. I carefully cut the bag and poured the juice into the t-shirt covered ink well:

At first I thought it was working. How wrong I was. The juice did exactly what it was supposed to do when it hit the t-shirt fabric: it stained it. The result was a wonderfully colored swatch of t-shirt fabric and no ink in my inkwell. D'oh.

I was about to give up, when I noticed I had a few drops of liquid left in the bag. I squeezed those into my inkwell. For good measure I added a bit corn starch (as recommended here), and gave it all little mix with a toothpick.

Using a toothpick as a stylus, I went to work creating a masterpiece from my new ink:

I've got to say, the result was incredibly satisfying. I'd bumbled my way through the process and still managed to make ink! It's truly remarkable how potent those berries are - talk about a stainfest waiting to happen.

I'm definitely going to keep an eye out for more berries. And next time, I'll try using pantyhose instead of cotton fabric for the straining part. I'm sure Shira won't mind if I raid her supply.

Monday, September 12, 2016

NFC + Legos = ?, Adventures in Gamification of Legos

Who knew that buying a package of Legos could lead to an emotion roller coaster? On one hand, I was psyched when I picked up a few Lego Dimension kits at Five Below. The small set seemed perfect for a quick afternoon activity. I then found myself disappointed when I opened the package and found out that the instructions for building the small set were available only through a Lego game. I was then back to happy when I found a site that gave free access to said instructions. Finally, my little journey of joy and annoyance ended on a happy note when I learned that the plastic bases that hold the Lego Dimension characters are actually NFC Tags.

Over the summer, I sent the kids home with their Lego Dimension characters and vehicles, but held onto the little magic plastic bases. I figured I'd have to put them to use, somehow. Here's a random knock-off minifigure perched upon the NFC base, waiting for me to do something brilliant with him:

I thought about doing something practical, but I couldn't really see any value the NFC Lego base would have over the NFC stickers that are quite frankly, awesome. Then last night it hit me: I should build a sort of hybrid game, where you play with Legos but use the NFC base and a mobile phone to help steer the playing. Think Dungeons and Dragons, only with Lego Characters and your mobile phone and not dice.

There's only one small detail: I know absolutely nothing about D&D. While my older brother played, I did not. Even Simple DnD was too complex for me to quickly absorb and turn into some sort of program. So yeah, my vision of being a game master would have to wait.

But I decided I'd dip a toe into the process, regardless. Step 1: vastly simplify *everything*.

I imagined that for a character roll playing game to work you'd need something random (think: roll of a dice) and some sort of state (think: the health of your player). And so I started to futz around with these ideas. Of course, I went to my goto prototyping environment: Tasker.

Here's a Task that generates a random number, whether it's positive or negative, and updates your current score (which starts at 100). Every time I scan the character's base, my phone brings up a dialog box with the updated status of my character:

%Lego Refresh (162)
 A2: Variable Set [ Name:%char To:char1 Do Maths:Off Append:Off ] 
 A3: Variable Randomize [ Name:%polarity Min:0 Max:1 ] 
 A4: Variable Randomize [ Name:%offset Min:1 Max:10 ] 

 A5: Test File [ Type:Type Data:Tasker/lego/%char.txt Store Result In:%found Use Root:Off Continue Task After Error:On ] 
 A6: If [ %found !Set ]
   A7: Variable Set [ Name:%current To:100 Do Maths:Off Append:Off ] 
 A8: Else 
   A9: Read Line [ File:Tasker/lego/%char.txt Line:1 To Var:%current ] 
 A10: End If 

 A11: Variable Set [ Name:%updated To:%current Do Maths:Off Append:Off ] 

 A12: If [ %polarity eq 0 ]
   A13: Variable Add [ Name:%updated Value:%offset Wrap Around:0 ] 
   A14: Variable Set [ Name:%operator To:+ Do Maths:Off Append:Off ] 
 A15: Else 
   A16: Variable Subtract [ Name:%updated Value:%offset Wrap Around:0 ] 
   A17: Variable Set [ Name:%operator To:- Do Maths:Off Append:Off ] 
 A18: End If 

 A19: If [ %updated < 0 ]
   A20: Variable Set [ Name:%updated To:0 Do Maths:Off Append:Off ] 
 A21: End If 

 A22: Write File [ File:Tasker/lego/%char.txt Text:%updated Append:Off Add Newline:On ] 

 A23: Show Scene [ Name:Lego Update Display As:Dialog Horizontal Position:100 Vertical Position:100 Animation:System Show Exit Button:On Continue Task Immediately:On ] 
 A24: Element Text [ Scene Name:Lego Update Element:Score Position:Replace Existing Text:%current %operator %offset 
= 
%updated Selection: ] 

Here's 3 scans of my character in a row:

So yeah, there's not much to see here. But it is interesting to see how Tasker Scenes work, and to continue to experiment with novel uses of NFC. I'll have to think about what strategic code I can write that will start moving this closer to an actual playable activity. With the right story line and heavy use of imagination, perhaps not much. We'll see.

Friday, September 09, 2016

Pastebin and the Command Line - Clipboard Access Anywhere

A couple of days ago, I setup my phone to push the clipboard to pastebin.com automatically. Now I wanted an easy way to access these pastes from the command line. Fortunately, the pastebin API is a breeze to use, and quite curl friendly.

Here's a shell script that pulls down the most recent paste:

#!/bin/bash

##
## A command line tool to pull pastes from pastebin.com
##

USER_KEY=__SAME_USER_KEY_TASKER_USES__
API_KEY=__SAME_API_KEY_TASKER_USES__
count=1


ids() {
  curl -s -d api_option=list \
       -d api_user_key=$USER_KEY \
       -d api_dev_key=$API_KEY \
       -d api_results_limit=$count \
       'http://pastebin.com/api/api_post.php' | 
    grep paste_key |
    sed -e 's|<paste_key>||' -e 's|</paste_key>||'  
}

for id in `ids` ; do
   id=`echo $id | tr -d '[\r\n]'`
   curl -s http://pastebin.com/raw/$id
done

On Windows, I can leverage clip.exe to store the output of the most recent paste into the clipboard.

  pbget | clip

Getting content from my phone's clipboard to my Desktop's clipboard is now nearly automatic, and thanks to pastebin.com is archived for 24 hours. And as a bonus, I'm not limited to accessing the phone's clipboard from a local computer. Any server with curl and a net connection can now get quick access to my phone's clipboard.

How I Get Stuff Done

Over at /r/getdisciplined, the following advice was offered:

[Advice] This is the *real* secret to success...a million self help books boiled down to their essence in one sentence.

Learn to front-load your pain.

The author continues:

If you procrastinate, you're putting off more than your work. You're putting off the pain. Right?

But doesn't it always catch up to you?

What you have to do is front-load all those yucky crappy feelings. Go ahead and feel it now so you don't have to feel it later. And guess what? If you put it off, it gets amplified. Right now you're dreading doing your homework or writing an article or w/e, but what if you don't do it? And worse, what if you put that stuff off consistently?

That thing you feel crappy about? That thing you're dreading? That is exactly the thing you need to do in order to improve your life.

This got me thinking about how I get stuff done, and it occurred to me that I follow a related, yet different paradigm. I'd tersely describe it so:

Pump your legs.

Allow me to explain.

Imagine you're a 6 year old kid. You want to swing on the swing-set, but you know you're too old to ask your mom or dad to push you. Instead, you decide it's time to try the technique your parents have been barking at you for the last few months: pump your legs! You brace yourself and heave yourself forward with all your might. Nothing happens. Well, not quite nothing. You notice that you move forward ever so slightly. You try again. And again. At some point, something magical happens, you start to rock back and forth. Then you start pumping your legs like your parents told you. And just like that, your swinging all without any help. What started as an apparently futile effort morphed itself into a beautiful display of playground mastery.

And that's how I tend to tackle projects.

I start small. Do something. Do anything. At first, my attempts look clumsy and seem to make little to no progress. But after warming up a bit I gain that magic momentum where I start making more and more progress. Before I know it, the project I was dreading is something I can't wait to work on. You can forget questions of "where to put the pain" because there isn't any pain.

This approach works because of this mysterious property I'm referring to as momentum. But what the heck is it? I think it's is closely related to flow. Where flow applies to a particular work session, momentum is the result of stringing together sessions that hold the potential for reaching flow. Where flow makes a particular set of tasks seem effortless, momentum helps make the entire project seem on track and generally in the groove.

While my preferred strategy differs from the one offered on Reddit, it does have an important commonality: they both only work if you start today. Building momentum takes time, so procrastination is definitely the enemy.

So how do you prefer to get stuff done? Please share in the comments.

Wednesday, September 07, 2016

Pastebin and Tasker - An Automatic Clipboard Archiving Solution

The other day I realized I had no seamless way of accessing my phone's clipboard while on my desktop computer. Sure, I had work-arounds like pasting the clipboard into a Google Doc and accessing said Google Doc on a desktop machine, but that's clunky to the say the least. Here's my first pass at a more automated solution.

After a bit of poking around, I decided that I'd shoot for the following: have my Android phone push the system clipboard to pastebin.com, and then use a browser on my desktop to access pastebin. Solutions like AirDroid are really slick, but are relatively cumbersome to setup. By having the clipboard in pastebin, I know I can easily access it from anywhere. Additionally, pastebin's archival nature means that accessing older clipboard entries is breeze. As a bonus, pastebin's API is drop dead simple and I was hoping it would play nice with Tasker.

Fortunately, my hunch was correct: Tasker's HTTP Post action is a near perfect fit for the pastebin API. Here's the Tasker Action I worked up that creates a new pastebin entry:

Pastebin, Create (115)
  A1: Variable Set [ Name:%api_key To:API_KEY ... ] 
  A2: Variable Set [ Name:%paste To:%par1 ...] 
  A3: Variable Set [ Name:%expires To:%par2 ... ] 
  A4: Variable Set [ Name:%user_key To:USER_KEY ... ] 
  A5: HTTP Post [ 
   Server:Port:pastebin.com
   Path:/api/api_post.php 
   Data / File:
    api_option=paste
    api_dev_key=%api_key
    api_paste_private=2
    api_paste_name=From My Phone
    api_paste_expire_date=%expires
    api_user_key=%user_key
    api_paste_code=%paste 
   ... Content Type:application/x-www-form-urlencoded
   Output File:Tasker/pastebin.response.txt
  ] 
  A6: Read File [
   File:Tasker/pastebin.response.txt To Var:%response 
  ] 
  A7: Return [ Value:%response Stop:On ] 

A few notes on the code above. You'll need to fill in your own version of API_KEY and USER_KEY to make this work. The above action is intended to be called by Perform Action with two parameters: the content to paste and an expiration date. The result is a generic Pastebin, Create action that can be used in a number of contexts.

With the above code written and debugged, I just needed to setup a simple action that would ship off the the magic %CLIP variable that contains the clipboard contents to pastebin.

Pastebin, Push Clipboard (134)
 A1: Perform Task [
   Name:Pastebin, Create
   Priority:%priority+1
   Parameter 1 (%par1):%CLIP
   Parameter 2 (%par2):1D
   Return Value Variable:%response
   Stop:Off ] 
 A2: Notify [
    Title:%response Text: Icon:ipack:crystalhd:package_editorspackage_editors
    Number:0 Permanent:Off Priority:3
 ] 

Note that I'm setting the 'paste' to expire in 1 day. I expect I'll tweak this over time, but for now, I'm thinking 1 day makes sense.

Finally, I setup a profile that detects when the %CLIP variable changes:

With all of this in place, anytime I copy text to my phone's clipboard, it shows up just a few moments later on pastebin. An unexpected bonus: my phone has a Copy to Clipboard sharing action which means that I can effectively push data from apps to pastebin with a single click. Here's an example of this functionality as seen from the YouTube app:

If I clicked the Copy Link option, a few moments later, the URL of the video would be on pastebin.

I doubt this will be the last word on copy and pasting the clipboard between my phone and desktop devices. But it sure is a fun start. I've been a fan of Pastebin for many years, so I'm psyched to integrate with the service. And the fact that it's completely automated, well let's just say I wrote the code and even I think it's magic. Time will tell how practical it is, though.