Smart Home Naming is Hard

The past two years I have spent filling my home with smart home gear.  I haven’t touched a light switch or a TV remote in months.  It’s quite nice.  However, it’s not perfect and one of the problems you inevitably run into when you start to pile up the smart home gear is how to name things so that Alexa or Google or Siri can understand what you mean.

For instance, I had a light strip on the back of a TV that was named in my smart hub “TV light strip.”  That worked well until I bought the TV smart hub and now “TV” was also a device in the list.  When I tell Alexa or Google to “turn on the TV” they will sometimes turn on the actual TV and sometimes turn on the  TV light strip.  First world problems, am I right?

I’ve also had some issues with temperature sensors.  I named one “master bedroom” and then when I replaced the light switches in there, I wasn’t sure what to call the light for the master bedroom.

When I get my naming conventions down, I will update this or another post.  But in the meantime, be careful with your naming!

Continue reading

How to restart services on Linux box you’re not familiar with?

One of the things that I inevitably run into when my group takes over some servers from another company or department and we haven’t set them up ourselves, is where everything is and how to start and restart services. One trick that I use a lot is to do a “history” and pipe it to grep.

If I know the server runs Apache but I’m not sure how they’re restarting it, you can usually do this to see:

Or to be super-pedantic, a case-insensitive grep:

The results actually tell me a lot about the system without having to dig around very far:

You can replace “apache” with whatever service you’re looking for.

Happy history grepping!

Continue reading

How to map the ESC key on a Macbook Pro to be a VIM warrior

My old Mac died and I needed to get the new Macbook Pro with the touch bar. The touch bar is useless for a developer, just absolutely useless. The first time I went into VIM I felt the pain. No hardware ESCAPE key!

There’s lots of tutorials out there to remap your ESC key to your Caps Lock. The steps that worked best for me are below:

  1. Open System Preferences → Keyboard.
  2. Click the Modifier Keys button in the bottom right-hand corner.
  3. If USB devices are attached, you will need to “Select Keyboard” at the top and choose “Apple Internal Keyboard/Trackpad”
  4. Click the drop down box next to the hardware key that you’d like to remap, and select Escape.
  5. Click OK and close System Preferences.

Some steps pulled from the article No hardware Escape key on new MacBook Pros? Don’t fret, macOS Sierra lets you remap the Escape action to a modifier key

Continue reading

How to get the Minecraft Aquatic Update for Windows 7, 8 and Mac

If your kids haven’t already bugged you about it, the Minecraft Aquatic update has been released on some platforms. However, its still in beta on the Java platform for Mac and Windows. Here’s how to run the Minecraft beta (including the Aquatic update) on Windows 7,8 and Mac:

In the Java Edition, we put out regular test versions known as Snapshots: just go to the Launch Options tab, enable Snapshots, and then select the latest snapshot by clicking the arrow next to the Play button on the main tab.

Here’s info on how to get the Minecraft betas on all different systems.

Anything with a 1.13 release number should get you the Aquatic update.

Once in, create a world with 111 as the seed under “more options.”

Then when spawned in the world, go find an ocean. One should be close to you. Get a turtle shell so you can breathe underwater. And put some dolphin, turtle and tropical fish eggs in your inventory. Then you can spawn any of these creatures that you want in the water. Actually, it’s fun to spawn them on land too.


Continue reading

How to search and replace text in Vim

Here’s how to search and replace in vim (also known as “substituting” text).

Let’s say I want to replace the text “this” with the text “that”.  In vim, we can do:

This is saying, from line 1, to the end of the file (represented by $), replace “this” with “that”.  The “g” on the end is to do this multiple times on one line of text if applicable.
So you can mix this up and do it from line 1 to line 10:

Or from line 100 to the end:

Or only the first instance on each line (remove the “g”)

There you go.  Happy Vim substituting!
Continue reading

Error renaming database in SQL Server 2008

I right clicked on a database in SQL Server Management Studio and selected rename. Gave it a new name and hit enter. Eventually this error comes back:

The database could not be exclusively locked to perform the operation.

The better way to rename the database is using SQL running these queries:

Continue reading

How to check MD5 hash values for a file with a Microsoft tool

We have a lot of download sites blocked at work, so I’m not always able to just go and grab a utility when I need it. But I usually have access to all the Microsoft sites.  I needed to calculate some MD5 sums for a file on a Windows machine. You can do this with the Microsoft File Checksum Integrity Verifier or FCIV. The current version is from 8/22/2012.

The download is a zipfile that you can extract and it produces a .exe file and a readme. I put small utilities like this into a directory on my machine that’s easy to get to like c:\tools

Once you have the exe, you can follow the instructions of “How to compute the MD5 of SHA1 hash values for a file” or just use this:

Happy MD5 summing!

Continue reading