Posted Under: , , ,

I’d love to go into detail about how I hacked together this awesome way to install wubi from the loopback mount onto it’s own partition. Truth be told, save for a quick boot loader edit, I did almost nothing.

Take a look at this site: http://lubi.sourceforge.net/lvpm.html for a complete, visual step-by-step on how to install your wubi instance directly to your hard drive.

The only issue I ran into was with booting into Parted Magic. The DEB I was instructed to install pointed at the wrong disk for root() in the GRUB line. It was as easy as editing /boot/grub/menu.lst to point it at the right place.

In /boot/grub/menu.lst search for ubninit. Change the root line above where you landed to look like this:

root(hd0,)

Rather than this:

root(hd1,)

Enjoy!

0 comments | 0 pingbacks

Known hosts fun

23.07.2008 9:00

posted by: Benjamin Smith

Posted Under: , ,

Today I had to yank a line from my ~/.ssh/known_hosts file on my jump box here at the office and I noticed that I had a lot of known hosts! I’d be interested to see how many you have.

My work jump box:

bsmith@ops654 [09:06:04 (0.00)] ~/.ssh 
-> wc -l known_hosts 
1155 known_hosts

My desktop:

AGCOM\bsmith@bsmith-laptop [09:07:21 (0.22)] ~/.ssh 
-> wc -l known_hosts 
65 known_hosts
0 comments | 0 pingbacks

PyOhio 2008 Registration Is Now Open

15.07.2008 14:01

posted by: Benjamin Smith

Posted Under: , ,

PyOhio is a day long mini conference for Python programmers in and around Ohio. It will be held Saturday, July 26, 2008 from 9:00 to 6:00 at the Columbus Metropolitan Library.

We have some great talks scheduled. We are also planning on having Lightning Talks, Open Spaces and a Poster Session.

Did I mention that it is free as in beer?

You can register by going to http://www.pyohio.org/reg/register/.

0 comments | 0 pingbacks

Linux tip of the day - dmidecode

08.07.2008 20:54

posted by: Benjamin Smith

Posted Under: , ,

Here is a fun command we use at the office that makes extracting hardware info from a remote machine easy as pie. It’s called dmidecode and it can be quite useful. Here is one section of the information it can provide, extracted from one of my servers(some bits removed):

 Handle 0x0100
    DMI type 1, 27 bytes.
    System Information
            Manufacturer: Dell Inc.
            Product Name: PowerEdge 1950
            Version: Not Specified
            Serial Number: XXXXXX
            UUID: XXXXXXXXXXXXXXXXXXXX
            Wake-up Type: Power Switch

You are, unfortunately, at the mercy of the hardware manufacturer for accuracy of the hardware information, but thus far I’ve found it to be accurate.

Enjoy.

0 comments | 0 pingbacks

Linux tip of the day — Working with links

25.06.2008 19:44

posted by: Benjamin Smith

Posted Under: , ,

I recently decided that I needed to come up with a system for managing custom and commonly used python modules. In doing so I decided upon a directory structure similar to this:

volatile/
dev/
prod/

Where volatile would be an unsafe set of packages, not yet tested in a staging environment (constantly updated), dev would be the packages currently in the staging environment and prod would be the packages currently installed, or ready to deploy to the production environment. This has been done before, nothing new. Along the way I thought to myself, how can I conserve disk space, avoiding up to three copies of the same file? An easy and logical way to avoid this would be hard links. So, rather than having three copies of a file that gets approved through to production, I would hardlink back to the original. I will demand that new files into volatile be uniquely named, so avoid overwriting. As files become obsolete, they will be pruned down the line (a system to handle this would need to be developed).

SO! Now that we got passed the background, too the yummy tips.

I have this awesome directory structure of existing files, right? How do I duplicate it creating links instead of files, and creating the directories as needed(can’t safely hardlink directories). I knew I could use rsync with --link-dest. It would look something like this:

rsync -avz --link-dest /volatile /dev/ \
rsync -avz --link-dest /volatile /prod/

-a says to preserve things, -v is verbose, -z says compress and --link-dest says to make links of the destination files.

I also thought of some find/exec magic creating directories and linking files, it would look something like this:

