Monthly Archives: March 2009

Creating empty files in Linux

I had a need for several files of various sizes to do some network testing with.  I found a very good us for dd here. dd if=/dev/zero of=10mb-file.bin bs=1024k count=n Using the above command (and replacing n for a value) allows the creation of empty files with the size specificed. Need a 10Mb file, n = [...]
Posted in quickfire, tips | Tagged , | Leave a comment

Force the use of ‘www’ in your URL.

This is a pretty simple use of mod_rewrite to force the use www in your urls. RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC] RewriteRule .? http://www.example.com%{REQUEST_URI} [R=301,L]\ The first line is only needed if mod_rewrite isn’t enabled on your server (though the module does need to be enabled). Replace example.com with your actual domain name of course.
Posted in quickfire | Tagged | 2 Comments