Sunday January 22 2012
At the office we’re using an internal development server, which also hosts all our git repositories. We’re using the small and awesome ViewGit repository browser to get an insight in the latest commits.
However, our development server is only accessible at the office, not at home over the web, unless you set up an SSH tunnel. This is a little bit cumbersome to do every time you just want a quick peek, so we used a simple solution to make ViewGit accessible over the web. Behind some HTTP Basic authentication of course.
Continue reading Using Apache to serve a SSH-tunneled website…
Sunday January 15 2012
Simple piece of code to put in your .htaccess if you want to join in the protest against SOPA:
# RewriteEngine on (enable if you don't have it yet)
RewriteCond %{TIME_YEAR}%{TIME_MON}%{TIME_DAY} ^20120118$
RewriteCond %{TIME_HOUR} >7
RewriteCond %{TIME_HOUR} <20
RewriteRule ^(.*)$ http://reddit.com/r/sopa [L]
This will redirect any request, to your protest site of choice on Jan 18th, between 08:00 and 20:00 (local webserver time). Assuming Apache of course!
Thursday September 29 2011
A small moment of triumph today. After a company-wide rollout of IE9, some internal apps seemed to break. What actually was happening that people were pushing the Compatibility View button for some reason.
Fretting over having to update dozens of sites and apps with a set of meta tags to prevent Compatibility View, a better solution appeared. Why not serve this meta tag as a HTTP header? It works! Simply add the following lines to your Apache configuration (for instance apache2.conf or httpd.conf) and you’ll be permanently freed from users triggering IE7-mode on you…
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
BrowserMatch MSIE ie
Header add X-UA-Compatible "IE=Edge,chrome=1" env=ie
</IfModule>
</IfModule>
Make sure you have both modules installed and enabled. On Ubuntu simply fire off a2enmod headers to enable the headers module. As an added bonus, the above headers will trigger Google Chrome Frame as well, if available…