<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-34576434</id><updated>2011-09-30T07:23:39.154-05:00</updated><category term='archival'/><category term='Displays'/><category term='Fedora'/><category term='open source software'/><category term='creative-commons'/><category term='Luxeon'/><category term='ext2/ext3'/><category term='bugs'/><category term='Nikon D-50'/><category term='dns aliasing'/><category term='Kernel'/><category term='e2label'/><category term='Remote Desktop'/><category term='GNU'/><category term='codecs'/><category term='bicycles'/><category term='panoramas'/><category term='BitTorrent'/><category term='gas mileage'/><category term='repair'/><category term='maintenance'/><category term='piping'/><category term='LED'/><category term='hardware'/><category term='backup'/><category term='ogg vorbis'/><category term='Hugin'/><category term='scripting'/><category term='checksums'/><category term='gnu+linux'/><category term='data management'/><category term='SSH'/><category term='beep'/><category term='shell scripting'/><category term='usb'/><category term='photography'/><category term='Thunderbird'/><category term='IMAP'/><category term='encryption linux storage'/><category term='Gmail'/><category term='music'/><category term='Perl'/><category term='removable storage'/><category term='blog'/><category term='computers'/><category term='system configuration'/><category term='needs revision'/><category term='PHP'/><category term='E-mail'/><category term='Perl CGI'/><category term='file organization'/><category term='Linux'/><category term='ddclient'/><category term='flac'/><category term='HTML'/><category term='Power Regulators'/><category term='VNC'/><category term='Intel'/><title type='text'>Ryan's Bliggity Blog</title><subtitle type='html'>This blog allows me to disseminate knowledge I think should be readily available. If I find myself ranting, I try to make sure it's informative, and not completely  subjective. I try to offer solutions--not problems--but in the case I do present a problem, please feel free to post a comment.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>54</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-34576434.post-7259300353333558544</id><published>2010-01-09T11:17:00.007-05:00</published><updated>2010-01-11T21:20:18.420-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='encryption linux storage'/><title type='text'>Encrypted FS with LUKS</title><content type='html'>&lt;h1&gt;Partitioning a Seagate FreeAgent&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Outline&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;Check for bad blocks (not required)&lt;br /&gt;&lt;pre&gt;badblocks -c 10240 -s -w -t random -v /dev/disk/by-id/usb-Seagate_FreeAgentDesktop-0:0&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Partition drive. In this case, I create one 'Linux' partition which spans the whole drive.&lt;br /&gt;&lt;pre&gt;cfdisk /dev/disk/by-id/usb-Seagate_FreeAgentDesktop-0:0&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Create a LUKS device (partition) on the drive&lt;br /&gt;&lt;pre&gt;cryptsetup --verbose --verify-passphrase luksFormat /dev/disk/by-id/usb-Seagate_FreeAgentDesktop-0:0-part1&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Open that device &lt;br /&gt;&lt;pre&gt;cryptsetup luksOpen /dev/disk/by-id/usb-Seagate_FreeAgentDesktop-0:0-part1 FreeAgent&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Create an EXT partition on the device. &lt;br /&gt;&lt;pre&gt;mkfs.ext3 -j -m 1 -O dir_index,filetype,sparse_super /dev/mapper/FreeAgent&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;These options aren't necessary. The following will also work fine:&lt;br /&gt;&lt;pre&gt;mkfs.ext3 /dev/mapper/FreeAgent&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Mount the encrypted partition&lt;br /&gt;&lt;pre&gt;mkdir /media/FreeAgentLuks&lt;br /&gt;mount /dev/mapper/FreeAgent /media/FreeAgentLuks&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Transcript&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;This is something  I did before, following instructions from somewhere. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;[root@exciter ~]# badblocks -c 10240 -s -w -t random -v /dev/disk/by-id/usb-Seagate_FreeAgentDesktop-0:0&lt;br /&gt;Checking for bad blocks in read-write mode&lt;br /&gt;From block 0 to 488386583&lt;br /&gt;Testing with random pattern: done                                &lt;br /&gt;Reading and comparing: done                                &lt;br /&gt;Pass completed, 0 bad blocks found.&lt;br /&gt;[root@exciter ~]# cfdisk /dev/disk/by-id/usb-Seagate_FreeAgentDesktop-0:0&lt;br /&gt;Disk has been changed.&lt;br /&gt;&lt;br /&gt;WARNING: If you have created or modified any&lt;br /&gt;DOS 6.x partitions, please see the cfdisk manual&lt;br /&gt;page for additional information.&lt;br /&gt;&lt;br /&gt;[root@exciter ~]# cryptsetup --verbose --verify-passphrase luksFormat /dev/disk/by-id/usb-Seagate_FreeAgentDesktop-0:0-part1 &lt;br /&gt;&lt;br /&gt;WARNING!&lt;br /&gt;========&lt;br /&gt;This will overwrite data on /dev/disk/by-id/usb-Seagate_FreeAgentDesktop-0:0-part1 irrevocably.&lt;br /&gt;&lt;br /&gt;Are you sure? (Type uppercase yes): YES&lt;br /&gt;Enter LUKS passphrase: &lt;br /&gt;Verify passphrase: &lt;br /&gt;Command successful.&lt;br /&gt;[root@exciter ~]# cryptsetup luksOpen /dev/disk/by-id/usb-Seagate_FreeAgentDesktop-0:0-part1 FreeAgent&lt;br /&gt;Enter LUKS passphrase for /dev/disk/by-id/usb-Seagate_FreeAgentDesktop-0:0-part1: &lt;br /&gt;key slot 0 unlocked.&lt;br /&gt;Command successful.&lt;br /&gt;[root@exciter ~]# mkfs.ext3 -j -m 1 -O dir_index,filetype,sparse_super /dev/mapper/FreeAgent &lt;br /&gt;mke2fs 1.41.4 (27-Jan-2009)&lt;br /&gt;Filesystem label=&lt;br /&gt;OS type: Linux&lt;br /&gt;Block size=4096 (log=2)&lt;br /&gt;Fragment size=4096 (log=2)&lt;br /&gt;30531584 inodes, 122095871 blocks&lt;br /&gt;1220958 blocks (1.00%) reserved for the super user&lt;br /&gt;First data block=0&lt;br /&gt;Maximum filesystem blocks=4294967296&lt;br /&gt;3727 block groups&lt;br /&gt;32768 blocks per group, 32768 fragments per group&lt;br /&gt;8192 inodes per group&lt;br /&gt;Superblock backups stored on blocks: &lt;br /&gt; 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, &lt;br /&gt; 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, &lt;br /&gt; 102400000&lt;br /&gt;&lt;br /&gt;Writing inode tables: done                            &lt;br /&gt;Creating journal (32768 blocks): done&lt;br /&gt;Writing superblocks and filesystem accounting information: done&lt;br /&gt;&lt;br /&gt;This filesystem will be automatically checked every 34 mounts or&lt;br /&gt;180 days, whichever comes first.  Use tune2fs -c or -i to override.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Un-mounting&lt;/h1&gt;&lt;br /&gt;&lt;pre&gt;umount /mnt/FreeAgent&lt;br /&gt;rmdir /mnt/FreeAgent&lt;br /&gt;cryptsetup luksClose /dev/mapper/FreeAgent&lt;/pre&gt;&lt;br /&gt;(safe to remove)&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Notes&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;With LUKS, you can easily change the pass-phrase, and even have more than one at a time. See luksAddKey in the manual (man cryptsetup). &lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-7259300353333558544?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/7259300353333558544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=7259300353333558544' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/7259300353333558544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/7259300353333558544'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2010/01/encrypted-fs-with-luks.html' title='Encrypted FS with LUKS'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-38244049297078276</id><published>2009-06-02T19:12:00.011-05:00</published><updated>2009-06-02T19:39:32.219-05:00</updated><title type='text'>Zoom Lens Comparison</title><content type='html'>&lt;p&gt;How useful is a high-power zoom lens? &lt;i&gt;Very useful&lt;/i&gt; if it means you don't have to switch lenses and carry an extra lens around. The following table shows how much more powerful the Nikon 18-200mm 1:3.5-5.6 G is over the Nikon 28-80mm 1:3.3-5.6 G. &lt;/p&gt;&lt;br /&gt;&lt;table&gt;&lt;br /&gt;&lt;tbody&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;th&gt;&lt;/th&gt;&lt;br /&gt;&lt;th&gt;D50 28-80mm&lt;/th&gt;&lt;br /&gt;&lt;th&gt;D90 18-200mm&lt;/th&gt;&lt;br /&gt;&lt;/tr&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;Wide&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_X6E8ImjoLLw/SiXCACa4dXI/AAAAAAAAALI/-IQsE6HEvq8/s1600-h/dsc_0003.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 133px;" src="http://4.bp.blogspot.com/_X6E8ImjoLLw/SiXCACa4dXI/AAAAAAAAALI/-IQsE6HEvq8/s200/dsc_0003.jpg" alt="" id="BLOGGER_PHOTO_ID_5342889838850372978" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: center; "&gt;28mm&lt;/div&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_X6E8ImjoLLw/SiXClv0ZnKI/AAAAAAAAALY/Ozh3kG0Ds-s/s1600-h/DSC_0067.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 133px;" src="http://3.bp.blogspot.com/_X6E8ImjoLLw/SiXClv0ZnKI/AAAAAAAAALY/Ozh3kG0Ds-s/s200/DSC_0067.JPG" alt="" id="BLOGGER_PHOTO_ID_5342890486692158626" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: center; "&gt;18mm&lt;/div&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;Tele&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_X6E8ImjoLLw/SiXBPX4KN2I/AAAAAAAAALA/N8QKrQkg7Gc/s1600-h/dsc_0002.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 133px;" src="http://3.bp.blogspot.com/_X6E8ImjoLLw/SiXBPX4KN2I/AAAAAAAAALA/N8QKrQkg7Gc/s200/dsc_0002.jpg" alt="" id="BLOGGER_PHOTO_ID_5342889002796726114" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: center; "&gt;80mm&lt;/div&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_X6E8ImjoLLw/SiXDGPdS5zI/AAAAAAAAALg/HNbIa-KkHfw/s1600-h/DSC_0066.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 133px;" src="http://2.bp.blogspot.com/_X6E8ImjoLLw/SiXDGPdS5zI/AAAAAAAAALg/HNbIa-KkHfw/s200/DSC_0066.JPG" alt="" id="BLOGGER_PHOTO_ID_5342891044940998450" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: center; "&gt;200mm&lt;/div&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Within each column, the only variable is the movement of the zoom ring on the lens. Within each row, I changed out the lens and the camera body, so exposure details may vary. Both cameras were on point-and-shoot mode, since this is merely an illustration of the field of view. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-38244049297078276?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/38244049297078276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=38244049297078276' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/38244049297078276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/38244049297078276'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2009/06/zoom-lens-comparison.html' title='Zoom Lens Comparison'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_X6E8ImjoLLw/SiXCACa4dXI/AAAAAAAAALI/-IQsE6HEvq8/s72-c/dsc_0003.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-8308892243532700774</id><published>2009-05-14T13:36:00.004-05:00</published><updated>2009-05-14T14:30:11.313-05:00</updated><title type='text'>Need more swap space?</title><content type='html'>When I installed Fedora 10 from scratch, I thought that 2GB was probably enough swap space, given that disk access is slow. With only 4GB of RAM, which used to be a lot, as soon as I started using upwards of 6GB, the swap space I had allocated obviously became filled and the program would fail.&lt;br /&gt;&lt;br /&gt;Therefore, I am reverting back to the rule of thumb,&lt;br /&gt;"Your swap space should be about twice your RAM size"&lt;br /&gt;which has never failed me.&lt;br /&gt;&lt;br /&gt;However, even though I tried, it's a huge pain to make space when you have three hard drives all allocated into a boot partition, a swap partition, and a bunch of LVM partitions, and a logical volume that uses all the LVM space. Is freeing space for a new swap partition possible? Yes. Fast or convenient? No.&lt;br /&gt;&lt;br /&gt;Luckily, I discovered that you can use a file in the file system for swap, just as our favourite operating system from Redmond does. I was successful in doing the following on two different machines:&lt;br /&gt;&lt;br /&gt;Become the superuser.&lt;br /&gt;&lt;pre&gt;$ sudo su&lt;/pre&gt;Create a large file of zeros.&lt;br /&gt;&lt;pre&gt;# dd if=/dev/zero of=/swapfile1 bs=1024 count=6144k&lt;br /&gt;6291456+0 records in&lt;br /&gt;6291456+0 records out&lt;br /&gt;6442450944 bytes (6.4 GB) copied, 106.946 s, 60.2 MB/s&lt;/pre&gt;Make this file a swap partition.&lt;pre&gt;# mkswap -c /swapfile1&lt;br /&gt;Setting up swapspace version 1, size = 6291452 KiB&lt;br /&gt;no label, UUID=7f5ab06e-4315-4185-b5a2-b3151a5a608c&lt;/pre&gt;Add the partition to the swap space.&lt;br /&gt;&lt;pre&gt;# swapon /swapfile1&lt;/pre&gt;Check that it worked; total swap should be 6GB larger now.&lt;br /&gt;&lt;pre&gt;# free -m&lt;br /&gt;          total       used       free     shared    buffers     cached&lt;br /&gt;Mem:          3967       3936         30          0         75       3054&lt;br /&gt;-/+ buffers/cache:        807       3159&lt;br /&gt;Swap:         8144          0       8144&lt;/pre&gt;Add the swapon command somewhere in this file. This will add the file to the swap space the at boot.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# vi /etc/rc.local&lt;/pre&gt;You're done! However, a partition would be faster (and perhaps safer), so the next time you upgrade, consider re-partitioning.&lt;br /&gt;&lt;br /&gt;Also note that Linux will use the partition swap first, as per its priority according to:&lt;br /&gt;&lt;pre&gt;# cat /proc/swaps&lt;br /&gt;Filename    Type  Size Used Priority&lt;br /&gt;/dev/sdb1                               partition 2048248 96 -1&lt;br /&gt;/swapfile1                              file  6291448 0 -2&lt;/pre&gt;&lt;br /&gt;And with that in mind, I can think of all sorts of other fixes for running out of swap space (USB drives, compact flash to SATA adapters, etc.).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-8308892243532700774?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/8308892243532700774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=8308892243532700774' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/8308892243532700774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/8308892243532700774'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2009/05/need-more-swap-space.html' title='Need more swap space?'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-554017070261349543</id><published>2009-01-30T12:09:00.015-05:00</published><updated>2010-01-30T23:57:10.883-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='photography'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Nikon D-50'/><title type='text'>Making a Time-lapse Video with the Nikon D50 and gphoto2</title><content type='html'>&lt;span style="font-style: italic;"&gt;Who said you cannot teach a 2-year-old digital camera new tricks?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I was really excited when I found out I could control my Digital SLR camera via the USB cable. Nikon produces a software called Camera Control Pro. The software is $170 USD, and there is no non-pro version that I know of. They give you a 30-day trial, so I thought I would check it out.&lt;br /&gt;&lt;br /&gt;At first, my camera wouldn't connect. I had to use the menu on the camera to take the USB mode out of "Mass Storage" and into "PTP". The camera stopped bringing up iPhoto and started working in Camera Control. Life was good.&lt;br /&gt;&lt;br /&gt;I made a time-lapse of the sunset through my 10.5mm fisheye lens, taking one frame per minute. I used ImageMagick to convert the JPEGs into an MPEG, although this method lacks a lot of the control that I expected: frame rate, bitrate, etc.&lt;br /&gt;&lt;br /&gt;As I was looking for a free way to do this, since I was not going to pay almost $200; I have to eat too you know. I (almost by accident) came across &lt;a href="http://www.gphoto.org/"&gt;gphoto2&lt;/a&gt;. I think I had already heard of this software as I was wondering how I could capture images from a webcam, if I had one. The gphoto2 software (available through YUM in Fedora) provides a command-line method to do what I was doing with Camera Control; taking time-lapse pictures. However, it doesn't provide an interface similar to the one on the camera in a GUI form for changing camera settings. No matter, since you can use the controls on the camera directly in PTP mode.&lt;br /&gt;&lt;br /&gt;So I made an AT job:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;at 6:00am&lt;br /&gt;cd /home/ryan/Pictures/Timelapse/Sunrise&lt;br /&gt;gphoto2 --capture-image --interval=15&lt;br /&gt;[CTRL+D]&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;I quickly found out that I need to purchase the Nikon EH-5 AC adapter since the camera spends a lot of power in PTP mode and the battery died overnight. Replaced with a spare just in the nick of time and everything went as planned. I should have increased the rate to four times per minute (every 15 seconds), but I was scared after the battery died that with nearly continuous long-shutter shots the battery would die again. As soon as I have the adapter, I'll try going to four frames per minute (or more).&lt;br /&gt;&lt;br /&gt;Then, I used a script that had taken some time to develop to compile the frames into video. There are three major steps:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Down-sample the stills&lt;/li&gt;&lt;li&gt;Crop the stills to some standard video format (here I chose to move the crop region 131 pixels (all the way down) since the earth was more interesting than the sky&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Use good old piping to massage the frames into an MPEG&lt;/li&gt;&lt;/ol&gt;The following script performs all this, and assumes that the captured images are named as gphoto2 names them, capt0000.jpg, capt0001.jpg, etc.&lt;br /&gt;&lt;br /&gt;Here are the packages I needed:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;netpbm-progs&lt;br /&gt;&lt;li&gt;mjpegtools&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;&lt;br /&gt;echo "Resizing images to 720p (1280x720)..."&lt;br /&gt;for JPG in capt????.jpg ;&lt;br /&gt;do&lt;br /&gt;TMPNAME=`echo $JPG | sed 's/capt/Mov/' | sed 's/\.jpg/\.ppm/'`;&lt;br /&gt;if [ ! -f $TMPNAME ] ;&lt;br /&gt;then&lt;br /&gt;      echo "$JPG";&lt;br /&gt;      CORRNAME=$JPG&lt;br /&gt;      # Resizing gives an image that is 1280x851, so I need to also crop and shift by 65 pixels (to crop the top and bottom equally)&lt;br /&gt;      convert -resize 1280x1280 -crop 1280x720+0+131 $CORRNAME $TMPNAME;&lt;br /&gt;fi&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;echo "Compiling video...";&lt;br /&gt;ls *.ppm | xargs cat | pamdepth 255 | ppmtoy4m -F 24:1 -S 420mpeg2 | yuvfps -s 4:1 -r 24:1 | mpeg2enc -f 12 -o timelapse.m1v&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;echo "Done!"&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;The last piping command&lt;br /&gt;&lt;ul&gt;&lt;li&gt;makes a list of all the PPM's (this could be more elegant),&lt;br /&gt;&lt;/li&gt;&lt;li&gt;makes them all arguments to cat (basically, sends them all to stdout),&lt;br /&gt;&lt;/li&gt;&lt;li&gt;decreases the PPM color depth to one byte (255 values),&lt;br /&gt;&lt;/li&gt;&lt;li&gt;translates the stream of PPM's to a Y4M stream using some standard MPEG settings (24 FPS, and 4:2:0 chroma subsampling mode),&lt;/li&gt;&lt;li&gt;repeats frames to make four distinct exposures per second but 24 video frames per second,&lt;/li&gt;&lt;li&gt;and finally compiles an MPEG using format 12 (ATSC 720p video).&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;And, finally, here is the fruit of my labor, which was originally 720p (1280x720 pixels), and 4 frames per second up-sampled to 24 frames per second. The framerate is a bit slow, so you might change the '-s' argument to 'yuvfps' to '8:1' to make it smoother, but with that I recommend to capture more frames per minute.&lt;br /&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-f23b65fb177deaac" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v18.nonxt3.googlevideo.com/videoplayback?id%3Df23b65fb177deaac%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331389159%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D78A6F1C071C3B4AE99515E5031CB3FDCC46E4C9.1CD0BC9FB9585F135F5CB4DEEA0181CD6E7FB727%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Df23b65fb177deaac%26offsetms%3D5000%26itag%3Dw160%26sigh%3DnlND4UDzWTfS31djjTSkkvF5M5o&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v18.nonxt3.googlevideo.com/videoplayback?id%3Df23b65fb177deaac%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331389159%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D78A6F1C071C3B4AE99515E5031CB3FDCC46E4C9.1CD0BC9FB9585F135F5CB4DEEA0181CD6E7FB727%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Df23b65fb177deaac%26offsetms%3D5000%26itag%3Dw160%26sigh%3DnlND4UDzWTfS31djjTSkkvF5M5o&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;Yes, you can see my wall clock because a night-shift construction crew was lighting up my whole apartment.&lt;br /&gt;&lt;br /&gt;For better results during daytime or night-time (not a transition between the two), I would recommend going to manual exposure control. This would make things a lot smoother.&lt;br /&gt;&lt;br /&gt;So to recap, with gphoto2 you can:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Take more frames per minute, such as 4&lt;/li&gt;&lt;li&gt;Try making a scene using manual exposure control (like clouds or a tree) &lt;/li&gt;&lt;li&gt;Create a &lt;a href="http://en.wikipedia.org/wiki/1080p" title="1080p"&gt;1080p&lt;/a&gt; (1920×1080) video since your native resolution is probably higher&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Watch more on YouTube:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=iWvCHlPRN-k"&gt;http://www.youtube.com/watch?v=iWvCHlPRN-k&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=SbcrCUPQf-g"&gt;http://www.youtube.com/watch?v=SbcrCUPQf-g&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-554017070261349543?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=f23b65fb177deaac&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/554017070261349543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=554017070261349543' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/554017070261349543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/554017070261349543'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2009/01/making-time-lapse-video-with-nikon-d50.html' title='Making a Time-lapse Video with the Nikon D50 and gphoto2'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-6202671571833041240</id><published>2008-12-08T23:17:00.005-05:00</published><updated>2008-12-08T23:37:06.638-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='photography'/><title type='text'>Nikon D-50 Cleaning Dust from Sensor</title><content type='html'>So, on some bright long-exposure shots, I noticed there were some consistent dust spots. I took some slow-shutter, out-of-focus test shots to see. I changed lenses thinking it could be one of the internal elements, but nothing---the dirt was on the sensor. I decided to clean out the inside of the body. Some dust was accumulating on the reflex mirror and the window for the viewfinder. However, if you move the mirror down and out of the way (ever so carefully!), there is a door in the rear which is called the shutter curtain. I thought I was out of luck and needed help, until (completely by chance) I came across a section in the User Manual about cleaning the low-pass filter.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_X6E8ImjoLLw/ST31aqnrIcI/AAAAAAAAAKo/RiX7ZjdcpMc/s1600-h/dirt.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 133px;" src="http://1.bp.blogspot.com/_X6E8ImjoLLw/ST31aqnrIcI/AAAAAAAAAKo/RiX7ZjdcpMc/s200/dirt.jpg" alt="" id="BLOGGER_PHOTO_ID_5277644176814186946" border="0" /&gt;&lt;/a&gt;You can see the dirt at about 4:30 in this test shot.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I knew that the low-pass filter was a fancy term for an IR filter that happens to provide an air-tight seal for the CCD sensor. There's a procedure in the manual that enables you to lock open the reflex mirror and the shutter curtain, exposing the low-pass filter and sensor. I highly recommend that you read these instructions; they're very easy to follow. They recommend not to contact the low-pass filter, and I totally agree.&lt;br /&gt;&lt;br /&gt;I followed the instructions for locking the mirror and curtain open, and when I removed the body cap, I could clearly see the debris on the sensor. I simply blew some air in there, and it was freed. I recommend blowing air while holding the body upside-down. Make sure you have a lot of light.&lt;br /&gt;&lt;br /&gt;Nikon also has directions for setting up test shots for seeing if you have a dust problem. It is geared for their dust removal software, but it also serves as a diagnostic.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_X6E8ImjoLLw/ST31rKx7cqI/AAAAAAAAAKw/THKKTLeBv90/s1600-h/clean.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 133px;" src="http://3.bp.blogspot.com/_X6E8ImjoLLw/ST31rKx7cqI/AAAAAAAAAKw/THKKTLeBv90/s200/clean.jpg" alt="" id="BLOGGER_PHOTO_ID_5277644460325040802" border="0" /&gt;&lt;/a&gt;Test shot following Nikon's directions after cleaning&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;You turn the camera off to exit the special lock mode. Presto! No more dirt on my photos!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-6202671571833041240?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/6202671571833041240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=6202671571833041240' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/6202671571833041240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/6202671571833041240'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2008/12/nikon-d-50-cleaning-dust-from-sensor.html' title='Nikon D-50 Cleaning Dust from Sensor'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_X6E8ImjoLLw/ST31aqnrIcI/AAAAAAAAAKo/RiX7ZjdcpMc/s72-c/dirt.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-1449480775645144854</id><published>2008-04-27T11:18:00.004-05:00</published><updated>2008-09-02T12:49:13.747-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><category scheme='http://www.blogger.com/atom/ns#' term='scripting'/><title type='text'>MD5SUM reorganization revisited</title><content type='html'>&lt;p&gt;I was running my shell script on a collection of over 10,000 files, and it was running for over three days. The shell interpreter is just way too slow when this amount of work is involved. So, I re-wrote the script in Perl and it is now lightning fast because I am able to take advantage of Perl hashes (associative arrays). &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;#!/usr/bin/perl&lt;br /&gt;#&lt;br /&gt;# This file takes a checksum file (output from md5sum utility)&lt;br /&gt;# and attempts to reorganize the files in the directory to&lt;br /&gt;# match the listing in the md5 file.&lt;br /&gt;#&lt;br /&gt;# Files not found in the md5 input are left alone.&lt;br /&gt;# Files already in the right place are left alone.&lt;br /&gt;# Other files have their checksums computed and, if they are found&lt;br /&gt;# in the md5 input, they are moved to the appropriate location.&lt;br /&gt;#&lt;br /&gt;# WARNING: It confuses duplicate files!!!&lt;br /&gt;#&lt;br /&gt;use File::Basename;&lt;br /&gt;&lt;br /&gt;if ( $#ARGV &lt; reorgpath =" $ARGV[1];" reorgptah = "." lines =" &lt;sumsfile"&gt;;&lt;br /&gt;&lt;br /&gt;close(SUMSFILE);&lt;br /&gt;&lt;br /&gt;foreach my $line (@lines) {&lt;br /&gt;chomp($line);&lt;br /&gt;$sums{substr($line,0,32)} = substr($line,34);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;print "Read in ".($#lines+1)." checksums and paths.\n";&lt;br /&gt;&lt;br /&gt;&amp;amp;reorg($reorgPath);&lt;br /&gt;&lt;br /&gt;sub reorg {&lt;br /&gt;my $dir = shift;&lt;br /&gt;#print "Recurring for $dir\n";&lt;br /&gt;&lt;br /&gt;opendir DIR, $dir or return;&lt;br /&gt;my @contents =&lt;br /&gt; map "$dir/$_",&lt;br /&gt; sort grep !/^\.\.?$/,&lt;br /&gt; readdir DIR;&lt;br /&gt;closedir DIR;&lt;br /&gt;foreach my $file (@contents) {&lt;br /&gt; #print "Considering $file\n";&lt;br /&gt; #next unless !-1 &amp;amp;&amp;amp; -d;&lt;br /&gt; if ( -d $file ) {&lt;br /&gt;  &amp;amp;reorg($file);&lt;br /&gt; } else {&lt;br /&gt;#   my @args = ("md5sum", $file);&lt;br /&gt;#   system(@args) == 0 or die("System @args failed: $?\n");&lt;br /&gt;  $tmpLine = `md5sum "$file"`;&lt;br /&gt;  chomp($tmpLine);&lt;br /&gt;  $tmpHash = substr($tmpLine,0,32);&lt;br /&gt;  $tmpPath = substr($tmpLine,34);&lt;br /&gt;&lt;br /&gt;  #print "$tmpHash -&gt; $tmpPath\n";&lt;br /&gt;  # Now lookup the hash, if the paths aren't the same, move the file&lt;br /&gt;  if (defined $sums{$tmpHash}) {&lt;br /&gt;   #print $sums{$tmpHash};&lt;br /&gt;   if ($tmpPath ne $sums{$tmpHash}) {&lt;br /&gt;    print "Moving ".$tmpPath." to ".$sums{$tmpHash}."\n";&lt;br /&gt;&lt;br /&gt;    # Make directory for move if it doesn't exist&lt;br /&gt;    @args = ("mkdir", "-p", dirname($sums{$tmpHash}) );&lt;br /&gt;    system(@args) == 0 or print STDERR "Couldn't create directory @args: $!\n";&lt;br /&gt;    # Move file to path found in checksum file&lt;br /&gt;    @args = ("mv", $tmpPath, $sums{$tmpHash});&lt;br /&gt;    system(@args) == 0 or print STDERR "Couldn't move: $!\n";&lt;br /&gt;   } else {&lt;br /&gt;    print "File $tmpPath is already in place.\n";&lt;br /&gt;   }&lt;br /&gt;  } else {&lt;br /&gt;   print "No hash for $tmpPath found.\n";&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;return;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;exit;&lt;/sumsfile&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;A few things still need to be fixed: Inserting a new hash from the file into the hash table should fail if it is already there (hash collision or duplicate files). Also, a reverse lookup in the hash table could save needing to compute the MD5SUM, but at what computational cost?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-1449480775645144854?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/1449480775645144854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=1449480775645144854' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/1449480775645144854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/1449480775645144854'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2008/04/md5sum-reorganization-revisited.html' title='MD5SUM reorganization revisited'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-9000278037206099795</id><published>2008-03-04T10:49:00.005-05:00</published><updated>2008-03-04T11:17:34.257-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='backup'/><category scheme='http://www.blogger.com/atom/ns#' term='system configuration'/><title type='text'>Data/Documents backup script</title><content type='html'>&lt;p&gt;I used to always create directory under my home called &lt;tt&gt;data&lt;/tt&gt;. I'd store files which I need to do work and my working files. Then, this would be the only directory I had to synchronize with Unison (http://www.cis.upenn.edu/~bcpierce/unison/)between machines. Since Fedora has included a directory called &lt;tt&gt;Documents&lt;/tt&gt;, which has a similar purpose (and so has Mac OS X), I've just changed the name of this special directory from &lt;tt&gt;data&lt;/tt&gt; to &lt;tt&gt;Documents&lt;/tt&gt;. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;That brings me to the topic of this article--how do I manage if I mess up a file in this directory, and I synchronize the mistake to other mirrors? That would mean none of the computers I work on has a copy anymore. The answer is &lt;tt&gt;rdiff-backup&lt;/tt&gt; (http://www.nongnu.org/rdiff-backup/). I used to make just a user &lt;tt&gt;cron&lt;/tt&gt; job to call &lt;tt&gt;rdiff-backup&lt;/tt&gt; and update an incremental backup repo on my behalf, but I wanted this to be more mechanical (what if I added a new user, etc.). So I wrote the following script which replaces an old script I used to have which would &lt;b&gt;only&lt;/b&gt; make a mirror with &lt;tt&gt;rsync&lt;/tt&gt;. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Note that, on my configuration, the incremental backup repo is on the same device as the original files, &lt;b&gt;but both are mirrored&lt;/b&gt; in an overnight backup job. This means I have (at least) four mirrors of the same files, which is sort of a waste but I don't really worry about it since it's about 200 MB / user. &lt;i&gt;Ideally&lt;/i&gt;, you would keep just the local mirror on the disk, and the &lt;tt&gt;rdiff-backup&lt;/tt&gt; repository on the backup device (or system over network). The downside here would be, if the backup device (or remote system) crashes you loose the ability to restore a previous increment. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Following is the script for maintaining incremental backup repositories with &lt;tt&gt;rdiff-backup&lt;/tt&gt; for all users. &lt;b&gt;Caution&lt;/b&gt;: the backup path should be as read-only as possible, but it is not if the user logs in to the system. For this reason, you'll have to count on them not to modify the files, or keep the files on a filesystem they cannot mount. For simple remote access over &lt;tt&gt;samba&lt;/tt&gt; (the kind of access in my setup), you would have to configure a per-user share (so Joe can't see Susan's backup, for instance) and make each one read-only (so Joe cannot corrupt his repository by changing the files there). &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;# Make incremental backups of 'Documents' directories for users&lt;br /&gt;#&lt;br /&gt;# Ryan Helinski&lt;br /&gt;&lt;br /&gt;LOGFILE=/var/log/rdiff-backup.log&lt;br /&gt;&lt;br /&gt;# Close stdout and stderr&lt;br /&gt;1&gt;&amp;-; 2&gt;&amp;-;&lt;br /&gt;&lt;br /&gt;# Direct stdout and stderr to logfile&lt;br /&gt;exec 1&gt;&gt;$LOGFILE; exec 2&gt;&gt;$LOGFILE;&lt;br /&gt;&lt;br /&gt;echo Begin $0, `date`;&lt;br /&gt;&lt;br /&gt;# For debugging&lt;br /&gt;#set -x&lt;br /&gt;&lt;br /&gt;# Script-specific configuration&lt;br /&gt;HOMESPATH=/home&lt;br /&gt;BACKUPPATH=/opt/backup&lt;br /&gt;RDIFF_OPTIONS="--print-statistics"&lt;br /&gt;DOCSDIR=Documents&lt;br /&gt;&lt;br /&gt;# Max increment life &lt;br /&gt;# The time interval is an integer followed by the character s, m, h, D, W, &lt;br /&gt;# M, or Y, indicating seconds,  minutes, hours,  days,  weeks,  months, or &lt;br /&gt;# years respectively, or a number of these con-catenated.&lt;br /&gt;MAX_LIFE=4W&lt;br /&gt;&lt;br /&gt;for USERHOME in $HOMESPATH/* ; do&lt;br /&gt;&lt;br /&gt;# USERDIR=`basename $USERHOME`;&lt;br /&gt; USER=`stat -c "%U" $USERHOME`;&lt;br /&gt;&lt;br /&gt; if [ -d "$USERHOME/$DOCSDIR" ] ; then&lt;br /&gt;  echo "Updating $BACKUPPATH/$USER/$DOCSDIR";&lt;br /&gt;&lt;br /&gt;  # Create backup repo if it doesn't exist&lt;br /&gt;  if [ ! -d "$BACKUPPATH/$USER/$DOCSDIR" ] ; then&lt;br /&gt;   echo "Creating rdiff-backup repo";&lt;br /&gt;   mkdir -p "$BACKUPPATH/$USER/$DOCSDIR";&lt;br /&gt;   chown $USER "$BACKUPPATH/$USER";&lt;br /&gt;   chown $USER "$BACKUPPATH/$USER/$DOCSDIR";&lt;br /&gt;  fi&lt;br /&gt;&lt;br /&gt;  # Update repo&lt;br /&gt;  rdiff-backup $RDIFF_OPTIONS "$USERHOME/$DOCSDIR" \&lt;br /&gt;   "$BACKUPPATH/$USER/$DOCSDIR" ;&lt;br /&gt;&lt;br /&gt;  # Clean up repo&lt;br /&gt;  #rdiff-backup --remove-older-than $MAX_LIFE --force \&lt;br /&gt;  # "$BACKUPPATH/$USER/$DOCSDIR" ;&lt;br /&gt;&lt;br /&gt; fi&lt;br /&gt;&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;echo End $0, `date`;&lt;br /&gt;echo&lt;br /&gt;&lt;br /&gt;exit&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;To actually remove old backups, uncomment the code in the "Clean up repo" section. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-9000278037206099795?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/9000278037206099795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=9000278037206099795' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/9000278037206099795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/9000278037206099795'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2008/03/datadocuments-backup-script.html' title='Data/Documents backup script'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-5687920788635390431</id><published>2008-01-30T12:38:00.001-05:00</published><updated>2008-02-02T22:31:13.877-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='VNC'/><category scheme='http://www.blogger.com/atom/ns#' term='SSH'/><title type='text'>Shell Script to Tunnel VNC Sessions over SSH (Improved)</title><content type='html'>Following is a parameterized shell script which you can use with this syntax:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;Usage: vnctunnel [ssh session] [screen] [vnc options]&lt;br /&gt;Example: vnctunnel user@server :1&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;It's "improved" because it's completely parameterized--you can specify the SSH session, screen, and even vnc options. &lt;br /&gt;&lt;br /&gt;(Assuming you copy it to your &lt;tt&gt;~/bin&lt;/tt&gt; directory and make it executable)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;#!/bin/sh&lt;br /&gt;# This is a parameterized script to SSH tunnel a VNC session&lt;br /&gt;# Ryan Helinski&lt;br /&gt;&lt;br /&gt;# Local settings&lt;br /&gt;# Change this if you don't like `vncviewer'&lt;br /&gt;VNCVIEWER=vncviewer&lt;br /&gt;# Change this if you use ports near 25900 for something else locally&lt;br /&gt;PORTOFFSET=20000&lt;br /&gt;# Apply extra options to vncviewer&lt;br /&gt;VNCOPTS="--AutoSelect=0 $3"&lt;br /&gt;&lt;br /&gt;if [ $# -lt 2 ] ; then&lt;br /&gt;        echo "Usage: $0 [ssh session] [screen]";&lt;br /&gt;        echo "Example: $0 user@server :1";&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;SSHPARM=$1;&lt;br /&gt;SCREEN=`echo $2 | cut -d':' -f2`;&lt;br /&gt;SSHPORT=$[$SCREEN+5900];&lt;br /&gt;&lt;br /&gt;echo "Session: $SSHPARM, Screen: $SCREEN, Port: $SSHPORT"&lt;br /&gt;&lt;br /&gt;ssh -f -L $[$PORTOFFSET+$SSHPORT]:localhost:$SSHPORT $SSHPARM sleep 10; \&lt;br /&gt;        vncviewer localhost:$[$PORTOFFSET+$SSHPORT]:$SCREEN $VNCOPTS&lt;br /&gt;&lt;br /&gt;exit&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-5687920788635390431?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/5687920788635390431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=5687920788635390431' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/5687920788635390431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/5687920788635390431'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2008/01/shell-script-to-tunnel-vnc-sessions.html' title='Shell Script to Tunnel VNC Sessions over SSH (Improved)'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-8876538640698282336</id><published>2008-01-30T12:02:00.000-05:00</published><updated>2008-01-30T18:28:58.725-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='data management'/><category scheme='http://www.blogger.com/atom/ns#' term='archival'/><title type='text'>Using 7-zip for Archival</title><content type='html'>I've been using 7-zip to archive large collections of files--mainly college and documents which have  high potential to be compressed. 7-zip has a high compression ratio--higher than bzip2, but also higher than the evil RAR archive everyone seems to like--and it's GPL and widely available for GNU+Linux, UNIX and Mac via `p7zip'. However, I've been slightly concerned that it doesn't retain POSIX file modes. For files like text, graphics, etc. this doesn't really bother me. However, if I was going to archive something which contains scripts, or a shared directory where user ownership needs to be preserved, I'd need to retain this extra information. &lt;br /&gt;&lt;br /&gt;I have seen it a couple times while browsing, and thought "oh...". When I tried to look for it, I really found a lack of examples. After careful reading of the manuals for &lt;tt&gt;tar&lt;/tt&gt; and &lt;tt&gt;7z&lt;/tt&gt;, following is the solution:&lt;br /&gt;&lt;br /&gt;To encode:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;tar cf - data/ | 7za a data.tar.7z -si&lt;/pre&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;To decode:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;7za x ~/data.tar.7z -so | tar xf -&lt;/pre&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-8876538640698282336?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/8876538640698282336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=8876538640698282336' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/8876538640698282336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/8876538640698282336'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2008/01/using-7-zip-for-archival.html' title='Using 7-zip for Archival'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-1340697772170311550</id><published>2008-01-28T10:17:00.000-05:00</published><updated>2008-01-28T10:42:30.072-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='data management'/><category scheme='http://www.blogger.com/atom/ns#' term='gnu+linux'/><title type='text'>Trash Management Scripts</title><content type='html'>&lt;h3&gt;Moving files to trash&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Today's post is about some trash management scripts I have written for myself and would like to share. They should run on most GNU+Linux environments.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;If you're like me, you prefer to &lt;tt&gt;mv file ~/.Trash/&lt;/tt&gt; rather than &lt;tt&gt;rm file&lt;/tt&gt;, but this is both dangerous and hard to type. I created a (very small) script that will act as a command you can use to move files to your Trash bin without overwriting anything. &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Uses 'numbered' backup scheme of 'mv', so the most recently trashed &lt;br /&gt;file will have its name intact, and the backups will have the suffix &lt;br /&gt;".~n~" appended, where the higher the n, the more recent the backup.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;code&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;# Moves files in the command arguments to the trash bin, while keeping &lt;br /&gt;# backups of any files already in that directory. &lt;br /&gt;#&lt;br /&gt;# Uses 'numbered' backup scheme of 'mv', so the most recently trashed &lt;br /&gt;# file will have its name intact, and the backups will have the suffix &lt;br /&gt;# .~n~ appended where the higher the n, the more recent the backup. &lt;br /&gt;#&lt;br /&gt;# It uses the basename of the file so that no (absolute or relative) &lt;br /&gt;# directory is preserved.&lt;br /&gt;#&lt;br /&gt;TRASH="$HOME/.Trash";&lt;br /&gt;&lt;br /&gt;while [ $# -gt 0 ];&lt;br /&gt;do&lt;br /&gt;        mv --backup=numbered "$1" "$TRASH/`basename $1`";&lt;br /&gt;&lt;br /&gt;        shift;&lt;br /&gt;done&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;After you copy this file to your favorite &lt;tt&gt;bin&lt;/tt&gt; directory and make it executable, you can use the following syntax&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;trash file1 file2 path/to/file3 path/to/file4&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;And, even if file1 and file3 have the same name, you'll still be able to find both in your trash bin.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Rounding up and deleting trash automatically&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;If your trash is anything like mine, the probability that a file is &lt;b&gt;not&lt;/b&gt; trash increases exponentially every day. For this reason, I wanted to somehow tag when I threw something out so I could tell how old it was, and maybe delete everything after a specific number of days. &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;The solution I came up with was to create siblings of the &lt;tt&gt;.Trash&lt;/tt&gt; directory, using UNIX time-stamps. In conjunction with a &lt;tt&gt;cron&lt;/tt&gt; task, yesterday's trash will be in a directory at &lt;tt&gt;~/.Trash-XXXXXXXXXX&lt;/tt&gt; where the X's are the time-stamp for 4:00am today. In this manner, you'll have a bin for each day you throw something out. The script follows.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;# The first step is to move all files under ~/.Trash, other than &lt;br /&gt;# ., .., and .#bin-n into a new trash bin for yesterday.&lt;br /&gt;# &lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;NEWBIN=`date +%s`;&lt;br /&gt;NEWBINPATH="$HOME/.Trash-$NEWBIN";&lt;br /&gt;OLDESTBIN="20"; # days&lt;br /&gt;&lt;br /&gt;OLDESTBINTIME=`date -d "now - $OLDESTBIN days" +%s`;&lt;br /&gt;OLDESTBINPATH="$HOME/.Trash-$OLDESTBINTIME";&lt;br /&gt;&lt;br /&gt;echo "Moving current trash to $NEWBINPATH";&lt;br /&gt;mkdir $NEWBINPATH;&lt;br /&gt;mv $HOME/.Trash/* $HOME/.Trash/.[!.]* $NEWBINPATH/;&lt;br /&gt;&lt;br /&gt;for BIN in $HOME/.Trash-*; do &lt;br /&gt;&lt;br /&gt;        STAMP=`echo "$BIN" | cut -d'-' -f2`;&lt;br /&gt;#       echo $BIN $STAMP $OLDESTBINTIME;&lt;br /&gt;        if [ $STAMP -lt $OLDESTBINTIME ] ;&lt;br /&gt;        then&lt;br /&gt;                echo "Deleting $BIN";&lt;br /&gt;#               rm -Rf $BIN;&lt;br /&gt;        fi&lt;br /&gt;&lt;br /&gt;done&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;So I copied this file into my &lt;tt&gt;~/bin/&lt;/tt&gt; directory and used &lt;tt&gt;crontab -e&lt;/tt&gt; to add the following line to my crontab:&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;00 4 * * * /home/ryan/bin/trash-roundup.sh&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;i&gt;Right now this script will send errors to &lt;tt&gt;crond&lt;/tt&gt;, which should be delivered in your local mail (accessed using &lt;tt&gt;mail&lt;/tt&gt;). Also, deleting old bins is disabled since I haven't had a chance to thoroughly test it. &lt;/i&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;To actually &lt;b&gt;delete&lt;/b&gt; old trash, choose a value for the OLDESTBIN variable in the script, this is the longest time that a bin will hang around. Then, you have to un-comment the line with &lt;tt&gt;rm&lt;/tt&gt; in the script.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-1340697772170311550?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/1340697772170311550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=1340697772170311550' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/1340697772170311550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/1340697772170311550'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2008/01/trash-management-scripts.html' title='Trash Management Scripts'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-2039962663398997150</id><published>2008-01-25T11:34:00.001-05:00</published><updated>2008-01-30T01:36:52.430-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='backup'/><category scheme='http://www.blogger.com/atom/ns#' term='data management'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>Using the Seagate FreeAgent as a (periodic) Mirror Backup</title><content type='html'>&lt;p&gt;I recently purchased a Seagate FreeAgent 100D USB drive. The drive is quite nice, small, quiet, and  has advanced power management. I plugged the device in on a Fedora 7 installation, and it came right up.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;P&gt;The first problem I had was the NTFS partition that came on the device. This is easily fixed with &lt;tt&gt;fdisk&lt;/tt&gt; and &lt;tt&gt;mkfs.ext3&lt;/tt&gt;. Don't forget to use &lt;tt&gt;e2label&lt;/tt&gt;, especially if you have more than one of the same device.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;P&gt;The next thing you want to do is determine the "id" of the device, so that you can uniquely identify it. The problem is that &lt;tt&gt;udev&lt;/tt&gt; sets up devices in order of connection (/dev/sda, /dev/sdb, ...). To remedy this, use the symbolic links that &lt;tt&gt;udev&lt;/tt&gt; creates under &lt;tt&gt;/dev/disk/&lt;/tt&gt; to identify the disk by one of the following means:&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;UL&gt;&lt;br /&gt;&lt;LI&gt;&lt;tt&gt;/dev/disk/by-id/&lt;/tt&gt; - Uses connection, make, model, &lt;b&gt;and&lt;/b&gt; serial number&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;tt&gt;/dev/disk/by-uuid/&lt;/tt&gt; - Uses the UUID given to the partition when it was created &lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;TT&gt;/dev/disk/by-label/&lt;/TT&gt; - If you have used &lt;tt&gt;e2label&lt;/tt&gt;, this is more meaningful than the UUID&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;TT&gt;/dev/disk/by-path/&lt;/TT&gt; - This is the one you &lt;b&gt;do not&lt;/b&gt; want to use!&lt;/LI&gt;&lt;br /&gt;&lt;/UL&gt;&lt;br /&gt;&lt;br /&gt;&lt;P&gt;I want to disable normal users (including myself) from modifying the contents of the backup, so the plan is to keep it unmounted and disable users from mounting it. Thefefor, this is the appropriate entry &lt;B&gt;for me&lt;/B&gt; in &lt;tt&gt;/etc/fstab&lt;/tt&gt;: &lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;/dev/disk/by-id/usb-Seagate_FreeAgentDesktop_30DFK39D-0:0-part1 /media/FreeAgent        ext3    defaults        1 2&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;I&gt;Note this will require the device to be present and consistent at boot-time. If you don't need this, change the last two numbers in the &lt;tt&gt;fstab&lt;/tt&gt; entry to zero. &lt;/I&gt;&lt;br /&gt;&lt;br /&gt;Before automating backup, I had a problem: The drive spins down automatically, so if you use &lt;B&gt;only&lt;/B&gt; a command like &lt;TT&gt;rsync&lt;/TT&gt; it may terminate due to an I/O Error because it simply timed out. This happened with me using &lt;TT&gt;ls&lt;/TT&gt;, but it doesn't &lt;I&gt;always&lt;/I&gt; happen -- so you should be more paranoid about the power mode. &lt;br /&gt;&lt;br /&gt;The solution is to use a utility called &lt;TT&gt;sdparm&lt;/TT&gt;, which is made to control SCSI (and SATA) disks. This is available for Fedora in a &lt;TT&gt;yum&lt;/TT&gt; package called simply &lt;TT&gt;sdparm&lt;/TT&gt;. This allows you to send a command to the drive to "start" (spin up) or "stop" (spin down). &lt;br /&gt;&lt;br /&gt;Then, the final task is to create a backup procedure that is invoked by &lt;TT&gt;crond&lt;/TT&gt;. Rather than writing something to &lt;TT&gt;/etc/crontab&lt;/TT&gt;, I added the following file to &lt;TT&gt;/etc/cron.daily/&lt;/TT&gt;. Make sure it has execute permissions, and call it (as root) a couple times to make sure it's working.  &lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;CODE&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;# Backup to a USB disk &lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;# Env variables &lt;br /&gt;SHELL=/bin/bash&lt;br /&gt;PATH=/sbin:/bin:/usr/sbin:/usr/bin&lt;br /&gt;MAILTO=root&lt;br /&gt;HOME=/&lt;br /&gt;&lt;br /&gt;# OK to change these&lt;br /&gt;LOGFILE=/var/log/backup-usb.log&lt;br /&gt;DISKDEVICE=/dev/disk/by-id/usb-Seagate_FreeAgentDesktop_30DFK39D-0\:0&lt;br /&gt;DISKPARTITION=$DISKDEVICE-part1&lt;br /&gt;MOUNTPOINT=/media/FreeAgent&lt;br /&gt;&lt;br /&gt;# Leave these alone&lt;br /&gt;DEVICEFILE=`readlink -f $DISKDEVICE`&lt;br /&gt;PARTITIONFILE=`readlink -f $DISKPARTITION`&lt;br /&gt;&lt;br /&gt;# Close stdout&lt;br /&gt;1&gt;&amp;-;&lt;br /&gt;# Close stderr&lt;br /&gt;2&gt;&amp;-;&lt;br /&gt;&lt;br /&gt;# Log needs to be rotated manually&lt;br /&gt;#mv $LOGFILE $LOGFILE.1&lt;br /&gt;&lt;br /&gt;# Direct stdout and stderr to logfile&lt;br /&gt;exec 1&gt;&gt;$LOGFILE;&lt;br /&gt;exec 2&gt;&gt;$LOGFILE;&lt;br /&gt;&lt;br /&gt;echo Begin $0, `date`;&lt;br /&gt;&lt;br /&gt;# Preliminary work (get backup device online)&lt;br /&gt;if [ -e $DISKDEVICE ] ;&lt;br /&gt;then&lt;br /&gt; echo "Device exists (is connected).";&lt;br /&gt;&lt;br /&gt;# /usr/bin/sdparm --all $DISKDEVICE&lt;br /&gt;&lt;br /&gt; echo "Sending start (wake up) signal...";&lt;br /&gt; /usr/bin/sdparm --command=start $DISKDEVICE&lt;br /&gt; if [ "$?" -eq "0" ] ; &lt;br /&gt; then &lt;br /&gt;  echo "Success";&lt;br /&gt; else &lt;br /&gt;  echo "Failed to start device";&lt;br /&gt;  exit;&lt;br /&gt; fi&lt;br /&gt;&lt;br /&gt; # Get backup partition mounted&lt;br /&gt; if [ `grep $PARTITIONFILE /etc/mtab | wc -l` -le "0" ] ;&lt;br /&gt; then&lt;br /&gt;  echo "Device $PARTITIONFILE is not mounted!";&lt;br /&gt;  mount $PARTITIONFILE $MOUNTPOINT;&lt;br /&gt;  if [ "$?" -eq "0" ] ;&lt;br /&gt;  then&lt;br /&gt;   echo "Mounted OK.";&lt;br /&gt;  else&lt;br /&gt;   echo "Failed to mount.";&lt;br /&gt;   exit;&lt;br /&gt;  fi&lt;br /&gt;  &lt;br /&gt; else &lt;br /&gt;  echo "Partition $PARTITIONFILE is already mounted.";&lt;br /&gt; fi&lt;br /&gt;else&lt;br /&gt; echo "Device doesn't exist, must not be connected!";&lt;br /&gt; exit;&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;# Backup procedure &lt;br /&gt;# &lt;br /&gt;# For now I'm just using RSYNC because these files don't often change&lt;br /&gt;# &lt;br /&gt;rsync --verbose --itemize-changes \&lt;br /&gt;--archive --hard-links --partial --delete-before \&lt;br /&gt;/opt/srv/ $MOUNTPOINT/srv/ &amp;&amp; \&lt;br /&gt;date &amp;&amp; \&lt;br /&gt;df -h $MOUNTPOINT &amp;&amp; \&lt;br /&gt;echo ;&lt;br /&gt;&lt;br /&gt;# NOTE might also want to un-mount the device at this point &lt;br /&gt;# to prevent users from modifying it directly !&lt;br /&gt;echo "Unmounting $PARTITIONFILE"&lt;br /&gt;umount $PARTITIONFILE&lt;br /&gt;echo "Stopping device $DISKDEVICE"&lt;br /&gt;/usr/bin/sdparm --command=stop $DISKDEVICE&lt;br /&gt;# /usr/bin/sdparm --all $DISKDEVICE &amp;&amp; \&lt;br /&gt;&lt;br /&gt;echo End $0, `date`;&lt;/CODE&gt;&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;&lt;P&gt;The variables section and the &lt;TT&gt;rsync&lt;/TT&gt; command have to be updated to fit your installation and your backup scheme.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;P&gt;Again, this worked well for me, you may have to make adjustments. &lt;/P&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-2039962663398997150?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/2039962663398997150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=2039962663398997150' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/2039962663398997150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/2039962663398997150'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2008/01/using-seagate-freeagent-as-periodic.html' title='Using the Seagate FreeAgent as a (periodic) Mirror Backup'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-8994117876638858612</id><published>2008-01-18T14:55:00.000-05:00</published><updated>2008-01-18T15:12:06.613-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='data management'/><title type='text'>Shell Script to Reorganize a Mirror to Match a Newer Mirror</title><content type='html'>This script has a very specific purpose, but you've probably had a chance where it could have come in handy. The idea is, if there are two mirrors of a bunch of files, and you reorganize (more around and/or rename) files on one mirror, then when you go to RSYNC the other mirror, it thinks the files that were only moved were added and deleted. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To use this script, you would first move the files on one mirror, and generate an MD5 sum file, as in:&lt;/div&gt;&lt;div&gt;$ find ./ -type f -exec md5sum {} \; | tee checksums.md5&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then, copy this small file to the root of the other mirror, and invoke the script with the name of the checksums file:&lt;/div&gt;&lt;div&gt;$ md5sum-reorg.sh checksums.md5&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The script will process every file under the working directory and attempt to correct its path so that it matches a file in the new 'checksums.md5'. Files not found in the checksums file are left alone. Files already in place are left alone (obviously), without even calculating their md5sum.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Script follows:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;#&lt;br /&gt;# This file takes a checksum file (output from md5sum utility)&lt;br /&gt;# and attempts to reorganize the files in the directory to &lt;br /&gt;# match the listing in the md5 file. &lt;br /&gt;#&lt;br /&gt;# Files not found in the md5 input are left alone.&lt;br /&gt;# Files already in the right place are left alone.&lt;br /&gt;# Other files have their checksums computed and, if they are found &lt;br /&gt;# in the md5 input, they are moved to the appropriate location.&lt;br /&gt;#&lt;br /&gt;# WARNING: It confuses duplicate files!!!&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;if [ $# -lt 1 ];&lt;br /&gt;then&lt;br /&gt; echo "Usage: $0 [checksums file]";&lt;br /&gt; exit;&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;declare -a SUMS&lt;br /&gt;declare -a NEWPATHS&lt;br /&gt;&lt;br /&gt;exec 10&lt;$1&lt;br /&gt;let count=0&lt;br /&gt;&lt;br /&gt;echo "Parsing checksums and paths from input file...";&lt;br /&gt;&lt;br /&gt;while read LINE &lt;&amp;10; do&lt;br /&gt; SUM=`echo "$LINE" | cut -d' ' -f1`;&lt;br /&gt; NEWPATH=`echo "$LINE" | cut -d' ' -f1 --complement | cut -d' ' -f1 --complement`;&lt;br /&gt; SUMS[$count]=$SUM;&lt;br /&gt; NEWPATHS[$count]=$NEWPATH;&lt;br /&gt; ((count++));&lt;br /&gt;done&lt;br /&gt;# close file &lt;br /&gt;exec 10&gt;&amp;-&lt;br /&gt;&lt;br /&gt;echo "Compiling list of files that need to be checked...";&lt;br /&gt;&lt;br /&gt;TMPFILE=`mktemp`;&lt;br /&gt;find ./ -type f -printf "%p\n" &gt; $TMPFILE;&lt;br /&gt;&lt;br /&gt;exec 10&lt;$TMPFILE&lt;br /&gt;while read OLDFILE &lt;&amp;10; do&lt;br /&gt; echo "Trying to find new path for $OLDFILE";&lt;br /&gt;&lt;br /&gt; SKIP=0;&lt;br /&gt; let count=0;&lt;br /&gt; while [ $count -lt ${#NEWPATHS[@]} ] ; do&lt;br /&gt;  if [ "${NEWPATHS[$count]}" == "$OLDFILE" ]; then&lt;br /&gt;   echo "File already exists at '${NEWPATHS[$count]}'";&lt;br /&gt;   SKIP=1;&lt;br /&gt;   break;&lt;br /&gt;  fi&lt;br /&gt;  ((count++));&lt;br /&gt; done&lt;br /&gt;&lt;br /&gt; if [ $SKIP -eq 1 ]; then&lt;br /&gt;  continue; #skip the rest of this iteration&lt;br /&gt; fi&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; echo "Computing checksum of $OLDFILE";&lt;br /&gt; OLDSUM=`md5sum "$OLDFILE" | cut -d' ' -f1`;&lt;br /&gt;&lt;br /&gt; # iterate over the pair of arrays until we might find a matching sum&lt;br /&gt; let count=0;&lt;br /&gt; while [ "$count" -lt ${#SUMS[@]} ]; do &lt;br /&gt;  SUM=${SUMS[$count]};&lt;br /&gt;  NEWPATH=${NEWPATHS[$count]};&lt;br /&gt;&lt;br /&gt;  if [ "$SUM" == "$OLDSUM" ];&lt;br /&gt;  then&lt;br /&gt;   if [ "$OLDFILE" != "$NEWPATH" ] ;&lt;br /&gt;   then&lt;br /&gt;    NEWPARENT=`dirname "$NEWPATH"`;&lt;br /&gt;    if [ ! -d "$NEWPARENT" -a "$NEWPARENT" != "." ];&lt;br /&gt;    then&lt;br /&gt;     echo "Making directory $NEWPARENT";&lt;br /&gt;     mkdir "-p" "$NEWPARENT";&lt;br /&gt;    fi&lt;br /&gt;    echo "Moving $OLDFILE to $NEWPATH";&lt;br /&gt;    mv "$OLDFILE" "$NEWPATH";&lt;br /&gt;   else&lt;br /&gt;    echo "Path hasn't changed.";&lt;br /&gt;   fi&lt;br /&gt;   break;&lt;br /&gt;  fi&lt;br /&gt;  ((count++));&lt;br /&gt; done&lt;br /&gt;&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;exec 10&gt;&amp;-&lt;br /&gt;&lt;br /&gt;exit&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;In case it's not clear, this is offered without any warranty or guarantee whatsoever. &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-8994117876638858612?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/8994117876638858612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=8994117876638858612' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/8994117876638858612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/8994117876638858612'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2008/01/shell-script-to-reorganize-mirror-to.html' title='Shell Script to Reorganize a Mirror to Match a Newer Mirror'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-4649356248557416768</id><published>2008-01-11T23:55:00.000-05:00</published><updated>2008-01-12T00:22:12.153-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='data management'/><title type='text'>Scripts for Moving Large Files to DVD (GNU+Linux environment)</title><content type='html'>&lt;P&gt;Often, we have tons of files (videos, ISO's, software packages, etc.) that we're done with but don't want to throw away. I have written a few scripts to pack a directory of these kinds of files up into volumes (without any kind of compression) so that they can be written to DVD. Each volume should have an MD5 sum file generated which provides both a directory for that volume (since you can keep a copy locally and search using &lt;tt&gt;grep&lt;/tt&gt;) and a means to verify its integrity.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;P&gt;The first script attempts to "pack" files at the current directory level (it's non-recursive) into volumes of a specified size. This is really the only part of this post that warrants a real script since it's a nested loop. Note that really small files will always end up in the extra space on the first volume, so you may want to move them first. &lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;# Script takes files (or directories) in the current working directory &lt;br /&gt;# and moves them to subdirectories for writing out to discs&lt;br /&gt;#&lt;br /&gt;# This allows collections of relatively same-sized files or directories&lt;br /&gt;# of files to be packed into volumes for storage on optical media.&lt;br /&gt;#&lt;br /&gt;# Modified to output a shell script instead of making any changes&lt;br /&gt;# Disk capacity can now be entered&lt;br /&gt;&lt;br /&gt;# Defaults&lt;br /&gt;discSize="0";&lt;br /&gt;discDefaultSize="4380000";&lt;br /&gt;discInitNumDef="0";&lt;br /&gt;discInitNum="0";&lt;br /&gt;scriptPathDef="pack.sh";&lt;br /&gt;diskPath="disks";&lt;br /&gt;&lt;br /&gt;echo -n "Enter the volume number at which to start [$discInitNumDef]: ";&lt;br /&gt;read discNumOffset;&lt;br /&gt;&lt;br /&gt;if [ "$discNumOffset" == "" ] ;&lt;br /&gt;then&lt;br /&gt; discNumOffset=$discInitNumDef;&lt;br /&gt;fi&lt;br /&gt;echo $discNumOffset;&lt;br /&gt;&lt;br /&gt;echo -n "Enter the maximum capacity of the media [$discDefaultSize]: ";&lt;br /&gt;read discMaxSize;&lt;br /&gt;&lt;br /&gt;if [ "$discMaxSize" == "" ] ;&lt;br /&gt;then &lt;br /&gt; discMaxSize=$discDefaultSize;&lt;br /&gt;fi&lt;br /&gt;echo $discMaxSize;&lt;br /&gt;&lt;br /&gt;echo -n "A shell script will be output, move files now? [y/N]";&lt;br /&gt;read moveFiles;&lt;br /&gt;&lt;br /&gt;if [ "$moveFiles" == "" ];&lt;br /&gt;then&lt;br /&gt; moveFiles="N";&lt;br /&gt; echo "Not going to move files.";&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;echo -n "Enter the path to save the shell script [$scriptPathDef]: ";&lt;br /&gt;read $scriptPath;&lt;br /&gt;&lt;br /&gt;if [ "$scriptPath" == "" ] ;&lt;br /&gt;then&lt;br /&gt; scriptPath=$scriptPathDef;&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;echo "Going to write shell script to '$scriptPath'.";&lt;br /&gt;&lt;br /&gt;# Declare disk size array&lt;br /&gt;diskSizes[0]=0;&lt;br /&gt;arraySize=1;&lt;br /&gt;&lt;br /&gt;echo "#!/bin/sh" &gt; $scriptPath;&lt;br /&gt;&lt;br /&gt;if [ ! -d "$diskPath" ];&lt;br /&gt;then&lt;br /&gt; echo "mkdir \"$diskPath\";" &gt;&gt; $scriptPath;&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;if [ ! -d "$diskPath/`expr $discNum + $discNumOffSet`" ] ;&lt;br /&gt;then&lt;br /&gt; echo "mkdir \"$diskPath/`expr $discInitNum + $discNumOffset`\";" &gt;&gt; $scriptPath;&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;for file in * ;&lt;br /&gt;do&lt;br /&gt;&lt;br /&gt;if [ "$file" != "$diskPath" -a "$file" != "$scriptPath" ] ;&lt;br /&gt;then &lt;br /&gt; echo "$file";&lt;br /&gt;&lt;br /&gt; discNum=$discInitNum;&lt;br /&gt;&lt;br /&gt; newSize=`du -s "$file" | cut -f1`;&lt;br /&gt; #discSize=`du -s todisk/$discNum/ | cut -f1`;&lt;br /&gt; #discSize=`expr $diskSizes[$discNum] + $newSize`;&lt;br /&gt; discSize=${diskSizes[$discNum]};&lt;br /&gt;&lt;br /&gt; echo "newSize = $newSize, discSize = $discSize";&lt;br /&gt;&lt;br /&gt; if [ $newSize -gt $discMaxSize ] ;&lt;br /&gt; then&lt;br /&gt;  echo "$file is larger than the disc size, skipping it.";&lt;br /&gt; else&lt;br /&gt;  while [ `expr $discSize + $newSize` -gt $discMaxSize ] &lt;br /&gt;  do&lt;br /&gt;   echo "Won't fit in $discNum + $discNumOffset: $discSize + $newSize &gt; $discMaxSize";&lt;br /&gt;&lt;br /&gt;   discNum=`expr $discNum + 1`;&lt;br /&gt;   &lt;br /&gt;   if [ $discNum -ge $arraySize ] ;&lt;br /&gt;   then&lt;br /&gt;    #diskSizes[$diskNum]=0;&lt;br /&gt;    diskSizes=( ${diskSizes[@]} 0 );&lt;br /&gt;    arraySize=`expr $arraySize + 1`;&lt;br /&gt;&lt;br /&gt;    if [ ! -d "$diskPath/`expr $discNum + $discNumOffset`" ];&lt;br /&gt;    then&lt;br /&gt;            echo "mkdir \"$diskPath/`expr $discNum + $discNumOffset`\";" &gt;&gt; $scriptPath;&lt;br /&gt;    fi&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   fi&lt;br /&gt;   &lt;br /&gt;   discSize=${diskSizes[$discNum]};&lt;br /&gt;  done&lt;br /&gt;  &lt;br /&gt;  echo "Going to move $file into $discNum to make $discSize kb `expr $discSize + $newSize`";&lt;br /&gt; &lt;br /&gt;  echo "mv \"$file\" \"$diskPath/`expr $discNum + $discNumOffset`/\";" &gt;&gt; $scriptPath;&lt;br /&gt;&lt;br /&gt;  # Update disc size entry&lt;br /&gt;  diskSizes[$discNum]=`expr $discSize + $newSize`;&lt;br /&gt; &lt;br /&gt; fi&lt;br /&gt;&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;echo "Disk sizes:";&lt;br /&gt;&lt;br /&gt;for DISC in ${diskSizes[@]}&lt;br /&gt;do&lt;br /&gt; echo "$DISC kb";&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;exit;&lt;br /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;&lt;P&gt;The next, albeit more simple script creates checksum files (for later use with &lt;TT&gt;md5sum -c ...&lt;/TT&gt;) in each volume and provides the option to save a copy of the checksum file to another location.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;# Create checksum files for disk volumes generated by 'disk-pack'.&lt;br /&gt;# These files allow the fidelity of the optical media to be &lt;br /&gt;# evaluated, and allow the contents of the disk to be catalogued.&lt;br /&gt;#&lt;br /&gt;# This file should not change any files; only add new files. &lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;CATDIRDEF="`pwd`";&lt;br /&gt;echo -n "Path to save a duplicate of the MD5 checksums [$CATDIRDEF]: ";&lt;br /&gt;read CATDIR;&lt;br /&gt;&lt;br /&gt;if [ "$CATDIR" == "" ];&lt;br /&gt;then&lt;br /&gt; CATDIR=$CATDIRDEF;&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;echo "Saving duplicate checksums in '$CATDIR'";&lt;br /&gt;&lt;br /&gt;if [ ! -d "$CATDIR" ];&lt;br /&gt;then &lt;br /&gt; echo "Directory doesn't exist.";&lt;br /&gt; exit;&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;PREFIXDEF="disk";&lt;br /&gt;echo -n "Prefix to use in checksum file names [$PREFIXDEF]: ";&lt;br /&gt;read PREFIX;&lt;br /&gt;&lt;br /&gt;if [ "$PREFIX" == "" ];&lt;br /&gt;then&lt;br /&gt;        PREFIX=PREFIXDEF;&lt;br /&gt;fi&lt;br /&gt;echo "Using prefix '$PREFIX'.";&lt;br /&gt;&lt;br /&gt;for DISK in [0-9]* ;&lt;br /&gt;do&lt;br /&gt;&lt;br /&gt; if [ "$DISK" != "." -a "$DISK" != ".." ]&lt;br /&gt; then&lt;br /&gt;  echo "Processing volume $DISK";&lt;br /&gt;  cd $DISK;&lt;br /&gt;  find . -type f -exec md5sum {} \; | tee ../tempsums.md5;&lt;br /&gt;  cd ..;&lt;br /&gt;&lt;br /&gt;  if [ -e "$CATDIR/$PREFIX$DISK.md5" ];&lt;br /&gt;  then &lt;br /&gt;   echo "WARNING: Catalog file already exists, using alternate name.";&lt;br /&gt;   NUM="0";&lt;br /&gt;   while [ -e ""$CATDIR/$PREFIX$DISK-$NUM.md5 ]; do&lt;br /&gt;    NUM=`expr $NUM + 1`;&lt;br /&gt;   done&lt;br /&gt;   cp tempsums.md5 $CATDIR/$PREFIX$DISK-$NUM.md5;&lt;br /&gt;  else&lt;br /&gt;   cp tempsums.md5 $CATDIR/$PREFIX$DISK.md5;&lt;br /&gt;  fi&lt;br /&gt;&lt;br /&gt;  if [ -e "$DISK/$PREFIX$DISK.md5" ];&lt;br /&gt;  then&lt;br /&gt;   echo "WARNING: File $DISK/$PREFIX$DISK.md5 already exists, using alternate name.";&lt;br /&gt;   NUM="0";&lt;br /&gt;   while [ -e $DISK/$PREFIX$DISK-$NUM.md5 ]; do&lt;br /&gt;    NUM=`expr $NUM + 1`;&lt;br /&gt;   done&lt;br /&gt;   mv tempsums.md5 $DISK/$PREFIX$DISK-$NUM.md5;&lt;br /&gt;  else&lt;br /&gt;   mv tempsums.md5 $DISK/$PREFIX$DISK.md5;&lt;br /&gt;  fi&lt;br /&gt; fi&lt;br /&gt;done&lt;br /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;&lt;P&gt;Finally, you're ready to put these volumes out to optical media (since you've minimized internal fragmentation, captured a catalog of the files, and took an extra step to preserve integrity). You can do so using your favorite method, but when there are many volumes (like more than three) I prefer to take the following steps.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;P&gt;The following command, if you have &lt;TT&gt;genisoimage&lt;/TT&gt; will create a .iso file for the directory '40' and it will have the volume name "Volume40" when you mount it. &lt;/P&gt;&lt;br /&gt;&lt;PRE&gt;genisoimage -o volume40.iso -J -r -V Volume40 40/&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;&lt;P&gt;After you have a .iso file, you're almost ready to burn. &lt;B&gt;Always, always, always&lt;/B&gt; mount the ISO image (&lt;TT&gt;mount -o loop -t iso9660 volume40.iso isotest/&lt;/TT&gt;), enter it and check some of the MD5 sums to make sure you have a good .iso file! You'll have to check the man page for genisoimage and make sure you're providing the command-line options correctly if the files in the ISO seem corrupted. &lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;P&gt;If you're familiar with &lt;TT&gt;cdrecord&lt;/TT&gt;, it is now provided by &lt;TT&gt;wodim&lt;/TT&gt;. You need to be root. The command looks like:&lt;br /&gt;&lt;PRE&gt;wodim -v -eject speed=8 dev='/dev/scd0' volume40.iso&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;&lt;P&gt;Then, before I delete anything, I &lt;B&gt;always&lt;/B&gt; insert the CD, preferably into another optical drive, and run &lt;TT&gt;md5sum -c volume40.md5&lt;/TT&gt;. Now you know you have an exact copy, you can put it in a case and delete the original. &lt;I&gt;Note I'm assuming that if the disc fidelity decays that the files can be found again from the Internet--make sure you have even more redundancy if these are your personal files!&lt;/I&gt;&lt;/P&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-4649356248557416768?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/4649356248557416768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=4649356248557416768' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/4649356248557416768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/4649356248557416768'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2008/01/scripts-for-moving-large-files-to-dvd.html' title='Scripts for Moving Large Files to DVD (GNU+Linux environment)'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-1177566391218696520</id><published>2008-01-11T23:49:00.000-05:00</published><updated>2008-01-30T01:37:19.063-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='file organization'/><title type='text'>New Split Directory Script</title><content type='html'>&lt;I&gt;Follow-up to: "Making directory traversals more efficient"&lt;/I&gt;&lt;br /&gt;&lt;br /&gt;&lt;P&gt;Back at the beginning, I posted a lengthy script that would split up a congested directory alphabetically. Recently, I needed it again, but needed it to be smarter, so I re-wrote it. Also, I figured out how to insert code into Blogger. Enjoy.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;# by Ryan Helinski, January 2008&lt;br /&gt;#&lt;br /&gt;# This is the second revision of a script that should be used &lt;br /&gt;# when there are too many files or directories at a single level&lt;br /&gt;# on the file system. &lt;br /&gt;#&lt;br /&gt;# It now recognizes the word, "the", and that the name should &lt;br /&gt;# be alphabetized by the words following.&lt;br /&gt;#&lt;br /&gt;# A script is output so the changes can be reviewed before&lt;br /&gt;# any are made. &lt;br /&gt;#&lt;br /&gt;# The script should add to existing bin directories if they &lt;br /&gt;# already exist.&lt;br /&gt;#&lt;br /&gt;# A further improvement would be to allow the split to be &lt;br /&gt;# multi-level.&lt;br /&gt;&lt;br /&gt;BINS=(0-9 a b c d e f g h i j k l m n o p q r s t u v w x y z);&lt;br /&gt;BIN_EXPS=(0-9 Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz);&lt;br /&gt;&lt;br /&gt;SCRIPT_FILE=".script.sh";&lt;br /&gt;&lt;br /&gt;echo "#!/bin/sh" &gt; $SCRIPT_FILE;&lt;br /&gt;&lt;br /&gt;for BIN in ${BINS[*]};&lt;br /&gt;do&lt;br /&gt; if [ -d $BIN ];&lt;br /&gt; then &lt;br /&gt;  echo "mv $BIN .$BIN" &gt;&gt; $SCRIPT_FILE;&lt;br /&gt; else&lt;br /&gt;  echo "mkdir .$BIN" &gt;&gt; $SCRIPT_FILE;&lt;br /&gt; fi&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;INDEX="0";&lt;br /&gt;while [ "$INDEX" -lt "${#BINS[*]}" ];&lt;br /&gt;do&lt;br /&gt; echo "mv [Tt][Hh][Ee]\ [${BIN_EXPS[$INDEX]}]* .${BINS[$INDEX]}/" &gt;&gt; $SCRIPT_FILE;&lt;br /&gt; INDEX=`expr $INDEX + 1`;&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;INDEX="0";&lt;br /&gt;while [ "$INDEX" -lt "${#BINS[*]}" ];&lt;br /&gt;do&lt;br /&gt; echo "mv [${BIN_EXPS[$INDEX]}]* .${BINS[$INDEX]}/" &gt;&gt; $SCRIPT_FILE;&lt;br /&gt; INDEX=`expr $INDEX + 1`;&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;for BIN in ${BINS[*]};&lt;br /&gt;do&lt;br /&gt; echo "mv .$BIN $BIN" &gt;&gt; $SCRIPT_FILE;&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;ANSWER="";&lt;br /&gt;while [ "$ANSWER" != "yes" -a "$ANSWER" != "no" ];&lt;br /&gt;do&lt;br /&gt; echo "Script written to \"$SCRIPT_FILE\", execute now? (yes, no)";&lt;br /&gt; read ANSWER;&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;if [ "$ANSWER" == "yes" ];&lt;br /&gt;then&lt;br /&gt; sh $SCRIPT_FILE;&lt;br /&gt; &lt;br /&gt; ANSWER="";&lt;br /&gt; while [ "$ANSWER" != "yes" -a "$ANSWER" != "no" ];&lt;br /&gt; do&lt;br /&gt;  echo "Delete script file? (yes, no)";&lt;br /&gt;  read ANSWER;&lt;br /&gt; done&lt;br /&gt;&lt;br /&gt; if [ "$ANSWER" == "yes" ];&lt;br /&gt; then&lt;br /&gt;  rm "$SCRIPT_FILE";&lt;br /&gt; fi&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;exit;&lt;br /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-1177566391218696520?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/1177566391218696520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=1177566391218696520' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/1177566391218696520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/1177566391218696520'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2008/01/new-split-directory-script.html' title='New Split Directory Script'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-5521040952500189365</id><published>2007-12-04T09:39:00.000-05:00</published><updated>2008-01-30T01:33:14.069-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='codecs'/><category scheme='http://www.blogger.com/atom/ns#' term='ogg vorbis'/><category scheme='http://www.blogger.com/atom/ns#' term='flac'/><category scheme='http://www.blogger.com/atom/ns#' term='music'/><title type='text'>Make OGG not MP3</title><content type='html'>In reference to &lt;a href="http://yro.slashdot.org/article.pl?sid=07/12/03/235241&amp;amp;from=rss"&gt;recent news&lt;/a&gt;, MP3 is still gaining momentum, as &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Wal&lt;/span&gt;-Mart is replacing their Windows Media Audio (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;WMA&lt;/span&gt;) files with MP3. In my humble opinion, MP3 is still better than &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;WMA&lt;/span&gt; because it is so well understood (coders, decoders, support, household name, etc.) and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;WMA&lt;/span&gt; is really just a way for Microsoft to get a piece of the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;Fraunhofer&lt;/span&gt; pie. However, as long as MP3 is really "gaining momentum", then we need to collectively do something about it...&lt;br /&gt;&lt;br /&gt;Personally, I've made the following pledges and hope they inspire someone:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;I will not distribute MP3 &lt;/span&gt;&lt;br /&gt;I deal with a lot of original content, and after mix-down there's a choice--how to encode it to let someone hear it over the Internet? I will always choose &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;FLAC&lt;/span&gt; or &lt;a href="http://www.vorbis.com/"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;Ogg&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;Vorbis&lt;/span&gt;&lt;/a&gt;, and refuse to send an MP3.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;I will maintain my personal collection in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;Ogg&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;Vorbis&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;When I buy a new CD, the first thing I do (usually) is run it through &lt;a href="http://burtonini.com/blog/computers/sound-juicer"&gt;GNOME Sound Juicer&lt;/a&gt; (which supports &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;OGG&lt;/span&gt; and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;FLAC&lt;/span&gt; by default) and create &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;Ogg&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;Vorbis&lt;/span&gt; files so I can load it onto music player (software) or portable media player (hardware), and to protect the data from being damaged by wear on the CD. This is the &lt;span style="font-weight: bold;"&gt;cheif&lt;/span&gt; method that OGG could become ubiquitous. Transcoding MP3 to OGG is lossy (it's much better to start from the original sampling), and any audiophile would tell you it's not worth it. Therefor, the most important source of OGG files is at the source (audio CD, FLAC, etc.), and we can become less dependent on MP3 by &lt;span style="font-weight: bold;"&gt;replacing &lt;/span&gt;MP3 files with newly-encoded OGG files.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;I will not buy a portable media player that does not support free &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;codecs&lt;/span&gt;&lt;/span&gt; like &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;Ogg&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;Vorbis&lt;/span&gt;&lt;br /&gt;Okay, I still want to be able to listen to MP3, but in order to support pledge #2, I need my portable media device to support &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;OGG&lt;/span&gt; out of the box. I personally have a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;COWON&lt;/span&gt; (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;iAudio&lt;/span&gt;) T2, but there are many other options &lt;a href="http://wiki.xiph.org/index.php/PortablePlayers"&gt;from abroad&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;I prefer Ogg Vorbis Internet radio over other formats&lt;/span&gt;&lt;br /&gt;Hey, if OGG has the same fidelity at a lower bandwidth (you'll note the rates on Internet streams have a lower average), then we're saving the host bandwidth by preferring an Ogg Vorbis stream. Also, since Internet radio is struggling with royalties, &lt;span style="font-weight: bold;"&gt;why don't they save themselves money&lt;/span&gt; by dropping their MP3 streams and providing only Ogg Vorbis streams? I feel that most Internet radio listeners would not mind having to download an additional codec (if they even need to) to make the switch.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;These are reasonable commitments to make, and the second big corporations catch on, we'll start to see MP3 dwindle away. Ogg Vorbis will have to make a statistical win (what is the probability of an audio file being an OGG?), and a compatibility win (what is the probability I can play this OGG?) in order to acheive this.&lt;br /&gt;&lt;br /&gt;Note that DRM is not even in my vocabulary--it seems like the only "solution" to DRM is to avoid it at all costs. This business of limiting where, when and who can listen to a file (that someone has paid for, mind you) is nonsense. This is exactly the reason we dropped vinyl albums and magnetic tapes for compact discs--so we could hear the same thing again whenever and wherever we want.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-5521040952500189365?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/5521040952500189365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=5521040952500189365' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/5521040952500189365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/5521040952500189365'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/12/make-ogg-not-mp3.html' title='Make OGG not MP3'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-7005009476330994000</id><published>2007-11-06T09:47:00.000-05:00</published><updated>2007-11-06T09:51:42.767-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='E-mail'/><category scheme='http://www.blogger.com/atom/ns#' term='IMAP'/><category scheme='http://www.blogger.com/atom/ns#' term='Gmail'/><title type='text'>Finally, Gmail offers IMAP</title><content type='html'>Previously Google claimed that IMAP would be too difficult to implement given their unconventional e-mail organization scheme (all e-mails basically in one folder). Now, they've finally opened up IMAP servers which allows much greater control than POP 3 previously did. For instance, one should be able to now import old e-mails into Gmail so that now all your mail is searcheable from one place!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-7005009476330994000?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/7005009476330994000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=7005009476330994000' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/7005009476330994000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/7005009476330994000'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/11/finally-gmail-offers-imap.html' title='Finally, Gmail offers IMAP'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-5092947736506742020</id><published>2007-09-20T23:16:00.000-05:00</published><updated>2008-01-30T01:38:29.808-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU'/><category scheme='http://www.blogger.com/atom/ns#' term='Remote Desktop'/><title type='text'>GNU Screen -- The best thing since VNC?</title><content type='html'>I have recently found myself in a bit of a blunder. I found myself opening a VNC server (with &lt;tt&gt;vncserver&lt;/tt&gt;) and then connecting to it just to open a bunch of &lt;tt&gt;xterm&lt;/tt&gt;'s, and this seemed wasteful to download pictures of a text-mode terminal. I also SSH in and run long-term tasks and want to disconnect--but don't want to use &lt;tt&gt;nohup&lt;/tt&gt; because I might want to re-gain control of the program or just see in real-time what the output is.&lt;br /&gt;&lt;br /&gt;Then I remembered I read the description of a software some time ago in &lt;tt&gt;pirut&lt;/tt&gt;, and thought it was a great idea. This software, as I remember it, was much like what I've just found &lt;a href="http://cyberelk.net/tim/vtgrab/"&gt;here&lt;/a&gt;, but it seems like this project is defunct. I know there was something which was its own daemon and allowed persistent sessions, but...&lt;br /&gt;&lt;br /&gt;After a lot of Googling, I finally came accross &lt;a href="http://en.wikipedia.org/wiki/Gnu_screen"&gt;GNU Screen&lt;/a&gt;. I find this software awesome! Basically, it's like a window manager for your Secure Shell, allowing multiple new shells to be opened and switched between, "screen splitting" so you can see two screens at once, persistence of your tasks--which was exactly what I was looking for, and other features like sharing the session between users. Now I can have my multiple terminals running on the remote machine and use them effectively and more efficiently than via VNC.&lt;br /&gt;&lt;br /&gt;The Wikipedia article links to many good tutorials in its references section. I recommend you try a few of them, especially &lt;a href="http://gustaf.symbiandiaries.com/weblog/comp/Screen-quickstart.html"&gt;this one&lt;/a&gt;, but if you're like me--you need to know right away:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;install: &lt;tt&gt;yum install screen&lt;/tt&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;run: &lt;tt&gt;screen&lt;/tt&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;disconnect: &lt;tt&gt;CTRL+a d&lt;/tt&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;reconnect: &lt;tt&gt;screen -r -d&lt;/tt&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; Yes, VNC is newer than Screen. No, Screen is not convenient when you need to use GUI's since even if you get it to work, it's forwarding who X windows, which can be much too slow if you're connecting over WAN. VNC is definitely the way to go if you have GUI programs you want to use in conjunction with text-mode. &lt;br /&gt;&lt;br /&gt;Happy screening!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-5092947736506742020?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/5092947736506742020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=5092947736506742020' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/5092947736506742020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/5092947736506742020'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/09/gnu-screen-best-thing-since-vnc.html' title='GNU Screen -- The best thing since VNC?'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-1006003234717651384</id><published>2007-09-03T19:32:00.000-05:00</published><updated>2007-10-03T12:55:50.635-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='creative-commons'/><category scheme='http://www.blogger.com/atom/ns#' term='music'/><title type='text'>Jamendo</title><content type='html'>Jamendo is an excellent program which allows artists to release musical works into the public domain under various formats. With plugins for programs like Rhythmbox, you can use the service as an Internet Radio, and if you like something you can visit the artist's site on Jamendo or get the whole album on BitTorrent. Recordings are uploaded in WAV for FLAC, and are distributed in OGG and MP3. &lt;br /&gt;&lt;br /&gt;If you are an artist with content that you feel would should be in the public domain, sharing your original recordings is easy. More importantly, you can get feedback on your recordings from the Jamendo community, which can be exciting because all the opinions (although sometimes misguided) are impartial--which is more than you can expect of your friends :) .&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-1006003234717651384?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/1006003234717651384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=1006003234717651384' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/1006003234717651384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/1006003234717651384'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/09/jamendo.html' title='Jamendo'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-2239078576093152</id><published>2007-09-01T13:22:00.000-05:00</published><updated>2007-09-01T13:30:56.015-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source software'/><title type='text'>SourceForge.net User Network</title><content type='html'>Anyone can join SourceForge.net, even if you don't have a project to share. Many projects need testers, developers, documentation writers, and translators (and more). There's a long list of projects which have advertised they need assistance (http://sourceforge.net/people/). It's a great way to help out the SF.net community and gain coding experience both by examining code and by extending/adding new code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-2239078576093152?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/2239078576093152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=2239078576093152' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/2239078576093152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/2239078576093152'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/09/sourceforgenet-user-network.html' title='SourceForge.net User Network'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-7330521794871419399</id><published>2007-08-30T07:21:00.001-05:00</published><updated>2008-09-02T11:00:47.625-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSH'/><category scheme='http://www.blogger.com/atom/ns#' term='system configuration'/><title type='text'>Configure OpenSSH to automatically authenticate</title><content type='html'>Sometimes entering your pass-phrase to gain SSH access can get redundant, or you may want an automated script to be able to authenticate as you (as described at http://sial.org/howto/rsync/).&lt;br /&gt;&lt;br /&gt;I've been trying to do this for some time now--apparently if you read the man pages carefully enough you can figure this out. I thought I'd need a more advanced SSH client, but OpenSSH already has everything you need--the &lt;tt&gt;ssh-keygen&lt;/tt&gt; program is key. Following is a brief walk-through of how to configure connection from &lt;i&gt;client&lt;/i&gt; to &lt;i&gt;server&lt;/i&gt; for SSH. Replace the words client and server as appropriate. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;client$ ssh-keygen -t rsa&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It will ask where to save, you want the default since this is where &lt;tt&gt;ssh&lt;/tt&gt; will look. It will ask for a pass-phrase, and since we're trying to get around having to enter a pass-phrase, we don't want to protect our authentication, so just hit enter twice. Then it will give you a fingerprint and put files in your ~/.ssh directory.&lt;br /&gt;&lt;br /&gt;Copy the &lt;tt&gt;~/.ssh/id_rsa.pub&lt;/tt&gt; to the server machine taking care not to overwrite the same file there:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;client$ scp ~/.ssh/id_rsa.pub user@server.address:.ssh/client.pub&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now SSH to the server and add the public key to the authorized keys file like so:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;server$ cd ~/.ssh&lt;br /&gt;server$ cat client.pub &gt;&gt; authorized_keys&lt;br /&gt;server$ rm client.pub&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The SSH server won't let you use the key unless the file is secured. That is, the keys should only be readable by you. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;server$ ls -l authorized_keys&lt;br /&gt;-rw-rw-r-- 1 user users authorized_keys&lt;br /&gt;server$ chmod og-rw authorized_keys&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now we should be able to open an SSH session simply by:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;client$ ssh user@server.address&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;where you can omit the 'user@' part if the user names are the same on the local and remote machines. &lt;br /&gt;&lt;br /&gt;Finally, note that doing all this means if you leave your machine open, an intruder has more doors they can open! This is why you should always lock and/or time-out your screen. If the key has no passphrase, then if someone copies it, they can gain access to the machine you opened with this procedure. Therefore, you should restrict access to your machine by configuring &lt;tt&gt;/etc/hosts.allow&lt;/tt&gt; and &lt;tt&gt;/etc/hosts.deny&lt;/tt&gt;. If you're concerned, don't let the passphrase for the key be null (use a passphrase). Taking these steps can help protect your key.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-7330521794871419399?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/7330521794871419399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=7330521794871419399' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/7330521794871419399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/7330521794871419399'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/08/configure-openssh-to-automatically.html' title='Configure OpenSSH to automatically authenticate'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-5498532848489941491</id><published>2007-08-16T23:53:00.000-05:00</published><updated>2008-01-30T01:31:36.725-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='LED'/><category scheme='http://www.blogger.com/atom/ns#' term='Luxeon'/><category scheme='http://www.blogger.com/atom/ns#' term='bicycles'/><title type='text'>Cost Review for Luxeon LED Headlight</title><content type='html'>To justify building on myself, I had to do a cost analysis. &lt;br /&gt;&lt;br /&gt;Purchased:&lt;br /&gt;&lt;br /&gt;4x D-cell Batteries ($5)&lt;br /&gt;1x LED Dynamics BoostPuck ($35)&lt;br /&gt;4x Lumileds Luxeon I Star/O ($25)&lt;br /&gt;&lt;br /&gt;Subtotal: $65&lt;br /&gt;&lt;br /&gt;Spare parts:&lt;br /&gt;1x 270uF capacitor&lt;br /&gt;1x 24-gauge (AWG) lead wire&lt;br /&gt;1x Pentium3 Heat Sink&lt;br /&gt;1x Mounting bracket&lt;br /&gt;1x Rocker switch&lt;br /&gt;2x 2 D-cell Battery Holder&lt;br /&gt;1x 18-gauge (AWG) lead wire&lt;br /&gt;&lt;br /&gt;Note that comparable systems are water-resistant and include a rechargeable battery system, but can cost from $120 up to $300.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-5498532848489941491?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/5498532848489941491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=5498532848489941491' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/5498532848489941491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/5498532848489941491'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/08/cost-review-for-luxeon-led-headlight.html' title='Cost Review for Luxeon LED Headlight'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-9047673365128059813</id><published>2007-08-16T16:20:00.000-05:00</published><updated>2007-09-08T14:14:13.534-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Power Regulators'/><category scheme='http://www.blogger.com/atom/ns#' term='LED'/><category scheme='http://www.blogger.com/atom/ns#' term='Luxeon'/><title type='text'>Rebuild of Luxeon I Bicycle Headlight</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_X6E8ImjoLLw/RsTk3iraYQI/AAAAAAAAAEM/0ZlYTP6xs6M/s1600-h/fair+comparison.jpg"&gt;&lt;img class="figure" src="http://3.bp.blogspot.com/_X6E8ImjoLLw/RsTk3iraYQI/AAAAAAAAAEM/0ZlYTP6xs6M/s200/fair+comparison.jpg" alt="" id="BLOGGER_PHOTO_ID_5099452320943071490" border="0" /&gt;&lt;/a&gt;This is a practical comparison between two light sources: an old 2-C cell halogen headlight and a single Luxeon I Star (with optics), both driven at the proper power. This is an image with no special adjustments and the sources about 5 feet away. It is easy to see that the Luxeon I has both more flux (total amount of light) and better throw (maximum intensity of beam). Note that halogen bulbs are known to be more efficient than traditional vacuum bulbs, see &lt;a href="http://en.wikipedia.org/wiki/Lighting_efficiency"&gt;Lighting efficacy&lt;/a&gt; for more. According to my calculations, the power delivered to the halogen bulb is about 1.5 Watts, and the power to the Luxeon I (obviously) is 1 Watt. Note the spectrum of light output, and how this would make riding safer. This comparison allows the efficiency of the LED to really "shine".&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Note that my power supply (limited to 1 amp) may not have been able to provide enough current to drive the Halogen bulb to the same power as the 2 C-cells, so the halogen light may get brighter with actual batteries. However, the power measurements quoted are absolutely correct and (together with the comparison picture) still illustrate the point of efficiency. Also note that only one Luxeon I (1-watt) is switched on in the comparison picture, whereas four are used in my headlight assembly. &lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The LED Dynamics BoostPuck 350mA current regulator came today. The model with lead wires attached was not available, so I had to solder on wires. It really is small as they say; even smaller than my rocker switch. I left the extra pins (reference voltage, and dim) not connected.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_X6E8ImjoLLw/RsTomCraYRI/AAAAAAAAAEU/a_D3FiQPbMU/s1600-h/alive+with+power+supply.jpg"&gt;&lt;img class="figure" src="http://1.bp.blogspot.com/_X6E8ImjoLLw/RsTomCraYRI/AAAAAAAAAEU/a_D3FiQPbMU/s200/alive+with+power+supply.jpg" alt="" id="BLOGGER_PHOTO_ID_5099456418341871890" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span&gt;Using my power supply, I verified all the parts and connections were OK. The meter pictured is showing volts across the input power pins of the BoostPuck (out of frame). The system is was actually pulling down the voltage on my 1-amp-maximum power supply set at 6.0V by 200mV. You can see that the LED's are fully illuminated, which requires at least 12 Volts in their wiring configuration...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_X6E8ImjoLLw/RsTpaSraYSI/AAAAAAAAAEc/XmHk2Iq3OvU/s1600-h/new+wiring+config.jpg"&gt;&lt;img class="figure" src="http://2.bp.blogspot.com/_X6E8ImjoLLw/RsTpaSraYSI/AAAAAAAAAEc/XmHk2Iq3OvU/s200/new+wiring+config.jpg" alt="" id="BLOGGER_PHOTO_ID_5099457315990036770" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I soldered everything together as I mentioned I would in my last post (in series). I included a 270uF capacitor. The only problem with the BoostPuck is that it's a sealed unit and has no way to mount it to anything, unless you use the pins to anchor it (which I don't). It's not heavy, so I didn't think it's all that important. Using industrial hot glue, I fixed it to the rocker switch, and the capacitor to it as well. I expect the hot glue not to hold for long, especially if things heat up. I'll use some epoxy if all goes well--the hot glue comes off easily, epoxy won't.&lt;br /&gt;&lt;br /&gt;The light output looks about right. It might be a little dimmer than the unregulated circuit, but it's worth the gains in battery efficiency/power delivery. The BoostPuck is producing over 12VDC across the four LED's in series, which is about what I expected. I haven't actually checked, but I'm assuming that the diode current is 350mA. I didn't make measurements of the current drawn from the batteries because of the AC components.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_X6E8ImjoLLw/RsTqHiraYTI/AAAAAAAAAEk/q1Pa8_7ZuXQ/s1600-h/installed.jpg"&gt;&lt;img class="figure" src="http://3.bp.blogspot.com/_X6E8ImjoLLw/RsTqHiraYTI/AAAAAAAAAEk/q1Pa8_7ZuXQ/s200/installed.jpg" alt="" id="BLOGGER_PHOTO_ID_5099458093379117362" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The light beam itself is continuous (as opposed to strobed); waving hands in front of the beam doesn't reveal individual light pulses as with other charge-pumping lights I've encountered. Also, the intensity differences between the new and old LED's is gone as I expected. The newer LED's needed a higher voltage than the older LED's to produce the same amount of light, and fixing the current at 350mA equalized the light intensity.&lt;br /&gt;&lt;br /&gt;For clarity, below is a crude circuit diagram including all the parts.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_X6E8ImjoLLw/RsTxICraYUI/AAAAAAAAAEs/KGPehEiT83w/s1600-h/headlight_circuit.jpeg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; clear: both; " src="http://1.bp.blogspot.com/_X6E8ImjoLLw/RsTxICraYUI/AAAAAAAAAEs/KGPehEiT83w/s200/headlight_circuit.jpeg" alt="" id="BLOGGER_PHOTO_ID_5099465798550446402" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-9047673365128059813?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/9047673365128059813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=9047673365128059813' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/9047673365128059813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/9047673365128059813'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/08/rebuild-of-luxeon-i-bicycle-headlight.html' title='Rebuild of Luxeon I Bicycle Headlight'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_X6E8ImjoLLw/RsTk3iraYQI/AAAAAAAAAEM/0ZlYTP6xs6M/s72-c/fair+comparison.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-1760222911821122007</id><published>2007-08-14T20:28:00.000-05:00</published><updated>2007-09-08T14:18:07.414-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='LED'/><category scheme='http://www.blogger.com/atom/ns#' term='Luxeon'/><title type='text'>Luxeon LED headlight assembly</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_X6E8ImjoLLw/RsJZsATns9I/AAAAAAAAADs/mgeWuRhzaEY/s1600-h/heat_sink.jpg"&gt;&lt;img class="figure" src="http://4.bp.blogspot.com/_X6E8ImjoLLw/RsJZsATns9I/AAAAAAAAADs/mgeWuRhzaEY/s200/heat_sink.jpg" alt="" id="BLOGGER_PHOTO_ID_5098736340668232658" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Have an old processor heat sink laying around? This Pentium 3 heatsink is the perfect size for four Luxeon I Star/O assemblies (LumiLEDs Product# LXHL-NWE8). Luxeon light sources need very good heat dissipation, and this might be over-doing it, but why not prolong the life of the light sources?&lt;br /&gt;&lt;br /&gt;I wanted to get around paying up to $300 for a battery-powered bicycle headlamp, so I decided to meet or exceed the expectations with available parts.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_X6E8ImjoLLw/RsJZ8wTns-I/AAAAAAAAAD0/rNW5_DtD9Fw/s1600-h/light_sources_back.jpg"&gt;&lt;img class="figure" src="http://3.bp.blogspot.com/_X6E8ImjoLLw/RsJZ8wTns-I/AAAAAAAAAD0/rNW5_DtD9Fw/s200/light_sources_back.jpg" alt="" id="BLOGGER_PHOTO_ID_5098736628431041506" border="0" /&gt;&lt;/a&gt;I initially bought only two of these Luxeon Stars (with optics) over a year ago. I didn't have a good way to drive them other than my &lt;span style="font-style: italic;"&gt;Elenco Precision&lt;/span&gt; (TM) power supply and alkaline batteries, both of which are voltage sources. I tried using two D cell alkaline batteries, this provided 3.0V which is less than the typical 3.4V, and not didn't force enough current to for the LED's to be all the way on.  I also didn't have a good mounting bracket, or a good way to mount the batteries to the bicycle frame.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_X6E8ImjoLLw/RsJbTgTns_I/AAAAAAAAAD8/WC0gbTUZJK8/s1600-h/heat_sink_assembled.jpg"&gt;&lt;img class="figure" src="http://2.bp.blogspot.com/_X6E8ImjoLLw/RsJbTgTns_I/AAAAAAAAAD8/WC0gbTUZJK8/s200/heat_sink_assembled.jpg" alt="" id="BLOGGER_PHOTO_ID_5098738118784693234" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Recently, using the mounting bracket from and old mechanical speedometer and zip ties, I was able to make an excellent mount. This stops the lights from changing pitch (very important for this application) or breaking free. I connected them all in parallel to try to give them all 3.0V from the two D cells.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Lesson learned:&lt;/span&gt; Don't solder when the device is a metal core PCB and it's sitting on a heat sink with silicon paste in between! Leave these PCB's on an insulator while soldering.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_X6E8ImjoLLw/RsJiowTntAI/AAAAAAAAAEE/kz52uil02Y0/s1600-h/headlight_mounted.jpg"&gt;&lt;img class="figure" src="http://3.bp.blogspot.com/_X6E8ImjoLLw/RsJiowTntAI/AAAAAAAAAEE/kz52uil02Y0/s200/headlight_mounted.jpg" alt="" id="BLOGGER_PHOTO_ID_5098746180438307842" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I noted that they were only drawing around 800mA, nowhere near 1.4A (4x350mA). I decided to increase my power supply voltage potential, but this meant there needs to be another component in series with the light sources to allow the excess voltage to be dissipated. In the application notes from LumiLEDs, they recommend using a 6V power supply and a 10 Ohm resistor for a Luxeon I. I added another battery pack to the frame to get 6.3V, but I decided to use  0.9V rectifying diodes (3A max) rather than four resistors (one in series with each supply) which would require desoldering. This achieved 1.6A with one diode in series and 1.1A with two diodes in series. I stuck with the two diodes in series to stay on the safe side. The diodes get rather hot very quickly since they're dissipating so much power. This is a major problem, by my measurements -- 45% of the power was being dissipated in the diodes themselves, delivering only 55% of the power from the batteries to the light sources. Another reason that a passive approach (linear mode voltage regulation) is bad for alkaline battery applications is that the higher the power delivery, the more the batteries self heat and increase internal resistance. In other words, Alkaline's are less efficient when discharged quickly. It is a common trend that batteries are more efficient with intermittent loading for reasons related to battery theory. For much more, see the IEEE paper &lt;span style="font-weight: bold;"&gt;Battery­Driven System Design: A New Frontier in Low Power Design&lt;/span&gt;, by Kanishka Lahiri, Anand Raghunathan, Sujit Dey, and Debashis Panigrahi.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Lesson learned&lt;/span&gt;: The voltage drop across an LED is related to the energy released in each photon--relating to the wavelength of the light emitted. (Note that this is the P-N junction voltage drop, and differs from the external voltage drop and light spectrum is also highly dependent upon construction materials). The current through the LED corresponds to the number of photons emitted--relating to the intensity of light emitted. These brief rules of thumb really help in understanding how to apply high-power LED's.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Lesson learned&lt;/span&gt;: Luxeon LED's are constant-current devices, so to get them to the proper luminous intensity and power consumption, they need to be driven at the proper current amperage. For Luxeon I's this is 350mA, for Luxeon III's this is 700mA, etc. This point remained subtle to me because I figured I could always just find a voltage potential which would result in the proper current being drawn. The problem is that LumiLEDs has a tighter manufacturer tolerance of 350mA operating conditions than the forward voltage (Vf) which is loosely maintained. This means each light source will require a slightly different Vf to draw 350mA and use run at the full 1 Watt. The most robust solution is a constant current source which can be used to drive multiple light source in series. This also allows the supply voltage to fluctuate (eg: a draining battery) and not affect the luminous intensity as it would without a regulator.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Lesson learned&lt;/span&gt;: A common optimization for alkaline battery-powered applications is to use a charge-pumping power regulator. These are capable of producing voltages higher than their input voltage (12VDC from 6VDC for instance) by intermittently presenting a larger load and driving an oscillating circuit. The typical result is luminous intensity remaining mostly flat until the battery is mostly depleted. Just connecting a 12VDC battery supply would result in an exponentially decaying luminous intensity.&lt;br /&gt;&lt;br /&gt;These conclusions lead me to replace my diode-dissipating circuit with a switch-mode power supply including a boost circuit. Because of the scarce availability of through-hole mounting switch-mode power supplies and the necessity for a PCB, I was very happy to find products from &lt;a href="http://www.leddynamics.com"&gt;LED Dynamics&lt;/a&gt; including the &lt;a href="http://www.leddynamics.com/LuxDrive/boostpuck.php"&gt;BoostPuck&lt;/a&gt;. Their Application Figure 3 in their &lt;a href="http://www.leddynamics.com/LuxDrive/datasheets/4015-BoostPuck.pdf"&gt;datasheet&lt;/a&gt; is my exact application. The regulators are unfortunately around $34, but it's worth the efficiency of a switch-mode power supply, the optimized battery utilization, and proper driving (constant current of 350mA) of the light sources to get the most light without risking burning out the LED.&lt;br /&gt;&lt;br /&gt;When the unit arrives, I'll removed the hot glue (to keep the parts clean) and connect the light sources in series and connect the BoostPuck to the ligth sources after the rocker switch. As per the application notes, I'll need to include a capacitor since my batteries are a few feet away. More as soon as the part comes in.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-1760222911821122007?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/1760222911821122007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=1760222911821122007' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/1760222911821122007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/1760222911821122007'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/08/luxeon-led-headlight-assembly.html' title='Luxeon LED headlight assembly'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_X6E8ImjoLLw/RsJZsATns9I/AAAAAAAAADs/mgeWuRhzaEY/s72-c/heat_sink.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-7958152857257501096</id><published>2007-08-03T12:15:00.000-05:00</published><updated>2008-01-30T01:31:47.062-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='repair'/><category scheme='http://www.blogger.com/atom/ns#' term='maintenance'/><category scheme='http://www.blogger.com/atom/ns#' term='bicycles'/><title type='text'>1979 Free Spirit Ten Speed</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_X6E8ImjoLLw/RrPgsQTnsxI/AAAAAAAAAB0/gSsZqydfl9w/s1600-h/01+before.jpg"&gt;&lt;img class="figure" src="http://2.bp.blogspot.com/_X6E8ImjoLLw/RrPgsQTnsxI/AAAAAAAAAB0/gSsZqydfl9w/s200/01+before.jpg" alt="" id="BLOGGER_PHOTO_ID_5094662654382289682" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Once I started riding this old Free Spirit ten-speed, I was hooked. Most of my riding is on a paved recreational trail, so the thin tires aren't a hazard and the bike is a lot more efficient than a Mountain Bike on those conditions.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The bicycle came from Sears &amp; Roebuck circa 1979. I decided that even if I buy a new road bike, that I wanted to keep the Free Spirit around since it was in such good condition compared to a few much younger bikes I have seen. The parts are old (Shimano) parts, but most of the following procedures still apply to most bicycles.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_X6E8ImjoLLw/RrPhBATnszI/AAAAAAAAACE/cWj6yiaqygI/s1600-h/03+speedometer.jpg"&gt;&lt;img class="figure" src="http://1.bp.blogspot.com/_X6E8ImjoLLw/RrPhBATnszI/AAAAAAAAACE/cWj6yiaqygI/s200/03+speedometer.jpg" alt="" id="BLOGGER_PHOTO_ID_5094663010864575282" border="0" /&gt;&lt;/a&gt;The first problem was that the wheels needed to be "trued" very badly, the crank was loose, it had lots of grime around the chain hardware, the brakes needed to be tensioned, and it had some out of order accessories. The accessories it had were a luggage wrack in the back which had a broken support (which is laying on the ground behind the bike in the picture), and a mechanical speedometer which had a loose cable and just made chirping noises. It also had "soft" plastic handle grips on the end of the dropped handle bars which were petrified and provided no cushioning.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_X6E8ImjoLLw/RrPhHQTns0I/AAAAAAAAACM/F-7RfrmVtkg/s1600-h/04+derailleur.jpg"&gt;&lt;img class="figure" src="http://2.bp.blogspot.com/_X6E8ImjoLLw/RrPhHQTns0I/AAAAAAAAACM/F-7RfrmVtkg/s200/04+derailleur.jpg" alt="" id="BLOGGER_PHOTO_ID_5094663118238757698" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I started by disassembling the whole thing! I cleaned all the parts with CLOROX(tm) disinfecting wipes because they have a cleaning agent which does no harm and are great for absorbing grime. I put the luggage wrack aside because it just got in the way of mounting/dismounting (and was broken). As for the speedometer, modern bicycle computers (speedometer, odometer, tripometer, etc.) are now inexpensive, under $12 at your local "superstore", and allow you to program your wheel size (unlike the mechanical one), so I replaced the huge speedometer with the little computer.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_X6E8ImjoLLw/RrPhKgTns1I/AAAAAAAAACU/k0ryNOXjKqY/s1600-h/05+front+caliper.jpg"&gt;&lt;img class="figure" src="http://3.bp.blogspot.com/_X6E8ImjoLLw/RrPhKgTns1I/AAAAAAAAACU/k0ryNOXjKqY/s200/05+front+caliper.jpg" alt="" id="BLOGGER_PHOTO_ID_5094663174073332562" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I took the wheels to the local bike shop and had them trued for $5/wheel. They still have a little jitter, but it's nothing compared to the thumping and wobbling that they had before. They had both lateral (off rotation axis) wobble and radial (tending to not form a circle) wobble. I can ride over 20 mph now and not leave the ground.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_X6E8ImjoLLw/RrPhNgTns2I/AAAAAAAAACc/qrDl5S0Tsp8/s1600-h/06+rear+caliper.jpg"&gt;&lt;img class="figure" src="http://3.bp.blogspot.com/_X6E8ImjoLLw/RrPhNgTns2I/AAAAAAAAACc/qrDl5S0Tsp8/s200/06+rear+caliper.jpg" alt="" id="BLOGGER_PHOTO_ID_5094663225612940130" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;While the wheels were being worked on, I was able to remove the plastic grips a lot easier than I expected (these things have tendency to become attached). Rubber grips can be a real pain, but I figured the plastic grips would have been fused to the handlebars. I just inserted a flat-head screw driver (on the bottom side to avoid any visible scratching) in between the grip and the handle bar. I didn't pry with the screwdriver, rather just inserted and removed it several times, spraying WD-40 down the length of the screwdriver each time. After about three times, I was able to break each grip free by trying to twist the grip around the handlebar. Once it came free, I took out the screwdriver and worked it off. I cleaned the lubricant off the bars. I bought some handlebar gel tape from Bartrager, and installed them according to &lt;a href="http://www.parktool.com/repair/readhowto.asp?id=71"&gt;these directions&lt;/a&gt; since there were none in the box. I guess I have long handlebars because I didn't have to cut the length of the tape, I just made a cut to taper the distal end of the tape so it was flush with the handlebar cap.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_X6E8ImjoLLw/RrPhTgTns3I/AAAAAAAAACk/yw91d6tUDTw/s1600-h/08+handlebar+before.jpg"&gt;&lt;img class="figure" src="http://3.bp.blogspot.com/_X6E8ImjoLLw/RrPhTgTns3I/AAAAAAAAACk/yw91d6tUDTw/s200/08+handlebar+before.jpg" alt="" id="BLOGGER_PHOTO_ID_5094663328692155250" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The bicycle has a disk brake in the back which needed to be manually tightened because it didn't lock the wheel. The brakes in the front were also too loose. &lt;span style="font-weight: bold;"&gt;Tip&lt;/span&gt;: If brake pads don't lock the wheel, they need more tension. Take the wheel off of the frame, and ask an assistant to hold the pads together. If your caliper makes it easy to disengage the recoiling springs, you won't need an assistant.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_X6E8ImjoLLw/RrPhXQTns4I/AAAAAAAAACs/ZDJ2XpIhkUc/s1600-h/09+grips+removed.jpg"&gt;&lt;img class="figure" src="http://2.bp.blogspot.com/_X6E8ImjoLLw/RrPhXQTns4I/AAAAAAAAACs/ZDJ2XpIhkUc/s200/09+grips+removed.jpg" alt="" id="BLOGGER_PHOTO_ID_5094663393116664706" border="0" /&gt;&lt;/a&gt; Taking the wheel off will provide enough slack to make the adjustment--I found it was impossible otherwise.  Adjust where the steel cable is fastened on the caliper side about a centimeter and tighten everything back up.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The bike was back in order but the crank still felt bad because it moved inside the frame. It's a one-piece crank and is a lot simpler than I thought before. Take the chain off first. It has a big locking nut which you'll need a big wrench for.  Note that the threads are in the opposite direction from most threads, so you take the nut off by turning it in a clockwise direction. Under that, there were some washers which act as dust covers. There is a big nut that the ball bearings ride on which needs to be finger-tightened, it was loose and this is where the crank wobble came from. &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_X6E8ImjoLLw/RrPhawTns5I/AAAAAAAAAC0/ownNH5eSsFw/s1600-h/10+gel+tape+installed.jpg"&gt;&lt;img class="figure" src="http://4.bp.blogspot.com/_X6E8ImjoLLw/RrPhawTns5I/AAAAAAAAAC0/ownNH5eSsFw/s200/10+gel+tape+installed.jpg" alt="" id="BLOGGER_PHOTO_ID_5094663453246206866" border="0" /&gt;&lt;/a&gt;I de-greased the ball bearings and the journals inside the frame. It was essentially dry inside just a lot of black deposits on everything. There was some fatigue on the right-hand (gear) side where the ball bearings either crashed down or the bearing retainer was hitting. With one-piece cranks, look inside where the crank fits and look for the obstructions from the other tubes. Find a place to fit the corner of the crank and angle the crank through as to take the gear away from the frame. This will give you more space and will let the crank rest. After everything was clean (I had to use an abrasive brush in some places), I greased everything up as much as I could and put everything back together. I used a screwdriver to make the final torque on the hand-tightened nut, I stopped as soon as I felt no wobbling of the crank. When you put everything back together, you should be able to spin the crank and it should keep spinning for a while. If it doesn't make it more than a few turns after you let go, it's too tight.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_X6E8ImjoLLw/RrPhfATns6I/AAAAAAAAAC8/iiqHI9ANuvc/s1600-h/11+dirty+bearing.jpg"&gt;&lt;img class="figure" src="http://1.bp.blogspot.com/_X6E8ImjoLLw/RrPhfATns6I/AAAAAAAAAC8/iiqHI9ANuvc/s200/11+dirty+bearing.jpg" alt="" id="BLOGGER_PHOTO_ID_5094663526260650914" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After a few other adjustments, like the kickstand position, everything was ready to go. The bike feels a lot tighter like a new bike would. All the rattling, chirping, and wobbling is gone.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_X6E8ImjoLLw/RrPhiATns7I/AAAAAAAAADE/XudHmpx267I/s1600-h/13+clean+bearing+and+journal.jpg"&gt;&lt;img class="figure" src="http://1.bp.blogspot.com/_X6E8ImjoLLw/RrPhiATns7I/AAAAAAAAADE/XudHmpx267I/s200/13+clean+bearing+and+journal.jpg" alt="" id="BLOGGER_PHOTO_ID_5094663577800258482" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The bike will need new tires soon (the thin tires don't last very long), I have about 300 miles on mine and the tread in the back is disappearing. When I replace these, I'll try to disassemble the bearings on the wheels and try to revive them like I did the crank bearings. I'll also replace the chain at that time.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_X6E8ImjoLLw/RrPhogTns8I/AAAAAAAAADM/oBxGGbsHILA/s1600-h/14+done.jpg"&gt;&lt;img class="figure" src="http://3.bp.blogspot.com/_X6E8ImjoLLw/RrPhogTns8I/AAAAAAAAADM/oBxGGbsHILA/s200/14+done.jpg" alt="" id="BLOGGER_PHOTO_ID_5094663689469408194" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-7958152857257501096?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/7958152857257501096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=7958152857257501096' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/7958152857257501096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/7958152857257501096'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/08/1979-free-spirit-ten-speed.html' title='1979 Free Spirit Ten Speed'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_X6E8ImjoLLw/RrPgsQTnsxI/AAAAAAAAAB0/gSsZqydfl9w/s72-c/01+before.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-4368461116219398519</id><published>2007-07-17T11:54:00.000-05:00</published><updated>2008-01-30T01:41:05.237-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='removable storage'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><category scheme='http://www.blogger.com/atom/ns#' term='system configuration'/><category scheme='http://www.blogger.com/atom/ns#' term='usb'/><title type='text'>Mount USB drives on boot</title><content type='html'>On Fedora Core 7, leaving a USB drive (a simple flash disk) connected doesn't seem to be mounting after reboot even though it's properly listed in the &lt;tt&gt;/etc/fstab&lt;/tt&gt;. I went through a few solutions to this, like &lt;a href="http://floatingsun.net/articles/howtos/howto-usb-automount.html"&gt;this one&lt;/a&gt;, but the only one that worked for me was modifying the &lt;tt&gt;/etc/rc.sysinit&lt;/tt&gt; script as I explain below. &lt;br /&gt;&lt;br /&gt;I seem to remember creating an entry in the &lt;tt&gt;fstab&lt;/tt&gt;, and allowing the &lt;tt&gt;auto&lt;/tt&gt; option (which is part of the &lt;tt&gt;default&lt;/tt&gt; specification), would make your USB partition mount on boot. The issue with FC7 seems to be that the &lt;tt&gt;usb-storage&lt;/tt&gt; kernel module isn't being loaded when the &lt;tt&gt;fstab&lt;/tt&gt; is first loaded, and that the USB devices aren't initialized yet by &lt;tt&gt;/etc/rc.sysinit&lt;/tt&gt;. This seems to be common with all newer distros, in accordance with the move to &lt;tt&gt;udev&lt;/tt&gt;, &lt;tt&gt;hal&lt;/tt&gt; and other components, which facilitate plug &amp; play user mounting and they don't need them to be available before entering a GUI. This is great for workstations, but I have a "headless" server configuration, therefor I'm not using GNOME to mount anything on-demand, but rather they should be available statically. &lt;br /&gt;&lt;br /&gt;After a few days of trial &amp; error, and inspiration from &lt;a href="http://forums.fedoraforum.org/showthread.php?t=11544"&gt;this post&lt;/a&gt;, I added the following lines to the end of my &lt;tt&gt;/etc/rc.sysinit&lt;/tt&gt;. Note that changes to this particular file may be removed by system updates (Using &lt;tt&gt;yum&lt;/tt&gt;) as I explain below.&lt;br /&gt;&lt;pre&gt;# Try to mount all USB partitions&lt;br /&gt;# This should be moved to `rc.local' and be prepended with a wait&lt;br /&gt;modprobe usb-storage&lt;br /&gt;mount -a&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I believe this is the most most robust method, since simply adding the entry to the &lt;tt&gt;fstab&lt;/tt&gt; will allow it to be mounted after the USB devices are initialized. It is preferred to use the &lt;tt&gt;/etc/rc.local&lt;/tt&gt; script to issue this nature of commands (local/custom configuration), but this script seems to be run &lt;b&gt;before&lt;/b&gt; the &lt;tt&gt;/etc/rc.sysinit&lt;/tt&gt; script exits, meaning the USB partitions may not yet be available. Commanding the &lt;tt&gt;/etc/rc.local&lt;/tt&gt; script to wait for the &lt;tt&gt;/etc/rc.sysinit&lt;/tt&gt; script to exit may be a solution. &lt;br /&gt;&lt;br /&gt;Finally, note that you can guarantee consistency of the partition before mounting it by carefully editing the corresponding &lt;tt&gt;fstab&lt;/tt&gt; line in the normal way, see &lt;tt&gt;man 5 fstab&lt;/tt&gt; for more.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-4368461116219398519?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/4368461116219398519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=4368461116219398519' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/4368461116219398519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/4368461116219398519'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/07/mount-usb-drives-on-boot.html' title='Mount USB drives on boot'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-7562420682415751161</id><published>2007-07-14T14:16:00.000-05:00</published><updated>2008-01-30T01:40:48.378-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ext2/ext3'/><category scheme='http://www.blogger.com/atom/ns#' term='removable storage'/><category scheme='http://www.blogger.com/atom/ns#' term='e2label'/><title type='text'>Label your EXT3 partitions!</title><content type='html'>If you have removable drives used for backup or portable media, and you're using EXT3 rather than FAT16 (the default format of most USB flash drives), mounting these drives by their Linux device name is ambiguous. For example, I have a hard drive in a Venus DS-3 with a single EXT3 partition on it. The problem is, making the entry in the /etc/fstab file. The /dev/sd[a-z][1-9] designation is not good enough because it changes with the order of the connections during boot-time or plug-in time.&lt;br /&gt;&lt;br /&gt;Making labels for each partition to be mounted fixes the problem entirely. To create a label for an ext2/ext3 partition, use the e2label command:&lt;br /&gt;&lt;pre&gt;e2label [device] [label]&lt;/pre&gt;&lt;br /&gt;My exact command was:&lt;br /&gt;&lt;pre&gt;e2label /dev/sde1 "Venus1"&lt;/pre&gt;&lt;br /&gt;Note that I had to find the right drive using 'fdisk' before I knew it was 'sde1'.&lt;br /&gt;&lt;br /&gt;The change takes place right away, and then you can put a line in your /etc/fstab like:&lt;br /&gt;&lt;pre&gt;LABEL="Venus1"          /media/venus1           ext3    noauto          0 0&lt;/pre&gt;&lt;br /&gt;And it will run through the drives to find the right label. We've associated the mount location with the partition on the physical device. This is especially important if you're mounting the drives on a server and are not using any automatic mounting facility.&lt;br /&gt;&lt;br /&gt;Some recommend to also label the static partitions if you're using only EXT3. If you're using LVM, the groups and volumes are already labeled.&lt;br /&gt;&lt;br /&gt;Alternatively, you may use a UUID, obtained from&lt;br /&gt;&lt;pre&gt;udevinfo -q env -n /dev/sdd1&lt;/pre&gt;&lt;br /&gt;Where sdd1 is your USB device, which you can find from &lt;br /&gt;&lt;pre&gt;fdisk -l&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;There is a lot more info you can get with &lt;tt&gt;udevinfo&lt;/tt&gt; but for now, just grab the &lt;tt&gt;ID_FS_UUID&lt;/tt&gt; and you can use it in your &lt;tt&gt;/etc/fstab&lt;/tt&gt; as follows:&lt;br /&gt;&lt;pre&gt;UUID=492bc203-de77-40b6-be4b-49e84fee430e /data ext3 auto,defaults 0 0&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;See http://www.patrickmin.com/linux/tip.php?name=usbkey_mount and &lt;br /&gt;http://floatingsun.net/articles/howtos/howto-usb-automount.html for more.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-7562420682415751161?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/7562420682415751161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=7562420682415751161' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/7562420682415751161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/7562420682415751161'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/07/label-your-ext3-partitions.html' title='Label your EXT3 partitions!'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-896409054303191579</id><published>2007-07-14T13:16:00.000-05:00</published><updated>2007-07-14T13:34:16.243-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='panoramas'/><category scheme='http://www.blogger.com/atom/ns#' term='Hugin'/><category scheme='http://www.blogger.com/atom/ns#' term='Nikon D-50'/><title type='text'>Narrow-angle Panormas with Hugin</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_X6E8ImjoLLw/RpkWwFjYPnI/AAAAAAAAABM/U1Di-NuuvjA/s1600-h/Watch+Tower+Panorama+Balanced.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_X6E8ImjoLLw/RpkWwFjYPnI/AAAAAAAAABM/U1Di-NuuvjA/s320/Watch+Tower+Panorama+Balanced.jpg" alt="" id="BLOGGER_PHOTO_ID_5087122269471784562" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I have a &lt;span style="font-weight: bold;"&gt;telephoto lens&lt;/span&gt; and I wanted to stitch together several pictures of the Baltimore-Washington International airfield. Taking the pictures was just fine, although I hadn't learned how to set the exposure settings yet (see my post on this), and need to do it again on a clear day. What I didn't realize was that there's essentially no 'barrel distortion' with narrow-angle shots.&lt;br /&gt;&lt;br /&gt;I found that it's hard for &lt;span style="font-weight: bold;"&gt;Hugin &lt;/span&gt;to figure out the angle of your shots when there's no barrel distortion. It misbehaves if you try to use the same procedure as you would for &lt;span style="font-weight: bold;"&gt;wide angle&lt;/span&gt; panoramas, and gives you completely insane average errors and if you try a preview--it won't be pretty. There are two things you need to do: tell it your &lt;span style="font-weight: bold;"&gt;horizontal field of view angle&lt;/span&gt;, and &lt;span style="font-weight: bold;"&gt;don't &lt;/span&gt;allow &lt;span style="font-weight: bold;"&gt;barrel distortion optimization&lt;/span&gt;. Only use "Positions and View (y,p,r,v)", and check that the barrel distortion stays close to 0.000 for now. This means that your panorama is essentially flat.&lt;br /&gt;&lt;br /&gt;I was taking my panorama shots in &lt;span style="font-weight: bold;"&gt;portrait mode&lt;/span&gt;, which meant that my horizontal angle was 75% (the inverse of the aspect ratio 4/3) of the angle in landscape mode. That angle was about 8.10 degrees, and so the angle for each shot was 6.08 degrees. I got my focal length from the EXIF data, 224 mm, but the angle is most important.&lt;br /&gt;&lt;br /&gt;Before final optimiztion and stitching, you may want to change the barrel distortion to something between 0.0034 and 0.006. This will add perspective to the panorama. Make sure you still don't run the optimizer for barrel distortion.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-896409054303191579?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/896409054303191579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=896409054303191579' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/896409054303191579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/896409054303191579'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/07/narrow-angle-panormas-with-hugin.html' title='Narrow-angle Panormas with Hugin'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_X6E8ImjoLLw/RpkWwFjYPnI/AAAAAAAAABM/U1Di-NuuvjA/s72-c/Watch+Tower+Panorama+Balanced.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-5441412045187253732</id><published>2007-07-14T12:45:00.000-05:00</published><updated>2007-07-14T13:15:44.163-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='panoramas'/><category scheme='http://www.blogger.com/atom/ns#' term='Nikon D-50'/><title type='text'>Panoramas with the Nikon D-50</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_X6E8ImjoLLw/RpkRSljYPmI/AAAAAAAAABE/9eYD4VlTDDM/s1600-h/Family+Room.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_X6E8ImjoLLw/RpkRSljYPmI/AAAAAAAAABE/9eYD4VlTDDM/s320/Family+Room.jpg" alt="" id="BLOGGER_PHOTO_ID_5087116265107504738" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;This is a panorama I made while learning the following procedure for the &lt;span style="font-weight: bold;"&gt;Nikon D-50&lt;/span&gt;. These same instructions should apply to most &lt;span style="font-weight: bold;"&gt;Nikon Digital SLR&lt;/span&gt; cameras, and can be translated to most other digital cameras. In fact, I find that the huge resolution of my camera doesn't really impact the final product because you want most of the image to fit on your computer monitor, and you're literally multiplying megapixel area each time you take a shot (your canvas gets big quick)--so for close range panoramas, cheap digital cameras are fine as long as you can apply the following instructions to them.&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-weight: bold;"&gt;Nikon CoolPix&lt;/span&gt; series, unlike the &lt;span style="font-weight: bold;"&gt;Nikon D-50&lt;/span&gt;, has a Panorama Assist mode. This mode allowed you to take the first shot, which would set up the shutter, aperture and white balance for the rest of the shots. Then the right third of the last image would appear on the left-hand side and be semi-transparent. This allowed you to align landmarks and get good anchors for your stiching. The fixing of the shooting settings was also nice because it meant that the seems wouldn't be visible if you use a good panorama tool (see my post on &lt;span style="font-weight: bold;"&gt;Hugin&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;However, the &lt;span style="font-weight: bold;"&gt;Nikon D-50&lt;/span&gt; is more professional and didn't include such a mode. No matter! After reading over the manual, which is available on the internet (it was hard to find at Nikon's site, www.nikonusa.com), it was easy to piece together the same process as the 'Panorama Assist' mode.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;How to do it:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Get a tripod and make sure it has a level. Set up the tripod and check the level before &lt;span style="font-weight: bold;"&gt;and &lt;/span&gt;after mounting the camera. Loosen the yaw all the way, and tighten the pitch and roll. Without a Tripod, you'll find that your panorama will actually be askew, and picking a level rectangle for cropping will leave you with a lot of wasted image area.&lt;br /&gt;&lt;br /&gt;If you're shooting a large up and down angle and have the standard 300mm lens, roll the camera and shoot portrait shots. This means if you don't rotate each shot, you might be stichting tops and bottoms of images in &lt;span style="font-weight: bold;"&gt;Hugin&lt;/span&gt;, which is counterinuitive, but you can rotate the anchor in &lt;span style="font-weight: bold;"&gt;Hugin&lt;/span&gt; later and everything will be fine.&lt;br /&gt;&lt;br /&gt;Since we're post-processing the images, you should use 'Fine' mode. You don't have to use 'Raw', and in fact I noticed no real difference between 'Raw' and 'Fine' modes for this application.&lt;br /&gt;&lt;br /&gt;The the 'M' mode on the mode dial means 'Manual Mode'. So, you just put the camera into this mode, and the shooting settings (shutter speed and aperture) are fixed.&lt;br /&gt;&lt;br /&gt;Note that being in Manual Mode means the camera is not doing anything for you! You'll have to find some angle in your panorama to set the exposure settings until the exposure meter says zero. I favor the angle closest to the sun, but don't let the sun enter the frame. This will leave the dark portions of the panorama underexposed. The exposure meter is inside the viewfinder along the bottom. Rotate the winder on the right-hand side as you normally would to change the shutter speed and find the fastest speed that gets the reticle inside the meter. Then hold down the button on top, next to the power switch, shaped like an iris and rotate the same winder to adjust the aperture. Repeat the process until the reticle in the exposure meter is at zero.&lt;br /&gt;&lt;br /&gt;On other thing you'll want to do is find a &lt;span style="font-weight: bold;"&gt;target&lt;/span&gt; at nominal distance to &lt;span style="font-weight: bold;"&gt;focus&lt;/span&gt; (or perform an auto focus) on. Then switch the camera into &lt;span style="font-weight: bold;"&gt;manual focus&lt;/span&gt; mode, since we don't want it to change. Don't accidentally change the focus.&lt;br /&gt;&lt;br /&gt;Now you can start snapping away. Pick the most left angle and shoot, then change the yaw of the camera keeping a landmark that was on the right-hand side in the frame. Don't share too much of the yaw angle with the previous frame or you'll take too many pictures. Don't share too little or you won't have enough landmarks (common features) to teach the panorama tool how to stitch them together. You'll get the hang of it.&lt;br /&gt;&lt;br /&gt;Finally, load the pictures onto your GNU+Linux workstation (or Windows, bleh) and import the series of shots into &lt;span style="font-weight: bold;"&gt;Hugin&lt;/span&gt;. http://hugin.sourceforge.net/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-5441412045187253732?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/5441412045187253732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=5441412045187253732' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/5441412045187253732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/5441412045187253732'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/07/panoramas-with-nikon-d-50.html' title='Panoramas with the Nikon D-50'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_X6E8ImjoLLw/RpkRSljYPmI/AAAAAAAAABE/9eYD4VlTDDM/s72-c/Family+Room.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-1186701904449267812</id><published>2007-07-14T12:35:00.000-05:00</published><updated>2007-07-14T13:35:02.332-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='panoramas'/><category scheme='http://www.blogger.com/atom/ns#' term='Hugin'/><title type='text'>Hugin Deserves a Hug!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_X6E8ImjoLLw/RpkLEljYPlI/AAAAAAAAAA8/YhFUumBaIWA/s1600-h/mom+1.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://2.bp.blogspot.com/_X6E8ImjoLLw/RpkLEljYPlI/AAAAAAAAAA8/YhFUumBaIWA/s200/mom+1.jpg" alt="" id="BLOGGER_PHOTO_ID_5087109427519569490" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Yes, I know other bloggers have already written in depth about &lt;span style="font-weight: bold;"&gt;Hugin,&lt;/span&gt; but I'd like to share my experience.&lt;br /&gt;&lt;br /&gt;First of all, Hugin is just a graphical front-end for already established panorama libraries (which I didn't know existed) called &lt;span style="font-weight: bold;"&gt;panotools.&lt;/span&gt; Before, I would piece together a panorama by hand with &lt;span style="font-weight: bold;"&gt;The GIMP&lt;/span&gt;, but that never made the edges seamless, and never accounted for the lens barrel distortion.&lt;br /&gt;&lt;br /&gt;The official page:&lt;br /&gt;http://hugin.sourceforge.net/&lt;br /&gt;&lt;br /&gt;They have plenty of &lt;span style="font-weight: bold;"&gt;tutorials&lt;/span&gt; to get you started. The program is not overcomplicated and you can get the hang of it rather quickly (make sure you are following the tutorials). It's just a matter of teaching the panorama tool how the images fit together and how the camera distorts the landscape.&lt;br /&gt;&lt;br /&gt;The panorma shown was taken with a Nikon Coolpix 5400 in Panorama Assist mode some time ago. I hadn't been able to see the pictures stitched together because of the intensity of the barrel distortion, but with Hugin, it was a snap!&lt;br /&gt;&lt;br /&gt;More process-specific posts on Hugin to come.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-1186701904449267812?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/1186701904449267812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=1186701904449267812' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/1186701904449267812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/1186701904449267812'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/07/hugin-deserves-hug.html' title='Hugin Deserves a Hug!'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_X6E8ImjoLLw/RpkLEljYPlI/AAAAAAAAAA8/YhFUumBaIWA/s72-c/mom+1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-2301404316965823561</id><published>2007-07-14T12:32:00.000-05:00</published><updated>2007-07-14T12:35:47.911-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='blog'/><title type='text'>Announcing New Bliggity Blog</title><content type='html'>Assuming that anyone might read this, I just want to make this post to announce that my &lt;span style="font-weight: bold;"&gt;blog&lt;/span&gt; will no longer be strictly &lt;span style="font-weight: bold;"&gt;GNU+Linux&lt;/span&gt; and computer tips. It will still be related to these topics, but posts on 'how to do this' either with a GUI or from the command line are getting too scarce. Note that I will start to use 'labels' (aka 'tags') so that you can still filter out all but a certain topic.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-2301404316965823561?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/2301404316965823561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=2301404316965823561' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/2301404316965823561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/2301404316965823561'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/07/announcing-new-bliggity-blog.html' title='Announcing New Bliggity Blog'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-5259658924714689469</id><published>2007-05-16T12:35:00.000-05:00</published><updated>2008-01-30T01:42:25.836-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='data management'/><category scheme='http://www.blogger.com/atom/ns#' term='gnu+linux'/><title type='text'>Pesky Windows "Thumbs.db" Files</title><content type='html'>Windows creates a Thumbs.db file whenever it finds an image in a directory. If you are trying to reduce the number of files on your file system, or trying (really hard) to save space, you can issue the following commands as administrator.&lt;br /&gt;&lt;pre&gt;locate -r ".*/Thumbs.db" &gt; ~/delme-thumbs.txt&lt;/pre&gt;&lt;br /&gt;Which queries the mlocate database for the thumbnail files. If you're not running mlocate, you would use the find command here.&lt;br /&gt;&lt;pre&gt;cat ~/delme-thumbs.txt | tr \\n \\0 | xargs -0 du -hsc&lt;/pre&gt;&lt;br /&gt;This will show you how much each file is taking up and include a sum of the total size. Finally, you might want to free these files with the following command:&lt;br /&gt;&lt;pre&gt;cat delme-thumbs.txt | tr \\n \\0 | xargs -0 rm&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-5259658924714689469?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/5259658924714689469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=5259658924714689469' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/5259658924714689469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/5259658924714689469'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/05/pesky-windows-thumbsdb-files.html' title='Pesky Windows &quot;Thumbs.db&quot; Files'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-6722891114587011557</id><published>2007-03-22T09:28:00.000-05:00</published><updated>2008-01-30T01:52:50.540-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><category scheme='http://www.blogger.com/atom/ns#' term='E-mail'/><category scheme='http://www.blogger.com/atom/ns#' term='beep'/><title type='text'>To Beep or not to Beep</title><content type='html'>Seems like Linux has done &lt;span style="font-style: italic;"&gt;everything &lt;/span&gt;to prevent anyone from controlling the I/O devices under /dev, which includes you. I had a simple task, I wanted my "mail-notification" program to beep when I had mail. Under "When new mail arrives:", there was the command "play /path/to/some/sound.aiff" or something... I don't want any process interrupting my sound card because I'm running Fedora Linux, and I don't have JACK or another sound mixer which will mix sounds from multiple processes (maybe one day ALSA will work like this).&lt;br /&gt;&lt;br /&gt;So anyway, I tried a million different commands...&lt;br /&gt;&lt;pre&gt;echo -ne "\a"&lt;/pre&gt;which prints just a bell character, but it's interpretted by mail-notification (or nothing) and is lost--not sounded on the system beeper.&lt;br /&gt;&lt;br /&gt;I tried a C program by Johnathan Nightingale, beep, which I had lying around, but it fails because the kernel doesn't like it touching the devices.&lt;br /&gt;&lt;br /&gt;Finally, I thought "hmm, beep.c is just writing to /dev/console, why can't I?" and I tried&lt;br /&gt;&lt;pre&gt;echo -ne "\a" &gt; /dev/console&lt;/pre&gt;And it worked! It's not the same beep as Thunderbird/xterm/emacs, but it's &lt;span style="font-style: italic;"&gt;fine with me!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-6722891114587011557?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/6722891114587011557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=6722891114587011557' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/6722891114587011557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/6722891114587011557'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/03/to-beep-or-not-to-beep.html' title='To Beep or not to Beep'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-1714386914076627709</id><published>2007-03-18T14:45:00.000-05:00</published><updated>2008-01-30T01:30:37.684-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='piping'/><category scheme='http://www.blogger.com/atom/ns#' term='shell scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='GNU'/><title type='text'>Executing a command on multiple files with FIND</title><content type='html'>Okay, so apparently, the FIND command is &lt;span style="font-weight: bold;"&gt;so powerful&lt;/span&gt; that you can even tell it what to do with the files when it finds them. I always used to find multiple files, translate newline characters to null characters, then pass each argument to XARGS as in:&lt;br /&gt;find ./ -regex ".*\.mp3" | tr \\n \\0 | xargs -0 -n 1 md5sum &gt; mp3checksums.md5&lt;br /&gt;&lt;br /&gt;But, you can also say:&lt;br /&gt;find ./ -regex ".*\.mp3" -exec md5sum {} \; &gt; mp3checksums.md5&lt;br /&gt;&lt;br /&gt;Where, the {} implies to insert an individual argument into that part of the exec string, and the semicolon (escaped so it's not picked up by BASH) ends the -exec agrument.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-1714386914076627709?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/1714386914076627709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=1714386914076627709' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/1714386914076627709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/1714386914076627709'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/03/executing-command-on-multiple-files.html' title='Executing a command on multiple files with FIND'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-6511865550734851531</id><published>2007-03-13T07:40:00.000-05:00</published><updated>2008-01-30T01:43:57.674-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='computers'/><category scheme='http://www.blogger.com/atom/ns#' term='maintenance'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>Computer Internal Dust Solutions</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_X6E8ImjoLLw/RfajwIaOUeI/AAAAAAAAAAU/A4hXTJGcF2w/s1600-h/vacuum_foam_sleeve.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://3.bp.blogspot.com/_X6E8ImjoLLw/RfajwIaOUeI/AAAAAAAAAAU/A4hXTJGcF2w/s320/vacuum_foam_sleeve.jpg" alt="" id="BLOGGER_PHOTO_ID_5041396880174371298" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;It seems like opening up my computer (or multiple in my case) and blowing it out every month is releasing too much dust back into the air, and all those particles that were stuck in there can wreak havoc upon your moving parts (fans). Assuming you operate electronic devices which have ventilation fans indoors, try the following.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Get a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;HEPA&lt;/span&gt; filter and run it, at least on its lowest setting, all the time. &lt;/span&gt;&lt;br /&gt;The electricity it takes to run such filters is completely eclipsed by how much dust they remove from the indoor air and prevent those particles from being &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_1"&gt;stirred&lt;/span&gt; up again. It's better for human breathing, and better for devices with moving parts. Also, if the filter circulates the air, your components might run cooler.&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;Install low-impedance dust filters in front of your computer's ventilation intakes.&lt;/span&gt;&lt;br /&gt;Many computer cases are already shipping with single-layer plastic mesh filters which will stop most huge dust particles (the ones you can see anyway). I decided to give it a shot and installed some extra dust filters on the intakes of two computers. One computer had side ports which were completely open (no, fan, just big holes). NOTE: If you have filters installed, air will follow the path of least &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;impedance&lt;/span&gt;, so either block or put filters over all air passageways that flow into the case. Don't put filters on exhaust ports (ports which blow out).&lt;br /&gt;I decided to use&lt;span style="font-weight: bold;"&gt; WEB Vent Filters&lt;/span&gt;, but these have a few drawbacks: they have fibers which come loose, and are higher impedance than the coarse foam. Coarse foam like that in &lt;span style="font-weight: bold;"&gt;SHOP*VAC Foam Sleeves&lt;/span&gt; is preferred for low &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_3"&gt;impedance&lt;/span&gt; of air flow, but doesn't offer good filtering of smaller particles. Both are readily available at the local hardware store.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_X6E8ImjoLLw/RfajqIaOUdI/AAAAAAAAAAM/IFWIQSyNBDo/s1600-h/web_vent_filters.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://3.bp.blogspot.com/_X6E8ImjoLLw/RfajqIaOUdI/AAAAAAAAAAM/IFWIQSyNBDo/s320/web_vent_filters.jpg" alt="" id="BLOGGER_PHOTO_ID_5041396777095156178" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I put WEB Vent Filters on the outside of the case (so they wouldn't get sucked into the fan) for one, and in between the case and the air duct for the other. On the other computer, I took the front panel off, and installed the filters over the intake fans, but under the outer cover. The only concern I have now is cleaning these. I'm hoping that after the one-to-two month interval, I can vacuum the filters externally to clear large debris back out through the intake, and then the next interval I can remove them and wash them under water.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_X6E8ImjoLLw/RfamIIaOUfI/AAAAAAAAAAc/SReDszwT4tA/s1600-h/DSC_0015.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_X6E8ImjoLLw/RfamIIaOUfI/AAAAAAAAAAc/SReDszwT4tA/s320/DSC_0015.JPG" alt="" id="BLOGGER_PHOTO_ID_5041399491514487282" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;WARNING: Remember, the foam should be low impedance! Any dust filter you install over a ventilation port or fan will impede the flow of air through your device. Fans will spin a little faster, but air flow will be slower. Make sure this doesn't cause any &lt;span style="font-weight: bold;"&gt;heat issues&lt;/span&gt;, and either remove the filter or install more fans if necessary. Inevitably, over time the filters will become clogged and become further impeding, and will require replacement or washing.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Vacuum and dust often.&lt;/span&gt;&lt;br /&gt;I know, this is common sense, but I've seen people who just have a million Duster cans and they blow out their computer whenever it starts to make noise. &lt;span style="font-weight: bold;"&gt;Grinding noises &lt;/span&gt;are a very bad sign--this means that something is on or around the fan's journal (which usually has ball bearings), and the fan will most likely fail if not cleaned. Oiling the fan's journals using three-in-one motor oil can help, but the best bet is to keep the fans free from particles beforehand, and replace them when things start to go awry. &lt;span style="font-weight: bold;"&gt;Rule of thumb&lt;/span&gt;: if you have to clean it out more than once every one to two months, you have a dust problem. Also, blowing the dust around can cause a fan assembly to become dirty.&lt;br /&gt;&lt;br /&gt;Finally, keeping these computer systems away from sources of dust is a good idea. Major sources of dust include laundry, bedding, and animals and humans.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-6511865550734851531?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/6511865550734851531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=6511865550734851531' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/6511865550734851531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/6511865550734851531'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/03/computer-internal-dust-solutions.html' title='Computer Internal Dust Solutions'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_X6E8ImjoLLw/RfajwIaOUeI/AAAAAAAAAAU/A4hXTJGcF2w/s72-c/vacuum_foam_sleeve.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-117060570626916626</id><published>2007-02-04T11:11:00.000-05:00</published><updated>2008-01-30T01:32:34.975-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='piping'/><category scheme='http://www.blogger.com/atom/ns#' term='shell scripting'/><title type='text'>Shell Script to Parse Command Line Arguments</title><content type='html'>Problem: I needed a script that took just file names and translated large JPEG's into smaller or thumbnail images. The problem was the &lt;span class="code"&gt;convert&lt;/span&gt; command, part of ImageMagick, needs the specific output file name.&lt;br /&gt;&lt;br /&gt;Solution: The following script.&lt;br /&gt;&lt;pre&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;if [ ! -d Thumbs ] ; then&lt;br /&gt;mkdir Thumbs;&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;while [ $# -ge 1 ]; do&lt;br /&gt;TARGET=`echo -n "$1" | sed "s/.jpg/t.png/" | sed "s/.JPG/T.PNG/" | sed "s/.jpeg/t.png/" | sed "s/.JPEG/T.PNG/"`;&lt;br /&gt;if [ -e $TARGET ] ; then&lt;br /&gt;echo "Refusing to overwrite $TARGET. ";&lt;br /&gt;else&lt;br /&gt;echo -n "Converting $1 to Thumbs/$TARGET: ";&lt;br /&gt;convert $1 -resize 128x128 Thumbs/$TARGET;&lt;br /&gt;&lt;br /&gt;if [ $? -eq 0 ]&lt;br /&gt;then&lt;br /&gt;echo "OK."&lt;br /&gt;else&lt;br /&gt;echo "ERROR: $?"&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;shift&lt;br /&gt;&lt;br /&gt;done&lt;br /&gt;exit 0&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-117060570626916626?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/117060570626916626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=117060570626916626' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/117060570626916626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/117060570626916626'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2007/02/shell-script-to-parse-command-line.html' title='Shell Script to Parse Command Line Arguments'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-116723732049086361</id><published>2006-12-27T10:46:00.000-05:00</published><updated>2008-01-30T01:45:05.708-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><category scheme='http://www.blogger.com/atom/ns#' term='Intel'/><title type='text'>Bragging Rights</title><content type='html'>I put a new computer together, so I could have better performance than my previous rig. I wanted a powerful but quiet workstation. I just didn't feel like installing Windows--I've never felt so dissuaded from installing Windows. It just seemed like an unnecessary hassle. I just wanted to have just Fedora Linux on the machine.&lt;br /&gt;&lt;br /&gt;In sort of an aimless manner, I ended up having a software RAID partition with an 899GB capacity. I don't know if I'll keep this configuration, but it's very fast and I can't imagine running out of space. I just hope it's not drawing too much power. I was pretty floored by the following responses from Linux:&lt;br /&gt;&lt;br /&gt;/proc/cpuinfo:&lt;br /&gt;processor    : 0&lt;br /&gt;vendor_id    : GenuineIntel&lt;br /&gt;cpu family    : 6&lt;br /&gt;model        : 15&lt;br /&gt;model name    : Intel(R) Core(TM)2 CPU          6600  @ 2.40GHz&lt;br /&gt;stepping    : 6&lt;br /&gt;cpu MHz        : 1596.000&lt;br /&gt;cache size    : 4096 KB&lt;br /&gt;physical id    : 0&lt;br /&gt;siblings    : 2&lt;br /&gt;core id        : 0&lt;br /&gt;cpu cores    : 2&lt;br /&gt;fdiv_bug    : no&lt;br /&gt;hlt_bug        : no&lt;br /&gt;f00f_bug    : no&lt;br /&gt;coma_bug    : no&lt;br /&gt;fpu        : yes&lt;br /&gt;fpu_exception    : yes&lt;br /&gt;cpuid level    : 10&lt;br /&gt;wp        : yes&lt;br /&gt;flags        : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm&lt;br /&gt;bogomips    : 4811.97&lt;br /&gt;&lt;br /&gt;processor    : 1&lt;br /&gt;vendor_id    : GenuineIntel&lt;br /&gt;cpu family    : 6&lt;br /&gt;model        : 15&lt;br /&gt;model name    : Intel(R) Core(TM)2 CPU          6600  @ 2.40GHz&lt;br /&gt;stepping    : 6&lt;br /&gt;cpu MHz        : 1596.000&lt;br /&gt;cache size    : 4096 KB&lt;br /&gt;physical id    : 0&lt;br /&gt;siblings    : 2&lt;br /&gt;core id        : 1&lt;br /&gt;cpu cores    : 2&lt;br /&gt;fdiv_bug    : no&lt;br /&gt;hlt_bug        : no&lt;br /&gt;f00f_bug    : no&lt;br /&gt;coma_bug    : no&lt;br /&gt;fpu        : yes&lt;br /&gt;fpu_exception    : yes&lt;br /&gt;cpuid level    : 10&lt;br /&gt;wp        : yes&lt;br /&gt;flags        : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm&lt;br /&gt;bogomips    : 4805.23&lt;br /&gt;&lt;br /&gt;Now, my Pentium 4 3.2GHz processor gave me 6,400 bogomips for each CPU, but we all know that only approximately 6,400 operations per second can occur. In other words, the second CPU is virtual and only gets work done when the 31-stage Pentium 4 pipeline would otherwise be empty. These two 4,800 bogomips readings can occur simultaneously, allowing approximately 9,600 bogomips for the whole system.&lt;br /&gt;&lt;br /&gt;/proc/meminfo:&lt;br /&gt;MemTotal:      2074924 kB&lt;br /&gt;MemFree:       1084092 kB&lt;br /&gt;Buffers:         32624 kB&lt;br /&gt;Cached:         673980 kB&lt;br /&gt;SwapCached:          0 kB&lt;br /&gt;Active:         481828 kB&lt;br /&gt;Inactive:       454244 kB&lt;br /&gt;HighTotal:     1179264 kB&lt;br /&gt;HighFree:       264560 kB&lt;br /&gt;LowTotal:       895660 kB&lt;br /&gt;LowFree:        819532 kB&lt;br /&gt;SwapTotal:     4095992 kB&lt;br /&gt;SwapFree:      4095992 kB&lt;br /&gt;Dirty:           42252 kB&lt;br /&gt;Writeback:           0 kB&lt;br /&gt;AnonPages:      229628 kB&lt;br /&gt;Mapped:          55352 kB&lt;br /&gt;Slab:            35120 kB&lt;br /&gt;PageTables:       4552 kB&lt;br /&gt;NFS_Unstable:        0 kB&lt;br /&gt;Bounce:              0 kB&lt;br /&gt;CommitLimit:   5133452 kB&lt;br /&gt;Committed_AS:   602780 kB&lt;br /&gt;VmallocTotal:   114680 kB&lt;br /&gt;VmallocUsed:      7012 kB&lt;br /&gt;VmallocChunk:   107160 kB&lt;br /&gt;HugePages_Total:     0&lt;br /&gt;HugePages_Free:      0&lt;br /&gt;HugePages_Rsvd:      0&lt;br /&gt;Hugepagesize:     4096 kB&lt;br /&gt;Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;/dev/md2              899G  3.2G  849G   1% /&lt;br /&gt;/dev/md0               99M   10M   84M  11% /boot&lt;br /&gt;tmpfs                1014M     0 1014M   0% /dev/shm&lt;br /&gt;192.168.0.5:/home     360G  249G   94G  73% /home&lt;br /&gt;/dev/hde              3.3G  3.3G     0 100% /media/FC_6 i386 DVD&lt;br /&gt;&lt;br /&gt;There are two 500GB SATA 3.0GB/s Seagates!&lt;br /&gt;&lt;br /&gt;[root@localhost ryan]# /sbin/hdparm -t /dev/md2&lt;br /&gt;&lt;br /&gt;/dev/md2:&lt;br /&gt; Timing buffered disk reads:  426 MB in  3.01 seconds = 141.61 MB/sec&lt;br /&gt;[root@localhost ryan]# /sbin/hdparm -t /dev/md2 ; /sbin/hdparm -t&lt;br /&gt;/dev/md2; /sbin/hdparm -t /dev/md2&lt;br /&gt;&lt;br /&gt;/dev/md2:&lt;br /&gt; Timing buffered disk reads:  434 MB in  3.01 seconds = 144.34 MB/sec&lt;br /&gt;&lt;br /&gt;/dev/md2:&lt;br /&gt; Timing buffered disk reads:  434 MB in  3.00 seconds = 144.60 MB/sec&lt;br /&gt;&lt;br /&gt;/dev/md2:&lt;br /&gt; Timing buffered disk reads:  434 MB in  3.01 seconds = 144.26 MB/sec&lt;br /&gt;[root@localhost ryan]# /sbin/hdparm -T /dev/md2 ; /sbin/hdparm -T&lt;br /&gt;/dev/md2; /sbin/hdparm -T /dev/md2&lt;br /&gt;&lt;br /&gt;/dev/md2:&lt;br /&gt; Timing cached reads:   5120 MB in  2.00 seconds = 2565.42 MB/sec&lt;br /&gt;&lt;br /&gt;/dev/md2:&lt;br /&gt; Timing cached reads:   5152 MB in  2.00 seconds = 2580.52 MB/sec&lt;br /&gt;&lt;br /&gt;/dev/md2:&lt;br /&gt; Timing cached reads:   5060 MB in  2.00 seconds = 2533.59 MB/sec&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-116723732049086361?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/116723732049086361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=116723732049086361' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116723732049086361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116723732049086361'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/12/bragging-rights.html' title='Bragging Rights'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-116594832020611031</id><published>2006-12-12T13:28:00.000-05:00</published><updated>2007-07-14T15:37:20.103-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='backup'/><title type='text'>Nightly Backup Script</title><content type='html'>If you're working on a small project, you might want to do a simple nightly backup. The following Bash Shell Script, when copied into your /etc/cron.daily/ directory will do the trick. You might have to allow read access for 'other' users for everything you want to back up. It worked without changing that for me.&lt;br /&gt;&lt;br /&gt;Obviously, you'll have to change the file and directories. This is just an example.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;[ryan@a564n cmpe646]$ cat cmpe646_backup.sh&lt;br /&gt;#!/bin/sh&lt;br /&gt;&lt;br /&gt;date=$(date +%s)&lt;br /&gt;&lt;br /&gt;tar -cf /home/cmpe646/cmpe646_project_backup_$date.tar /home/cmpe646/*/*.h* /home/cmpe646/*/*.c* /home/cmpe646/*/*.bench*&lt;br /&gt;bzip2 /home/cmpe646/cmpe646_project_backup_$date.tar&lt;br /&gt;&lt;br /&gt;exit 0&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-116594832020611031?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/116594832020611031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=116594832020611031' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116594832020611031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116594832020611031'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/12/nightly-backup-script.html' title='Nightly Backup Script'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-116593657573024545</id><published>2006-12-12T10:05:00.000-05:00</published><updated>2008-01-30T01:45:33.005-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='computers'/><category scheme='http://www.blogger.com/atom/ns#' term='maintenance'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>Blowing out Fans</title><content type='html'>I took some highly compressed air and blew out a small processor fan (VIA EPIA) because it seemed to be making noise. It started to make &lt;span style="font-style: italic;"&gt;more&lt;/span&gt; noise after I blew it out. So at first, I thought maybe I was using too much air pressure, but then I remembered that tiny fans usually make the most noise when compared to much larger fans. Later,  I went and noticed that the fan was spinning &lt;span style="font-style: italic;"&gt;a lot&lt;/span&gt; faster after I blew it out. Something I didn't expect to see. Then, I noticed a downward trend over the last half of a year since the fan was put into commission. &lt;br /&gt;&lt;br /&gt;What I get from these pictures is that the fan is now spinning faster like it was half a year ago and the processor also started running cooler after I blew out the fan. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/x/blogger/6204/3811/1600/618337/fan_gets_dirty-lm_sensors_fan_fan1-year.png"&gt;&lt;img style="cursor: pointer;" src="http://photos1.blogger.com/x/blogger/6204/3811/320/182859/fan_gets_dirty-lm_sensors_fan_fan1-year.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/x/blogger/6204/3811/1600/780029/fan_gets_dirty-lm_sensors_fan_fan1-day.png"&gt;&lt;img style="cursor: pointer;" src="http://photos1.blogger.com/x/blogger/6204/3811/320/509189/fan_gets_dirty-lm_sensors_fan_fan1-day.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/x/blogger/6204/3811/1600/906803/fan_gets_dirty-lm_sensors_temp_Proc%20Temp-day.png"&gt;&lt;img style="cursor: pointer;" src="http://photos1.blogger.com/x/blogger/6204/3811/320/754926/fan_gets_dirty-lm_sensors_temp_Proc%20Temp-day.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The conclusion: The failure mode of computer case fans is to develop (physical and electrical) resistance and spin slower and slower. They should be kept clean to prolong the life of the fan and the components they cool, but don't use too much pressure--you don't want to break the assembly.&lt;br /&gt;&lt;br /&gt;If you're using compressed air -- you can use about 80-100 PSI, but don't use anything bigger than a Sports Ball Inflator or you'll have too much air velocity. Also, if you don't have a filter or anything on your compressor, you have to be careful about debris! Don't hold the air canister upside down or anything that might stir up dust or debris inside the tank. For most people, it's probably best to go to the store and get a can of "air" for your exact purpose.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-116593657573024545?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/116593657573024545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=116593657573024545' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116593657573024545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116593657573024545'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/12/blowing-out-fans.html' title='Blowing out Fans'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-116398548732014557</id><published>2006-11-19T19:52:00.000-05:00</published><updated>2008-01-30T01:52:27.114-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><category scheme='http://www.blogger.com/atom/ns#' term='Displays'/><title type='text'>Comparison of 20.1" LCD Monitors</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/6204/3811/1600/widescreen_analysis.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/6204/3811/320/widescreen_analysis.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I wanted to know which display would be better for desktop computing: a normal 1600x1200 pixel display or a widescreen 1680x1050 pixel (HDTV) display. The widescreen, would be more efficient for movies. I remember doing this once before, so I decided to write it out this time. To simplify my analysis, I chose to consider only 20.1" diagonal viewing areas, with the aforementioned resolutions.&lt;br /&gt;&lt;br /&gt;For the widescreen, I calculate the display is 17" by 10.6", giving a viewing area of 181.6 square inches. For the 4:3 ratio display, I got 16" by 12" inches, and a viewing area of 193.9 square inches. This is a 6.7% bigger display area for the 4:3 ratio display. More generally, if the diagonal length is fixed, a square maximizes the area of a rectangle.&lt;br /&gt;&lt;br /&gt;To compare the resolutions, the widescreen gives 1.76 megapixels, and the 4:3 ratio gives 1.92 megapixels. This is a 9.1% increase in pixel count for the 4:3 ratio display.&lt;br /&gt;&lt;br /&gt;In conclusion, you win with the 1600x1200 20.1" non-widescreen display in terms of specifications, but they are generally more expensive (partly due to TFT manufacturing realities) but more compatible with video games (until recently). The wide screen, however, might be a more natural design because of our rectangular viewing perspectives.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-116398548732014557?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/116398548732014557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=116398548732014557' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116398548732014557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116398548732014557'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/11/comparison-of-201-lcd-monitors.html' title='Comparison of 20.1&quot; LCD Monitors'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-116256496024371448</id><published>2006-11-03T09:33:00.000-05:00</published><updated>2008-01-30T01:46:31.453-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thunderbird'/><category scheme='http://www.blogger.com/atom/ns#' term='E-mail'/><category scheme='http://www.blogger.com/atom/ns#' term='IMAP'/><title type='text'>Fedora Core 5 + IMAP Server + SquirrelMail</title><content type='html'>The next best thing, because sharing the Mozilla Thunderbird Storage folder is giving me problems when I change networks, is to have an IMAP server that Thunderbird can store/retrieve messages with.&lt;br /&gt;&lt;br /&gt;The mail from the Internet accounts could be copied to the IMAP server using Thunderbird, even if a delivery system (POP/SMTP) is not in place (for mail to get there otherwise). I installed SquirrelMail and tested this capability with Thunderbird already. I closed down &lt;span class="code"&gt;sendmail&lt;/span&gt;, installed and started &lt;span class="code"&gt;postfix&lt;/span&gt;. I set up the Cyrus IMAP, which was the hardest part of the IMAP/SquirrelMail setup.&lt;br /&gt;&lt;br /&gt;The tutorials I found to help do this on Fedora Core 5 are:&lt;br /&gt;&lt;br /&gt;http://cyrusimap.web.cmu.edu/imapd/install.html&lt;br /&gt;http://nakedape.cc/info/Cyrus-IMAP-HOWTO/quickstart-fedora.html&lt;br /&gt;http://www.howtoforge.com/perfect_setup_fedora_core_5&lt;br /&gt;&lt;br /&gt;The last one shows how to set up SMTP, as does the one from Cyrus itself. I'm still trying to figure out if I can have my own SMTP and use my IP Address (or its alias) as a domain for sending mail to.&lt;br /&gt;&lt;br /&gt;Even if I can't, I think that having the IMAP server in place, just for storing mail, would be a big help as the mail would be accessible from anywhere (even using SquirrelMail).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-116256496024371448?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/116256496024371448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=116256496024371448' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116256496024371448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116256496024371448'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/11/fedora-core-5-imap-server-squirrelmail.html' title='Fedora Core 5 + IMAP Server + SquirrelMail'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-116251129444037452</id><published>2006-11-02T18:40:00.000-05:00</published><updated>2008-01-30T01:47:19.538-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='needs revision'/><category scheme='http://www.blogger.com/atom/ns#' term='gas mileage'/><title type='text'>PHP Gas Mileage Application</title><content type='html'>Here's a little something I wrote out of necessity and decided not to stop before it was completed. I'm pretty proud of it and am surprised how easy PHP was to learn. It basically helps me keep track of my gas mileage over the web so I can throw the receipt out faster, and don't have to carry a spreadsheet around. The following is from the program itself:&lt;br /&gt;&lt;br /&gt;This program is a gas mileage database and analyzer written in PHP. It is self-contained (has a single source code file). It stores data in a simple text file in HTTP-query format. It allows users to add new records, and add new data files for different vehicles. It creates a backup before a new record is added. It also implements password protection before users can add refueling records.&lt;br /&gt;&lt;br /&gt;Source Code:&lt;br /&gt;&lt;a href="http://www.cs.umbc.edu/~rhelins1/getfile.php?id=23"&gt;Source Code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.cs.umbc.edu/~rhelins1/gas_mileage/"&gt;See it in action&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-116251129444037452?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/116251129444037452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=116251129444037452' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116251129444037452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116251129444037452'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/11/php-gas-mileage-application.html' title='PHP Gas Mileage Application'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-116208674367591826</id><published>2006-10-28T20:45:00.001-05:00</published><updated>2008-09-04T08:41:29.594-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='needs revision'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Simple Web File Upload Form</title><content type='html'>&lt;p&gt;I put the following form and post processing files together from a manual on PHP. The HTML could really be embedded in the PHP file, but this might be better if you only want one copy of the PHP code on the system. Modify both to fit your environment and make sure the PHP file is executable.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--&lt;br /&gt;&lt;a href="http://www.cs.umbc.edu/%7Erhelins1/getfile.php?id=30"&gt;upload.html&lt;/a&gt; &lt;br /&gt;&lt;a href="http://www.cs.umbc.edu/%7Erhelins1/getfile.php?id=31"&gt;getfile.php&lt;/a&gt;&lt;br /&gt;--&gt;&lt;br /&gt;Example &lt;tt&gt;.HEADER.html&lt;/tt&gt;&lt;br /&gt;&lt;pre&gt;&lt;textarea&gt;&lt;br /&gt;&lt;h1&gt;Index of /srv/pub&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="/"&gt;Back to Welcome Page&lt;/a&gt;&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;This form allows you to upload a file of up to 10 MiB:&lt;br /&gt;&lt;br /&gt;&lt;!-- The data encoding type, enctype, MUST be specified as below --&gt;&lt;br /&gt;&lt;form enctype="multipart/form-data" action="/cgi-bin/getfile.php" &lt;br /&gt;method="POST"&gt;&lt;br /&gt;    &lt;input type="hidden" name="dest_dir" value="/srv/pub/" /&gt;&lt;br /&gt;    &lt;!-- MAX_FILE_SIZE must precede the file input field --&gt;&lt;br /&gt;    &lt;input type="hidden" name="MAX_FILE_SIZE" value="1000000000" /&gt;&lt;br /&gt;    &lt;!-- Name of input element determines name in $_FILES array --&gt;&lt;br /&gt;    Send this file: &lt;input name="userfile" type="file" /&gt;&lt;br /&gt;    &lt;input type="submit" value="Send File" /&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Example &lt;tt&gt;getfile.php&lt;/tt&gt;&lt;br /&gt;&lt;pre&gt;&lt;textarea&gt;&lt;br /&gt;&lt;html&gt;&lt;br /&gt;&lt;head&gt;&lt;br /&gt;&lt;title&gt;File Upload&lt;/title&gt;&lt;br /&gt;&lt;/head&gt;&lt;br /&gt;&lt;body&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;File Upload&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead&lt;br /&gt;// of $_FILES.&lt;br /&gt;&lt;br /&gt;//$uploaddir = '/var/www/srv/Public/';&lt;br /&gt;$uploaddir = $_POST['dest_dir'];&lt;br /&gt;$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);&lt;br /&gt;&lt;br /&gt;echo '&lt;pre&gt;';&lt;br /&gt;echo "Trying to save to: ".$uploadfile."\n";&lt;br /&gt;&lt;br /&gt;if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {&lt;br /&gt;   chmod($uploadfile, 0644);&lt;br /&gt;   echo "File is valid, and was successfully uploaded.\n\n";&lt;br /&gt;   echo "Saved in: ".$uploaddir."\n";&lt;br /&gt;   echo "Note that this program sets the file permissions to 0644.\n";&lt;br /&gt;&lt;br /&gt;   echo "&lt;a href=\"javascript:history.go(-1)\"&gt;Click Here to Continue.&lt;/a&gt;\n";&lt;br /&gt;&lt;br /&gt;} else {&lt;br /&gt;   echo "File upload failed.\n";&lt;br /&gt;     switch ($_FILES['uploadFile']['error'])&lt;br /&gt;     { case 1:&lt;br /&gt;         print '&lt;p&gt; The file is bigger than this PHP installation allows&lt;/p&gt;';&lt;br /&gt;         break;&lt;br /&gt;       case 2:&lt;br /&gt;         print '&lt;p&gt; The file is bigger than this form allows&lt;/p&gt;';&lt;br /&gt;         break;&lt;br /&gt;       case 3:&lt;br /&gt;         print '&lt;p&gt; Only part of the file was uploaded&lt;/p&gt;';&lt;br /&gt;         break;&lt;br /&gt;       case 4:&lt;br /&gt;         print '&lt;p&gt; No file was uploaded&lt;/p&gt;';&lt;br /&gt;         break;&lt;br /&gt;     }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;echo "&lt;br&gt;&lt;br&gt;Here is some more debugging info:\n&lt;br&gt;\n";&lt;br /&gt;print_r($_FILES);&lt;br /&gt;&lt;br /&gt;print "&lt;/pre&gt;";&lt;br /&gt;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This code is derived from a few examples.&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-116208674367591826?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/116208674367591826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=116208674367591826' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116208674367591826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116208674367591826'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/10/simple-web-file-upload-form.html' title='Simple Web File Upload Form'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-116208558715165719</id><published>2006-10-28T20:23:00.000-05:00</published><updated>2008-01-30T01:54:22.108-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl CGI'/><category scheme='http://www.blogger.com/atom/ns#' term='file organization'/><title type='text'>Web File Search CGI Program for Linux</title><content type='html'>So you can install Fedora, and choose the Web Server package. If you are running any kind of file server, you will probably want to find a file over the web. This script allows users to search the &lt;span class="code"&gt;mlocate&lt;/span&gt; database which is usually compiled by your Linux installation every night. It's a fast database which circumvents searching the filesystem manually. I had to write it, so I extend my source code to everyone in hopes that it will help someone.&lt;br /&gt;&lt;br /&gt;It has some thought put into security. The results are displayed as links to facilitate viewing/downloading the located file. It should be used to search one part of the file system. In my case, the public area is &lt;span class="code"&gt;/srv/&lt;/span&gt;. This part of the filesystem should be linked into the Apache document root via&lt;br /&gt;&lt;pre&gt;ln -s /srv /var/www/html/srv&lt;/pre&gt;to allow the users access to the files with your HTTP server.&lt;br /&gt;&lt;br /&gt;Following is the Perl-CGI code. Name it &lt;span class="code"&gt;locate.cgi&lt;/span&gt; and it should go in your &lt;span class="code"&gt;cgi-bin&lt;/span&gt; directory. Don't forget to &lt;span class="code"&gt;chmod 755&lt;/span&gt; the file so it's executable. Because of technical limitations of Blogger, I can't paste the Perl-CGI code here--please follow the following link: &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cs.umbc.edu/~rhelins1/getfile.php?id=26"&gt;http://www.cs.umbc.edu/~rhelins1/getfile.php?id=26&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-116208558715165719?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/116208558715165719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=116208558715165719' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116208558715165719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116208558715165719'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/10/web-file-search-cgi-program-for-linux.html' title='Web File Search CGI Program for Linux'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-116188674301413189</id><published>2006-10-26T13:01:00.000-05:00</published><updated>2008-01-30T01:48:20.946-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thunderbird'/><category scheme='http://www.blogger.com/atom/ns#' term='E-mail'/><category scheme='http://www.blogger.com/atom/ns#' term='needs revision'/><title type='text'>Using the Same Thunderbird Storage Folder on Windows and Linux</title><content type='html'>&lt;p&gt;Today I finally solved the problem of having multiple e-mail clients and multiple storage folders. First I used an IMAP account I have access to in order to move all the old e-mail I have on multiple computers onto the Thunderbird "Local Folders" in Linux on my server. This is as easy as copying all the messages in one Inbox to the Inbox on the IMAP account, and then on the other computer moving the messages out of the Inbox on the IMAP account to the local Inbox account. It's not the fastest, but it's the most compatible as Thunderbird doesn't support much importing from other e-mail storage folders.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;So once I had everything on the "Local Folders" account in Thunderbird on Linux, I changed the Local Message Storage directory on Windows (not on the Server) to the storage directory in my &lt;span class="code"&gt;home&lt;/span&gt; folder on my Linux server via a drive-mapped &lt;span class="code"&gt;Samba&lt;/span&gt; share:&lt;br /&gt;&lt;span class="code"&gt;Y:\.thunderbird\ayrxordj.default\Mail\Local Folders&lt;/span&gt;&lt;br /&gt;This can be found by going to Tools-&gt;Account Settings-&gt;Local Folders. Click Browse. You'll have to have "Show Hidden Files" ON to locate your Local Folders path with the GUI. You also need to make sure that all your e-mail accounts you have are set up to store the mail in the "Local Folders" rather than an individual folder for that account.&lt;br /&gt;After some testing with no networking on the Windows computer, if the client doesn't have accesss to the network drive, you just get nothing under "Local Folders". In other words, it doesn't crash or anything.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;So what does this mean? If I download a message on my Windows Thunderbird client, it is exactly like downloading it on the Linux Thunderbird client. It is the same for the Linux client (vice-versa). It also means that now I can have "Delete message from POP after download" set to "Yes" on both clients and avoid downloading e-mail that I've already seen.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Issues I can imagine running into include having both clients open simultaneously and possible Operating System dissimilarities in the implementation of Thunderbird. Also, it took a long time to open the gigantic storage folder the first time over the network, but cleaning up the 2-3 thousand messages and perhaps "compacting" the folders should help. The other issue is, since I merged the two clients, there are several duplicate e-mails, but there is an extension to find &amp;amp; delete duplicate messages which has already solved this problem for me. I removed all the duplicates (leaving me with only roughly two thirds of the messages, because this merge was so large) and compacting the folders did solve the long-to-load problem.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Now I can load up Thunderbird on Windows or Linux using the same "Local Folders" storage directory. Finally, no more getting on different computers/clients to find different mail.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;There are still issues with using this technique. If you have a laptop or are losing connectivity, Windows will let you know that "Delayed Writing" failed. Also, a solution like having IMAP storage would be much more network-friendly in terms of bandwidth. See my post on setting up Cyrus IMAPD&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-116188674301413189?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/116188674301413189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=116188674301413189' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116188674301413189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116188674301413189'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/10/using-same-thunderbird-storage-folder.html' title='Using the Same Thunderbird Storage Folder on Windows and Linux'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-116170908091120635</id><published>2006-10-24T11:54:00.000-05:00</published><updated>2008-01-30T01:54:03.910-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VNC'/><category scheme='http://www.blogger.com/atom/ns#' term='SSH'/><category scheme='http://www.blogger.com/atom/ns#' term='Remote Desktop'/><title type='text'>Shell Script for Tunneling VNC over SSH</title><content type='html'>If you use VNC over the Internet rather than just over your LAN, it is not recommended to allow the 2590x port to be forwarded to the Internet. Instead, if you already have port 22 for SSH forwarded to the machine you want to get VNC from, you're all set to connect securely via an SSH tunnel. Note that you still have to have VNC set up and working on the LAN and know which screen number you are using (if you've used the GUI to allow your desktop to be connected to remotely, then you are using screen 1). This can also be accomplished using PuTTy with its GUI.&lt;br /&gt;&lt;br /&gt;Replace {user} with your username on the remote machine, and the {WAN Address} with your public IP address on the remote machine. Replace the screen with the (single) number of the screen you use (1,2,3,...). Due to technical limitations, I can't use backslashes, so please make the command a one-liner. The ssh with the sleep argument needs to have a command after it that uses the forwarded port or it will close immediately.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#!/bin/sh&lt;br /&gt;&lt;br /&gt;ssh -f -L 2590{screen}:127.0.0.1:590{screen} &lt;br /&gt; {user}@{WAN Address} sleep 10; &lt;br /&gt; vncviewer 127.0.0.1:2590{screen}:{screen};&lt;br /&gt;&lt;br /&gt;exit&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So an example script would look like:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#!/bin/sh&lt;br /&gt;&lt;br /&gt;ssh -f -L 25901:127.0.0.1:5901 user@mysubnet.domain.com sleep 10; &lt;br /&gt; vncviewer 127.0.0.1:25901:1;&lt;br /&gt;&lt;br /&gt;exit&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-116170908091120635?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/116170908091120635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=116170908091120635' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116170908091120635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116170908091120635'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/10/shell-script-for-tunneling-vnc-over.html' title='Shell Script for Tunneling VNC over SSH'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-116170834287299147</id><published>2006-10-24T11:41:00.000-05:00</published><updated>2007-07-14T15:31:53.817-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='ext2/ext3'/><category scheme='http://www.blogger.com/atom/ns#' term='file organization'/><title type='text'>Shell Scripts for making links unique or sole copies</title><content type='html'>Here are scripts to convert soft links to unique copies, and to sole copied (which moves the target of the link to the location of the link).&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#!/bin/sh&lt;br /&gt;&lt;br /&gt;# Check that link exists&lt;br /&gt;ls "$1" &gt; /dev/null&lt;br /&gt;if test $? -eq 0&lt;br /&gt;then&lt;br /&gt;echo -n "File found. "&lt;br /&gt;else&lt;br /&gt;echo "Error: File not found."&lt;br /&gt;exit 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;linktarget=`find "$1" -printf "%l\0"`&lt;br /&gt;linktargettype=`stat --format=%F "$linktarget"`&lt;br /&gt;&lt;br /&gt;# Check that link target exists&lt;br /&gt;if test -z "$linktarget"&lt;br /&gt;then&lt;br /&gt;  echo "Error: Null link target, not a valid soft link."&lt;br /&gt;  exit 1&lt;br /&gt;else&lt;br /&gt;  echo -n "Found soft link. "&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;# Check that link target is NOT a directory&lt;br /&gt;#if test "$linktargettype" = "directory"&lt;br /&gt;#  then&lt;br /&gt;#    echo "Link to directory, skipping."&lt;br /&gt;#    exit 0&lt;br /&gt;#  else&lt;br /&gt;#    echo "Not a directory."&lt;br /&gt;#fi&lt;br /&gt;&lt;br /&gt;# Remove soft link&lt;br /&gt;echo -n "Unlinking $1... "&lt;br /&gt;unlink "$1"&lt;br /&gt;if test $? -eq 0&lt;br /&gt;then&lt;br /&gt;  echo "Done."&lt;br /&gt;else&lt;br /&gt;  echo "Error!"&lt;br /&gt;  exit 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;# Replace soft link with unique copy&lt;br /&gt;echo "Creating copy from $1"&lt;br /&gt;echo -n " to $linktarget... "&lt;br /&gt;cp -a "$linktarget" "$1"&lt;br /&gt;if test $? -eq 0&lt;br /&gt;then&lt;br /&gt;  echo "Done."&lt;br /&gt;else&lt;br /&gt;  echo "Error!"&lt;br /&gt;  exit 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;exit 0&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here's the same script for changing the link to the unique copy:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# Check that link exists&lt;br /&gt;ls "$1" &gt; /dev/null&lt;br /&gt;if test $? -eq 0&lt;br /&gt;then&lt;br /&gt;echo -n "File found. "&lt;br /&gt;else&lt;br /&gt;echo "Error: File not found."&lt;br /&gt;exit 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;linktarget=`find "$1" -printf "%l\0"`&lt;br /&gt;linktargettype=`stat --format=%F "$linktarget"`&lt;br /&gt;&lt;br /&gt;# Check that link target exists&lt;br /&gt;if test -z "$linktarget"&lt;br /&gt; then&lt;br /&gt;   echo "Error: Null link target, not a valid soft link."&lt;br /&gt;   exit 1&lt;br /&gt; else&lt;br /&gt;   echo -n "Found soft link. "&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;# Check that link target is NOT a directory&lt;br /&gt;#if test "$linktargettype" = "directory"&lt;br /&gt;#  then&lt;br /&gt;#    echo "Link to directory, skipping."&lt;br /&gt;#    exit 0&lt;br /&gt;#  else&lt;br /&gt;#    echo "Not a directory."&lt;br /&gt;#fi&lt;br /&gt;&lt;br /&gt;# Remove soft link&lt;br /&gt;echo -n "Unlinking $1... "&lt;br /&gt;unlink "$1"&lt;br /&gt;if test $? -eq 0&lt;br /&gt; then&lt;br /&gt;   echo "Done."&lt;br /&gt; else&lt;br /&gt;   echo "Error!"&lt;br /&gt;   exit 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;# Replace soft link with only copy&lt;br /&gt;echo "Moving $1"&lt;br /&gt;echo -n " to $linktarget... "&lt;br /&gt;mv "$linktarget" "$1"&lt;br /&gt;if test $? -eq 0&lt;br /&gt; then&lt;br /&gt;   echo "Done."&lt;br /&gt; else&lt;br /&gt;   echo "Error!"&lt;br /&gt;   exit 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;exit 0&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-116170834287299147?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/116170834287299147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=116170834287299147' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116170834287299147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116170834287299147'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/10/shell-scripts-for-making-links-unique.html' title='Shell Scripts for making links unique or sole copies'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-116170807103283058</id><published>2006-10-24T11:38:00.001-05:00</published><updated>2008-08-18T10:45:24.122-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='ext2/ext3'/><category scheme='http://www.blogger.com/atom/ns#' term='file organization'/><title type='text'>Convert Soft Links to Hard Links</title><content type='html'>Here's a Shell script I wrote to convert large numbers of soft links to hard links on Linux.&lt;br /&gt;It now handles soft links on different file systems properly.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#!/bin/sh&lt;br /&gt;# soft2hard.sh by Ryan Helinski&lt;br /&gt;# Replace a soft (symbolic) link with a hard one.&lt;br /&gt;#&lt;br /&gt;# $1 is name of soft link&lt;br /&gt;# Returns 0 on success, 1 otherwise&lt;br /&gt;#&lt;br /&gt;# Example: To replace all the soft links in a particular directory:&lt;br /&gt;# find ./ -type l | tr \\n \\0 | xargs -0 -n 1 soft2hard.sh&lt;br /&gt;#&lt;br /&gt;# finds all files under ./ of type link (l), replaces (tr) the newline&lt;br /&gt;# characters with null characters and then pipes each filename one-by-one&lt;br /&gt;# to soft2hard.sh&lt;br /&gt;&lt;br /&gt;# Check that link exists&lt;br /&gt;ls "$1" &gt; /dev/null&lt;br /&gt;if test $? -eq 0&lt;br /&gt;then&lt;br /&gt;echo -n "File found. "&lt;br /&gt;else&lt;br /&gt;echo "Error: File not found."&lt;br /&gt;exit 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;linktarget=`find "$1" -printf "%l\0"`&lt;br /&gt;linktargettype=`stat --format=%F "$linktarget"`&lt;br /&gt;&lt;br /&gt;# Check that link target exists&lt;br /&gt;if test -z "$linktarget"&lt;br /&gt; then&lt;br /&gt;   echo "Error: Null link target, not a soft link."&lt;br /&gt;   exit 1&lt;br /&gt; else&lt;br /&gt;   echo -n "Found soft link. "&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# Check that link target is NOT a directory&lt;br /&gt;if test "$linktargettype" = "directory"&lt;br /&gt; then&lt;br /&gt;   echo "Link to directory, skipping."&lt;br /&gt;   exit 0&lt;br /&gt; else&lt;br /&gt;   echo "Not a directory."&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;# Remove soft link&lt;br /&gt;echo -n "Unlinking $1... "&lt;br /&gt;unlink "$1"&lt;br /&gt;if test $? -eq 0&lt;br /&gt; then&lt;br /&gt;   echo "Done."&lt;br /&gt; else&lt;br /&gt;   echo "Error!"&lt;br /&gt;   exit 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;# Replace with hard link&lt;br /&gt;echo "Creating hard link from $1"&lt;br /&gt;echo -n " to $linktarget... "&lt;br /&gt;ln "$linktarget" "$1"&lt;br /&gt;if test $? -eq 0&lt;br /&gt; then&lt;br /&gt;   echo "Done."&lt;br /&gt; else&lt;br /&gt;   echo "Error creating hard link, replacing soft link"&lt;br /&gt;   ln -s "$linktarget" "$1"&lt;br /&gt;   exit 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;exit 0&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-116170807103283058?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/116170807103283058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=116170807103283058' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116170807103283058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116170807103283058'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/10/convert-soft-links-to-hard-links.html' title='Convert Soft Links to Hard Links'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-116049010947176790</id><published>2006-10-10T09:20:00.000-05:00</published><updated>2008-01-30T01:50:01.125-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bugs'/><category scheme='http://www.blogger.com/atom/ns#' term='GNU'/><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><title type='text'>GRUB Read Error</title><content type='html'>&lt;p&gt;If you've ever gotten the following error:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span class="code"&gt;Loading GRUB... Read error&lt;/span&gt;&lt;/p&gt; &lt;br /&gt;&lt;p&gt;It looks like the GRUB read error occurs not because I shut the system down abrubtly or modified the GRUB configuration incorrectly, but because I'm trying to boot the system up without a keyboard. So, for now, I'll just keep the keyboard and mouse plugged in, but I'd like to be able to boot without these eventually. Some settings in the BIOS (like enabling USB keyboard support) might let me get around this error.  &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-116049010947176790?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/116049010947176790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=116049010947176790' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116049010947176790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116049010947176790'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/10/grub-read-error.html' title='GRUB Read Error'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-116048952796038188</id><published>2006-10-10T08:04:00.000-05:00</published><updated>2007-07-14T15:33:42.718-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ext2/ext3'/><category scheme='http://www.blogger.com/atom/ns#' term='checksums'/><category scheme='http://www.blogger.com/atom/ns#' term='file organization'/><title type='text'>Optimizing Multimedia and Backup Storage with Hard or Soft Links</title><content type='html'>Here are the notes on this subject in my Server Log with some annotations. Basically, it's (hard links are) a quick fix for duplicate files  to free up space. &lt;br /&gt;&lt;br /&gt;&lt;p&gt;I had md5 files generated for &lt;i&gt;everything&lt;/i&gt; that was copied onto the server, so using the shell commands &lt;span class="code"&gt;sort&lt;/span&gt;, &lt;span class="code"&gt;grep&lt;/span&gt;, and &lt;span class="code"&gt;uniq&lt;/span&gt;, I was able to clean up a lot of space from files that had been copied over twice as a result of using &lt;span class="code"&gt;WinMerge&lt;/span&gt; to prepare for deleting the backups that were on one of the hard drives that went into the RAID.  &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I was about to start playing with &lt;span class="code"&gt;FSlint&lt;/span&gt;, but by chance came across a perl program called &lt;span class="code"&gt;dupseek&lt;/span&gt;. I was looking for a script which replaced one of two duplicate files with a link.  &lt;/p&gt; &lt;br /&gt;&lt;br /&gt;&lt;p&gt;As far as I can tell, this is an excellent program with a well thought-out algorithm for finding duplicate files on a Unix system (based on personal experience, and what it says on their page), but more importantly to me, it has a function for creating Unix soft links in place of the duplicate files. Although it's text-mode, this is the best program I've used for dealing with duplicate files. And text-mode is just fine! This is a real life-saver because I don't want duplicates sitting on the file system, and I'd like to keep some files cross-referenced in directories. Also, removing duplicates in directories which are already backed up will make the copy on hard disk seem like it has fewer files than that on the CD.  &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Hard links would really be better (for me), because soft (symbolic) links in Unix probably raise some compatibility issues when, for instance, trying to but the directory on a CD. Unless interpreted correctly, these links are just files. With hard links, however, the same file system inode is just referenced by two different directories. Since the directories in question won't be changing, this wouldn't raise any issues (deletion, separation, etc.). &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;i&gt;In fact, &lt;span class="code"&gt;gnomebaker&lt;/span&gt; currently has a bug where soft links are dereferenced for computer the size of the CD image, but the link file itself if put onto the CD.&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I was able to save less than 10 GB by realizing there were duplicate media files as a result of combining directories before the big move to the server RAID, and more than 2 GB by using &lt;span class="code"&gt;dupseek&lt;/span&gt;. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://www.pixelbeat.org/fslint/"&gt;http://www.pixelbeat.org/fslint/&lt;/a&gt;&lt;br&gt;&lt;a href="http://www.beautylabs.net/software/dupseek.html"&gt;http://www.beautylabs.net/software/dupseek.html&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;i&gt;Notes:&lt;/i&gt;&lt;br&gt;&lt;br /&gt;You can use a text file, generated yourself or by filtering the report generated the “&lt;span class="code"&gt;-b report&lt;/span&gt;” function of &lt;span class="code"&gt;dupseek&lt;/span&gt;, which contains filenames to be removed. You can pipe these names to &lt;span class="code"&gt;xargs&lt;/span&gt; which calls &lt;span class="code"&gt;rm&lt;/span&gt;. This is useful in case files have been copied to more specific directories and many duplicates lie in a general directory (e.g. “downloads” vs. “singles”).  &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-style: normal;"&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span class="code"&gt;cat [name of report file] | grep “/Downloads/” | tr \\n \\0 | xargs -0 rm&lt;/span&gt;&lt;/p&gt; &lt;br /&gt;&lt;p&gt;Which accomplishes the task of filtering the report to only files which are in a path which includes&lt;br /&gt;“/Downloads/”, replacing the new line characters with null characters, and &lt;span class="code"&gt;xargs&lt;/span&gt; passes each of these lines to &lt;span class="code"&gt;rm&lt;/span&gt;. This removes the duplicate files which are in the common directory (which you want to clean out, and not preserve). Also, this must be executed from the same directory the report file was created in reference to (to make the relative filenames match up).  For safety, try replacing &lt;span class="code"&gt;rm&lt;/span&gt; with &lt;span class="code"&gt;ls&lt;/span&gt; before you do anything to make sure you're about to remove the right files: &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span class="code"&gt;cat [name of report file] | tr \\n \\0 | xargs -0 ls | less&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Only after checking over this output, hit q and then run:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span class="code"&gt;cat [name of report file] | tr \\n \\0 | xargs -0 rm&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;i&gt;Note: &lt;/i&gt;A much safer plan is to use the interactive mode of &lt;span class="code"&gt;dupseek&lt;/span&gt;, or use the &lt;span class="code"&gt;FSlint&lt;/span&gt; GUI (takes into account hard links). The interactive mode of &lt;span class="code"&gt;dupseek&lt;/span&gt; got too repetitive and so I just used it to identify duplicates in one case, but in general the interactive or batch mode is fine (be careful of the batch mode, unless you're running my version of &lt;span class="code"&gt;dupseek&lt;/span&gt;).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In the end, dupseek is better for batch jobs (but I feel that only with my hard link modification) and FSLint is better for compatibility and running on directories like home folders where it is the case that you want to leave some unique files alone. Of course, a compressed file system would be a step better, but who has the (CPU) time for that?&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-116048952796038188?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/116048952796038188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=116048952796038188' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116048952796038188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/116048952796038188'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/10/optimizing-multimedia-and-backup.html' title='Optimizing Multimedia and Backup Storage with Hard or Soft Links'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-115902728981875217</id><published>2006-09-23T11:00:00.000-05:00</published><updated>2007-07-14T15:07:11.784-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='file organization'/><title type='text'>Making directory traversals more efficient</title><content type='html'>&lt;p&gt;I wrote a script which takes less than a second to run, and which splits bulky folders up into 28 different subfolders folders. If there's a well-organized folder with more than 30-50 subfolders under it, then they're all the same type of subdirectory and they only differ in their name. More than thirty or fifty subfolders is too much for your users to digest at once, and it slows down traversing the file system. It takes longer for Linux to get all the files necessary to list all the subfolders, and if you're browsing with Apache, it might take a while to download the whole listing.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;A very popular solution for this type of directory is to subdivide the collection of similar subfolders by their name. I wrote a script which does this based on the first character of the folder name. This way, you can divide a huge directory into chunks that make traversals more efficient for the computer and more responsive to your users (even over CIFS, FTP, NFS, etc.).&lt;/p&gt;Following is the script code:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;#!/bin/sh&lt;br /&gt;&lt;br /&gt;mkdir /tmp/myindex&lt;br /&gt;&lt;br /&gt;mkdir /tmp/myindex/0-9&lt;br /&gt;mkdir /tmp/myindex/misc&lt;br /&gt;mkdir /tmp/myindex/a&lt;br /&gt;mkdir /tmp/myindex/b&lt;br /&gt;mkdir /tmp/myindex/c&lt;br /&gt;mkdir /tmp/myindex/d&lt;br /&gt;mkdir /tmp/myindex/e&lt;br /&gt;mkdir /tmp/myindex/f&lt;br /&gt;mkdir /tmp/myindex/g&lt;br /&gt;mkdir /tmp/myindex/h&lt;br /&gt;mkdir /tmp/myindex/i&lt;br /&gt;mkdir /tmp/myindex/j&lt;br /&gt;mkdir /tmp/myindex/k&lt;br /&gt;mkdir /tmp/myindex/l&lt;br /&gt;mkdir /tmp/myindex/m&lt;br /&gt;mkdir /tmp/myindex/n&lt;br /&gt;mkdir /tmp/myindex/o&lt;br /&gt;mkdir /tmp/myindex/p&lt;br /&gt;mkdir /tmp/myindex/q&lt;br /&gt;mkdir /tmp/myindex/r&lt;br /&gt;mkdir /tmp/myindex/s&lt;br /&gt;mkdir /tmp/myindex/t&lt;br /&gt;mkdir /tmp/myindex/u&lt;br /&gt;mkdir /tmp/myindex/v&lt;br /&gt;mkdir /tmp/myindex/w&lt;br /&gt;mkdir /tmp/myindex/x&lt;br /&gt;mkdir /tmp/myindex/y&lt;br /&gt;mkdir /tmp/myindex/z&lt;br /&gt;&lt;br /&gt;mv ./[0-9]* /tmp/myindex/0-9/&lt;br /&gt;mv ./[!0-9a-zA-Z]* /tmp/myindex/misc/&lt;br /&gt;mv ./[Aa]* /tmp/myindex/a/&lt;br /&gt;mv ./[Bb]* /tmp/myindex/b/&lt;br /&gt;mv ./[Cc]* /tmp/myindex/c/&lt;br /&gt;mv ./[Dd]* /tmp/myindex/d/&lt;br /&gt;mv ./[Ee]* /tmp/myindex/e/&lt;br /&gt;mv ./[Ff]* /tmp/myindex/f/&lt;br /&gt;mv ./[Gg]* /tmp/myindex/g/&lt;br /&gt;mv ./[Hh]* /tmp/myindex/h/&lt;br /&gt;mv ./[Ii]* /tmp/myindex/i/&lt;br /&gt;mv ./[Jj]* /tmp/myindex/j/&lt;br /&gt;mv ./[Kk]* /tmp/myindex/k/&lt;br /&gt;mv ./[Ll]* /tmp/myindex/l/&lt;br /&gt;mv ./[Mm]* /tmp/myindex/m/&lt;br /&gt;mv ./[Nn]* /tmp/myindex/n/&lt;br /&gt;mv ./[Oo]* /tmp/myindex/o/&lt;br /&gt;mv ./[Pp]* /tmp/myindex/p/&lt;br /&gt;mv ./[Qq]* /tmp/myindex/q/&lt;br /&gt;mv ./[Rr]* /tmp/myindex/r/&lt;br /&gt;mv ./[Ss]* /tmp/myindex/s/&lt;br /&gt;mv ./[Tt]* /tmp/myindex/t/&lt;br /&gt;mv ./[Uu]* /tmp/myindex/u/&lt;br /&gt;mv ./[Vv]* /tmp/myindex/v/&lt;br /&gt;mv ./[Ww]* /tmp/myindex/w/&lt;br /&gt;mv ./[Xx]* /tmp/myindex/x/&lt;br /&gt;mv ./[Yy]* /tmp/myindex/y/&lt;br /&gt;mv ./[Zz]* /tmp/myindex/z/&lt;br /&gt;&lt;br /&gt;mv /tmp/myindex/* ./&lt;br /&gt;rmdir /tmp/myindex&lt;br /&gt;&lt;br /&gt;exit 0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Some 'for' loops would make this code substantially smaller, and if someone makes a suggestion I'll try it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-115902728981875217?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/115902728981875217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=115902728981875217' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/115902728981875217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/115902728981875217'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/09/making-directory-traversals-more.html' title='Making directory traversals more efficient'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-115902683020695583</id><published>2006-09-23T10:47:00.000-05:00</published><updated>2007-07-14T15:09:32.002-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Kernel'/><title type='text'>Compiling the vt1211.ko Kernel Module</title><content type='html'>&lt;p&gt;I basically followed the directions from VIA, except I used the latest patch file for kernel 2.6.17 available at Lars Ekman's website: &lt;a href="http://hem.bredband.net/ekmlar/vt1211.html"&gt;http://hem.bredband.net/ekmlar/vt1211.html&lt;/a&gt; instead of the one VIA provides in their VIA FC5 Hardware Monitor Application Notes (&lt;a href="http://www.viaarena.com/"&gt;www.viaarena.com&lt;/a&gt;). The patch file is designed to patch the whole kernel tree (only a small part, but you need the whole thing). If you have 2.6.17-1.2174_FC5, the module I compiled is already available on Lars Ekman's website.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Below is a copy &amp;amp; paste of the instructions from VIA, available on VIA Arena, with annotations made where I remember their instructions didn't work. Fill in the mentioned kernel name with your kernel. If I ever have to do this again, I'll make my own instructions.  &lt;/p&gt;&lt;br /&gt;&lt;p&gt;I got the corresponding kernel source package from YUM instead of downloading the RPM. The package is called &lt;span class="code"&gt;kernel-devel&lt;/span&gt;. This puts files in &lt;span class="code"&gt;/usr/src/redhat&lt;/span&gt;. Note that when you're done, you can use YUM to again remove this package. I had to do a few things to get &lt;span class="code"&gt;rpmbuild&lt;/span&gt; installed and working (I remember it needed a few software packages from YUM), but then I could make it through the first few lines.  &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#rpm –ivh kernel-2.6.15-1.2054_FC5.src.rpm&lt;br /&gt;#cd /usr/src/redhat/SPECS&lt;br /&gt;#rpmbuild –bp –-target=i686 kernel-2.6.spec&lt;br /&gt;#cd /usr/src/redhat/BUILD&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Then they want you to move the kernel source tree to /usr/src/{name of kernel} and then apply the patch.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;You can find the kernel source directory in path&lt;br /&gt;/usr/src/redhat/BUILD/kernel-2.6.15/linux-2.6.15.i686. Move the&lt;br /&gt;kernel source directory to path /usr/src/kernels and patch&lt;br /&gt;the os default kernel.&lt;br /&gt;#cd /usr/src/redhat/BUILD/kernel-2.6.15&lt;br /&gt;#mv linux-2.6.15.i686 /usr/src/linux-2.6.15-1.2054_FC5&lt;br /&gt;#cp vt1211_FC5.patch /usr/src&lt;br /&gt;#cd /usr/src&lt;br /&gt;#patch –p0 &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now you have the new kernel tree, and you need to compile the kernel with the vt1211 source as a  module to get the &lt;span class="code"&gt;vt1211.ko&lt;/span&gt;.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Select needed item and rebuild the patched kernel&lt;br /&gt;Edit the Makefile in directory linux-2.6.15-1.2054_FC5.Find the string&lt;br /&gt;“EXTRAVERSION = -prep” and modify it to “EXTRAVERSION = -1.2054_FC5”.&lt;br /&gt;#cd linux-2.6.15-1.2054_FC5&lt;br /&gt;#cp /boot/config-2.6.15-1.2054_FC5 .config&lt;br /&gt;#make menuconfig&lt;br /&gt;Device Drivers ---&gt; Hardware Monitoring support ---&gt;&lt;br /&gt;[M] Hardware Monitoring support&lt;br /&gt;[M] VT1211&lt;br /&gt;After set the kernel item completely and save it, we can rebuild the kernel&lt;br /&gt;source. When the compiling module procedure is completed, you can find&lt;br /&gt;the “vt1211.ko” module to path&lt;br /&gt;/lib/modules/2.6.15-1.2054_FC5/kernel/drivers/hwmon&lt;br /&gt;#make&lt;br /&gt;#cp linux-2.6.15-1.2054_FC5/drivers/hwmon/vt1211.ko&lt;br /&gt;/lib/modules/2.6.15-1.2054_FC5/kernel/drivers/hwmon&lt;br /&gt;#depmod -a&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The GUI &lt;span class="code"&gt;menuconfig&lt;/span&gt; didn't work for me. If you run &lt;span class="code"&gt;make config&lt;/span&gt;, you can do the same thing in text mode. If you just run &lt;span class="code"&gt;make&lt;/span&gt;, I think it will ask you if you want Kernel/Module whenever not specified by the .&lt;span class="code"&gt;config&lt;/span&gt; file you copied from your boot folder. Make sure you select Module (type the letter 'm') for the vt1211 objects. Then, about six hours later, it'll finally make it through all the source and you'll get your .ko file. Copy it out of there and into your &lt;span class="code"&gt;/lib/modules&lt;/span&gt; tree and then run &lt;span class="code"&gt;depmod&lt;/span&gt; as in the instructions above.  &lt;/p&gt;&lt;br /&gt;&lt;p&gt;When you're done, you can go back to the &lt;span class="code"&gt;/usr/src/{linux kernel name}&lt;/span&gt; and run &lt;span class="code"&gt;make clean&lt;/span&gt;, or you can remove that whole directory if you no longer need it. You can also remove the &lt;span class="code"&gt;kernel-devel&lt;/span&gt; package, &lt;span class="code"&gt;rpmbuild&lt;/span&gt;, etc.&lt;br /&gt;&lt;/p&gt;&lt;span style="font-size:130%;"&gt;Update&lt;/span&gt;&lt;br /&gt;&lt;p&gt;Linux kernel 2.6.21 now includes an even better version of the vt1211 module! This kernel is the default on RedHat Fedora 7 Linux. Finally time to upgrade my server installation.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-115902683020695583?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/115902683020695583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=115902683020695583' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/115902683020695583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/115902683020695583'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/09/compiling-vt1211ko-kernel-module.html' title='Compiling the vt1211.ko Kernel Module'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-115858839250943680</id><published>2006-09-18T09:06:00.000-05:00</published><updated>2007-07-14T15:10:17.729-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='piping'/><category scheme='http://www.blogger.com/atom/ns#' term='shell scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='checksums'/><title type='text'>Create md5 sum files in Linux</title><content type='html'>&lt;p&gt;Learned that the Linux shell can be quickly used to generate md5 checksums of an entire directory to an md5 file, the command is of the form:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;cd [directory to generate check sums for]&lt;br /&gt;find ./ -printf “%p\0” | xargs -0 -n 1 md5sum &gt; ./checksums.md5&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Then, to check the files in a new location (e.g. on a CD-ROM), use the command:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;md5sum -c ./checksums.md5&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Or there are other programs for validating the files with the checksums, like &lt;span class="code"&gt;wxChecksums&lt;/span&gt; which is available for Windows.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I wanted this because the graphical &lt;span class="code"&gt;wxChecksums&lt;/span&gt; was too difficult to compile, and didn't seem worth the effort. Although I'm sure a couple backwards-compatibility packages for gcc would fix this problem, the command-line method makes it straightforward for doing multiple check sums in a single command in text mode.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-115858839250943680?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/115858839250943680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=115858839250943680' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/115858839250943680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/115858839250943680'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/09/create-md5-sum-files-in-linux.html' title='Create md5 sum files in Linux'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-115851747579639280</id><published>2006-09-17T13:24:00.000-05:00</published><updated>2007-07-14T15:10:45.060-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='BitTorrent'/><title type='text'>Python BitTorrent Daemon</title><content type='html'>&lt;p&gt;If you're running a server and leeching/seeding torrents, and it's a no-screen machine, you might not want to use a BitTorrent client with an interface. The main reason is, the interface requires a lot of CPU cycles to constantly update and if you're not even looking, why bother? &lt;span class="code"&gt;Azureus&lt;/span&gt; is the most powerful BitTorrent client, but it's also the most CPU-intensive. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;On my Mini-ITX server, Azureus running on a VNC Server (&lt;span class="code"&gt;xvnc&lt;/span&gt;) left the kernel 60% or less idle at times when the GUI was open or when traffic was heavy (30-40% cycles given to Azureus), and Azureus is also known for hogging memory (weakness of Java). After I switched to just letting &lt;span class="code"&gt;btseed&lt;/span&gt; run, the &lt;b&gt;total&lt;/b&gt; CPU usage is about 8% (92% idle). This means that the kernel is more responsive to new tasks. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;A Python BitTorrent service (Daemon) either comes with Fedora or is part of the packages installed as dependencies of the YUM &lt;span class="code"&gt;bittorrent-gui&lt;/span&gt; package. There is a Daemon set up called &lt;span class="code"&gt;btseed&lt;/span&gt;, which is capable of monitoring &lt;span class="code"&gt;.torrent&lt;/span&gt; files in a specified directory and downloading them automatically. There's essentially no documentation I can find about how to use this correctly, but I got it working OK. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;The &lt;span class="code"&gt;/etc/init.d/btseed&lt;/span&gt; script should be used to start/stop/restart the Daemon. This script launches &lt;span class="code"&gt;btseed&lt;/span&gt;, which is an incarnation of the &lt;span class="code"&gt;launchmany-console&lt;/span&gt; Python program. The file &lt;span class="code"&gt;/etc/sysconfig/bittorrent&lt;/span&gt; should be configured to your preferences.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The Daemon is capable of UPNP, which makes it pretty nice. Here is my &lt;span class="code"&gt;/etc/sysconfig/bittorrent&lt;/span&gt; configuration file:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;SEEDDIR=/srv/bittorrent/data&lt;br /&gt;SEEDOPTS="--max_upload_rate 50 --display_interval 30 --minport 49900 --maxport 52000"&lt;br /&gt;SEEDLOG=/var/log/bittorrent/btseed.log&lt;br /&gt;TRACKPORT=6969&lt;br /&gt;TRACKDIR=/srv/bittorrent/data&lt;br /&gt;TRACKSTATEFILE=/srv/bittorrent/state/bttrack&lt;br /&gt;TRACKLOG=/var/log/bittorrent/bttrack.log&lt;br /&gt;TRACKOPTS="--min_time_between_log_flushes 4.0 --show_names 1 --hupmonitor 1"&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Note that the TRACK* settings are not important unless you're running a tracker.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-115851747579639280?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/115851747579639280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=115851747579639280' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/115851747579639280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/115851747579639280'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/09/python-bittorrent-daemon.html' title='Python BitTorrent Daemon'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34576434.post-115851557688997803</id><published>2006-09-17T12:47:00.000-05:00</published><updated>2008-01-30T01:35:19.397-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dns aliasing'/><category scheme='http://www.blogger.com/atom/ns#' term='ddclient'/><title type='text'>Get a free domain name (IP alias) for your subnet</title><content type='html'>&lt;p&gt;DynDNS.com provides a free IP Address Alias for everyone. The only problem is, I have a dynamic IP address, so I had to also get &lt;span class="code"&gt;ddclient&lt;/span&gt; (for Linux) working. It was pretty simple—a package was available on YUM, and it installs itself by default as a daemon (service). All you need to do is set up the &lt;span class="code"&gt;/etc/ddclient.conf&lt;/span&gt; file to work correctly. You need to do two things with the &lt;span class="code"&gt;ddclient&lt;/span&gt;: discover your IP address, and check with DynDNS. I basically just had to uncomment some lines and fill in the details. DynDNS has a facility for giving you your WAN IP address. Your router does too, but it may be too hard to find.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34576434-115851557688997803?l=ryans-bliggity-blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ryans-bliggity-blog.blogspot.com/feeds/115851557688997803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34576434&amp;postID=115851557688997803' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/115851557688997803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34576434/posts/default/115851557688997803'/><link rel='alternate' type='text/html' href='http://ryans-bliggity-blog.blogspot.com/2006/09/get-free-domain-name-ip-alias-for-your.html' title='Get a free domain name (IP alias) for your subnet'/><author><name>hawaiianryan</name><uri>http://www.blogger.com/profile/05251794313647154746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
