Archive for the ‘Development’ Category

BBEdit PerlTidy Filter

Categories: Development, Technology | August 28th, 2010 | by breandan | no comments

In my ever increasing quest to write better code, a friend of mine suggested that I use PerlTidy on everything I do. Every time I touch a piece of perl code, run PerlTidy. (Make sure it still works afterwards, of course, but that’s just common sense). So, here’s a Unix Filter for BBEdit to make PerlTidy a part of the editor. Save it into a file (mine is cleverly called PerlTidy.pl), and stick it into:

~/Library/Application Support/BBEdit/Unix Support/Unix Filters/


#!/usr/bin/perl -wn
use Perl::Tidy;
BEGIN { my $input_string = ""; my $output_string = ""; }
$input_string .= $_;

END {
Perl::Tidy::perltidy(
source => \$input_string,
destination => \$output_string,
);

print "$output_string\n";
}
__END__

The Nagios Project

Categories: Development, Home Network, Technology, Virtual Data Center | March 4th, 2010 | by breandan | no comments

I’ve been working on a massive home project recently – writing an Ajax frontend to Nagios and NDOUtils. This similar to groundworks, zenoss and op5, but I have specific needs to address, and a lot of what I learn in doing this can be used for my work projects. The important part of this is getting a handle on AJAX – it’s been all the rage for the last few years, but I avoided it because javascript implementations differs between browsers, and it wasn’t worth the hassle for what I needed to get done.

However, I’ve stumbled across jQuery – a mature, lightweight AJAX javascript library designed for cross-browser compatibility. I’m also working to achieve graceful degradation – so if a user doesn’t have javascript enabled, or their browser only understands a subset of the javascript calls, they still get full access the tools I write.

So, all of this lives in a subversion tree, and I’m madly hacking away on it. Once I get a stable, clean demo that validates user input, I may well post a link to it.

rsync over SSH on a non-standard port

Categories: Development, Technology | March 1st, 2010 | by breandan | no comments

A small tip for anyone using rsync, and trying to sync files from a server running SSH over a non-standard port (ie, something other than 22):

rsync -ac -e 'ssh -p24' username@remotehostname:/remote/path /local/path

In essence, you can run any command that gets a remote shell with the -e option, and if you use single quotes, you can pass as many arguments as you like. Handy.

Drive Throughput Improvement

Categories: Development, Home Network, Technology, Virtual Data Center | February 4th, 2010 | by breandan | no comments

I’ve gotta hand it to the OpenSolairs guys – they’ve done a lot of good work. When I was running an (admittedly old) build of Solaris Nevada, my network throughput would top out around 22MB/s – which is pretty respectable for a RAIDZ1 pool on consumer-level SATA disks. I was moving some VM disks around, and noticed this:

root@vault:~# zpool iostat tank 30
               capacity     operations    bandwidth
pool         used  avail   read  write   read  write
----------  -----  -----  -----  -----  -----  -----
tank        1.95T  1.46T     36      0  3.68M  17.8K
tank        1.95T  1.46T      0    324      0  39.5M
tank        1.96T  1.45T      0    511      0  62.9M
tank        1.96T  1.45T      0    501      0  61.7M
tank        1.96T  1.45T      0    485      0  59.6M
tank        1.96T  1.45T      0    482      0  59.3M
tank        1.96T  1.45T      0    498      0  61.4M
tank        1.96T  1.45T      0    509      0  62.6M
tank        1.96T  1.44T      0    495      0  61.0M

Wow. Just wow.

Preparing to Upgrade to OpenSolaris

Categories: Development, Home Network, Technology | January 24th, 2010 | by breandan | no comments

I’m finally doing it – working out all the bits needed to upgrade my remaining Solaris Nevada box to OpenSolaris. It’s doing a lot more than just being a fileserver, and it will require wiping out the boot drive (I don’t have a handy spare drive laying around), so I had to go into and make sure I knew exactly what the impact was of me formatting the drive and reinstalling.

Squid Proxy Server
OpenSolaris 06.09 has squid built in, registered with SMF. It’s just a matter of preserving my config files and making sure all the cache and log repositories aren’t on the root pool. Once I reinstall, 10 minutes later I’ll have my squid server back – and updates will be managed by Sun, not the bozos at blastwave.

DynDNS ddclient
I’ve got a copy of the script and the config file I’m using. It’s a matter of re-writing an SMF manifest to import, and making sure the pieces are in place. I should probably deploy this on other platforms – it’s not going to penalize me for running multiple copies.

DNS Server
Another simple service – it takes a hosts file and creates zone files etc. So, to get this ported is to grab a copy of the script and the hosts file, and run along my merry way, adding a cron job as I go.

Nagios Server
If you look into the contrib repository for OpenSolaris you can find packages for nagios, nagios-plugins, and nrpe. Perfect. Well, not perfect, as it’s Nagios 3.0.3, but it’s at least somewhat modern, and means I don’t have to mess with blastwave again. Again, save config files, move things over.

Firefly/mt-daapd Server
I’ve decided not to move this over. We simply don’t use it as much as I thought we would, and it’s not worth the trouble to move. If, at some point, we need it, I’ll dig up the instructions to get it running and blog it here.

UPDATE: I went ahead and did the upgrade (after saving the rpool to another ZFS pool). Two hours of reinstalling later, and we’re all good. I’ve got a couple of things left to do, but we’re back in business.

Older Posts »

The Guru College is Digg proof thanks to caching by WP Super Cache