This is a mini-HOWTO for setting up Linux Containers (LXC) on Ubuntu. This guide focuses on the creation of a web server with good process isolation and firewalling.
apt-get install lxc
def run(content): | |
content = content.replace("<pre>","<textile-pre>").replace("</pre>","</textile-pre>") | |
content = textile.textile(content) | |
content = content.replace("<textile-pre>","<pre>").replace("</textile-pre>","</pre>") | |
return content |
# This is a test case to describe a bug I'm seeing in PyPy 1.5. I have | |
# a Cache object that is a dictionary that supports lookup via regular | |
# attribute access. For instance: | |
# | |
# >>> c = Cache() | |
# >>> c["asdf"] = "asdf" | |
# >>> c.asdf == c["asdf"] | |
# True | |
# | |
# When looking up keys via attribute, PyPy 1.5 calls __getitem__ |
app.register_blueprint(view.contact, url_prefix="/contact") |
// ==UserScript== | |
// @name ProofreadNOW alert | |
// @namespace enigmacurry.com | |
// @description Alert when a new job comes in | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js | |
// @include https://secure.proofreadnow.com/index2.html?* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== |
def grep(pattern, file_obj, include_line_nums=False): | |
grepper = re.compile(pattern) | |
for line_num, line in enumerate(file_obj): | |
if grepper.search(line): | |
if include_line_nums: | |
yield (line_num, line) | |
else: | |
yield line |
# Just a test to see how Eliptic Curve DSA works in Bitcoin. | |
# This isn't production code, this was an exploratory process simply | |
# for me to learn about it. | |
def egcd(a, b): | |
if a == 0: | |
return (b, 0, 1) | |
else: | |
g, y, x = egcd(b % a, a) | |
return (g, x - (b // a) * y, y) |
function jc { | |
host=$1 | |
proxy_host="$1 -p 22" | |
# Find just the hostname (if specified as user@host): | |
host=`echo $host | sed 's/.*@//'` | |
jmxport=7199 | |
proxy_port=${2:-8123} |
from org.apache.cassandra.dht import Murmur3Partitioner | |
from org.apache.cassandra.utils import ByteBufferUtil | |
from java.lang import Integer | |
p = Murmur3Partitioner() | |
int_token = p.getToken(ByteBufferUtil.bytes(Integer(10))) | |
string_token = p.getToken(ByteBufferUtil.bytes("asdf")) |
Verifying that +enigmacurry is my Bitcoin username. You can send me #bitcoin here: https://onename.io/enigmacurry |