Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
import socket | |
if __name__ == "__main__": | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.connect(("localhost", 9000)) | |
data = "some data" | |
sock.sendall(data) | |
result = sock.recv(1024) | |
print result | |
sock.close() |
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
""" | |
Usage: %prog [width [columns]] < table.csv | |
Pretty-print CSV file with fixed width columns. | |
Arguments: |
import string | |
def make_color_tuple( color ): | |
""" | |
turn something like "#000000" into 0,0,0 | |
or "#FFFFFF into "255,255,255" | |
""" | |
R = color[1:3] | |
G = color[3:5] | |
B = color[5:7] |
FROM ubuntu | |
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list | |
RUN apt-get update | |
RUN apt-get upgrade | |
RUN apt-get install -y openssh-server supervisor | |
ADD sshd.conf /etc/supervisor/conf.d/sshd.conf | |
RUN mkdir -p /var/run/sshd |
FROM ubuntu | |
MAINTAINER Dustin Sallings "dustin@spy.net" | |
ADD http://cbfs-ext.hq.couchbase.com/couchbase-dist/couchbase-server-enterprise_2.2.0_x86_64.deb /tmp/couchbase-server-enterprise_2.2.0_x86_64.deb | |
RUN apt-get update | |
RUN apt-get install -y librtmp0 python-httplib2 | |
RUN dpkg -i /tmp/couchbase-server-enterprise_2.2.0_x86_64.deb | |
RUN rm /tmp/couchbase-server-enterprise_2.2.0_x86_64.deb | |
RUN /etc/init.d/couchbase-server stop |
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
import os | |
parent_pid = os.getpid() | |
print "[parent] starts PID: %d" % (parent_pid, ) | |
forked_pid = os.fork() | |
if forked_pid == 0: | |
print "[child] child process can't use os.fork() PID, since it's %d" % (forked_pid, ) | |
print "[child] but it can reevaluate os.getpid() to get it's own PID: %d" % (os.getpid(), ) | |
else: |
FROM ubuntu:precise | |
MAINTAINER Bohdan Mushkevych | |
# Installing Oracle JDK | |
RUN apt-get -y install python-software-properties ;\ | |
add-apt-repository ppa:webupd8team/java ;\ | |
apt-get update && apt-get -y upgrade ;\ | |
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections ;\ | |
apt-get -y install oracle-java7-installer && apt-get clean ;\ | |
update-alternatives --display java ;\ |