Showing posts from November, 2012

LimeSurvey Nginx rewrite rules

I just downloaded LimeSurvey, an amazing free open-source project for creating your own online surveys , and was about to install it on my own Nginx-powered server. To my surprise, there are no available Nginx rewrite rules for it on the official project website, and I didn't even find any blog post detailing such rules. So here I go again, filling the voids. This post details: - the Nginx rewrite rules translated directly from the provided .htaccess file, the small server configuration file containing the rewrite rules for Apache. - what to do after installing LimeSurvey Nginx rewrite rules The original rewrite rules for LimeSurvey are contained in this simple .htaccess file: <IfModule mod_rewrite.c>   RewriteEngine on     # if a directory or a file exists, use it directly     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     # otherwise forward it to index.php     RewriteRule . index.php </IfModule> # General setting to prope

Shanghai Air Quality Index Widget (from US Embassy data)

I live in Shanghai and air pollution is a major concern, especially in institutions such as schools or hospitals. It is important to give proper directives to children and elder: when the air pollution reaches a certain threshold, they should stay inside as much as possible and avoid any form of physical exercise outside. There are mainly two indices for air quality in Shanghai: the Chinese government's data and the official website of the US Consulate in Shanghai . The latter is based on an RSS feed updated every hour. In order to facilitate the display and comprehension of the data from that RSS feed, I have designed a widget (running under Windows XP/Vista/7/8) that is meant to display Shanghai's air quality index in real time - again, based on official data from the US Embassy. The widget was designed to be ran on display monitors that stay on 24/7, so it displays at the topmost  - it always shows on top regardless of other windows. The data is automatically refreshe