Excel – Converting Unix Timestamp to Human Readable Date(time)

You can use the formula =(B2/86400)+DATE(1970,1,1) to convert a unix epoch time to a human readable date (or date time). In my case, I have the unix timestamp in microseconds so I’ve got to divide by 86400000. The value you get is a not-so-meaningful float … but that’s actually a date.

Select a date format to display the value as a date

Or chose a custom format and use something like “m/d/yyyy hh:mm” to display a date and time.

Hop Greenhouse Redux

So we’re supposed to get five or six inches of snow tonight, and tomorrow night will get down to 28 degrees or so … which means the hop greenhouse is back! It’s sturdier this time so it’ll handle the snow load. There are two logs on each side, both with a long 2×6 board run across. Shorter 2×4’s were laid across the long boards to provide support for the roof. There are additional boards diagonal from the “roof” to the ground. The whole thing is covered with greenhouse plastic, and 4×4’s (and a few large logs) weigh down the edges.

I’ve also got plastic bags over the blueberries, raspberries, elderberries, baby pawpaws, garlic, and baby black walnuts. There’s a tarp over the part of the deer garden that’s actually sprouted. Hopefully everything fairs well. The hazelnuts aren’t protected — they’ve gotten quite large, but they should have plenty of energy in the root system. The kale isn’t protected either, but it survived the winter already … so that should be fine.

Trout Dough Ball Recipe

Scott’s going fishing, and Anya and I made dough balls for trout bait. Mix 1 cup all purpose flour, 1/3 cup corn meal, and 1-2T garlic powder (I used 1.5T of garlic powder, and it’s really garlicy).

Add enough water to make a firm but slightly sticky dough.

Pinch a bit of dough and roll between your palms to form into blueberry sized balls. Some of ours got a little big!


Drop in boiling water for 1-2 minutes.


Remove and place on napkin/towel (or, in my case, a perforated silicone baking mat) to dry. Cool for an hour then freeze overnight.

Blocking Device Internet Access

We block Internet access for a lot of our smart devices. All of our control is done through the local server; and, short of updating firmware, the devices have no need to be chatting with the Internet. Unfortunately, our DSL modem/router does not have any sort of parental control, blocking, or filtering features. Fortunately, ISC DHCPD allows you to define per-host options. Setting the router to the device’s IP (0.0.0.0 may work as well) allows us to have devices that can communicate with anything on their subnet without allowing access out to other subnets or the Internet.

Viewing and recording packets using tshark

This time, I’m writing this down so I don’t have to keep looking it up. To display some packet info to the screen while writing a network capture to a file, include the -P option (older versions of tshark used -S)

2021-04-18 13:58:58 [lisa@server ~]# tshark -f "udp port 123" -w /tmp/ntpd.cap -P
Running as user "root" and group "root". This could be dangerous.
Capturing on 'enp0s25'
1 0.000000000 10.x.x.x → x.x.x.18 NTP 90 NTP Version 4, client
2 3.898916081 10.x.x.x → x.x.x.199 NTP 90 NTP Version 4, client
3 7.898948128 10.x.x.x → x.x.x.20 NTP 90 NTP Version 4, client
4 7.928749596 x.x.x.20 → 10.x.x.x NTP 90 NTP Version 4, server
5 9.898958577 10.x.x.x → x.x.x.76 NTP 90 NTP Version 4, client
6 9.949450324 x.x.x.76 → 10.x.x.x NTP 90 NTP Version 4, server
7 10.898981132 10.x.x.x → x.x.x.185 NTP 90 NTP Version 4, client
8 11.009163093 x.x.x.185 → 10.x.x.x NTP 90 NTP Version 4, server

55 Days of Grilling: April 16

We’d made ribs a few weeks ago using my usual pressure cooking-followed by high temp cooking to caramelize the sauce approach. While that works well in an oven — where the falling-apart-tender ribs sit safely in a baking dish — it’s not great for grilling. Scott wondered how cooking some ribs just on the grill would work out. I spent some time researching how people make bbq ribs on gas or electric grills and came up with a cooking approach that sounded reasonable — low temp, long cook, and wrapped in aluminum so they don’t dry out.

After washing the ribs and removing the silver skin, I rubbed them with a blend of salt, paprika, chipotle pepper, black pepper, cayenne pepper, thyme, and garlic. I put the grill’s temperature sensor into a thick, meaty section and wrapped them in aluminum foil. The grill was heated to 300° F. The ribs cooked for about 90 minutes — the internal temperature was 180° F, which was in the range the cooking technique indicated. I took them inside and carefully unwrapped the foil.

I cut the rack in half because we had two different sauces we wanted to try. The larger half was liberally brushed with Guy Fieri Apple BBQ sauce, and the smaller half was brushed with the Brown Sugar version from the same company. The apple one smelled like some hand soap that had come with the house — not like actual apple, but like apple fragrance oil. I read and re-read the ingredients trying to figure out what the smell was, but didn’t find any artificial flavors listed.

