Unix quotes, regural expressions and sed

Good tutorial for unix scripting

UNIX SHELL Quote Tutorial


Regular Expressions


Sed – An Introduction and Tutorial


How to mount Win partition on Ubuntu

This guide has worked for me:


Particularly this section:


Presentation in HTML5

Here’s a link to a Ben Brton’s github page where he has i.a. his presentation in HTML5


Ubuntu Linux Start / Restart / Stop Apache Web Server

/etc/init.d/apache2 is service script used to start / stop / restart the Apache2 service under Debian or Ubuntu Linux. You need to login as root or use sudo command restart Apache.

Task: Start Apache 2 Server

# /etc/init.d/apache2 start
$ sudo /etc/init.d/apache2 start

Task: Restart Apache 2 Server

# /etc/init.d/apache2 restart
$ sudo /etc/init.d/apache2 restart

Task: Stop Apache 2 Server

# /etc/init.d/apache2 stop
$ sudo /etc/init.d/apache2 stop

The usual location for Debian-like systems (ubuntu) is to place webfiles under the /var/www/… branch of dirs. That is also the location where apache would look (at least you find it in many example apache config files).
So you could build dirs like that:


You may see such statement:

„Could not reliably determine the server’s fully qualified domain name, using for ServerName”

To fix that problem, you need to edit the httpd.conf file. Open the terminal and type,

sudo gedit /etc/apache2/httpd.conf

By default httpd.conf file will be blank. Now, simply add the following line to the file.

ServerName localhost

Save the file and exit from gEdit. Finally restart the server.

sudo /etc/init.d/apache2 restart

How to check what libs are installed

pip freeze

How to check if Postgres is running

/etc/init.d/postgresql status

Django – how to view executed queries

You also can use python logging to log all queries generated by Django. Just add this to your settings file.

    'disable_existing_loggers': False,
    'version': 1,
    'handlers': {
        'console': {
            # logging handler that outputs log messages to terminal
            'class': 'logging.StreamHandler',
            'level': 'DEBUG', # message level to be written to console
    'loggers': {
        '': {
            # this sets root level logger to log debug and higher level
            # logs to console. All other loggers inherit settings from
            # root level logger.
            'handlers': ['console'],
            'level': 'DEBUG',
            'propagate': False, # this tells logger to send logging message
                                # to its parent (will send if set to True)
        'django.db': {
            # django also has database level logging


Also useful some template to show queries in the DEBUG mode:  http://djangosnippets.org/snippets/93/


Get every new post delivered to your Inbox.