There is no Start menu; wait there is a Start menu. Is that a Start menu? Why are there two Internet Exploders? HOW DO I CLOSE THIS INTERNET EXPLODERS? Bubbles! Oh, that’s cool a floating clock–wait where’d it go. Fish!?
A Lobbyist By Any Other Name
My eyes must be fooling me. I just saw a pro-SOPA/PIPA advertisment on television published the the Campaign For Creative America. Is someone playing a joke?
Nope, apparently not. The Campaign For Creative America is no other than our “friends” the big names in Hollywood and the Entertainment Industry trying to garner public support for the almost-dead House and Senate bills. These of course were the pieces of legislation targeted by the January 18th blackout of Wikipedia, Google, Reddit and others.
Don’t be fooled friends. These are companies dressing in sheep’s clothing trying to rekindle any support for their dead bills. While I’m all for earning a profit in a free market, you’re not allowed to threaten free speech and suspend due-process with unconstitutional Federal laws in order to guarantee it.
Continue to write your senators and representatives to vehemently oppose these pieces of bad legislation.
Careful with those BASH loops!
I ran into something today that seems so very basic that I’m taken aback it hasn’t bitten me before.
For example, take this simple BASH ‘for’ loop:
for DERP in /dev/tty*; do echo ${DERP}; done
This should return a list of all the files matching /dev/tty* since BASH’s built-in file globbing expands as the list parameter of ‘for’ . Now, try this:
[bdowney@tlfmgt1 ~]$ for DERP in /dev/heraderp*; do echo $DERP; done /dev/heraderp*
Now the ${DERP} variable expanded to “/dev/herpaderp*”, but why? The answer is that since /dev/herpaderp* did not naturally expand into a list of matches (because none matched) the pattern itself becomes the list parameter. Makes sense once you understand what is happening, but seems a bit counterintuitive while programming.
I think most shell programmers would assume (myself included) the for loop would execute zero times upon no glob match.
So it would seem the correct way to handle this is by executing a subshell with a command that properly handles no-match globs, namely “ls”. In this case, it works perfectly and as expected–but we have yet another caveat:
for DERP in $(ls /home/bdowney/*.mp3 2>/dev/null); do echo $DERP; done
If we run into a file name with a space, say something like “01 – track1.mp3″, this version of the loop will still enumerate down to three separate list items because of the spaces, namely “01″, “-”, and “track1.mp3″. We cannot escape the subshell with double quotes, either. So we’re back to the plain globbing again without the subshell. So how do we resolve this? As follows:
for DERP in /dev/tty*; do
[[ -f ${DERP} ]] || continue
echo $DERP
done
Just test the loop iteration to see if it matches a file. Problem solved in all situations!
Old School Made New: Tradewars 2002
Many moons ago I ran a somewhat successful bulletin board system (BBS) called Communication Breakdown. You remember BBS’s right?
For all you newbies out there, BBS’s were the precursor to today’s Internet. People ran computers out of their homes hooked up to their telephone lines, and people would call each other using slow telephone modems to post on message boards, download and upload files, and play games. Many of the good friendships I still have today were made on BBSes in the 1990′s. That was the key difference versus the Internet today: Because you had to use your phone and could easily rack up a huge phone bill, generally you called other boards that were local. Naturally meet ups would often occur and friends were made.
But I’m getting off-topic. One of the bright spots of calling and running boards were things called “door games“. These were simple, text-based (modems, remember!) games that often involved interactions with other people on the same board, playing the same game.
Remember, in the early-to-mid 1990s MMO games like World of Warcraft and Eve were not even possible. Yet, on a BBS people could play against each other on-line before any of us even knew what TCP/IP or a web browser was. Back then, this was pretty mind-blowing stuff.
One of the bright spots of the era was a game called TradeWars 2002. In every conceivable way, this is the great-grandfather to today’s Eve Online. Trading for profit, corporations, alien encounters and building up ships: Tradewars had it all years before Eve was even an idea. Better yet, it was free and you could play it as much as you wanted (unless you ran out of turns for the day!)
A casual discussion came up in the office regarding old BBS stuff, and I was pleasantly surprised to find out that Tradewars 2002 is still around. Not only is it still around, it’s undergoing active development and has a dedicated following! Of course I had to set it up and start playing it with a couple of my co-workers. It’s every bit as fun as I remember, too.
Give it a shot! Telnet to tradewars.thelinuxfix.com and start playing. We won’t blow you up… too much. You’ll need a terminal (like PuTTY) that can do proper ANSI emulation. I bet “ANSI” is another term you probably haven’t heard in a good 10 years, either!
Fixing a Fortigate 200A
While prepping for the dedicated server build out at our Michigan datacenter this past week, a five year-old Fortigate 200A decided not to come back up after it had lost power. Via the serial console I determined the burned-in BootROM was intact, but no matter how many times I tried it the Fortigate kept responding “You must format the boot device.”
I also attempted flashing the unit back to the FortiOS level that we use, which sort of succeeded except for the very handy message the console threw back claiming it “Couldn’t write to the CF device”.
CF you say? Could that possibly mean Compact Flash?
This particular 200A was out of contract anyway, so instead of calling in for a service replacement I decided to crack the cover and see what was inside…
Not a whole lot for your few thousand dollars of investment! But sure enough… see that little card with the orange sticker on it? Peel that off and you’ll find a standard Apacer 64MB Compact Flash. Now the next question–would putting a larger (and readily available) Compact Flash work?
I can definitely say: Yes, yes it does. A quick run to MicroCenter to pick up a $15 2GB CF card worked in the 200A without a single complaint. Lots of room for onboard logging now! Additionally, that mounting pad to the rear of the mainboard matches the screw layout for a hard disk perfectly–and there’s an IDE cable attachment to the board sitting right there too–just in case you want to upgrade your onboard storage while you’re at it.
If you have an older Fortigate and do a lot of onboard logging, you might want to remember that CF cards have a limited write-cycle life, just like any magnetic media. At least now you know you can replace it without much fuss!



Recent Comments