Netcat + Tar for simple file transfers

January 31st, 2010

This past week I spent 3 days watching a 3-thread sftp process transfer over a system backup of 53GB. This backup in particular had a ton of files and directories, and I suspect most of the actual time was spent querying and creating the files rather than the actual transfer itself. Now that everything is transferred over, I can rsync it against another machine, but that's another story.

In searching for a better way than what I did, I found this cool gem:

On the sender:

tar cf - directory_to_copy | netcat other_host 7000

On the receiver:

netcat -l -p 7000 | tar x

The Source

 

Django On-Demand Model Fields

November 19th, 2009

I'm writing an Inventory system for work in my downtime, part to brush up my rusting Django skills, part because we really need one.

We started with a few requirements for what would make a good inventory system to meet our needs, and one of those was that it would be painless to add new types of items and have the ability to customize them. If you know much about Django models, you probably know enough to know that models are typically hard-baked. If you're writing a blog system, you might create a model with fields for Title, Author, Date, Text. Well for us, what if I want Widget X to have a field for Serial Number, and Widget Y to have a field for Firmware?

 
 
© 2008 Will McGugan.

A technoblog blog, design by Will McGugan