Getting browserconfig.xml out of your error logs

Getting browserconfig.xml out of your error logs

I’ve noticed a spike in 404s on several of my sites for browserconfig.xml. Turns out Windows 8.1 looks for this file automatically when a site is pinned to the start screen.

This file allows you to define several things, including graphics to use for various size tiles and also an RSS URL so you can update your readers when you have new content. Pretty neat. I doubt other browsers or OSs will pick up on it, but if you are noticing 404s for it in your logs, it may be worth the effort to throw a browserconfig.xml file together.

Microsoft conveniently provides a tool for doing this. It allows you to do the basics and will even resize your images for you. They also provide in-depth documentation on the file format in case you want to get more advanced.

I’m in the process of rolling this out to my sites, so no idea yet on whether the notifications will actually drive traffic, but it is so easy to set up that it is worth the initial effort.

Read More

A better CSS reset stylesheet

A better CSS reset stylesheet

If you aren’t a web developer then you may not know this, but browsers are a mess. Every browser picks and chooses how it wants to render the same HTML. For examples, some browsers don’t have any default margin on the body. Some do, but with varying amounts of margin. Internet Explorer is of course the worst offender, and there are many versions of Internet Explorer still widely used.

To get around these issues, web developers typically use what is commonly called a reset stylesheet. This CSS file resets all of the default styles for all the possible HTML elements, so that you have a blank slate to start with. They’re a bit of a pain to use because they require the web developer to then define what they want the styles to be for everything. For example, they typically wipe out padding and margins on all elements, so you have to set padding and margins on all elements if you don’t want them squished together.

Fortunately some smart people created something even better than a reset stylesheet: normalize.css. Instead of resetting all the default styles, normalize.css selectively sets reasonable styles only for the elements that need it. It keeps all the default styles that are already in use by the majority of browsers. You can get it for free here.

Read More

Flashlights for a 72 hour kit

Flashlights for a 72 hour kit

Flashlights are a basic item in any 72 hour kit. In an emergency you are going to need light: to set up a tent, to walk a trail, to find your stuff in a shelter, to read a map at night, etc etc. After doing a fair amount of research, I feel a kit needs three flashlights: a lightweight handheld battery powered flashlight, a battery powered headlight, and a crank or magnetic induction flashlight.

Lightweight handheld battery powered flashlight

I made the decision to power all my electronics with Energizer Ultra Lithium AA batteries. Using AA batteries really narrows which flashlights you can get. Big flashlights with D batteries are way too big and heavy for an emergency kit. Small flashlights with AAA batteries would require carrying AAA batteries and AA batteries. My solution was to buy whatever cheap flashlight I could find at Walmart that took AA batteries. For me it was a Black & Decker Cliplight. It is about 6 inches long, takes two AA batteries, and is reasonably bright at night. I plan on keeping two Ultra Lithium batteries in it, and packing two spare batteries in my bag.

Battery powered headlight

A headlight makes it easy to see while setting up a tent in the dark. It can also be handy if you are carrying a toddler while walking on a dark path. My choice of AA batteries again limited my options here. I ended up getting the Rayovac SE1WHLT-B Sportsman Xtreme on Amazon. It takes a single AA battery and claims to provide 45 lumens. It also has red LEDs so you can get a little light without ruining your night vision, and a low-power blue LED that allegedly makes it easy to see blood in the dark (designed for hunters), but I’ll probably just use it to save battery power.

The downside to this headlight is that it won’t last long on a single battery. With the main light, it will probably only last around 3 hours. Because of this I’ll be packing two spare batteries.

headlight

Crank or magnetic induction flashlight

It is vital to have light even if the batteries die and you run out of spares. This means you need something you can power on your own. The typical options for this are hand crank lights or magnetic induction lights (the kind you shake). I personally hate the shake lights, and my radio of choice comes with a crank and a flashlight, so I think I’m set.

Disposable flashlights

If I end up with a little extra room in my pack then I’ll probably pack several flashlights that I consider disposable. These are cheap (or more often free) LED flashlights from Harbor Freight. I consider them disposable because they tend to take button cells (like the common CR2032) and I’m committed to carrying only a single type of battery. The flashlights themselves are so inexpensive that it wouldn’t bother me to lose one (or two or three), trade them away, or to just toss them when the batteries die. If I end up putting these in my packs then I’ll probably use them up before draining the batteries on my primary lights.

Read More

Use an old cell phone as a baby monitor

Use an old cell phone as a baby monitor

When my first child was on her way I bought a fancy baby monitor. It had pan, tilt, zoom, night vision, a temperature sensor, etc etc. It did everything. It had two huge problems though: it severely degraded my wifi whenever it was on and the battery in the monitor went bad before the second baby arrived. Lame.

For my second child I switched to using an old Android. It doesn’t pan or tilt. It doesn’t have night vision. But it works, it is free, and it uses junk I already had laying around.

On the old Android I use IP Webcam. It is a free app that streams your phone’s video/audio.

On my current phone I use VLC for Android beta. It is also free, and lets me stream the audio from IP Webcam (which is all I want at night anyway). I leave it going all night so I can hear my son in case he gets up. It also makes it easy to go out and do yard work without worrying about him waking up without anyone inside to hear him.

To stream the audio on VLC, use the IP from your IP Webcam phone and add audio.wav to the end, like this: http://192.168.1.133:8080/audio.wav

2015-01-12 19.52.42

During the day, when I’m in my home office working, I can use my browser to watch/listen to him when he is down for a nap. Again, I can’t pan or tilt, but all I really care about is whether he is awake or asleep. I don’t really need pan/tilt for that.

Read More

Debugging bash scripts

Debugging bash scripts

I use a lot of bash scripts to automate my server tasks. They are quick and easy to write, and work across multiple distributions with little to no modification.

Debugging bash scripts is easy. If your bash script is named awesome_script, then you would do something like this:

bash -x awesome_script

In addition to running the script, it will output every command the script runs along with the result of that command. No modifications to your script are needed.

Read More