Hacked By Imam

Hacked By Imam with love

 

I found this post after (obviously) not visiting my own blog for awhile. I take it as a final sign that it’s time to migrate off WordPress, even with Dreamhost doing auto-upgrades for me. 

Thanks, Imam, for the kind way of saying it.

 

Posted in Tech Note | Comments Off on Hacked By Imam

Partscasting

2016-02-06 12.50.20

Thanks to my dear friend and guitar guru Michael Devito for leading and encouraging me in putting together a heavenly instrument, pictured above. Alder chambered body is light and resonant. Lovely rosewood/maple neck from Warmoth, compound 9-16 feels great to play. The pickups are outstanding hand-wound custom from Aaron at Rumplestiltskin, who did an incredible job of hitting the tonal qualities I wanted without knowing I could have them. Callaham bridge/trem and hardware. Put together by the superb Evan Gluck here in NYC for me.

Instruments are not people, but they can be alive and you can love them.

Hear it in action at https://soundcloud.com/danielseltzer

 

Posted in Music | Comments Off on Partscasting

What to do when Google Drive files disappear (how to recover orphans)

I just learned the hard way that you should never move a file or folder that has been shared with you. Maybe there are times and places where you can, but in my case and that of many others for several years now a bunch of files and folders disappeared when I tried to move them to My Drive from where they had been shared with me.

Trying to get them back was cause for panic until I learned that you still have them — they are just “orphaned”. So you can do a search in Drive for

owner:me

And then step through each result, looking at the Details info to see if they all have a Location folder associated. The ones that don’t have a Location are your orphans. They won’t show up anywhere until you add them back to your drive.

Seems like this should have been closed up awhile ago (how about a view of orphaned files sorted by when and an option to Undo the Orphaning), but it’s still there so don’t fall into it.

Posted in Tech Note | Comments Off on What to do when Google Drive files disappear (how to recover orphans)

Milling your own flour to bake your own bread (Daniel the Little Red Hen?)

Best birthday present I’ve had in a long time: Hillary gave me a grain mill attachment for our Kitchen Aid mixer, and a few bags of white wheat berries, spelt, and other grains from Four Star Farms in Northfield, Mass.

So I finally got it going and milled some flour for this weekend’s bread, which was a blast. Watching the grains go in and the powdery snow come out is fantastic, and only makes me worry that now I want to try growing the wheat…

Here’s the bread:

IMG_2316

Delicious, but I should have given the last rise a little more time and baked a little longer.

Specs on this one:

  • Total flour weight: 626g (about 10% Rye)
  • Flour to starter ratio: 4.82 (starter was not so young, fairly acidic)
  • Flour to water ratio: 1.08
  • Raisins: 138g
  • Salt: 20g
  • Total Rise: ~18 hours
  • Bake: 450° F 30 minute covered + 20 minutes uncovered (cast iron dutch oven)

 

Posted in Food | Comments Off on Milling your own flour to bake your own bread (Daniel the Little Red Hen?)

The Lazy Coder’s Guide to Deleting Old Harvest Invoices in Batch

I’ve used Harvest for time tracking over the years, and a bit of invoicing for consulting projects. I recently realized that all those old invoices were piling up and wanted to clear them out. Turns out, there’s no good way to do that other than one by one manually…unless you are lazy and a coder like me. Then you dust off your Groovy and write some code:

import org.apache.commons.httpclient.HttpClient
import org.apache.commons.httpclient.HttpMethodBase
import org.apache.commons.httpclient.UsernamePasswordCredentials
import org.apache.commons.httpclient.auth.AuthScope
import org.apache.commons.httpclient.methods.DeleteMethod
import org.apache.commons.httpclient.methods.GetMethod

/**
 *
 * Delete old invoices from Harvest by date range.
 * Note that the API only seems to return 50 at a time, so may have to repeat 
 * but script is idempotent.
 *
 * Author: Daniel Seltzer
 * Date: 11/16/14
 */

final def username = 'user@domain.com'
final def password = 'password'
final def authString = 'asdfasdflaksjdfalkdsjfasldfj=='
final def accountName = 'company'

final def APIbase = 'https://' + accountName + '.harvestapp.com'
final def toDate = '20120101'
final def fromDate = '20080101'


HttpClient client = new HttpClient()
client.getState().setCredentials(
    AuthScope.ANY, new UsernamePasswordCredentials(username, password)
)

def getUrl = APIbase + '/invoices?from=' + fromDate + '&to=' + toDate
GetMethod call = new GetMethod(getUrl)
setupCall(call, authString)	


try {
    int status = client.executeMethod( call )

    if (status != 200) {
        throw new RuntimeException('Call to ' + getUrl + ' failed: ' + status)
    }

    def invoices = new XmlSlurper().parseText(call.getResponseBodyAsString()).invoice
    println 'Found ' + invoices.size() + ' invoices.'

    for (i in invoices) {
        print 'Deleting invoice: ' + i.id
        def delUrl = APIbase + '/invoices/' + i.id

        DeleteMethod del = new DeleteMethod(delUrl)
        setupCall(del, authString)

        status = client.executeMethod(del)
        if (status == 200) {
            println '...done.'
        }
        else {
            throw new RuntimeException('Call to ' + delUrl + ' failed: ' + status)
        }
    }

} finally {
    call.releaseConnection()
}


