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
#!/bin/sh | |
# btsync service | |
# Replace with linux users you want to run BTSync clients for | |
BTSYNC_USERS="mendel" | |
DAEMON=/usr/bin/btsync | |
start() { | |
for btsuser in $BTSYNC_USERS; do | |
HOMEDIR=`getent passwd $btsuser | cut -d: -f6` | |
config=$HOMEDIR/.sync/config.json |
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
#!/usr/bin/env bash | |
# This hook is run after a new virtualenv is activated. | |
# ~/.virtualenvs/postmkvirtualenv | |
# determine if virtualenv is activated | |
python -c 'import sys; print(sys.real_prefix)' 2>/dev/null && INVENV=1 || INVENV=0 | |
if [ ! $INVENV == 1 ]; then | |
echo "You must activate a virtualenv for this to work." | |
exit -1 | |
fi |
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
worker_processes 2; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
use epoll; | |
} | |
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
install | |
# Ridiculous URL... I know... | |
url --url http://nl.archive.ubuntu.com/ubuntu/ubuntu/ubuntu/ubuntu/ubuntu/ | |
text | |
lang en_US | |
langsupport en_US | |
keyboard es | |
#rootpw pa$$word # you should replace, and use --iscrypted |
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
#### Start IPython, generate SHA1 password to use for IPython Notebook server | |
$ ipython | |
Python 2.7.5 |Anaconda 1.8.0 (x86_64)| (default, Oct 24 2013, 07:02:20) | |
Type "copyright", "credits" or "license" for more information. | |
IPython 1.1.0 -- An enhanced Interactive Python. | |
? -> Introduction and overview of IPython's features. | |
%quickref -> Quick reference. | |
help -> Python's own help system. |
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
import colorsys | |
def hex_to_rgb(hex_str): | |
"""Returns a tuple representing the given hex string as RGB. | |
>>> hex_to_rgb('CC0000') | |
(204, 0, 0) | |
""" | |
if hex_str.startswith('#'): | |
hex_str = hex_str[1:] |
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
''' | |
Non-parametric computation of entropy and mutual-information | |
Adapted by G Varoquaux for code created by R Brette, itself | |
from several papers (see in the code). | |
These computations rely on nearest-neighbor statistics | |
''' | |
import numpy as np |
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
""" | |
Some python code for | |
Markov Chain Monte Carlo and Gibs sampling | |
by Bruce Walsh | |
""" | |
import numpy as np | |
import numpy.linalg as npla |
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
# Written by Brendan O'Connor, brenocon@gmail.com, www.anyall.org | |
# * Originally written Aug. 2005 | |
# * Posted to gist.github.com/16173 on Oct. 2008 | |
# Copyright (c) 2003-2006 Open Source Applications Foundation | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# |
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
import logging | |
# prints to stdout | |
FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' | |
logging.basicConfig(format=FORMAT) | |
log = logging.getLogger(__file__) | |
log.setLevel(logging.DEBUG) | |
# prints log to stdout and also saves to specified log file | |
log = logging.getLogger('my_logfile') |
OlderNewer