# Pull the necessary images:
docker pull nathanleclaire/curl:latest
docker pull openjdk:8u111-jre-alpine
# Start the controller container, note that it has RW access to the Docker API socket:
docker run \
-ti \
--rm \
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
# Convert Treasury price to decimal in python | |
# calculating US treasury pricing in python | |
def treasury_to_decimal(price): | |
""" | |
Converts a treasury priced in 32nds into a decimal. This works for | |
treasurys priced up to 3dp i.e. "99-126" | |
""" | |
price_split = price.split("-") | |
integer_part = int(price_split[0]) |
This gist will drive you through creating a Docker 1.12 Swarm cluster (with Swarm mode) on AWS infrastructure.
You need a few things already prepared in order to get started. You need at least Docker 1.12 set up. I was using the stable version of Docker for mac for preparing this guide.
$ docker --version
Docker version 1.12.0, build 8eab29e
You also need Docker machine installed.
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
from functional import seq # PyFunctional | |
from itertools import product | |
def all_kmers(k): | |
'''return list of all dna carthesien products of length k''' | |
all = list(product('ACGT', repeat=k)) | |
return seq(all).map(lambda x: ''.join(x)).to_list() | |
def kmer_per_segment(dna_segment, k): | |
'''return all the dna substrings of length k of the different dna strings in dna list''' |
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
input { | |
tcp { | |
type => "syslog" | |
host => "127.0.0.1" | |
port => 3514 | |
} | |
tcp { | |
type => "eventlog" | |
host => "10.1.1.2" | |
port => 3515 |
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
{ | |
"config": { | |
"chainId": 88888, | |
"homesteadBlock": 0, | |
"eip155Block": 0, | |
"eip158Block": 0 | |
}, | |
"coinbase" : "0x0000000000000000000000000000000000000000", | |
"difficulty" : "0x1", | |
"extraData" : "0x00", |
This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)
Sister Document - Restore MySQL from Amazon S3 - read that next
this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc
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
// How to connect 5 publishers with 5 subscribers | |
// over TCP using ZeroMQ's XPUB/XSUB proxy. | |
// sub (connect) | |
// <-8701-> | |
// (bind) xpub <---> xsub (bind) | |
// <-8700-> | |
// (connect) pub | |
var zmq = require('zmq'); |
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 java.io.IOException; | |
import java.net.URL; | |
import java.util.Date; | |
import java.util.List; | |
import java.util.logging.Level; | |
import org.json.*; | |
import org.openqa.selenium.*; | |
import org.openqa.selenium.chrome.*; | |
import org.openqa.selenium.logging.*; |
As configured in my dotfiles.
start new:
tmux
start new with session name:
NewerOlder