IT

My .bashrc and .emacs Configs

July 18, 2011

At the request of some of my buddies, I’m making a short blog post here to share my emacs configuration file as well as my bashrc file.  I don’t think there is a whole lot going on in either of these, but there are some nice tricks I’ve picked up over the years.  The links to download will get updated over time.  To start off with, we’ll go over my bashrc since it is the simpler of the two.

Bash RC

Grab my .bashrc file and I’ll go over some of the special features.  It starts off by dot sourcing in any other system wide bash configuration files (including the excellent bash_completion config).  It then creates a PATH variable that most notably includes the current directory so you can just execute blah.py instead of ./blah.py.  I then define my editor as emacs, increase my history file and require it to only store unique entries (instead of like 4000 cd ~/ commands for example). It then defines all the basic terminal colors to help make building and changing my prompt easier (stuff like production = PURPLE, development = RED, etc).  After that I set my terminal title bar (thanks to Nick), enable grep color if possible, add some alias commands for ssh and common switches, and export my uber prompt.  My prompt is really kind of nice due to it dropping input down a line and starting with a hash symbol.  This results in very nice scriptable copy and paste commands like:

image

Where the blue line down is just a paste of the previous commands.  The # and newline make the prompt a bash comment and what you enter a command.

After that cool prompt I just have a neat function I grabbed somewhere (and add to from time to time), that will extract pretty much any archive file I have without me having to remember the switches to pull out a gzipped tarball vs. a bz2.  It is always just: extract file_name

Emacs

