2008-02-28

Locksport International guide to lock picking

The So-called "LSI Guide to Lock Picking" has been around for a few years, but it's a great primer for people who are interested in learning the art, science, and sport to picking locks. It covers basic lock parts terminology, a quick guide on making some basic lock picking tools, and some tips for picking your very first lock.

A few things to note:

  • Picking your own locks or locks you have permission to pick is not a crime.
  • It's very much like solving an interesting puzzle by feel alone.
  • Certain locations (states, cities) have laws regarding transportation or carrying of lock picking tools, so it's best to keep them at home.
Read: The LSI Guide To Lock Picking (pdf link)

2008-02-27

It's official: Leopard = No network for OpenSolaris Indiana VMs

Lukas got it working on Parallels 3.0 under OS X Tiger, but two different HiR guys failed to get networking to work on OpenSolaris Indiana DP2 on parallels 2.5, 3.0 and VMWare Fusion when running Mac OS X Leopard.

Oh well. Like I said, maybe I'll give it a crack on a real computer when I have a lab machine ready to use.

UNIX Tips of the day - 10 good UNIX habits

Have I mentioned lately how I really like IBM's developerWorks site? I don't think I have.

I already know all of these tricks, but I still catch myself in bad habits on occasion -- for instance, I rarely using grep to count matches and I sometimes pipe things with cat when I don't need to.

The 10 good habits in the article are as follows:

  1. Make directory trees in a single swipe.
  2. Change the path; do not move the archive.
  3. Combine your commands with control operators.
  4. Quote variables with caution.
  5. Use escape sequences to manage long input.
  6. Group your commands together in a list.
  7. Use xargs outside of find.
  8. Know when grep should do the counting -- and when it should step aside.
  9. Match certain fields in output, not just lines.
  10. Stop piping cats.

Continue reading: Learn 10 good UNIX usage habits (via IBM developerWorks portal)

2008-02-26

Homebrew geeky UNIX screen saver

For the past 7 years or so, I've been doing fun things with XScreensaver to make custom screen savers that display useful information. My favorite XScreensaver mode is Phosphor, which renders olde-school green text on your screen. By default, it just displays information about your system such as system load and host name. While that's fun and all, it's pretty boring for a desktop system.

So, I'm a weather geek. Part of the reason is because I like being outdoors, but even when I'm cowering inside on a blustery February morning, I like to know what the weather is doing. On my FreeBSD lab machine, I configured Phosphor to display the hourly National Weather Service data for my area.

Obviously, you need to download and install XScreensaver first. You can do this using whatever means you want, but on FreeBSD, it's as simple as "sudo pkg_add -r xscreensaver".

Then, I put an entry in my crontab that looks like this (all on one line, though):

7 * * * * /usr/local/bin/lynx -dump -nolist "http://www.crh.noaa.gov/product.php?site=EAX&issuedby=EAX&product=RWR&format=txt" | tail +16 | head -n 15 > ~/.wx.txt

This fetches the weather data (without a list of links and stripped of HTML) for the eastern KS/northwest MO region, grabs the lines I want, then puts it in the .wx file in my home directory. This runs 7 minutes after the hour, every hour, every day.

Of course, you could use a similar script to do an hourly scrape of the front page of your favorite news site, or run any program that will generate a text file for Phosphor on a regular basis.

Now that we have the weather data (or whatever else you want) coming to us every hour, it's time to configure xscreensaver. First, make sure "xscreensaver&" is included before the window manager starts up in your .xinitrc or .xsession file, depending on if you're using an X Display manager or just startx to launch X.

Run "xscreensaver-demo" to access the configuration screen, and set it up to use only one screen saver, choose Phospor, then tell it to read the text file ~/.wx, as shown in the screen shots below:





Notice how the display has that cheesy-yet-familiar phosphor persistent delay? I love it!





Sorry this didn't capture very much of the screensaver, I'm trying to figure out why xvidcap keeps crashing on FreeBSD.

2008-02-24

Hungry Hungry Hackers

So, what do command line junkies do when the urge to food hits? They tap out their order and wait for the steaming goodness to arrive via Pizza Party. Not having a Dominoes account to work with I'm at a loss to test, but it looks promising. Now you can justifiably say that, yes, you can do just about anything from the command line.

(via a recent post on KCLUG)

Sysadmin Sunday: Quick & Dirty SSH Tunneling

Occasionally, you might need to tunnel some other traffic over SSH. This could be to get access to an external web proxy, to get a remote X display up, or to get around a firewall-blocked port that you must access.

The syntax (on the command-line OpenSSH client) for a Local forward is like this:

# ssh remote-example.h-i-r.net -L 3128:localhost:3128

This tells my SSH client to tunnel traffic to port 3128 on my workstation to port 3128 on my DMZ box. Port 3128 isn't accessible because of a firewall, but tunnelled over SSH it works fine. In this case, I'm running squid on the remote example host. Telling Firefox to use http://localhost:3128 as the proxy will now tunnel all of my web traffic over the SSH tunnel to the squid proxy behind the firewall. The reason it's called a local forward because it forwards a local port over the SSH connection.

A remote forward will open up a port on the remote machine and connect it to a port on the client's network. The syntax is similar:

# ssh remote-example.h-i-r.net -R 3306:dbserver:3306

This would open up port 3306 (the MySQL server port) on the remote host and tunnel it to the MySQL service on the host named dbserver on my local network.

While running forwarding of either type, you can enter the hotkey sequence "~#" to see all the open connections through the forwarded ports.

2008-02-23

RMS steps down as lead EMACS dev.

A story just popped up in my RSS feed on /. with a comment that mentions the XKCD comic about real programmers. I had a good chuckle. I never gave EMACS much of a try, as I like the simplicity of stuff like vi(m). Maybe now we can have him turn an OS (Hurd) into a decent text editor...