Skip to content

Instantly share code, notes, and snippets.

@Benoss
Benoss / .bash_aliases
Last active August 29, 2015 14:01
Bash Alias
alias ll='ls -lah --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
alias la='ls -A'
alias l='ls -CF'
alias upgrade='sudo apt-get update && sudo apt-get dist-upgrade -V && sudo pip install --upgrade pip virtualenv virtualenvwrapper fabric && sudo npm update -g'
alias h='history | grep $1'
alias psg='ps -ef | grep $1'
alias ..='cd ..'
function my_ip() # get IP adresses
{
@Benoss
Benoss / config_local.py
Created March 17, 2014 01:09
Django add Debug Toolbar for non HTML response ex: Json rest response
DEBUG=True
SOUTH_TESTS_MIGRATE = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'geo', # Or path to database file if using sqlite3.
'USER': 'postgres', # Not used with sqlite3.
'PASSWORD': 'postgres', # Not used with sqlite3.
'HOST': '127.0.0.1', # Set to empty string for localhost. Not used with sqlite3.
@Benoss
Benoss / gist:8277602
Created January 6, 2014 03:05
Python pool multi thread/process example
import time, random
PROCESS = True
JOB_POOL_SIZE = 10
DATABASE_POOL_SIZE = 5
def apply_job(arg):
r = random.random() *10
time.sleep(r)
return (arg, r)