My emacs config is slightly more complex since it includes some handy libraries.  To install it, you will need to copy the file emacs to your ~/.emacs and create a ~/.emacs.d folder.  Copy the vendor folder into ~/.emacs.d/.  That should be all you need (of course back up your existing config if you don’t want it overwritten.  In general this nice config moves all your blah.blh~ files to ~/.emacs.d/backups (which makes for a nice central backup of previous versions), as well as your #filename# files to ~/.emacs.d/saves.  It changes the default tab width to 4, gets rid of the welcome screen, gets rid of silly bells, and fixes tramp and other shells to handle the cool shell prompt defined above.

On top of that it adds a vbscript and powershell mode to the editor (for you Windows shell scripters), loads the lovely color-theme library and chooses a default theme, adds goto line (M-g), and adds a few handy commands like line wrapping and indenting entire buffers.

Hit me up with comments or send me an e-mail if you run into any snags or have suggestions for other neat bash and emacs configuration tricks.

tags : IT, System

Migration from Zarafa to Google Apps

July 10, 2011

Over the 4th of July weekend I finally broke down and decided to migrate off of my own mail server and over to Google Apps.  Between the space, SPAM filtering, Android syncing, reliability, and cost, I couldn’t justify running my own mail services anymore.  It has been a great run for the last 10 years or so, but I doubt I’ll miss it.  That being said, here is a bit of a sysadmin journal of the migration, in case this ends up helping anyone, or more importantly myself, in the future.

tags : IT, Web

Setting Up IPv6 on a Home Network with Linux

June 19, 2011

So I have an IPv6 class tomorrow so I decided to study by dinking around with setting up IPv6 on my home network. I was disappointed to find out that Ubuntu (even the current revision), still doesn't ship with ISC's DHCPD v4 server, so I couldn't with DHCPv6, but other than that it was a blast.

Install FUPPES for Streaming Media to XBox 360 and iPhone

January 17, 2011

On Saturday I went on a treasure hunt for a UPnP / DLNA server that would work with Deena’s iPhone, the XBox 360, and my Nokia N900.  I wanted to be able to get our large music collection to every device in the house without any fuss, and I figured out how to do that with FUPPES.  Here is a copy and paste style install guide for getting everything setup and running using Ubuntu Linux as the media server (FUPPES supports other operating systems as well).

Project Complete

December 05, 2010

image

I just finished one of the largest undertakings I’ve ever been involved with when it comes to Web design by launching a newly designed KU School of Engineering site.  The project started in the summer of 2009 and involved migrating or at least assisting in migrating every School of Engineering academic—and some research—sites to a new template design given by the University.  This totaled about ten sites that needed to be migrated.

Remote Backup of Files, Subversion, and MySQL Using Rsync and Ssh

June 13, 2010

TuxRecently my VPS provider was doing some power maintenance and recommended backing up data.  I realized I hadn't made a backup of that system in very long time, and hadn't worked up a backup strategy.  This caused me to whip up a backup solution using my two favorite things; ssh and rsync.

In the past I had used tar and scp to do remote backups, but this painfully slow, and I don't have a requirement to do moment in time backups, so the amazing efficiency of rsync.  The only trick was that this server has subversion and MySQL databases, and doing a straight copy of the data for these apps is extremely dangerous.  So with a couple remote ssh commands run from the backup machine I ended up with a slick, simple, fast, and reliable backup script:

#!/bin/bash

# Individually backup relevant etc configurations using rsync
# with the archive and compressions flags set
rsync -az -e "ssh -i path/to/ssh/key" backup_user@example.org:/etc/apache2 /data/backup/etc/
.
.
rsync -az -e "ssh -i path/to/ssh/key" backup_user@example.org:/etc/ssl /data/backup/etc/

# Use remote commands to trigger app specific backups for MySQL and subversion

# Run safe backup of all MySQL databases to a location that gets rsynced later
ssh -i path/to/ssh/key backup_user@example.org "mysqldump -u root -pPassword --all-databases > /opt/backup/mysql-current.sql"

# Run safe backup of subversion using svnadmin dump to a directory that gets rsynced
ssh -i path/to/ssh/key backup_user@example.org "svnadmin dump --quiet /opt/repos/svn > /opt/backup/svn.current.dump"

# Sync /opt.  Backup everything.  This will grab the remote MySQL and subversion backups
# we just made.
rsync -az -e "ssh -i path/to/ssh/key" backup_user@cexample.org:/opt/ /data/backup/opt/

That is it. I get a safe backup of my databases and svn plus all of my file data ~8 GiB total, and after the initial backup it all happens in less than 5 minutes.

Attach it all to crontab like:

0 * * * * /usr/local/bin/backup.py

and you get an hourly synchronized copy of the remote server.

 

tags : FOSS, IT, System, VPS

Dell Updates

February 08, 2010

A quick update about my Dell Latitude saga.  I called customer service today at 7:00 a.m. and had a pleasurable and productive, albeit lengthy, exchange with their representatives.  I have managed an exchange for the ill-fated Latitude XT, and the process is everything that it should be.  They are sending a replacement laptop, and when I receive it, I'll just have to send the broken one back.  Hopefully they will ship it overnight, but that is doubtful, and I still haven't received any confirmation e-mails or phone calls that the exchange is going to actually happen.  I am cautiously optimistic.

Quick Update (2/10/2010):

I have heard back from Dell, and everything appears to going well so far.  I will say that I was dismayed that the standard laptop exchange takes 10-12 days to process.  They have assured me however that my exchange is a high priority and will be shipped overnight when it is ready.

Another Quick Update (2/18/2010):

 So, I received the replacement laptop as of yesterday, and everything works.  Well, pretty much everything.  The battery it came with was near dead, and while I did receive two CD-ROM attachments, one doesn't fit the CD-ROM, and the other, which does fit the CD-ROM uses e-SATA instead of USB, which the laptop doesn't have available.  So 8 days, and overnight shipping means it wasn't too bad of a wait for exchange, and just as I was about to call Dell about the not quite right bits I received a call from them.  They were OK with me swapping batteries, and tech support should take care of getting the right CD-ROM bit to me.  All in all, it took about three weeks to get everything straightened out, which was a tremendously long time, but on the plus side everytime I interacted with Dell's customer support staff, it was delightful (minus the call about the original shipment of the first laptop).

tags : Dell, IT, Personal

Love Hate Relationship with Dell

February 07, 2010

Dell has been the primary provider of commodity hardware in my current and last job.  At the NITC they were our primary provider of commodity servers, but the more exotic kit such as SAN, switching, and routing gear were left to field leaders in those areas.  I was extremely happy with their servers, we had great support, good pricing, and rock solid reliability.  At the KU School of Engineering Dell is the primary provider of all our IT systems including desktops, laptops, some switches, and all of our storage gear.  Again, I have been satisfied for the most part, though the prices and features for some of their re-branded storage kit has been painful.  The point of all that is that when it came to purchasing a replacement tablet for my girlfriend choosing a Dell Latitude XT series tablet seemed like a no brainer.  Wow, was that a mistake.  The entire experience has just been a nightmare.

tags : Dell, IT, Personal

Another fun thing about Apache

January 30, 2010

So recently I have run into some fun to do with the apache Web server, and I thought it was worth sharing.  Well I didn't really, but my buddy Jeff did.  Just about every time there is a holiday over the weekend at my work, at some point the Web server would run out of memory so badly it would crash.  It would crash so hard in fact, that it had to be hard power cycled.  I have tried just about everything short of sacrificing a chicken to try and figure this out.  Everything from cron jobs to bad PHP scripts (not mine of course ), but never really figured out the root cause.  Of course that was until MLK Jr. Weekend.

tags : IT, System, Web

Wow...Just...Wow

November 20, 2009

Really?!

I ran across this today while updating one of my clients Web pages, and I simply had to share.  Incredible.

 

Oh, and another representative line:

<p align="center"><strong><br /> </strong></p>

tags : IT, Personal