I cranked the grill (set to 600° F, but never got over 550° F) and cooked the ribs for five minutes.

I then brushed more sauce over the ribs, flipped them, and cooked them for five more minutes.

I flipped them and allowed them to cook for another minute because the sauce on the side facing up hadn’t caramelized.

I brought the ribs inside and let them rest for a bit while everyone got ready for dinner.

Scott sliced the ribs, and dinner was ready. The BBQ sauce wasn’t great — the sauces were quite vinegar-y too. The ribs weren’t falling apart like the double-cooked ones we made a few weeks ago, but it could have used a little more time on the grill to get more tender and fully render the fat. But it was a nice meal (and an interesting experiment).

LARPing the Trial

I wish live action role playing were permissible in jury trials. As we’ve been watching the Derek Chauvin trial, the defense presented body worn camera video from a 2019 traffic stop that involved George Floyd. The retired police officer testified that Mr. Floyd was not following instruction and such … then they rolled the video. Dude goes up to the car and yells something like ‘show me your hands’. Mr. Floyd raised his hands in the air. The officer then repeatedly yelled for him to both “unbuckle your seat belt” and “show me your hands” … two contradictory commands. The officer then ordered Mr. Floyd’s hands on the dash and the officer on the other side of the car ordered (him? the driver?) to put their hands on their head. The officer then shoves Mr. Floyd’s hands to the dash. This doesn’t seem to be someone refusing to follow instructions — this seems like someone trying to follow instructions while two different people shout two different directions.

What’s that got to do with LARP’ing? Well — imagine if you were on the jury and jurors were paired up. Each sat in a chair six feet apart (which is more distance than provided in a car) while two people with guns drawn march up behind them and start yelling orders to them. How well do you think you’d do at following the instructions from the guy closest to you?

Does it now seem more reasonable to say things like “I don’t want to get shot!”? And, since it’s a demonstration, you know the guns aren’t loaded. I’ve had a gun waved in my face exactly twice in my life — once when I took too long to pull over on a traffic stop. The second when I was visiting a friend at work and someone decided to rob the joint. In both cases, it was incredibly frightening. The cops, in the second instance, were somewhat bemused by the fact I couldn’t tell them a single thing about the suspect but could have spent an hour detailing the gun.

JQuery – Finding a set of checkboxes

A corollary to my JavaScript modifying checkbox values when the box is checked or unchecked … I needed a way to reset the form (in my form, the default is for the boxes to be checked and the value to be 1). The following code identifies all checkboxes with a particular class, checks them, and sets the value to 1.

/**
 * This function checks off each checkbox of the input class
 *
 * @param {string} strCheckboxClass     Name of class identifying in-scope checkboxes
 * @return {null} 
 *
 * @example
 *
 *     checkAllDatabases ('MyBoxes');
 */
 function checkAllDatabases(strCheckboxClass){
    arrayCheckboxes = $('.'+strCheckboxClass);
    for(i = 0; i < arrayCheckboxes.length; i++) {
        $( '#'+arrayCheckboxes[i].name).prop( "checked", true );
        $( '#'+arrayCheckboxes[i].name).val(1);
    } 
}

Changing checkbox value when (un)checked

This bit of code handles another rather esoteric scenario — I have a generic “go to this URL and download the resultant Excel file” JavaScript function. This is because I write a lot of reporting tools and didn’t want to write a lot of code for each new tool. The template is an input form with a submit button that calls the generic function. Params for the elements on the form from which values are read, the URL to call to generate the report, and the POST elements into which each corresponding form value is inserted gets stuffed. Works great for text inputs. Works fine for drop-downs. But the value of a checkbox is really a combination of the potential value (from the value tag) and the checked state. That is — my Button 1 has a potential value of 1, but if the box is checked or not is really important.

Instead of attempting to determine the type of element in each form input so I can evaluate the checked condition, I decided to just change the value when the checkbox state is changed. Now Button 1 has a potential value of 0 when unchecked and a potential value of 1 when checked. I don’t need to know if the box is checked because the value answers that question. So passing along button1’s value to my URL lets the target site know if I want whatever Button 1 represents. (In this case, users are able to select from a list of seven data sources — smaller numbers of data sources reduce the query time but also fail to provide the most robust report).

The JavaScript to handle changing the checkbox value when the checked state changes:

$("#button1").change(function () {
    if ($("#button1").is(':checked')) {
        $("#button1").val(1);
    }
    else{
        $("#button1").val(0);
    }
});

$("#button2").change(function () {
    if ($("#button2").is(':checked')) {
        $("#button2").val(1);
    }
    else{
        $("#button2").val(0);
    }
});

The HTML defining these two checkboxes:

<input type="checkbox" id="button1" name="button1" value="1" checked><label for="ngmss">Thing 1</label>
<input type="checkbox" id="button2" name="button2" value="1" checked><label for="ngmss">Thing 2</label>