View remote db connection
##Redis | |
change redis conf in remote server | |
``` | |
vim /etc/redis/redis.conf | |
# change the original to this line | |
bind 0.0.0.0 | |
``` |
View pillow installation log
for [this stackoverflow question](http://stackoverflow.com/questions/25558612/pillow-django-image-processing-the-file-you-uploaded-was-either-not-an-image-or) | |
Running setup.py 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 |
View sequence_problem
http://stackoverflow.com/questions/244243/how-to-reset-postgres-primary-key-sequence-when-it-falls-out-of-sync/13308052#13308052) | |
http://reinout.vanrees.org/weblog/2011/05/12/sqlite-postgres-django-cms-migrations.html | |
https://www.vlent.nl/weblog/2011/05/06/integrityerror-duplicate-key-value-violates-unique-constraint/ | |
https://gist.github.com/alonisser/7e931c68665721f0141c |
View update postgres last value.py
""" | |
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: http://www.vlent.nl/weblog/2011/05/06/integrityerror-duplicate-key-value-violates-unique-constraint/ |
View sources_list.md
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
View setup-headless-selenium-xvfb.sh
#!/bin/bash | |
# | |
# 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 http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list | |
# Install Google's public key used for signing packages (e.g. Chrome) | |
# (Source: http://www.google.com/linuxrepositories/) |
View generate_plugins.sh
set -e | |
trim() { | |
#http://stackoverflow.com/questions/369758/how-to-trim-whitespace-from-bash-variable | |
local var=$@ | |
var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters | |
var="${var%"${var##*[![:space:]]}"}" # remove trailing whitespace characters | |
echo -n "$var" | |
} |
View post-merge.sh
#!/bin/sh | |
#Inspired by https://gist.github.com/jbergantine/3870080 | |
#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 | |
#Installation: | |
# copy this script with the name:`post-merge.sh` to your project root folder | |
# symlink it to the ./git/hooks/post-merge: `ln post-merge.sh .git/hooks/post-merge | |
#You should have bash (windows users, means cygwin/mingw anything that works for you | |
#Based on the instructions here: https://oknesset-devel.readthedocs.org/en/latest/workflow.html#before-coding |