Tag Archives: tech

Ars: “The secret to online safety: Lies, random characters, and a password manager”

Ars Technica: “The secret to online safety: Lies, random characters, and a password manager”

It’s time to ask yourself an uncomfortable question: how many of your passwords are so absurdly weak that they might as well provide no security at all? Those of you using “123456,” “abc123,” or even just “password” might already know it’s time to make some changes. And using pets’ names, birth dates, your favorite sports teams, or adding a number or capital letter to a weak password isn’t going to be enough.

Don’t worry, we’re here to help. We’re going to focus on how to use a password manager, software that can help you go from passwords like “111111″ to “6WKBTSkQq8Zn4PtAjmz7″ without making you want to pull out all your hair. For good measure, we’ll talk about how creating fictitious answers to password reset questions (e.g. mother’s maiden name) can make you even more resistant to hacking.

Dotfiles

I’ve got a dotfile repository started and now public, which you can reach either via the menubar at the top of the page, or directly at this URL. At the moment, I’ve got my RSS feed subscriptions, my bashrc, and my vimrc, but I’ll be adding others in the near future. All are updated via cron automatically.

Don’t know what a dotfile is? Check out this article: “What are dotfiles, and how do I customize them?”

Add weather to your tmux status line

Here’s a quick method to add your local weather report to your tmux status line. First, have a look at the lower right of this screenshot to see what we’re talking about:


(Click to enlarge.)

Okay, here are the commands we’ll be using, all of which are either already installed or likely available in your favorite package manager:


Here are the steps, assuming everything’s installed:

  1. Create a small shell script called “gettemp.sh”.
  2. Add a line to your .tmux.conf file that calls and displays the results of the gettemp.sh script.
  3. There is no Step 3.

Step 0, however, is to find your local METAR weather code. Don’t know it by heart? For shame! ;) Go to this NOAA/NWS page and drill down to get your four-letter code. We’ll use KLAX for our example.


So, Step 1 — save this code in an executable file in your path:

#!/bin/sh weather -i KLAX | grep Temperature | sed 's/ Temperature: //g'

There are three parts to this. First, running the weather command, which grabs the online weather report for KLAX. The full report looks like this:

$ weather -i KLAX Current conditions at Los Angeles Interntl Airport, CA (KLAX) Last updated Jul 08, 2011 - 01:53 AM EDT / 2011.07.08 0553 UTC Temperature: 68.0 F (20.0 C) Relative Humidity: 78% Wind: from the WSW (240 degrees) at 7 MPH (6 KT) Sky conditions: clear

Second, the script uses grep to find the line in the report showing the Temperature.

Third, the script removes the “Temperature: ” label, leaving the numerical temperature that we want to display.


Step 2, edit your .tmux.conf file. Now, if you already have a .tmux.conf file in your home directory, you might also have a line that starts set -g status-right — that’s the line we’re going to edit.

Here’s an example .tmux.conf file with a good mix of commands and options set. Find the set -g status-right line, which we’ll use as a starting point.

set -g status-right '#[fg=green]][ #[fg=blue]%Y-%m-%d #[fg=white]%H:%M#[default]'

As you can probably guess, this is showing the Year-month-day in green, then hours:minutes in white. We’ll leave the color alone and put the weather directly after the time thusly:

set -g status-right '#[fg=green]][ #[fg=blue]%Y-%m-%d #[fg=white]%H:%M # // #(gettemp.sh)#[default]'

(Note: this will only work if your gettemp.sh script is in your path; otherwise, you’ll have to specify a full path there.)

And that’s it!