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
#source: http://hints.macworld.com/article.php?story=201106020948369 | |
#disable | |
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist | |
#enable | |
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist | |
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
[buildout] | |
extensions = buildout.dumppickedversions | |
parts = | |
libevent | |
gevent | |
[gevent] | |
recipe = zc.recipe.egg:custom | |
include-dirs = ${libevent:location}/include | |
library-dirs = ${libevent:location}/lib |
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
[django-haystack] | |
location = django-haystack | |
recipe = zerokspot.recipe.git | |
repository = https://github.com/toastdriven/django-haystack.git | |
[xapian-haystack] | |
location = xapian-haystack | |
recipe = zerokspot.recipe.git | |
repository = https://github.com/notanumber/xapian-haystack.git |
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
from wsgiref.util import setup_testing_defaults, FileWrapper | |
from wsgiref.simple_server import make_server | |
import sys | |
from pprint import pprint | |
# A relatively simple WSGI application. It's going to print out the | |
# environment dictionary after being updated by setup_testing_defaults | |
def simple_app(environ, start_response): | |
setup_testing_defaults(environ) |
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
# extended version of | |
# | |
# http://mapbox.com/tilemill/docs/guides/osm-bright-mac-quickstart/ | |
# | |
# install PostgreSQL (fresh) | |
brew install postgresql | |
initdb /usr/local/var/postgres | |
mkdir -p ~/Library/LaunchAgents |
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
kworker is accounts for all kernel threads so you will also see high system CPU usage | |
In my case I've had nearly filled up BTRFS partition, so kernel was constantly searching for space. | |
tracing kernel - raw | |
``` | |
# echo l > /proc/sysrq-trigger | |
# dmesg | |
``` |
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
setup DISPLAY accordingly i.e. | |
export DISPLAY=:0 | |
import -window root file.png |
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
# from: http://matelakat.blogspot.co.uk/2012/03/lettuce-and-ipython-interactive-shell.html | |
# | |
@step(u'And give me IPython') | |
def and_continue_here(step): | |
import IPython | |
import sys | |
shell = IPython.InteractiveShell() | |
ip = IPython.core.ipapi.get() | |
p = IPython.core.debugger.Pdb(ip.colors) | |
p.reset() |
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
# recommended ntp pool (/etc/ntp.conf) | |
server 0.amazon.pool.ntp.org iburst | |
server 1.amazon.pool.ntp.org iburst | |
server 2.amazon.pool.ntp.org iburst | |
server 3.amazon.pool.ntp.org iburst | |
ntpq | |
> peers | |
check for connection prefixed with * | |
> as |
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
class DebugContext(object): | |
def __init__(self): | |
print self.__class__, "init" | |
def __enter__(self): | |
print self.__class__, "enter" | |
def __exit__(self, type, value, traceback): |