Skip to content

Instantly share code, notes, and snippets.

fix for cryptography error
build/temp.macosx-10.11-intel-2.7/_openssl.c:423:10: fatal error: 'openssl/opensslv.h' file not found
#include <openssl/opensslv.h>
ARCHFLAGS="-arch x86_64" LDFLAGS="-L/usr/local/opt/openssl/lib" \
CFLAGS="-I/usr/local/opt/openssl/include" pip install cryptography
@ig0rix
ig0rix / AbstractJdbcRepository.java
Created January 29, 2016 17:50 — forked from criminy/AbstractJdbcRepository.java
Implementation of PagingAndSortingRepository using JdbcTemplate
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
@ig0rix
ig0rix / configure-pat.sh
Created December 24, 2015 11:45
AWS's /usr/local/sbin/configure-pat.sh script (un-altered) on the template: amzn-ami-vpc-nat-pv-2013.09.0.x86_64-ebs (ami-ad227cc4)
#!/bin/bash
# Configure the instance to run as a Port Address Translator (PAT) to provide
# Internet connectivity to private instances.
function log { logger -t "vpc" -- $1; }
function die {
[ -n "$1" ] && log "$1"
log "Configuration of PAT failed!"
exit 1
SERVER_PORT=<Your server port> SERVER_NAME='<Your server name>' php -dxdebug.remote_autostart=On app/console test
Make sure you have enabled xdebug inside php.ini
[XDebug]
xdebug.remote_enable = 1
xdebug.remote_host = 127.0.0.1
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM
mike@rbci:~$ psql -U postgres
psql (9.0.3)
Type "help" for help.
postgres=# update pg_database set datallowconn = TRUE where datname = 'template0';
UPDATE 1
postgres=# \c template0
You are now connected to database "template0".
template0=# update pg_database set datistemplate = FALSE where datname = 'template1';
UPDATE 1
@ig0rix
ig0rix / gist:e666fdfc2d476a497e9b
Created August 1, 2014 05:28
install PIL in virtualenv on Mac (Mavericks)
ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11 /usr/local/include/X11
sudo pip install PIL --allow-external PIL --allow-unverified PIL
@ig0rix
ig0rix / gist:f0ba767e2d92472bba46
Created August 1, 2014 05:24
install psycopg2 into virtualenv on Mac
export PATH=/Library/PostgreSQL/9.3/bin/:"$PATH"
pip install psycopg2
mike@rbci:~$ psql -U postgres
psql (9.0.3)
Type "help" for help.
postgres=# update pg_database set datallowconn = TRUE where datname = 'template0';
UPDATE 1
postgres=# \c template0
You are now connected to database "template0".
template0=# update pg_database set datistemplate = FALSE where datname = 'template1';
UPDATE 1
@ig0rix
ig0rix / gist:5d9d595016694f4f1586
Created May 20, 2014 05:23
numpy on mavericks
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install --upgrade numpy
@ig0rix
ig0rix / gist:11323520
Last active August 29, 2015 14:00 — forked from panuta/gist:3075882
django+nginx

Fix locale problem

Run the following command

$ update-locale LC_ALL="en_US.UTF-8"

If it failed, you will need to add the following to /var/lib/locales/supported.d/local file

en_US.UTF-8 UTF-8