Tag: code
Wednesday, 25 April 2012
Finding and Eliminating Duplicated Files
Fancy file systems are all the rage. "ZFS":http://hub.opensolaris.org/bin/view/Community+Group+zfs/whatis, "btrfs":https://btrfs.wiki.kernel.org, and even Microsoft's new "ReFS":http://blogs.msdn.com/b/b8/archive/2012/01/16/building-the-next-generation-file-system-for-windows-refs.aspx include data deduplication features. However, these techniques can use a lot of memory, and new file systems are often not nearly as stable as tried and true file systems, such as "ext3/ext4":https://ext4.wiki.kernel.org/ or "XFS":http://oss.sgi.com/projects/xfs/. Experimenting with file systems is fun; however, in this case, I am not about to trust all of my data to a new file system just to remove duplicate files. Instead, I decided to deduplicate my files using a few scripts. The end result: over 12GB of saved space after just a few minutes of scanning my hard drive. With hard drive prices sky high (but slowly coming down), this will help me last another 6 months before I have to upgrade my hard drives again.
Continue reading "Finding and Eliminating Duplicated Files"
Sunday, 07 November 2010
Introduction to awk
awk is a pattern scanning and processing language that is commonly used to process tabular data by either transforming the data in some way or producing a report about the data. The language is turing complete, and at least the GNU version has file and network I/O capabilities. However, this introduction guide will not discuss the advanced features for the sake of brevity.
Continue reading "Introduction to awk"
Saturday, 12 June 2010
Functional Programming with PHP
Wait, what? You can do functional programming in PHP? Doesn't that make PHP even more messy? Why would you do such a thing? In this case, no, it makes my code cleaner.
Continue reading "Functional Programming with PHP"
Thursday, 13 May 2010
Testing Whether an Integer is a Power of 2
By using the & (logical and) operator, we can easily (and quickly!) test whether an integer is a power of 2.
Continue reading "Testing Whether an Integer is a Power of 2"