Git: Using Soft Reset To Clean Up Un-pushed Commits

I missed a file when I was cleaning up debugging lines. I made the change and included it in a second commit, but I’d rather not have two commits for the same purpose. I hadn’t pushed my changes yet, so these commits only exist on my workstation … which means I can reset and bundle the changes into a single commit.

Find commit number that is one before the duplicate debug logging cleanup — this is the point to which you want to reset. In my case, it is the commit start with b443348c

Reset there with “–soft” — this doesn’t change anything on the file system (i.e. I don’t have to clean up those debug lines again) but puts the changes back into the staging area.

Now those files are staged again, so I can make a single commit for removing debug logging from my code.

Voila! I can push these changes and not clutter our history with my error.

 

No Durians

We stopped by CAM International Market on Saturday to see if they’ve got bat nuts, find fruit I don’t find at the local supermarket, and pick up a few expensive-elsewhere items (sesame oil!). Scott spotted a large, pokey looking fruit and asked if we should get one of those. Durian, the sign said … and I had to stop for a second because I don’t think I’ve had those before. And then I remembered where I’d heard the name …

The Singapore subway banned them because the odor was so offensive. And some people loved the things. We did not get the big durian fruit. Or the smaller vacuum sealed pack of durian flesh. He spotted durian-stuff a few more times and kept asking if we should try that. Finally, we happened across some mochi balls with durian ice cream. If you’re going to eat something with a stench awful enough that a subway system would bother banning it … a bit of it in ice cream is probably the way to go, so yeah … we’ll try it. There were four balls, just enough for each of us to have one.

I diced up a few persimmons — something that I knew was sweet and tasty — as a chaser. One ball out of the package in a bowl, and it smelled floral with a hint of not-so-good onions to me. But my nose doesn’t pick up a lot of chemicals and I figured, honestly, I’d be among those who don’t notice the smell. Scott tried a bite. He gave Anya a bite (and why didn’t we think to record this? She make an incredible YUCK face before and after trying it). I tried a bite. It was not good. The flavor was very onion-y with a sweetness like caramelized onions. But onion and ice cream isn’t really something that goes together in my mind. Maybe durian with roasted pork, but dessert? Nope. And then the half-a-ball sat in its dish. It got stinkier as it warmed up. Until it was voted off the island and into the city sewers (sorry gators!).

None of this prepared me for the horror of durian burps. A terrible combination of sewage and onions coming back to haunt me. Or sitting next to someone with a durian burp and thinking the stench has somehow lodged itself in my nasal passages. It was a good twelve hours before I wasn’t experiencing durian again.

Which makes me wonder … What in the world does a durian plantation smell like? I have fond memories of driving along the Nile at sunset and smelling sugar cane on the air. Even if the smell is significantly reduced in the whole fruit, a whole plantation of the things baking in the sun?!? And what does this stuff smell like if it’s gone bad? Does it rot and smell better? Or is it sewage and gym socks without the floral undertone?

But it was an entertaining experience. We’ve all had our lifetime supply of durian. And there are still three of these things in the freezer 🙂

Did you know you can control who can present during a Teams Meeting?

Did you know you can control who can present during a Teams Meeting? As of Dec 2019, you can!

There were a few cool Teams features that, when used inappropriately, disrupt the meeting. Anyone can mute other attendees — great when I notice someone is taking another call and can mute them; not great if I accidentally mute the presenter. Anyone can share their screen — great when we’re taking turns showing something and don’t need to transfer control; not great when you accidentally share your screen in the middle of someone’s presentation. And this occurs during meetings among respectful, professional business associates. The amount of control individual meeting participants get invite goofing off (while you can tell who just took over presenting, you cannot tell who just muted you for the seventh time).

Microsoft has introduced “roles” for meetings. As the meeting organizer, you can establish who has what role. By default (i.e. when you don’t define any roles), everyone can do everything. But, after you create the meeting, you can edit it and select “Meeting Options”

Two options will be presented — you can control who can bypass the lobby (avoid having external parties waiting if you anticipate their attendance) and define who can present. The terminology is a bit odd here, but this is the selection that defines who has what roles within a meeting.

