12 Mar'12
Disable ActiveX warning for local web pages in Internet Explorer 9
Go to Internet options and switch to tab Advanced:
12 Mar'12
Restore Ubuntu GRUB after Windows 8 installation
Use this package to recover: https://help.ubuntu.com/community/Boot-Repair
11 Mar'12
Django soft image thumbnail replacement
Using new template tag, you’re now free to cache images before rolling out new design and avoid heavy load (maybe via random call)!
https://docs.djangoproject.com/en/1.3/ref/templates/builtins/#with
<img src="{{img.url|thumb:"500x500"%}" /> {% if rand % 10 } {with newthumb=img.newthumb %}} or <!-- {{img.url|thumb:"500x580"%} --> {% endif %}
10 Mar'12
Fluent C#
The book is awful and riddled with errors. Here is the annotated list of errors on Google Docs from Jon Skeet. You can find his full review here.
05 Mar'12
Git deployment
Get some inspiration here first: http://stackoverflow.com/questions/279169/deploy-a-project-using-git
If it seems to hard for you, use this example: http://ryanflorence.com/simple-git-deployment/.
There is a middle method, but I failed to implement it successfully: http://caiustheory.com/automatically-deploying-website-from-remote-git-repository
Take a look at http://www.dejaaugustine.com/2011/05/leveraging-git-as-a-full-fledged-web-development-tool/ and http://deadlytechnology.com/web-development/deploy-websites-with-git/ as well.
05 Mar'12
Django fails with DEBUG=False on production
First, be sure to eliminate this issue: http://stackoverflow.com/a/4975210
Next, enable logging of all events. That will save you plenty of time.
Next, be sure to include both 404.html and 500.html in the root of your templates’ folder. See here and here for details.
If you are using nginx, be sure to include correct fastcgi configuration file: http://softwaremaniacs.org/forum/django/9093/ (post before the last). Fairly equal to http://serverfault.com/a/229188. But extensive configuration http://stackoverflow.com/a/605196 didn’t work for me.
05 Mar'12
MySQL with Django on Debian
First, install MySQL driver for Python:
sudo apt-get install python-mysqldb
Next, modify your config of MySQL: http://dba.stackexchange.com/a/8289
If you’ve already messed up the install, you can either drop/create database from scratch, or apply the following script to every table of your DB:
ALTER TABLE `table` CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
Alternative mirgation path: http://docs.joomla.org/Convert_a_MySQL_database_to_UTF-8
05 Mar'12
Python hostname
from socket import gethostname print gethostname() if 'prod' in gethostname: pass
05 Mar'12
Test nginx Configuration File
If there is a time when it becomes necessary to test out a nginx.conf file prior to attempting to use it (IOW on a live/production system) here is a handy little command.
user@machine ~> nginx -t -c /etc/nginx/nginx.conf