As the number of posts is growing, I think that having a search engine within the website is now relevant. This post only shows what I am using for that.
Instead of using an external search engine such as Google or DuckDuckGo, you have a plugin in Nikola than enables searching on the client side by using jQuery.
Assuming you have installed Nikola > v7.0, you can install the plugin like this:
It will give you a configuration sample to paste in your config.py file.
Fix the lock:
Where "pid int" is the pid you find with pg_stat_activity.
import psycopg2 conn = psycopg2.connect("dbname='template1' user='dbuser' host='localhost' password='dbpass'") cur = conn.cursor()
Once you have the cursor of the database, you can execute queries with:
The git-flow strategy
Very nice cheatsheet: http://danielkummer.github.io/git-flow-cheatsheet/
The centralized worklow
Like Subversion, the Centralized Workflow uses a central repository to serve as the single point-of-entry for all changes to the project. Instead of trunk, the default development branch is called master and all changes are committed into this branch. This workflow doesn’t require any other branches besides master.
Developers are always working on the last version of the code.
If some code breaks something, the whole process is stuck, no release can be done.
Feature Branch Workflow
The core idea behind the Feature Branch Workflow is that all feature development should take place in a dedicated branch instead of the master branch. This encapsulation makes it easy for multiple developers to work on a particular feature without disturbing the main codebase. It also means the master branch will never contain broken code, which is a huge advantage for continuous integration environments.
Encapsulating feature development also makes it possible to leverage pull requests, which are a way to initiate discussions around a branch. They give other developers the opportunity to sign off on a feature before it gets integrated into the official project. Or, if you get stuck in the middle of a feature, you can open a pull request asking for suggestions from your colleagues. The point is, pull requests make it incredibly easy for your team to comment on each other’s work.
Connect to external machine using VNC.
Liclipse seems to be the IDE to go for Python edition if you come from the Eclipse + pydev plugin world: Liclipse (Lightweight Eclipse)
It comes with pydev and gedit plugin already integrated.
On ubuntu 12.04, you need to install the following Java dependencies before being able to launch it.
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-installer
It'll keep your java 7 installation up to date.
To automatically set up the Java 7 environment variables JAVA_HOME and PATH:
Importing a Git project
If the project is already cloned in your local environment, then click "File" | "Import"| Select "Git" | "Project from Git"| "Existing local Repository" and select the project you want.
Else, you can also clone the project from Liclipse by doing "File" | "Import"| Select "Git" | "Project from Git"| "Clone Uri".
Egit enables you to do the same as what git already enables but in a much more friendly way.
Because egit is already integrated in Jiclipse, you already have all its features. I recommend the documentation. Most of the egit features are available when you right click on a file and select "Team".
Annotations: When you are editing a file, you can access it by right clicking the file, selecting "Team" and "Show annotations".
History: When you are editing a file, you can access it by right clicking the file, selecting "Team" and "Show in History".
pydev is the Python IDE in Eclipse.
The debugging mode is very easy to use:
- Place your breakpoints where you want by double clicking in the margin of the files.
- Edit the "Run configuration" according to your project settings.
- Click on "Run" | "Debug as" and select the configuration you created.
If you have launch a command that you cannot directly stopped with usually ctrl+c, you can always put the process in the background with ctrl+z and then use the jobs command to list the job (command) that you have launched. Then, you have the number of the job and you can kill it with the command kill %<number_of_the_job>.