Skip to content

Instantly share code, notes, and snippets.

#! /bin/sh
cd /usr/share/locales
./install-language-pack eo
./install-language-pack ia
./install-language-pack ie
./install-language-pack io
./install-language-pack vo
./install-language-pack ca
@berendiwema
berendiwema / gist:7944096
Last active December 31, 2015 05:58
European Union ISO-3166 List/Array
['AT', 'BE', 'BG', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'GB']
sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql-9.2 postgresql-server-dev-9.2 postgresql-contrib-9.2
sudo su -l postgres
psql -d template1 -p 5433
CREATE EXTENSION IF NOT EXISTS hstore;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
service postgresql stop
/usr/lib/postgresql/9.2/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.2/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.2/main/ -O "-c config_file=/etc/postgresql/9.2/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf"
sub vcl_recv {
# unless sessionid/csrftoken is in the request, don't pass ANY cookies (referral_source, utm, etc)
if (req.request == "GET" && (req.url ~ "^/static" || (req.http.cookie !~ "sessionid" && req.http.cookie !~ "csrftoken"))) {
remove req.http.Cookie;
}
# normalize accept-encoding to account for different browsers
# see: https://www.varnish-cache.org/trac/wiki/VCLExampleNormalizeAcceptEncoding
if (req.http.Accept-Encoding) {
if (req.http.Accept-Encoding ~ "gzip") {
I managed to make Codeiniter work with HHVM, using
nginx as a proxy. My problem was that hhvm has problems
with path_info, so I was not able to run /index.php/controller/action or
/controller/action/params -> /index.php/controller/action.params.
I used nginx as a proxy to hhvm. I changed the way codeigniter process
the url. Steps bellow:
Cleaned my HHVM .hdf file:
Server {
@berendiwema
berendiwema / client.py
Created February 13, 2012 11:31 — forked from micktwomey/client.py
python multiprocessing socket server example
import socket
if __name__ == "__main__":
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("localhost", 9000))
data = "some data"
sock.sendall(data)
result = sock.recv(1024)
print result
sock.close()
mainproject.urls:
from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'knowmore_api.views.home', name='home'),
url(r'^v1/', include('knowmore_api.api.urls')),