cd /volatile; find . -type d -exec mkdir -p /dev/{} \; \
find . type f -exec ln {} /dev/{} \;

Repeating the same thing for the /prod/ directory.

Both the above solutions feel hackish, but would work. I thought, there has to be a simpler way, this is a fairly routine operation. After checking out google, I was pointed to the cp(1) man page, which uncovered this gem:

-l, --link
       link files instead of copying

Woah, I knew it. So much shorter and uses the right tool for the job!

cp -r -l volatile/* dev/; cp -r -l volatile/* prod/

It’s amazing what you’ll uncover with a tad bit of googling and man page searching!

0 comments | 0 pingbacks

All the cool kids are doing it, right?

16.06.2008 9:05

posted by: Benjamin Smith

Posted Under: , ,

Here’s my wordle, with my name removed. All my posts contain my name, so it was among the largest of words! I couldn’t look conceded, now could I?

4 comments | 0 pingbacks

Wow, out of date much?

09.06.2008 22:42

posted by: Benjamin Smith

Posted Under: ,

So, I was installing FormEncode on some servers today and ran across a fun ‘warngin’.

Check it out:

Running FormEncode-1.0.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-iKCYq0/FormEncode-1.0.1/egg-dist-tmp-3yiKdV
warngin: no files found matching '*.py' under directory '.'
warngin: no files found matching '*.html' under directory 'docs'
no previously-included directories found matching '**/.svn'
zip_safe flag not set; analyzing archive contents...
formencode.fields: module references __file__
formencode.api: module references __file__
formencode.util.doctest24: module references __file__
formencode.util.doctest24: module MAY be using inspect.getsourcefile
FormEncode 1.0.1 is already the active version in easy-install.pth

Installed /usr/lib/python2.3/site-packages/FormEncode-1.0.1-py2.3.egg
Processing dependencies for FormEncode==1.0.1
Finished processing dependencies for FormEncode==1.0.1

At first, I naively emails the modules author, Ian Bicking. Shortly thereafter I realized that the message most likely wasn’t from his module, but the distribution utility used to install it.

I got home and quickly rushed to my Inbox, which revealed that Ian had confirmed my thoughts. A quick google search (which I should have done in the first place) showed that this is an old “bug” from waaay back when with distutils. It kind of hurt to know that some of my servers have code that old on them…Good thing they’re not publicly accessible.

Man, it really helps to do some quick searching/checking before jumping the gun, and man do I need to get these systems up to date!

3 comments | 0 pingbacks

Using python with postfix pipe.

08.06.2008 13:56

posted by: Benjamin Smith

Posted Under: , ,

Dear Lazyweb,

I was wondering if anyone here had experience with using a postfix pipe to a python program for processing mails. Most of my background in mail processing is with qmail, Perl and procmail.

From what I can tell there appears to be a ‘pipe’ command that I could use in an alias to point it at my python program, then use the ‘email.FeedParser’ class to keep it from blocking. For now I’m parsing mails from the maildir via the ‘email.Parser’ class, then moving them around. It would be very nice to process them as they come in. This would eliminate overhead from firing up python whenever I want to parse messages and make my process somewhat real time.

Any ideas/snippets/caveats are greatly appreciated!

P.S. I’m doing this in python to hook into byteflow, the django app powering this site.

5 comments | 0 pingbacks

Amazon outage.

06.06.2008 14:59

posted by: Benjamin Smith

Posted Under: , ,

I’ve been following the amazon outage via google news and google blog search.. Anyone else cackling an evil laugh about this? If you work for a larg(ish) web site, you know how funny this is and how much it sucks for everyone (at amazon) involved. I am just relieved that it’s not us.

1 comment | 0 pingbacks
Posted Under: ,

The PyOhio organizers have extended the Call for Proposals deadline to June 15! Several potential speakers have requested extra time to prepare submissions, and now you can too.

http://wiki.python.org/moin/PyOhio/CallForProposals

Don’t be shy… speaking at an event like PyOhio helps you share your knowledge, deepen your expertise, broaden your horizons, meet people, practice for bigger events like PyCon, and have fun.

See you at PyOhio!

0 comments | 0 pingbacks
More Posts: »