::fun with signature files

30 11 2007

Fortune is an itsy bitsy program in just about every Linux distribution that will give you a random quote when run.

jim@ingsoc:~$ fortune
Q: What do they call the alphabet in Arkansas?
A: The impossible dream.
jim@ingsoc:~$

This can make for minutes of fun if you’re staring at a command line wondering what to do next, but what if you want to do a little more with it?

I sometimes like to have a little fun with my email signature file, and a few months ago I thought it might be cool if I could generate a fortune for my email signature. Like a lot of people, I sometimes write a lot of email, and having to copy and paste a fortune every time I wrote an email would make the novelty quickly wear off. Instead, I decided to utilize the incredible power of bash scripting for this completely pointless endeavor. Following these simple steps can let you be as eL33t as me. Really.

And you know you want to be that cool.

So, here’s what I did.

First off, I made a directory in /home called sigs. This is just a handy place to put all of this coolness. Then inside that directory, I created a file called sigs. There’s some standard text that I want in all of my signatures, so I inserted that text. So far, that’s this:

jim@ingsoc:~$ mkdir sigs
jim@ingsoc:~$ cd sigs
jim@ingsoc:~/sigs$ nano sig

then you just insert your static text. In my case, that’s:

g o t j i m ?
http://www.gotjim.net

Now here’s where it gets really cool. Ready?

Fire up your favorite text editor–in my case, this is nano. Insert the following text:

#!/bin/bash

#Create a sig file based on fortune.

cp ~/sigs/sig.original ~/sigs/sig.new
/usr/games/fortune >> ~/sigs/sig.new
mv ~/sigs/sig.new ~/sigs/sig

Save the file and give it an obvious name. I chose sigmaker, but you can name it whatever you damn well please. I’m flexible like that.

Now, save the file and make it executable with chmod +x sigmaker.

Run it with a simple .sigmaker, and view the output with less sig.

g o t j i m ?

http://www.gotjim.net

Please remain seated until the ride has come to a complete stop.

Ohh, ahh.

Now you simply point your email program to your signature file. In the case of Thunderbird, you do this by going to Edit/Account Settings, and point to /home/you/sigs/sig. Open a new message to compose, and see your awesome skills in action.

But we’re not done here. Oh no. If you stop here, then the file never changes, and that defeats the point. So we’ll add this little slice of pimpness to our crontab for some real fun.

jim@ingsoc:~/sigs$ crontab -e

And do a little something like this:

# m h dom mon dow command
* * * * * /home/jim/sigs/./sigmaker

This will run sigmaker once every minute, giving you a new signature file with just about every email you write. You, of course, can change the timing however you like.

And there you have it, kids. A complete waste of time that’s good and good for you.

kisses,

jimbo





::shit broken

21 11 2007

kde4 installation=failure.

abort.

kisses,

jimbo





::maybe this post should be called

21 11 2007

“breakin’ shit.”

KDE4 Release Candidate 1 is out, and I’m currently installing it. Packages and instructions for Kubuntu 7.10 are here.

There will be an update shortly…maybe.

kisses,

jimbo





::social networking hits ubuntu

6 09 2007

Ubuntero, a social networking site specifically for Ubuntu users launched today. Sadly, it has already suffered the digg effect, and you can’t get to the site just now.

Regardless of this little bump, it should prove to be an interesting experiment in social networking.

kisses,

jimbo





::compiz rocks

2 08 2007

I just used this howto to get Compiz working, and I have to say that I’m very impressed.  I’ve never been much for eye candy just for it’s own sake, but this is just plain cool.

It is fast and smooth, and has a heap of very cool options.

The howto is straight-forward and very simple to put in place.  I highly recommend you give it a whirl.

kisses,

jimbo





::holy shit, batman

26 07 2007

10,003 hits as of this writing.

That’s cool.

kisses,

jimbo





::feisty joy

16 05 2007

So, I’ve mentioned before that my primary computer is a Dell D400 laptop.  Battery management has always been a minor issue, and I’ve never gotten what I think is the “standard” 2-3 hours that most folks get.

Because it can vary so much from laptop to laptop, power management is a little hit and miss, I think.  I tried various recommendations on the forums, but nothing really worked.  It got to the point about a month ago where I was getting maybe 45 minutes on a full charge.  I figured the battery was probably wearing out and not holding a charge anymore, and was trying to find one for less than the standard $80-$150 that most batteries go for.

I did a fresh install of Feisty about a week after it was released, and was very satisfied overall.  Performance without any tweaks is faster overall, and I’ve had no problems whatsoever with any of my hardware being detected or any software not working.  Wine even works, and I’ve never had any luck getting Windows apps to run well.

But the biggest improvement by far that I’ve seen is the new power management applet.  I can easily change battery modes from Dynamic to Powersave or Performance, and I get just over two hours on battery.  Suspend and hibernate both work flawlessly.

I’m very happy with the whole system.  Bug #1 is a little closer to being closed.

kisses,

jimbo