Brad's Blog

Easy Custom Vagrant Packages 2012-04-16

I've been using Vagrant quite a bit lately, and one of the nice things you can do with it is to define your own package. This makes it easy to share your VMs with others. It's also nice to have the same stuff installed on every VM that you create! So, here's how you create a package. To do this, you'll need to Install VirtualBox and Vagrant. (At the time of writing, I'm using VirtualBox ...

Ubuntu Audio, YES! Windows XP, NO. 2009-12-13

I run a dual-boot Ubuntu64[1] and Windows XP system. The windows partition really exists for a single purpose, and I occasionally just reboot the machine, choose the XP partition from the Grub menu, and all is well.However, a few weeks ago, I upgraded Ubuntu, but when I rebooted the machine and chose the XP partition, I noticed the sound[2] stopped working. What!? The audio worked fine in ubuntu!The Secret: I had to completely power down the ...

Sticky Groups 2009-11-24

I often deploy web projects in a directory that's not owned by the user under which my webserver runs. Therefor, I often have to change permissions so the webserver can read from or write to certain files. So, for this example, let's assume I'm logged in to my linux box as brad, and I'm using apache which runs under the user www-data. To give apache access to my public_html directory, I'd change ownership for the ...

Public Keys don't like write access! 2009-03-25

The first part of my Automatic Backups with cron, tar, and SSH details how to set up remote login (sans passwords) using RSA public key.Apparently this doesn't work if your home directory allows groups or others write access. So if used ssh-keygen -t rsa to generate a public key which you added to a remote host (under .ssh/authorized_keys), but ssh is still prompting you for a password, try setting your home directory's permissions to something like ...

Recursively Renaming files 2008-09-05

My hosting provider offers PHP4 and PHP5. Unfortunately, all files ending in .php get interpreted by PHP4, while all files ending in .php5 get interpreted by PHP5. So, how do I quickly change all of my files that end in .php to .php5?Do a google search for "recursively rename files", and you might run across this:http://seal-7.blogspot.com/2006/12/recursively-rename-files-with-regex-one.htmlSo, to accomplish my task, I use the following:find . -type f -print0 | xargs -0 rename ...

magic SysRq 2007-02-09

Occasionally I goof up. Yes, as much as I hate to admit it, it's true. However, thanks to this handy tutorial on liquidweather.net, I've learned about some nifty ways to kill things in linux.In addition to the traditional ways to kill a process, this tutorial lists some magic SysRq key combinations that--if enabled in your kernel--can provide a nice option to just pulling the plug...Alt+SysRq+K - Kills all processes (SIGKILL / kill -9)Alt+SysRq ...

wifit - an iwconfig tool 2007-02-08

I've recently installed Mepis Linux on a couple of laptops (a Compaq Presario 2195US and a Dell Latitude D610, both of which use NdisWrapper for wifi drivers).I'm fairly mobile, so I needed a way to quickly change my wireless settings. I wrote this simple bash script to let me do that, and I thought I'd just share it.#!/bin/bash## wifit - the wifi tool## This is a script that accepts a wifi-enabled interface, ## essid, and an ...

Automatic Backups with cron, tar, and SSH 2007-01-10

Everyone knows that backups are important, but how many of us regularly back up our own websites, blogs, or whatever? Well, I've put together a relatively simple way for my Mac to log into my Linux-based webserver, archive some content, and download it for me. All of this is done Automatically, too!The first thing I had to do, was set up my home machine (a Mac, but any Unix-based system should work, too) so that it could log ...

Blocking outgoing UDP traffic using iptables 2007-01-03

Since rebuilding my server (after having it used to propogate a UDP flood DoS attack), I’ve been advised that I should set up iptables to block any unnecessary outbound UDP traffic. So, how do I do this?Well, the first thing I’ll do is update my apt repository, and install iptables using the following two commands:apt-get updateapt-get install iptablesNow, the quick and dirty solution is to just add append a rule that blocks all outgoing UDP packets from my ...

Building a Debian-Based Webserver 2006-12-31

Well, my server was recently compromised and used to perform a UPD flood Denial of Service attack (or so my provider claimed), so I’ve had to rebuild my server from scratch. Now, this seems like a daunting task, but it has actually been quite easy. I started out with a minimal Debian Linux system, and after a few apt-get install commands, and a few hours of uploading backups, I’m up and running again.How’d I do it? Well, i just ...

Spiral 2006-07-28

I've recently grabbed the latest version of Inkscape, (which resulted in the Spiral) and I just have to say, "WOW". I'd played with the software about a year ago (maybe more), and it's amazing how far it's come. Works perfectly on Windows and Mac OS X (with X11). If you like to use your computer to draw, download Inkscape now!