Archived Posts from: ...And I Quote:


Having fun and solving problems can be mutually exclusive. Even for professional programmers and system administrators who chose their career because they enjoy problem solving, there can be times when finding a solution is an exercise in the mundane. Luckily, there are tools designed to ease the pain and frustration faced by programmers and admins. Ruby is a programming language that was designed from the start to not only provide a means of solving problems, but also to be inherently intuitive and fun to use. Wicked Cool Ruby Scripts, by Steve Pugh, is a book aimed to bring to light the fact that you can use Ruby to write concise yet useful scripts that solve difficult problems.

If you’re a fan of the “Wicked Cool” books from No Starch Press, you’ll find the format of this book familiar. It’s not a hefty tome complete with syntax and “hello world” introductory lessons, rather it’s almost a recipe book of sorts, divided into sections of problems and chock full of immediately useful Ruby code. This is the “Wicked Cool” book I’ve been waiting for, because although I write PHP and shell scripts (not so much Java and Perl, other topics covered in the series), I’ve always thought Ruby was the coolest of all. Right from the start, you can tell that Steve Pugh agrees with me. His tone throughout the book is that of a friend who has something fun to share, never browbeating or lecturing. He’s not simply writing to show us that he knows how to write Ruby well, he’s really trying to help us out.

Honestly, some of the examples in Wicked Cool Ruby Scripts might leave you wondering why you’d use such a powerful language like Ruby for such seemingly simple things. What Steve Pugh tries (and succeeds!) to show us is that Ruby isn’t just for writing massive web applications, but it can also handle tasks often relegated to the ubiquitous, but cryptic Awk or shell languages. Perhaps you still wonder why you’d want to? “Just because you can doesn’t mean you should”, right? So why bother? Because Ruby is “Wicked Cool”, that’s why.

So what’s cool? How about a simple file alteration monitor to help you see what’s changed on your system? Not cool enough? How about a web based photo gallery in about 50 lines of code? Still not impressed? How about writing a Metasploit module to attack one Windows machine from another? From general purpose utilities to system security and yes, even some games, Wicked Cool Ruby Scripts has enough in it to pique the interest of just about any programmer or sysadmin. I for one am finding it hard to concentrate on this review because I want to get back to writing Ruby. If you’re a programmer waiting for a good excuse to try Ruby, or a Windows sysadmin wondering what an open source programming language can do for you, you’ll find Wicked Cool Ruby Scripts enlightening, inspiring, and of course… cool.

So as you may know, I’m working on secret PHP project using the Zend Framework. It’s coming along well and I have been taking some notes on the server which is on the local network. I was about to download my notes and print them when I decided that printing directly from the FreeBSD server to the printer in our office should not be a difficult feat.

Of course… it wasn’t difficult, but it was a bit tricky. Here are some things I just learned, in no particular order:

* When installing the port called ghostscript8-no_x11 , you are asked to configure it and set up some options via the usual curses menu interface. One of these options says “include X11 support”. Doesn’t it seem strange that the port is named with the no_x11 suffix, yet including X support is an option? I thought so. I don’t have X on this server and never will. I don’t want X there. I unchecked the option, and then the build failed. Oddly enough you need to leave this option enabled or you will run into bizarre build errors like “ert file not found”.  Don’t worry though, leaving this option checked does not build X! (I don’t think it makes sense but with the port as it is today, this is the case)

* If you didn’t think about installing CUPS early enough to set up the special options in make.conf to tell FreeBSD’s ports system to overwrite the default LPR printing base, you’ll have to move or otherwise disable /usr/bin/lp and /usr/bin/lpr and then either link /usr/local/bin/lpr and lp to /usr/bin or just edit your PATH.  I found that tidbit here: http://home.nyc.rr.com/computertaijutsu/cups.html

* The DELL 5110 printer we use has been added to our windows domain. The drivers for PCL and PS were added to the print server so that when the printer is being added there are choices. If you have the PS driver installed, just use that, trust me. You can add the printer in cups’ web interface and tell it to send the job raw. It’s much easier, in my opinion, than messing with drivers and ppd files. Using the PS driver and the raw queue I was able to print a test page the first try, which is saying something, believe me.