As the person who scheduled the meeting, you are the organizer — you can elect to only allow yourself to present. If you select to allow “Specific people” or “People in my organization” to present, they are assigned the “presenter” role. Everyone else is an “attendee”. What can a presenter or attendee do? Consult the MS documentation for a complete list. The big ones, though … an attendee cannot share their screen. The option is grayed out, and they’ll be advised that only organizers and presenters can share.

Attendees cannot start or stop recording — the option, again, is grayed out.

And attendees cannot mute or unmute anyone through the participant listing. This means they cannot mute someone else — the microphone icon will disappear when they put their mouse over it. But it also means they cannot mute or unmute themselves here. They will need to use the meeting control bar to mute or unmute.

What if you’ve restricted someone as an attendee and need them to share their screen? You can modify their role in the participant listing — mouse over their listing and use the ellipsis to select “More options” and select “Make presenter” (or, if you wish to demote a presenter to attendee status, select “Make attendee”).

 

Displaying An Image Tooltip

JQuery developers seem to have put a lot of effort into filtering HTML components out of tooltips … which, as someone who visits a website … is A Good Thing. But what’s a good security consideration can be a massive pain when building a website. I have a form which takes an internal ID number, and I have an image showing people how to find that internal ID number. I want a little question mark after the field name that pops up the image as a tooltip on mouseover events. And clears the image on mouseout.

JavaScript:

// Show finding equipment ID image "tooltip" 
$('#ShowEquipmentIDTip').hover(
	function(){
        	$('#FindingEID').css({ "display": "block" });
    	}
	,function(){
        	$('#FindingEID').css({ "display": "none" });
    	}
);
HTML:
<div class="col-md-2 col-sm-2 col-lg-2 col-xs-2 text-left">
	<span><strong>Equipment ID(s): <a id="ShowEquipmentIDTip" href="#">(?)</a></strong></span>
	<div id="FindingEID" style="position: relative;top: 20;left: 60;width: 100%;height: 100%;z-index:99;display:none"><img src="/groomsGenerateCircuitReport/images/Tip-FindingEquipmentID.png" /></div>
</div>

Moving your mouse over the ShowEquipmentIDTip a element displays the div which contains my image “tooltip” and moving the mouse away sets the display back to none.

Simplified Outage Reporting

We’ve lost power the past few days — I think that’s because the forestry crew is clearing a few trees that are down on the power lines, but I don’t know so we report the outage. First Energy has a really cool way of reporting outages — you use SMS to register your phone with your account. Once the phone is registered to an account, you can text “OUT” to their short code. There’s a short code to register for outage notifications, status alerts. So when the power went out today, it took about three seconds to report the outage. No walking through the IVR to report the outage online. I hope to see more companies doing this in the future.

Updated Federal Budget Distribution – 2019

Here’s the latest pie charts of how the federal government spends its money. Again, there’s discretionary spending — spending from appropriation bills and the full budget which includes spending for things like Social Security, Medicare, and Medicaid which vary depending on the number of recipients and how much each recipient is being paid. This doesn’t mean the non-discretionary components couldn’t be changed — there’s been discussion of means testing Social Security payments and Medicare eligibility — but these changes are generally considered politically untenable (would you vote for the guy who just reduced your SS cheque because you happened to have a pension or money saved in a retirement account?).

Here’s the full budget breakout, updated for 2019

And discretionary budget

Recovering a bricked Netgear router

Netgear provides instructions for using TFTP to write firmware to a basically bricked router (it boots into a recovery mode, indicated by a flashing power light). The instructions are, unfortunately, specific to Windows. To use a Linux computer to recover the router

 

(1) Plug your computer into the router & unplug everything else, as in the instructions. Hard-code an IP address. Then verify that the router shows up in your arp table:

arp -a

If the router does not appear, add it — you’ll need to get the device MAC address from the sticker on the back of the device.

arp -s 192.168.1.1 ??-??-??-??-??-??

(2) If you don’t already have a TFTP client, install one. Once you have a client, follow the instructions to get the router into recovery mode. On the Linux computer, run “tftp 192.168.1.1”

You’ll be in a TFTP console. Type binary and hit enter to set the transfer mode to binary. Then use put /path/to/file.name to upload the firmware file to the device. Wait and proceed with device setup.

 

