Welcome
 

Making volume labels

Monday, May 12th, 2008 Comments Off

I always forget how to make a volume label. Here is a page that rounds up various methods for different filesystems:

www.debuntu.org/device-partition-labeling

The part on labeling FAT filesystems is not quite right. It works, but there is a better way. First make sure you have the debian package “mtools” installed:

To see if there is a label already there:
sudo mlabel -i /dev/device -s ::

To write a new label:
sudo mlabel -i /dev/device ::newlabel

In the place of “/dev/device” you should use something like “/dev/sdd1″.

 

netcat tricks

Monday, August 13th, 2007 Write a Comment

I have always liked netcat, but I never really use it at work. But I always feel like I should. Here is a wonderful list of things you may be able to use netcat for:

useful-netcat-tricks

Looking at the comments of that blog I saw another cool thing to do involving network transfer of files. It introduces a utility I didn’t know about before called lzop. It goes something like this:

On the sending computer…

dd if=/home/me/my_file | lzop | nc 192.168.0.1 9000

On the receiving computer…

nc -l -p 9000 | lzop -d |dd of=/someplace/my_file

So, the sending computer uses dd to pipe the file to lzop (which compresses it) then pipes it to netcat. The receiving computer gets the file via netcat, pipes it to “lzop -d” to decompress it, and finally dd gets it and writes it to disk. With lzop providing compression the transfer should go pretty quick. If the file compresses easily. Lzop is preferred in this case because it is supposed to much quicker than gzip, so it doesn’t get in the way while doing its thing.

A potential downside to sending huge files is that you have no progress meter. I suppose you can do a ls from time to time to judge when the file transfer will be done.

I have not tried any of this yet…