* I wasn’t able to print text files properly via the lpr command. I got strange stair-stepping on my printouts and they were totally unusable. Using the a2ps command to format and send the output directly to the printer worked amazingly. I never saw a printed text file look so good. a2ps is available in the ports tree and it works great even when you’re printing from a FreeBSD server via Cups and the samba/smb backend to some printer on a windows domain.

I love vim. I love firefox. I love Vimperator because it lets me control firefox as though it was vim. Nuff said. If you love vim, then you should install this :)

http://vimperator.org/trac/

Oh - and Happy 4th Birthday Firefox!  (http://www.mozilla.org/press/mozilla-2004-11-09.html)

If you have a mac and use wireless to connect, you might expect that it will automatically join your wireless network after you tell it to “remember this network”. I know on my old powerbook it did, and on my girlfriend’s macbook it auto-joins too. So I started wondering why my macbook pro just wouldn’t do it. I searched the keychain and found my network in the login keychain, so I thought something really bizarre was going on. When I checked console (the console app in /Applications/Utilities) it said my network wasn’t in the system keychain!

To make a long story short (as my mother would say), I found a solution here: http://discussions.apple.com/thread.jspa?messageID=6757490

It turns out that when I moved System Preferences to /Applications/Utilities it broke my mac’s ability to add networks to the system keychain! I moved it back to /Applications, deleted the network from my network preferences and keychain and then joined the network again. This time the network was added to the system keychain and all is well!

The DHCP server at my office was reconfigured yesterday and it started forcing my macbook pro to change it’s name. I like having my host name remain constant for various reasons, so I asked in #macosx and some kind user there pointed me to this blog post:

http://www.elharo.com/blog/software-development/web-development/2005/11/29/setting-a-permanent-host-name-in-mac-os-x/

It works on leopard, in case you’re wondering! Solved my problem after a reboot.

If you installed Security Update 002 for leopard and suddenly ssh tells you “bus error”, the answer lies here:

http://discussions.apple.com/thread.jspa?messageID=6863360#6863360

Apparently the guys at rogue amoeba have some work to do - we need instant hijack!

If you are too lazy to read that thread, the fix is:

sudo /usr/local/hermes/bin/hermesctl unload

thereby uninstalling instant hijack and fixing the problem. Somehow…

… and here’s the fix from Rogue Amoeba:

http://www.rogueamoeba.com/utm/2008/03/19/security-update-2008-002-compatibility-fix/ 

Ever heard of Paul Robeson?

I was listening to one of my favorite artists, Saul Willams, the other day - when it occurred to me that he speaks about some historical figures that I didn’t know much about.  One of these is Paul Robeson. Saul Williams has a song entitled Robeson, and also mentions the name in “Coded Language” which is on the same album (Amethyst Rockstar). I really enjoy learning, and Saul Williams is an artist whose lyrics have a lot to offer in terms of knowledge, so I took some time to do a little research.

It turns out that Paul Robeson’s life is really interesting. While wikipedia is generally not to be considered an absolute source of facts, the entry regarding Paul Robeson is more than enlightening. I’m not going to quote the page here, since you can just read it yourself, but I will say that if you want to read about an interesting figure in American history, particularly if you are interesting in African American history, it’s well worth the time to read. Also, with regards to wikipedia as a source of facts, this entry is chock full of real references and cited sources.

I was looking for a way to configure iLo (itegrated lights out) on the new Xserve. Funny thing is after googe and yahoo and searching like crazy all over the place, the one site I should have checked first had the answers 1 few clicks away. I found this doc on apple’s site in the support section: http://docs.info.apple.com/article.html?artnum=304896

Which describes the 3 methods of setting up what Apple calls LOM (lights out management). I was searching all over for ilo when it was called LOM the whole time. Hopefully this will help someone else who searches for how to set up/configure ilo on the apple xserve.

The picture says it all…

Internal Error: Success

So I went to a diner… (a diner called “The Diner”). It’s obviously a diner so it’s pretty obvious that that they sell is… “diner food”, right? You know… pancakes, burgers, eggs, coffee - you know… it’s a diner. Someone walked in and asked the chef what kind of food they served. Hahaha how do you not know what a diner serves? *sigh* what is common sense?

Next Page »