Categories

Albums

Shots

Pictures of things possibly worth looking at.
12 June 2012
1 images in album
2012_06_13/P6123751.jpg

Emblems

Powered By Jaws Project
Powered By Apache HTTP Server
Powered By MySQL
Supports RSS
Powered By RSS Lounge
















Computing

DRAFT Privacy and Email Usage Policy

I found out today my MX is blacklisted by Spamhaus, one of many RBL services out there. It's encouraging that this is the only RBL I failed. To remediate it, I need to implement some info on this site.

The Frankenstein

1/8 oz Fernet Branca
1 oz Melon liquer
1 1/4 Dillon's gin
1 oz Dolin's dry vermouth

measure over ice, stir and strain

pasado de moda

A Mexican variation on the Old Fashioned:

Back Online

Aaah, it's good to be back. After a hiaitus of several months, the 26a.net servers are back up and running, and nearly fully operational.

Email has just been restored and flipped back on for some tentative testing. If you had an account and cannot login, please contact me and I will get you up and running again.

SVN access is next on the list, and after that will be shell / sftp accounts. Thank you for your patience.

Search and Replace on all rows in a MySQL table using bash

While wrestling with a software upgrade to the LAMP application running this website, I wanted to test a fix for an issue I was experiencing. I would have thought this could be accomplished in straight MySQL, but a few searches including the official docs on the regexp and replace functions suggest it is not. When the best advice I could find was to do it in perl. Rather than bust out the old DBI routines, I decided to just use my shell.

Enjoying My mp3 Jukebox

A while back, I wrote down some thoughts about turning a spare computer into a jukebox to connect to my home stereo. Well, that dream has become a reality, although not exactly as I had originally envisioned it.

I'm currently listening to my Black Mountain mp3's through via a jukebox controlled over the home network. Thank you very much to the makers of Theory, a client for mpd. Theory is written in python using pylons, has a nifty AJAX-based interface, and optionally hooks into AWS to grab album art.

To make theory more useable, I installed a light web server (I chose nginx) in order to proxy theory over port 80. Of course pylons can't connect to port 80, since that would be a huge security risk for a number of reasons. I created a user account under which to run theory, and added a line to /etc/rc.local which starts theory when the machine boots. As it turns out, theory didn't like having the URL paths rewritten, so I couldn't use, e.g. "location /tunes"; I had to map the app to the docroot of the host, like so:


server {
listen jukebox;
server_name jukebox jukebox.lan jukebox.26a.net;
location / {
proxy_pass http://localhost:9099/;
root /var/www/nginx-default/;
index index.html;
}
}


Finally, I didn't want the machine to be on all the time (too noisy, wastes power, generates heat), and I didn't want to wait for the whole boot sequence every time I wanted to play some tunes, so I installed hibernate and the userspace software suspend package for debian. After configuring uswsusp, I modified /etc/acpi/powerbtn.sh - at the very end of the file, I commented out the call to "shutdown", and replaced it with a call to hibernate:


#/sbin/shutdown -h now "Power button pressed"

echo "Hibernate activated by power button"
/usr/sbin/hibernate



Headless and wireless, the beige box just sits on the stack with my other stereo components in the living room, while I control it via any machine on my LAN. Ta da!

Firefox Plugins

Firefox is a pretty rockin web browser. Still not quite as good, imho, as Galeon, but it's good enough, and it seems the Galeon project is heading into uncharted territory. I've been using Ffx a lot more lately, while I wait to see what comes out from the interesting experiment going on with the Galeon devs.

All of that is just a preface for the curious to the main point of this posting: Below I'm listing the Ffx extensions I find indespensible. Link love for the devs, and a list in one place so that I can sync up my desktop at home, laptop, and various work machines with the same set of tools I've grown to expect from my browser. Without further adieu:

Tracking Changes to Important Files with Subversion

aka. Revision Control for /home and /etc folders

Introduction


In Unix, the /etc folder contains most if not all of the system's configuration files. /home usually contains folders for all the system's users. I once read an article from a self-admitted obsessive-compulsive sysadmin who kept his home folder under revision control using a program called subversion. I thought this was a nifty idea, but of course, I didn't quite find the article to be a one-stop how-to on the subject. I'll spare you the long story of everything I did to get this working; here's what I did right:

Getting Set Up


I set up my new computer and installed the base operating system. Don't be jealous... it's an old, second-hand laptop which is now running Gentoo Linux. Subversion was one of the first pieces of software I installed once the system was up and running. I decided that, at least for now, I don't need to set up a fancy daemon to act as a subversion server, so I just created the repository as root with the plan to check-in all my changes using the file:/// protocol to access the repository, since I'll always be committing the changes locally. Logged into my machine as the root user, I got down to it:
mkdir /var/svn/repos
svnadmin create /var/svn/repos/backups

Dealing with Special Files


I quickly realized that file ownership, permissions, and special files such as devices would be an issue, so I downloaded a little script called asvn which is a wrapper script to subversion, to keep track of these properties that don't normally get recorded in a repository. I had to edit the script, which I put in /usr/local/bin, and change the path of my svn program which the script expects to be in /usr/local/bin, but which gentoo installed in /usr/bin. Then I was ready to go.

Ready for Takeoff


I imported my two very special folders into subversion, but then I realized that, though this added them to the repository, it didn't make the original folders into working copies for me. There is actually a 'best practices' way of doing this, described in the Subversion FAQ.
svn mkdir file:///var/svn/repos/backups/etc
cd /etc
svn co file:///var/svn/repos/backups/etc .
asvn add *
asvn ci
I repeated the process for /home, and now my folders are all set up. I should be able to easily tell which files have been added or changed, revert back to an older configuration if I happen to screw anything up, and add in new files to be tracked. Once it's working smoothly, I'd like to automate some of it, so that my configuration is always saved when I shut down the computer.

Day to Day Stuff


It was a good thing I did all this when the system was shiny, new and clean. But, I quickly noticed a number of files in my home folder that I wouldn't want to have under revision control or in my repository at all. I wasn't too worried about sensitive data being on there, for a number of reasons. Most importantly, nothing will be stored in my repository until I add it to subversion in my working copy. But, as it turns out, I do have to take things into consideration, such as my web browser's cache. Well, subversion has a way to let you ignore these things, by setting a property on a file or folder. First, I created a text file with the list of patterns to ignore:
*~
*history
*.bak
*private
*[Cc]ache*
.ssh
Next, I set the "svn:ignore" property on my home folder to the contents of that file:
asvn propset svn:ignore -F svn-ignore-patterns.txt /home

New Site, New System

So far I'm quite happy with my new site that I've set up using Jaws. I can see a lot of potential, and I think I'm just going to let my dev site drift off into its own experimental zone. My tinkering with Jaws can be watched live at http://alpha1.26a.net. One thing that might be different over there is that that space contains my thoughts on the jaws software. Yes, I categorized this under "fun".

FP

woot!