Shell Script: Path To Script

We occasionally have to re-home our shell scripts, which means updating any static path values used within scripts. It’s quick enough to build a sed script to convert /old/server/path to /new/server/path, but it’s still extra work.

The dirname command works to provide a dynamic path value, provided you use the fully qualified path to run the script … but it fails spectacularly whens someone runs ./scriptFile.sh and you’re trying to use that path in, say, EXTRA_JAVA_OPTS. The “path” is just . — and Java doesn’t have any idea what to do with “-Xbootclasspath/a:./more/path/goes/here.jar”

Voila, realpath gives you the fully qualified file path for /new/server/path/scriptFile.sh, ./scriptFile.sh, or even bash scriptFile.sh … and the dirname of a realpath is the fully qualified path where scriptFile.sh resides:

#!/bin/bash 
DIRNAME=`dirname $(realpath "$0")`
echo ${DIRNAME}

Hopefully next time we’ve got to re-home our batch jobs, it will be a simple scp & sed the old crontab content to use the new paths.

Oat Nut Bread

Oat Nut Bread

Recipe by LisaCourse: BreadCuisine: BreadDifficulty: Easy
Prep time

6

hours 
Cooking time

35

minutes

Ingredients

  • 2 1/2 tsp active dry yeast

  • 1 1/4 c warm water

  • 2 c all-purpose flour

  • 2 c white whole wheat flour

  • 1/2 c rolled oats, chopped

  • 2 T honey

  • 1 t salt

  • 1/4 c walnuts, chopped

  • 1/4 c sunflower seeds, chopped

Method

  • In a large bowl, combine the yeast (about 1/4 oz.) and 1/4 cup warm water. Stir and let stand for 5 minutes, until foamy.
  • Stir in remaining water, 1 cup of flour, the oats, and honey. Mix well. Add in salt, nuts, and an additional 1 1/2 – 2 cups flour. Stir, adding remaining flour gradually, until the dough comes together into a ball a begins to pull away from the sides of the bowl (this can also be done in an electric mixer with the dough hook attached).
  • Turn dough out onto a lightly floured board and knead, adding flour a tablespoon at a time as necessary to prevent sticking, until dough is smooth and elastic, about 5-8 minutes.
  • Place dough in a lightly greased bowl, cover with plastic wrap and let rise until doubled in size, about 1 – 1 1/2 hours.
  • Lightly grease a 9×5-inch loaf pan.
  • After dough has risen, turn dough out onto a lightly floured surface again. Gently deflate dough into a rectangular shape. Fold up the two long sides of the rectangle and pinch the seam together. Place seam-side down into prepared loaf pan.
  • Again cover the bread with a piece of plastic wrap and let rise until almost doubled in size, about 45 minutes.
  • While the bread is going through its final rise, preheat oven to 375F.
  • Bake loaf for 35 minutes, until an instant-read thermometer inserted into the bottom reads about 200F.
  • Cool loaf outside of pan on a wire rack completely before slicing.

One-Pot Pasta With Mascarpone

One-Pot Pasta With Mascarpone

Recipe by LisaCourse: DinnerCuisine: ItalianDifficulty: Easy
Servings

4

servings
Prep time

10

minutes
Cooking time

20

minutes

Ingredients

  • 16 oz fusilli

  • 1 T olive oil

  • 1/2 large red onion, chopped

  • 5 cloves garlic, crushed

  • 1 T Italian herb blend

  • 1 T salt

  • 28 oz petit diced tomatoes

  • 5 oz tomato paste

  • 2 T balsamic vinegar

  • 4 c vegetable stock

  • 1 T fresh basil

  • 16 oz fresh spinach

  • 4 T butter

  • 1/4 c mascarpone

Method

  • Heat a large pot, add olive oil, and sauté onions.
  • Add garlic and dried herbs, sauté for a minute.
  • Add tomatoes, tomato paste, salt, balsamic vinegar, and vegetable stock. Bring to a boil.
  • Add fusilli. Reduce heat and simmer for 12 minutes.
  • Add basil, spinach, and butter. Stir to combine.
  • Remove from heat and stir in mascarpone.