How to mount Win partition on Ubuntu

This guide has worked for me:

https://help.ubuntu.com/community/MountingWindowsPartitions

Particularly this section:

https://help.ubuntu.com/community/MountingWindowsPartitions#Manual_Configuration

Presentation in HTML5

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

https://github.com/benburton/presentations

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
or
$ sudo /etc/init.d/apache2 start

Task: Restart Apache 2 Server

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

Task: Stop Apache 2 Server

# /etc/init.d/apache2 stop
or
$ 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:

/var/www/example.com
/var/www/sub1.example.com
/var/www/sub2.example.com
etc.

You may see such statement:

„Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 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.

LOGGING = {
    '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/

siemic:

Simple How-To for NUnit in Visual Studio

Originally posted on iSparks:

What is Unit testing?

Unit testing is a method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine if they are fit for use. Intuitively, one can view a unit as the smallest testable part of an application. Let me take the example of the ‘Calculator’  for demonstrating the unit testing.

SOFTWARE REQUIREMENTS:

  • Windows 7 as OS
  • Microsoft Visual Studio 2010 as IDE
  • NUnit as Unit Testing Tool

SET-UP INSTRUCTIONS:

  • Create a new Project with C# Class Library and save it (‘Calculator’ in my example).
  • Rename the class ‘Class1.cs‘ to ‘Operator.cs‘.
  • Add the NUnit frameworks into the ‘Solution Explorer‘ by context-clicking on the project name and then select ‘Add Reference’ menu item.
  • When the Add Reference dialog appears, click on ‘Browse‘ and navigate to C:\Program Files (x86)\NUnit…

View original 783 more words

Follow

Get every new post delivered to your Inbox.