private void setupCall(HttpMethodBase call, authString) {
    call.setDoAuthentication(true)
    call.setRequestHeader('Accept', 'application/xml')
    call.setRequestHeader('Content-Type', 'application/xml')
    call.setRequestHeader('User-Agent', 'Groovy')
    call.setRequestHeader('Authorization', 'Basic ' + authString)
}

There are some utilities online to let you generate the auth string, which is Base64 encoded. Make sure you put in all the right variable values and this should work for you.

This is why APIs are so important. Because lazy coders can get around repetitive manual tasks and remember the pleasures of code.

 

Posted in Tech Note | Comments Off on The Lazy Coder’s Guide to Deleting Old Harvest Invoices in Batch

Blueberry Corn Muffins

Sometimes, that is enough.

Great corn meal from an upstate farm, wild frozen blueberries, a bit of Amaranth flour and wheat germ, almond milk and a greenmarket egg. Molasses. Non-aluminum baking powder, salt, some white flour and a bit of sugar and canola oil.

IMG_2303

Winter morning sunlight helps.

Posted in Food | Comments Off on Blueberry Corn Muffins

Rice Noodles and Teriyaki Salmon

 

I have a tough time with Asian cuisines, because they demand restraint, care, accuracy. I favor things where it’s okay to belly up to a thing incrementally, and if you overshoot there are ways to balance it back. Like baking bread, where you can make up for a multitude of sins with enough hours to step back and think it through, seek advice. At the hot wok’s maw, it’s already done before you have a chance to reconsider. But the combination of flavors draw me in, time and again: chiles, cilantro, mint, soy, peanut, sesame, lime, garlic, ginger.

And Hillary made an irresistible teriyaki sauce for our salmon(s): both farmed and steelhead. Special thanks to Derrick for that incredible Iwachu Nabe iron wok.

IMG_2300

Posted in Food | Comments Off on Rice Noodles and Teriyaki Salmon

The truth about bread

It’s really good when you make it yourself, from wild yeasts, and let it go for 24 hours of slow fermentation. It feels different, tastes, different, is different.

2014-11-28 11.18.14

And I love lots of raisins in it.

I got the chance to talk for awhile with the master baker at Hungry Ghost Bread in Northampton, MA, where they make some of the best breads I’ve had in recent years. He railed on the gluten-mania dominating discussion of bread these days and insisted that the problem is with the industrial yeast used to speed bread manufacture, and other additives. Slow-rising natural yeasts consume the gluten and break it down, he said.

I don’t know if any of my gluten-free friends would be willing to test this out with my bread, though.

 

Posted in Food | Comments Off on The truth about bread

Best part of Thanksgiving

Breakfast hash this next morning…

2014-11-28 11.03.42

I know the egg is gratuitous, but it was irresistible. I’m embarrassed to list all the things down under there, including quinoa, breakfast sausage, turkey, corn relish, cheddar cheese, sweet potato, stuffing, and fried up kale salad (thanks, Leila!). With ketchup.

Posted in Food | Comments Off on Best part of Thanksgiving

…but I’m not *that* good (or, the problem with Fitbit)

I may have climbed 5 or 10 flights of stairs today, but I didn’t climb 100.

So it’s damaging to my confidence in Fitbit that it sent me one of these emails:

fitbit100floors

 

Funny thing is that starting a few days ago it began crediting me with a lot of stair climbing. First it was 22, then 34, then 56 flights of stairs. Over 100 today.

After wearing it for a few weeks as an experiment I’m ready to say that:

  • It’s a beautifully designed little object
  • It’s informed me of just how much walking I do in a day (at least I think the walking is accurate…)
  • It’s kind of a drag to have to remember to put it on and take it off
  • They don’t let you just download your data as a file, which is outrageous and revealing
  • After just a few weeks I’m pretty much done with it and would not recommend it to others for any reason other than the brief fun of initially measuring your activity in a day and seeing how the feedback of information affects you

I have a lot more to say on the quantified self wave, particularly as I’m working with it in the context of healthcare, but for now I am reminded of how hard it is to be accurate in modeling the real world.

Anyone want to buy a used Fitbit?

 

 

Posted in Experience, Tech Note | Leave a comment

Android phone USB connection to ADB failing — simple solution

I was having a problem on one machine when I tried to connect my Nexus 5 to run ADB for Android dev: it would show USB debugging mode briefly, then drop off. I found these errors in the Console logs for my Mac:

7/16/14 2:43:47.000 PM kernel[0]: USBF: 10989.488 The IOUSBFamily is having trouble enumerating a USB device that has been plugged in. It will keep retrying. (Port 2 of Hub at 0x14000000)
7/16/14 2:43:47.000 PM kernel[0]: USBF: 10989.945 The IOUSBFamily was not able to enumerate a device.

After too much time reading various posts from folks with similar problems, I swapped out the cable, and now it works. So it turns out just because a cable is able to charge the phone doesn’t mean it works for ADB.

My phone is a Nexus 5, my Mac is running Mavericks, and I’m running Android Debug Bridge version 1.0.31.

 

Posted in Tech Note | Leave a comment