Ubuntu 12.10 setup (rbenv/RVM, Janus, PostgreSQL)
- Some utilities:
sudo apt-get install vim tmux git curl
- Copy/paste from the command line:
[buildout] | |
parts = nodejs nodejs-bin | |
versions = versions | |
[versions] | |
mongodb = 1.8.1 | |
[nodejs] | |
recipe = zc.recipe.cmmi | |
url = http://nodejs.org/dist/v0.6.16/node-v0.6.16.tar.gz |
sudo apt-get install vim tmux git curl
# http://flask.pocoo.org/mailinglist/archive/2012/4/10/serving-static-file-from-a-separate-domain-in-production/ | |
from flask import Flask, url_for | |
# Uncomment to set server name. | |
# SERVER_NAME = 'mianos.com' | |
app = Flask(__name__, static_folder=None) | |
app.config.from_object(__name__) | |
app.add_url_rule('/<path:filename>', endpoint='static', |
[client] | |
default-character-set = utf8 | |
socket = /tmp/mysql.sock | |
[mysqld] | |
#skip-grant-tables | |
max_sp_recursion_depth = 255 | |
socket = /tmp/mysql.sock | |
tmpdir = /opt/tmp |
""":mod:`hstore` --- Using PostgreSQL hstore with SQLAlchemy | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
.. note:: | |
I released it under Public Domain. Feel free to use! | |
It provides :class:`Hstore` type which makes you to store Python | |
dictionaries into hstore columns in PostgreSQL. For example:: |
from gevent import monkey, Greenlet | |
from gevent.queue import Queue, Empty | |
from gevent.pywsgi import WSGIServer | |
import gevent | |
monkey.patch_all() | |
from geventwebsocket.handler import WebSocketHandler | |
from pyramid.config import Configurator | |
from pyramid.view import view_config |
#!/usr/bin/python | |
import os | |
import sys | |
def listdir(d): | |
if not os.path.isdir(d): | |
print d | |
else: | |
for item in os.listdir(d): | |
listdir((d + '/' + item) if d != '/' else '/' + item) |
# to use this gist execute: $ rm -f 1506695 && wget https://raw.github.com/gist/1506695 && sh 1506695 | |
# refs to http://www.alfajango.com/blog/how-to-monitor-your-railspassenger-app-with-munin/ | |
echo "Installing munin..." | |
sudo apt-get install munin munin-node -y | |
echo ; | |
echo "Removing previous links for passenger_status and passenger_memory_stats..." | |
sudo rm /etc/munin/plugins/passenger_memory_stats | |
sudo rm /etc/munin/plugins/passenger_status |
# download and untar nginx | |
wget -O /tmp/nginx.tar.gz http://www.nginx.org/download/nginx-1.0.11.tar.gz | |
tar xzvf /tmp/nginx.tar.gz | |
rm /tmp/nginx.tar.gz | |
# download and untar extra modules | |
wget -O /tmp/nginx-echo-module.tar.gz https://github.com/agentzh/echo-nginx-module/tarball/v0.38rc1 | |
tar xzvf /tmp/nginx-echo-module.tar.gz | |
rm /tmp/nginx-echo-module.tar.gz |
#!/usr/bin/python | |
# | |
# git-slim | |
# | |
# Remove big files from git repo history. | |
# | |
# Requires GitPython (https://github.com/gitpython-developers/GitPython) | |
# | |
# References: | |
# - http://help.github.com/remove-sensitive-data/ |