web statistic EvilLawnGnome.com » Main

Two new creations

Blogged by Brian as Main — Brian Sun 20 Apr 2008 3:35 pm

Alright, i’ve been more active in the creativity department lately, so i thought it was time to fire this blog back up rather than emailing select people every time i created something semi cool.

First order of business: My new camera. Dad sent me some cash for my birthday, and i put it towards a new Nikon D60. After playing around with it, here’s a sample image of a flower in front of my house.

Okay, next up would be that i just installed Reason, and have been loving it. As you may know, i’ve been working on Debussy’s Claire de Lune off and on for months (over a year now, actually). Reason has some amazing piano samples, and a great mastering mixer. Here’s a rough playthrough of Claire de Lune, mastered with Reason. I mess up a few scales and the timing is pretty rough in some spots, but i still think i’m probably better than you at this song. :D

Enjoy.

The perfect keyboard

Blogged by Brian as Main — Brian Sat 12 Jan 2008 11:23 am

I spend a great deal of time every day typing. Either typing at the command line, typing in emails, or typing case notes. When i’m at home, i’m doing the same thing - typing emails and chatting with friends. I can rock about 80 WPM on the right keyboard. What is the right keyboard?

You are probably familiar with a modern keyboard. On the inside, it has tiny little silicone or rubber bumps that collapse when you press the key to make electrical contact.  In short, these keyboards suck. It’s possible to get misfires, and as time goes on, you may or may not notice the keys getting harder and harder to press. God forbid you spill anything in there; those rubber nubbins don’t take kindly to soda or beer. You’ll likely never use that keyboard again. No, this is not the right keyboard.

The right keyboard uses Buckling Spring technology. You’ve seen this before. I know you have - on those old computers in your schools computer lab or maybe your dad had an old IBM 386. THIS is the keyboard you want:

The original Model M

Now, unfortunately, the original Model M keyboard is out of production. You can buy them on ebay, but if you can find one new in box, it will go for well over $100. Used Model M’s typically go for $20-50. If you need street cred, this is probably the only option.

For the rest of us - those of us who just want a badass keyboard and don’t want to pay a high price for something that already has a lot of miles on it - there’s Unicomp. This amazing company is making Model M reproductions in both black and white, with and without the windows key, in multiple languages and form factors. I’m pretty fond of my Customizer 105:

A Unicomp repro

These keyboards are indestructable and an absolute dream to type on. Bonus: If you spill something in the keyboard, the special “drainage channels” keep the liquid from ever coming in contact with the mechanical or electrical parts of the keyboard. You’ll most likely be able to continue typing, although i would probably recommend letting it air out for a while.

A google search for Unicomp will drop you at the yahoo store, or you can follow this link. You won’t regret it.

A cheat sheet for linux newbies

Blogged by Brian as Main — Brian Fri 3 Aug 2007 9:14 am

I came accross the following article on Digg today. At first, i considered it blog-spam, but, the sheet actually would be pretty useful for the linux newbie out there. Grab it, print it, use it.

See the post here.
Get the PDF here.

Today: SysAdmin Appreciation Day.

Blogged by Brian as Main — Brian Fri 27 Jul 2007 9:59 am

See this.

You’re welcome.

SysAdmin Appreciation Day

HOW-TO: Microsoft Shadowrun in XP

Blogged by Brian as Main — Brian Wed 11 Jul 2007 9:53 pm

THIS NO LONGER WORKS. Well, it might. There was a comment recently from someone who actually got it to work, that was on october 7th. I don't think this person was playing on LIVE though. Basically, there was a patch that came out for the game and ruined the whole thing for us. Shadowrun was kind of crappy anyway, so i didn't bother trying to fix it or looking for any other updates. My HOW-TO will tell you how to get around the  error "This application has failed to start..." and that's it. Please don't post any questions here; I don't have answers and i don't want this to be a place to discuss illegal software. If you get yours working, and on LIVE, let me know and I'll update the HOW-TO with your information.

