Mostly about my amusement

Tag: Geek (page 1 of 1)

sed to the rescue again

Some days you just want to quickly edit a bunch of config files in one go.

One of the reasons I use Ubuntu LTS is that it’s got long term support (<light sarcasm>is that why it’s got LTS in the name?</light sarcasm>) and I make configuration templates that I just reuse in all the places. Poodle was announced and the short of it is that you need to disable the SSLv3 protocol on your web server.

No big deal. Visit your sites-available directory and change “SSLProtocol All -SSLv2” to add “-SSLv3” at the end. 17 times.

*Drinks more coffee and makes that face*

Or you know, run this command after checking you have “SSLProtocol All -SSLv2” in those mod_ssl config files.

sed -i.bak -e 's/SSLProtocol All -SSLv2$/SSLProtocol All -SSLv2 -SSLv3/g' *.conf

The -i.bak is to create unedited copies because bad things do happen to nice people.

Once I made sure that the files were edited I ran these commands to restart the web server and test.

service apache2 restart
openssl s_client -connect -ssl3

I promptly saw this line.

140496364975776:error:1409E0E5:SSL routines:SSL3_WRITE_BYTES:ssl handshake failure:s3_pkt.c:596:

And all was right in the world. I deleted the .bak files and finished my coffee.

Tabs and spaces

Self? Remember this:

tr 't' ' ' | sed -e 's/  */ /gp'

You’ll need it later.

At work I use bash, sed, [e]grep, cut, tr, and occasionally awk if I can’t get out what I need from the others. These aren’t used as scripts per se, just some tools I use to massage data.

Need that formatted, irregular, multi-line text file broken up and ripped into another format for processing? Sure, not a problem. Most people would (correctly) use PERL but I never got into it that much. I hardly ever get the same situation twice and deal with new data all the time.

But I do need to remove tabs and multiple spaces almost every time. While I always remember the tr part, I always need to rethink the sed regular expression. So here I am, writing a post to myself to keep it in my mind.

Middle age? It took me forever to get here

As you get older, your habits change and you do different things. In the past I have spent a great deal of time building Linux servers and running my domain’s mail and spam filters, my own web servers for family web sites, ftp server, and sometimes hosting a game server.

Linux and open source software is cool and exciting.

This past week? I’ve been working on my own time preparing the pool for Sunday. Last year we opened the pool up for the first time on Memorial day and had a great summer. Since it was the first time the pool company took care of balancing the water, adding salt, etc. This year it’s all me and Lily.

It’s not a great deal of work (vacuuming was a pain), and the pool is really low maintenance. It’s just that I used to spend my time doing geeky things.

Now my geek tasks are actually managed.

  1. My domain’s mail is handled by Google Apps because I was spending serious time losing the spam battle.
  2. I update my WordPress site using the automatic upgrade feature while I weep for my lost SVN commands.
  3. I never host any game servers anymore and feel like I should yell “you kids get off the lawn!”
  4. My Linux distro of choice for my servers is Ubuntu 10.04 LTS because I got tired of updating Linux distros every 6 months.

My hobbies have changed too. I used to play PC games much more frequently but lately I’m more into photography. Unlike other family members, I’ve only gotten into this about 3 years ago. And my 35mm film infatuation is more recent than that, I carry an Olympus Trip 35 everywhere.

I still plan on working on my Gunpla collection, but I’m finding it funny how my spare time is being used. I’m not upset about it, but the observation makes me laugh.