This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##Redis | |
change redis conf in remote server | |
``` | |
vim /etc/redis/redis.conf | |
# change the original to this line | |
bind 0.0.0.0 | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check redis log /var/logs/redis/redis-server.log for write errors | |
can be permissions on the redis dbump dir or memory conditions or not enough place on disk | |
check place on disks: | |
http://www.cyberciti.biz/faq/check-free-space/ | |
``` | |
$ df -h | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. replace apt-get upgrade to install only security patches: | |
http://askubuntu.com/questions/194/how-can-i-install-just-security-updates-from-the-command-line | |
2. use unattended-upgrade | |
3. automate unattended-upgrade with cron | |
https://help.ubuntu.com/community/AutomaticSecurityUpdates | |
4. get alerts about pending updates: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "Nginx Web", | |
"services": { | |
"query": { | |
"list": { | |
"0": { | |
"query": "response:[200 TO 299]", | |
"alias": "OK", | |
"color": "#7EB26D", | |
"id": 0, |