Recently, Circuit city had a sale on Shadowrun for PC: Buy the game, get $15 off, AND get a Wireless Gaming Reciever for Windows. That last little item lets you use a Xbox 360 Controller on your PC. Pretty sweet deal, right? Right. The problem is that Microsoft expects you to install Vista if you want to play Shadowrun.

Pass.

Fortunately for us, a hack / crack exists. Razor 1911 has released an archive containing 5 files that will let you play Shadowrun in XP. I recommend grabbing this from your favorite torrent site. It may also be available on usenet or IRC, but that's way more work than opening up the pirate bay and grabbing the 4 meg archive.

The installation is fairly simple. Allow me to borrow from the .NFO file:

  1. 1. Extract RARs
  2. 2. Install
  3. 3. Go into your installationfolder and delete the srsw_shadowrun.dll.
  4. 4. Copy srs_shadowrun.dll and srsx_shadowrun.dll to your installationfolder.
  5. 5. If you want the XP compatability, copy the files from the xp/ subdir to
  6. your installationfolder.
  7. 6. If you want a shortcut on your desktop, this is the time to make one!
  8. 7. Play!
  9. 8. Have fun!

The problem with this is that it is assuming you are installing the scene release - the w***z version. (We don't use that word on EvilLawnGnome.com because we don't want to attract the wrong type of user). I think there are quite a few people out there that have legitimately purchased this game and want to play it on an operating system that doesn't have a bad case of fail. I can't speak to Linux, but i can speak to XP.

Copy the files onto your pc

  1. Open up the dvd. Get thyself into x:/program files/microsoft games/
  2. Copy the shadowrun folder to someplace warm on your hard drive, wherever makes you happy.

Fantastic. Now, you need to crack that whip.

Apply the crack

Again, taken from the .NFO in the crack package:

  1. Go into your installationfolder and delete the srsw_shadowrun.dll.
  2. Copy srs_shadowrun.dll and srsx_shadowrun.dll to your installationfolder.
  3. If you want the XP compatability, copy the files from the xp/ subdir to your installationfolder.
  4. If you want a shortcut on your desktop, this is the time to make one!

Attempt to run it

At this point, double click on Shadowrun.exe and hope for the best. If it works, you can go on your merry little way. If you have the same luck that i did, you've got a few things you can do.

"This application has failed to start because the application configuration is incorrect. Reinstalling the application may resolve the problem"

This is why i hate microsoft. What a worthless error. Here's what you need to do:

  1. Re-install DirectX. Just for fun. Let's rule this out as the problem.
  2. Install the Microsoft VisualC++ 2005 SP1 Redistributable package.

You should now be able to play Shadowrun in XP. I came across this solution simply by googling for "Reinstalling the application may resolve the issue." This was a problem with a piece of homebrew code for something or other. I found it here.

All that remains is for you to configure your Live account. At some point, it may tell you that Shadowrun needs to update. This is A-OK. Said update may also complain that "The original file does not exist." Sounds like fail, right? Wrong. Fire up shadowrun again, and you should be ready to rock.

Well, ready to rock as hard as one can in this game. I hear it didn't get very good reviews...

Using X10 Home Automation and Linux to manage your home internet connection

Blogged by Brian as Main — Brian Wed 20 Jun 2007 11:05 am

I've been using SBC/Yahoo!/AT&T DSL for quite a while now, and i'm more or less satisfied with my service. My one complaint would be that my modem tends to flake out now and again. Who cares, right? Me. I run a linux server behind my DSL. I use it as a jumpbox, a private fileserver, an audio streamer, and i manage my torrents from it. Under most circumstances, i would simply call up AT&T and request that they troubleshoot my modem. However, i know that this is going to be a painful process. They aren't going to like that i use a dedicated Linux PC as my router - they will want me to hook up the modem directly to my PC, or buy an "approved" broadband router. So, you say, "Lie to them! Tell them it's all hooked up like in the manual!" They'll want me to run the "software" that came with the modem - little more than glorified spyware. Not gonna do it. Failing that, theyll want to spend a half hour doing meaningless tests that i've already done. I'll have to listen to them tell me how to ping and run ipconfig. It will be an hour of frustration that i just don't need.

