Wed 14 November 2012
I'm switching to a new laptop, but don't want to have to install
Archlinux again. So instead of re-installing I will try to copy all
files and hope the system will work. In this blogpost I will describe
the steps and issues I encountered while doing so.
Status: Succeeded!!!!
Summary …
Continue reading »
Fri 13 April 2012
For a mobile project I required a background worker which sents an email
with 300 generated QR codes zipped together as attachment. This costs
quite some time so we need a background worker to execute this task.
I wanted to achieve the following result:
- When the user wants to generate …
Continue reading »
Wed 11 April 2012
While setting up sentgrid I was searching for my password of sendgrid,
but coudn't find it. You can get it in the following way:
Which will show the parameters:
SENDGRID_PASSWORD, SENDGRID_USERNAME
After you get your username don't forget to add it to django settings:
Continue reading »
Thu 23 February 2012
To make my life easier I made a simple decorator which checks if the
parameters are present in the request.POST or request.GET and returns a
response if they are not.
It accepts a list of parameters in string format and will loop through
each parameter to check if …
Continue reading »
Wed 22 February 2012
Just a small code snippet I use when I need to return json, comments are
welcomed.
from django.http import HttpResponse
from django.utils import simplejson as json
def json_response(dict_to_convert_to_json):
return HttpResponse(json.dumps(dict_to_convert_to_json),
mimetype="application/json")
To use it in your view you just do it this …
Continue reading »
Sun 22 January 2012
The Chinese New Year aka Spring Festival is the most important festival
in Chinese culture. All the people travel back to their hometown,
because most of them are working/studying in cities far from their own
hometown. That means all train tickets are sold the day they get
available and …
Continue reading »
Tue 29 November 2011
I always keep forgetting how to import a SQL dump into postgres and
found it always hard to find the right documentation. So I thought lets
share it:
psql -d dbname -U username -f dumpfile.sql
This should also work with files created by pgdump.
Continue reading »
Tue 22 November 2011
mkdir ~/fastboot
cd ~/fastboot
wget http://xt720.ru/Tools/fastboot
chmod +x fastboot
sudo ./fastboot --help
Reference: http://forum.xda-developers.com/showthread.php?t=1121420
I tested the above with Ubuntu 11.10, but it should work on any ubuntu
version I think.
Continue reading »
Tue 01 November 2011
Just tried to install scrapy with pip / easy_install, but when it comes
to installing lxml it will give the following error:
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2
-Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c
src/lxml/lxml.etree.c -o
build/temp.linux-x86_64-2.7/src/lxml/lxml …
Continue reading »
Sat 29 October 2011
A quick solution is to install the libssl 0.9.8 package with the
Following command:
sudo apt-get install libssl0.9.8
Thanks to Rob who commented below and provided an answer on
Stackoverflow
I just upgraded from ubuntu 11.04 to 11.10 with a fresh install, by
keeping …
Continue reading »