Skip to content

Instantly share code, notes, and snippets.


Alonisser alonisser

View GitHub Profile
alonisser / remote db connection
Last active Aug 29, 2015
Connecting to remote mongo, redis, postgres
View remote db connection
change redis conf in remote server
vim /etc/redis/redis.conf
# change the original to this line
View pillow installation log
for [this stackoverflow question](
Running install for Pillow
building 'PIL._imaging' extension
/usr/bin/gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -I/usr/include/freetype2 -I/home/alon/server/django-warren/venv/build/Pillow/libImaging -I/home/alon/server/django-warren/venv/include -I/usr/local/include -I/usr/include -I/home/alon/.pyenv/versions/2.7.6/include/python2.7 -I/usr/include/x86_64-linux-gnu -c _imaging.c -o build/temp.linux-x86_64-2.7/_imaging.o
_imaging.c: In function ‘_filter’:
_imaging.c:877:8: warning: ‘kernelsize’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (kernelsize != xsize * ysize) {
/usr/bin/gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3
alonisser / sequence_problem
Last active Aug 29, 2015
Solving django/pg sequence problem after a user model migration to custom user model
View sequence_problem
View update postgres last
This utility addresses the InegrityError that occurs when you try to add a new record to
(probably a recently ported) postgres database while using Django, here's more . . .
duplicate key value violates unique constraint "<app>_<table>_pkey"
DETAIL: Key (id)=(2) already exists.
The problem here is that the Postgres sequence generators are out of sync with your data.
Here's a good overview:
alonisser /
Last active Aug 29, 2015
Controlling django warmup and common memory space with uwsgi - things to check
alonisser /
Created Jun 28, 2014
ppa and sources tweaking for setting up a new ubuntu machine

ppa to add

sudo add-apt-repository ppa:pdoes/ppa #git
sudo add-apt-repository ppa:nginx/stable #nginx
sudo add-apt-repository ppa:chris-lea/node.js #node.js
sudo add-apt-repository ppa:fish-shell/release-2 #fish

In sources.list

# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04) trying on ubuntu server 14.04
# Add Google Chrome's repo to sources.list
echo "deb stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source:
alonisser /
Created Apr 18, 2014
Generate a list of current vim plugins including path and git repo
set -e
trim() {
local var=$@
var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters
var="${var%"${var##*[![:space:]]}"}" # remove trailing whitespace characters
echo -n "$var"
alonisser /
Created Dec 29, 2013
git hook for bower install and npm install on bower.json/package.json change
#Inspired by
#Since every `git pull` is actually a merge. We can use it to automaticly run basic Django tasks after pulling from the upstream master branch (or any other)
#Notice: This won't run at git fetch. since fetch doesn't merge anything
# copy this script with the name:`` to your project root folder
# symlink it to the ./git/hooks/post-merge: `ln .git/hooks/post-merge
#You should have bash (windows users, means cygwin/mingw anything that works for you
#Based on the instructions here: