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
# Get latest Sun Java SDK in v6 from Oracle | |
wget http://download.oracle.com/otn-pub/java/jdk/6u31-b04/jdk-6u31-linux-x64-rpm.bin | |
# make it exec | |
chmod +x jdk-6u31-linux-x64-rpm.bin | |
# Install Java | |
sudo ./jdk-6u31-linux-x64-rpm.bin | |
# Check if the default java version is set to sun jdk |
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
vagrant@ubuntu-12:/docker-pub/redis$ cat base/2.8.1/Dockerfile | |
FROM ubuntu:12.10 | |
MAINTAINER James McKernan [email protected] | |
RUN apt-get update | |
RUN apt-get install -y build-essential | |
ADD redis-2.8.1.tar.gz redis-2.8.1.tar.gz | |
RUN tar xvfz redis-2.8.1.tar.gz | |
RUN cd redis-2.8.1 && make | |
RUN cd redis-2.8.1 && make install |
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 os | |
import sys | |
import context | |
def get_env_name(): | |
env = None #'dev' # the default | |
env = os.environ.get('ENV_NAME', env) | |
if env is None: | |
raise Exception("ENV_NAME=None") | |
env = env.lower() |
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 random | |
import itertools | |
x = [[random.randint(0, 100) for i in range(random.randint(1, 5))] for z in range(10)] | |
print x | |
def walk(seq): | |
for sub in itertools.izip_longest(*seq): | |
for i in sub: | |
if i is None: |
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
DATA = [ | |
[1, 2, 3], | |
[4, [5, 6], 7], | |
[[8, 9], 10, [11, 12, 13, 14]], | |
15, | |
[16, 17, [18, 19], 20] | |
] | |
def walk(data): | |
for el in data: |
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/python | |
# | |
import os | |
import sys | |
import argparse | |
import pygments | |
import pygments.lexers | |
import pygments.formatters |
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 conf | |
>>> srvs = map(dict, conf.get('chatservers')) | |
>>> from common import serverlock | |
>>> serverlock.lock_server(srvs) | |
{'lockport': 8070, 'lock': <socket._socketobject object at 0xb776cd4c>, 'host': 'alkime', 'logdir': 'log1'} | |
>>> |
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 conf | |
>>> conf.get('chatservers') | |
[{'lockport': 8080, 'host': $host, 'logdir': 'log0'}, {'lockport': 8070, 'host': $host, 'logdir': 'log1'}] | |
>>> conf.get('chatservers')[0]['host'] | |
'alkime' | |
>>> conf.get('host') | |
'alkime' | |
>>> from common import serverlock | |
>>> srvs = map(dict, conf.get('chatservers')) | |
>>> serverlock.lock_server(srvs) |
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
host: 'alkime' | |
chatservers: [ | |
{ | |
lockport : 8080 | |
logdir : 'log0' | |
host : $host | |
} | |
{ | |
lockport : 8070 | |
logdir : 'log1' |