sudo apt-get install libxml2-dev
sudo apt-get install libxslt1-dev
sudo apt-get install python2.6-dev
easy_install --allow-hosts=lxml.de,*.python.org lxml
Mar 30, 2012
How To: Install lxml on Ubuntu
Posted by Lono at 13:27 0 comments
List of commands for MySql and Django
mysqladmin.exe -u root -p create myapp
python manage.py syncdb
mysql -u root -p
sudo /etc/init.d/apache2 restart
Posted by Lono at 11:36 0 comments
Mar 18, 2012
OpenSSH configuration file
Putty is a lovely ssh program, but I love console2 even more.
To use ssh to connect to Amazon EC2 server, you need cygwin to run openssh in Windows environment.
The command is (under cygwin):
ssh -i MySite.pem ubuntu@xxx.amazonaws.com
To make the command shorter, create "~/.ssh/config"
and add:
Host MySite
User ubuntu
Port 22
IdentityFile ~/.ssh/MySite.pem
HostName xxx.amazonaws.com
To connect, just type:
ssh MySite
Posted by Lono at 17:10 0 comments
Mar 16, 2012
Setting selective sync of Dropbox on Amazon EC2 server
Dropbox provides an easy to backup the server. However, the default setting synchronizes all of the files to the server, which is very annoying.
I don't want all of my personal stuff to be stored in a public server.
In order to select the file which you would like to sync, download dropbox.py
and type the following commands in the terminal:
python dropbox.py exclude add ~/Dropbox/*
python dropbox.py exclude remove ~/Dropbox/<folder-to-sync>
The first command excludes all of files from your dropbox.
The second one adds the folder which is going to be synchronized.
Posted by Lono at 05:33 0 comments
Mar 7, 2012
Setting up Django on ubuntu
- sudo apt-get update
- sudo apt-get install apache2
- wget http://www.djangoproject.com/download/1.3/tarball/
- mv index.html Django-1.3.tar.gz
- tar xzvf Django-1.3.tar.gz
- cd Django-1.3
- sudo python setup.py install
- sudo apt-get install libapache2-mod-wsgi
- create "/home/ubuntu/mysite/django-server.wsgi"
- sudo /etc/init.d/apache2 start
- cd /etc/apache2/sites-available
- sudo cp default mysite
- edit "mysite"
- a2ensite mysite
- sudo /etc/init.d/apache2 reload
- sudo /etc/init.d/apache2 restart
- cd ~
- django-admin startproject mysite
- cd ~/mysite
- django-admin startapp myapp
- python manage.py runserver 0.0.0.0:8000
import os, sys
sys.path.append('/home/ubuntu/')
sys.path.append('/home/ubuntu/mysite')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Listen 8000
<VirtualHost *:8000>
WSGIScriptAlias / /home/ubuntu/mysite/django-server.wsgi
WSGIDaemonProcess server1piece user=www-data group=www-data processes=1 threads=10
ServerAdmin webmaster@localhost
DocumentRoot /home/ubuntu/
Alias /static/admin/ /home/ubuntu/Django-1.3/django/contrib/admin/media/
Posted by Lono at 03:01 0 comments
Labels: Django