Monthly Archives: May 2010

Case-insensitive Autocomplete in Bash

I use auto complete on the command line all the time to avoid having to type the full name of a file. Love it. What I hate is how it’s case-sensitive in bash, so I can’t do “cd ~/desk” to go to the “~/Desktop” folder.

The fix for this is to use the shell input options file: .inputrc
Just set this one option and restart your shell:

echo 'set completion-ignore-case On' >> ~/.inputrc

If you happen to have a system wide inputrc settings ( /etc/inputrc ) and want it included then you should add the following to your .inputrc file:

$include /etc/inputrc

Enable HTTP Authentication on Dreamhost

If you are using Dreamhost, or other similar shared server host, and are having problems with HTTP authentication then this is something to try. In my case I had a RAILS application where I was positive I was sending the appropriate HTTP Basic Authorization header (from PHP) like so:

$urlNew = curl_init();
...
curl_setopt($urlNew, CURLOPT_USERPWD, $strAuth);
curl_setopt($urlNew, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
...

However the server would repeatedly reply with Not Authorized (401 error). It turned out that the Authorization header was not being passed from Apache to the FastCGI application. So where I had this rewrite rule in /public/.htaccess:

RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

I just changed it to this:

RewriteRule ^(.*)$ dispatch.fcgi [E=X-HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L]

And all was well.