I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis
onto
the box and here's how I did it and some things to look
out for.
To install:
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# username@Machine ~/dev/dir[master]$ # clean working directory | |
# username@Machine ~/dev/dir[master*]$ # dirty working directory | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" |
# Greatest common divisor of 1 or more numbers. | |
from functools import reduce | |
def gcd(*numbers): | |
""" | |
Return the greatest common divisor of 1 or more integers | |
Examples | |
-------- |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
curl -XPUT localhost:9200/test -d ' | |
{"settings": { | |
"analysis" :{ | |
"analyzer": { | |
"exact_analyzer": { | |
"type": "custom", | |
"tokenizer":"my_pattern_tokenizer", | |
"filter":[] | |
} | |
}, |
#!/usr/bin/env bash | |
# Written by William Ting for the following blog post: | |
# http://williamting.com/posts/2012/04/18/set-up-python-and-django-on-dreamhost/ | |
rcfile="${HOME}/.bashrc" | |
version="2.7.3" | |
setuptools_version="2.7" | |
tmp_dir="${HOME}/tmp-${RANDOM}" | |
if [[ ${#} == 0 ]]; then |
You'll want to login using an official Google account (i.e. if this is for your company, use the comapany Gmail account vs. a personal one.)
When logging in, you might be prompted to verify the account; if so, enter your cell number to get a verification e-mail or phone call.
Once verified, you'll have to agree to the terms of service; do that, and click continue.
import glob | |
import inspect | |
import os | |
import re | |
import unittest | |
# http://superuser.com/a/748264/43406. NOTE ^ in front for negation | |
_unsafe_filename_regex = re.compile('([^\[\]\.0-9a-zA-Z-,;_])') | |