Instead, I've devised my own needlessly complicated solution: Monitor the internet connection via shell script, and power cycle the modem with a couple of X10 home automation modules fit the internet is unreachable.

Summary:

1. Get a couple of x10 modules
2. Hook a lamp module up to the cable modem and the transmitter module up to a linux pc
3. Write a script that checks the connection to the internet and power cycles the modem if necessary
4. Set the script up to run every five minutes via cron

The modules

I did a google search for "linux x10" and found Heyu (http://heyu.tanj.com/), an actively developed set of tools for the X10 protocol in linux. Looking at the supported devices, i popped a couple of those in to amazon, and a few days later, i had myself a CM11A and an LM14A module.

NOTE:
Some people (Eric and Neil) are saying that the LM14A may not be appropriate for this job. Personally, i find that it's working just fine, and i'm not to concerned if it lowers the life of my modem - at that point, i'll replace it. This added functionality is worth it, and the functionality comes with minimal input effort. Read the comments if you are concerned that the LM14A may reduce the life of your modem. Additionally, GrinningArmor advises, "Any X10 module being plugged to the battery-powered output of an UPS is not likely to work, and could be burnt," and i agree with him. Your mileage may vary, but please be aware of these factors when making your decision on implementing this solution, and when choosing a module.
The CM11A plugs in to the computer via serial port, and the LM14A simply plugs in to the wall. The modem is then plugged into the wall module, and we are, for the most part, done. The wall module needs to have an address, and I left this module set to A1 for simplicity. (Further details about the X10 system are out there; they are simply beyond the scope of this document.)

The software

I chose Heyu because it was command line based, and therefore, easy to script. I'm running Ubuntu Feisty on my router, and Heyu wasn't available through apt-get. However, compiling the source required minimal effort. Up until now, this computer had no need to compile source code, so i had to install the toolchain. That's easy enough:

  1. apt-get update
  2. apt-get install build-essential

The next step was to configure / make / make install.

  1. cd /directory/with/source
  2. ./Configure
  3. make
  4. sudo make install

Heyu is now installed and can be accessed like any other command. Heyu is a complete X10 toolset, but there were only two commands i needed:

  1. heyu on A1
  2. heyu off A1

The basic functionality was there - i heard the wall module click on and then back off. Now, all i need to do is script up an internet check script.

The script

I've done a little programming in the past - at least enough to know that this is a ... wordy way to do things. This script could be optimized in a number of ways, but considering the simplicity of function, i'm fairly satisfied with the results. Below is the exact script i use to check for a valid internet connection, and power cycle the modem if necessary:

  1. #!/bin/bash
  2. #logger -t intertest "Beginning outbound connectivity test..."
  3. ERRORS=0
  4. ping -q -c1 -W1 208.67.217.230 &> /dev/null
  5. let "ERRORS = $ERRORS + $?"
  6. ping -q -c1 -W1 216.91.182.78 &> /dev/null
  7. let "ERRORS = $ERRORS + $?"
  8. ping -q -c1 -W1 69.147.114.210 &> /dev/null
  9. let "ERRORS = $ERRORS + $?"
  10. ping -q -c1 -W1 216.74.180.189 &> /dev/null
  11. let "ERRORS = $ERRORS + $?"
  12. ping -q -c1 -W1 69.63.176.13 &> /dev/null
  13. let "ERRORS = $ERRORS + $?"
  14.  
  15. if [ $ERRORS -ge 5 ]; then
  16. logger -t intertest "FAILED OUTBOUND INTERNET PING TEST! THE MODEM WILL NOW POWER CYCLE!"
  17. logger -t intertest "Beginning power cycle..."
  18. heyu off A1
  19. sleep 2
  20. heyu on A1
  21. if [ $? -eq 0 ]; then
  22. logger -t intertest "Done. Modem was power cycled successfully."
  23. else
  24. logger -t intertest "ERROR: Unable to power cycle the modem. We are screwed."
  25. fi
  26. logger -t intertest "Done. Cycling outbound interface [eth3]"
  27. logger -t intertest "Power nap before cycling eth3..."
  28. sleep 8
  29. logger -t intertest "Waking up, cycling eth3..."
  30. ifdown eth3 &> logger
  31. ifup eth3 &> logger
  32. logger -t intertest "MODEM POWER CYCLE COMPLETE! Stirring the pot..."
  33. ping -q -c1 -W1 208.67.217.230 &> /dev/null
  34. ping -q -c1 -W1 216.91.182.78 &> /dev/null
  35. ping -q -c1 -W1 69.147.114.210 &> /dev/null
  36. ping -q -c1 -W1 216.74.180.189 &> /dev/null
  37. ping -q -c1 -W1 69.63.176.13 &> /dev/null
  38. #else
  39. #       logger -t intertest "Connectivity check OK."
  40. fi

Let's take a look at this one section at a time.

Section one: Check for an internet connection:

  1. #!/bin/bash
  2. #logger -t intertest "Beginning outbound connectivity test..."
  3. ERRORS=0
  4. ping -q -c1 -W1 208.67.217.230 &> /dev/null
  5. let "ERRORS = $ERRORS + $?"
  6. ping -q -c1 -W1 216.91.182.78 &> /dev/null
  7. let "ERRORS = $ERRORS + $?"
  8. ping -q -c1 -W1 69.147.114.210 &> /dev/null
  9. let "ERRORS = $ERRORS + $?"
  10. ping -q -c1 -W1 216.74.180.189 &> /dev/null
  11. let "ERRORS = $ERRORS + $?"
  12. ping -q -c1 -W1 69.63.176.13 &> /dev/null
  13. let "ERRORS = $ERRORS + $?"

These IP addresses resolve to google, yahoo, hotmail, savvis communications, and facebook. You can select your IPs differently if you choose, but it wont really matter. The script will only power cycle the modem if all 5 pings fail. Speaking of pings, these aren't your garden variety pings.

-q is quiet
-c1 is to send one packet
-W1 is a one second timeout
&> /dev/null redirects stdout and stderr to the black hole.

We redirect the output to /dev/null because we don't really care about it. What i'm looking for is the exit status of ping - 0 if a reply is sent, 1 if no reply is sent. This section of code tallies up the exit codes using the special variable $? which contains the exit status of the last command.

Section two: Error handling (the meat and potatoes)

  1. if [ $ERRORS -ge 5 ]; then
  2. logger -t intertest "FAILED OUTBOUND INTERNET PING TEST! THE MODEM WILL NOW POWER CYCLE!"
  3. logger -t intertest "Beginning power cycle..."
  4. heyu off A1
  5. sleep 2
  6. heyu on A1
  7. if [ $? -eq 0 ]; then
  8. logger -t intertest "Done. Modem was power cycled successfully."
  9. else
  10. logger -t intertest "ERROR: Unable to power cycle the modem. We are screwed."
  11. fi

The first if begins the test of our error count. If it is greater than 5, it is safe to say that the internet is out. Less than 5, it could be that hotmail was being DOS'ed, or any number of other reasons why a site is unreachable. We only want to cycle the modem if we are SURE that the internet is unreachable.

Logger is a handy command to write an entry to the syslog - this way i can look back and see when or how often the internet failed.

The next command you'll see is the Heyu command. We turn it off, and wait a couple seconds to make sure everything is drained before bringing it back up. I'm sure the manufacturer would like me to wait 5 minutes before turning it back on, but the manufacturer also made a crappy modem, so that shows how much THEY know.

We check the exit status of heyu on the second command to see if the modem was cycled properly. This way i can see in my log if the heyu command failed.

Section three: reset the outbound ethernet connection

  1. logger -t intertest "Done. Cycling outbound interface [eth3]"
  2. logger -t intertest "Power nap before cycling eth3..."
  3. sleep 8
  4. logger -t intertest "Waking up, cycling eth3..."
  5. ifdown eth3 &> logger
  6. ifup eth3 &> logger

I found that sometimes after the modem was up, i was still experiencing connection issues. "Flipping" the interface seemed to resolve the issue. We log that we are about to do it, then wait a few seconds to give the modem a chance to warm up. At that point, we proceed, piping the output to logger.

Section four: Priming the pump

  1. logger -t intertest "MODEM POWER CYCLE COMPLETE! Stirring the pot..."
  2. ping -q -c1 -W1 208.67.217.230 &> /dev/null
  3. ping -q -c1 -W1 216.91.182.78 &> /dev/null
  4. ping -q -c1 -W1 69.147.114.210 &> /dev/null
  5. ping -q -c1 -W1 216.74.180.189 &> /dev/null
  6. ping -q -c1 -W1 69.63.176.13 &> /dev/null

We repeat the ping exercise, except this time, we don't care about the return. All this does is generate some internet traffic to get the modem to establish a connection to the internets.

Section last: Fin

  1. #else
  2. #       logger -t intertest "Connectivity check OK."
  3. fi

This section is mostly commented out. I had it enabled for about ten minutes to make sure that the script was actually running. I commented it out so that if the check is successful, no output is generated. "fi" ends the if statement we began so long ago, and also ends our script.

The cron job

With the script written, the last step is to set it up as a cron job that runs every five minutes. As root,

  1. crontab -e

and insert the following:

  1. # m h  dom mon dow   command
  2. 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/bin/intertest

This sets up the intertest command (my script) to run every five minutes, every hour, every day of the month, every month, every day of the week. This concludes the installation.

And this also concludes the how-to. I hope you enjoyed it.

Now with 100% Less Angst!

Blogged by Brian as Main — Brian Tue 8 May 2007 11:41 am

Everything from the old style blog has been ... hidden. This is a technology / entertainment blog, not my personal rag anymore.

IMMA CHARGIN’ MAH LASER

Blogged by Brian as Main — Brian Tue 8 May 2007 9:28 am

I'm currently working on a project to put a DVD laser inside an NES Zapper. Why? Because the laser in a DVD burner can burn stuff, thats why. You can light matches and pop dark balloons, and even melt black plastic. Basically, youre getting a wicked laser (wicked brand laser) for a fraction of the cost. I've hit a few snags along the way, (blowing a laser module, nicking the plastic on the blaster, generally making mistakes), so it's not quite finished. What i'm doing today is cleaning up the website, hiding all the OLD content to make room for the complete how-to and write up on the project when the time comes. Why am i doing this post at all? To give my google Ad-Sense time to change its content. You may see a few more progress updates from me about lasers, containing all kinds of buzzwords in the time between now and the final How-To. By doing this, and hiding all the old content, the site will be better suited for the inevitable hit that comes when the How-To goes live. I can certainly imagine getting hits from Hack-A-Day, Makezine, Digg, and Fark. If that goes down on the current server setup, I'd be screwed in a matter of minutes. To save myself additional agony, I'm going to use Flickr to host the images, and the writeup will be generic HTML. This may change after the initial surge in traffic.

Stay tuned.

SHOOP DA WOOP

I miss you

Blogged by Brian as Main — Brian Wed 2 May 2007 10:28 pm

I wish i could figure out what to do with this site ... I miss having a creative outlet.

Proudly powered by wordpress - Theme Back in Black 2 by neuro