Skip to content

Instantly share code, notes, and snippets.

@ig0rix
ig0rix / tmux.conf
Last active January 4, 2016 15:09 — forked from shinzui/tmux.conf
# ~/.tmux.conf
#
# See the following files:
#
# /opt/local/share/doc/tmux/t-williams.conf
# /opt/local/share/doc/tmux/screen-keys.conf
# /opt/local/share/doc/tmux/vim-keys.conf
#
# URLs to read:
#
@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

@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
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:f0ba767e2d92472bba46
Created August 1, 2014 05:24
install psycopg2 into virtualenv on Mac
export PATH=/Library/PostgreSQL/9.3/bin/:"$PATH"
pip install psycopg2
@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
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
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
@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
@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;