This file contains hidden or 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/bash | |
CONSUL_VERSION=${CONSUL_VERSION:-0.4.1} | |
source /etc/environment | |
name=$(cat /etc/machine-id) | |
if [ ! -f /opt/consul ]; then | |
[ -d /opt ] || mkdir /opt | |
mkdir /var/lib/consul | |
wget -q -O- https://dl.bintray.com/mitchellh/consul/${CONSUL_VERSION}_linux_amd64.zip | funzip - > /opt/consul |
This file contains hidden or 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
nabeken@miyo ~ % dig d36cz9buwru1tt.cloudfront.net | |
; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> d36cz9buwru1tt.cloudfront.net | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62732 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 8, AUTHORITY: 0, ADDITIONAL: 0 | |
;; QUESTION SECTION: | |
;d36cz9buwru1tt.cloudfront.net. IN A |
This file contains hidden or 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 python | |
import json | |
import os | |
import shutil | |
import subprocess | |
import re | |
dockerdir = '/var/lib/docker' | |
volumesdir = os.path.join(dockerdir, 'volumes') |
This file contains hidden or 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
jenkinsvol: | |
image: nabeken/docker-volume-container-rsync | |
environment: | |
OWNER: 102 | |
GROUP: 106 | |
ports: | |
- "10873:873" | |
jenkins: | |
image: jenkins |
This file contains hidden or 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
Src: 2400:6180:0:d0::25:XXXX/64 | |
traceroute to orange.kame.net (2001:200:dff:fff1:216:3eff:feb1:44d7) from 2400:6180:0:d0::25:1001, 30 hops max, 24 byte packets | |
1 2400:6180:0:d0:ffff:ffff:ffff:fff2 (2400:6180:0:d0:ffff:ffff:ffff:fff2) 595.557 ms 0.323 ms 1.055 ms | |
2 2400:6180::601 (2400:6180::601) 0.45 ms 0.228 ms 0.198 ms | |
3 10gigabitethernet1-1.core1.sin1.he.net (2001:de8:4::6939:1) 4.201 ms 0.871 ms 0.86 ms | |
4 10ge10-8.core1.par2.he.net (2001:470:0:2df::1) 184.934 ms 187.81 ms 179.406 ms | |
5 100ge7-1.core1.lon2.he.net (2001:470:0:2ce::1) 222.892 ms 193.384 ms 211 ms | |
6 ge-0.linx.londen03.uk.bb.gin.ntt.net (2001:7f8:4::b62:1) 181.468 ms 181.451 ms 181.486 ms | |
7 ae-0.r23.londen03.uk.bb.gin.ntt.net (2001:728:0:2000::116) 181.86 ms 181.795 ms 181.742 ms |
This file contains hidden or 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/bash | |
# wait for docker ready | |
sleep 10 | |
FIRST=$(/sbin/ifconfig eth0 | grep -i global | awk '{ print $3 }' | cut -d":" -f1-4) | |
SECOND=$(/sbin/ifconfig eth0 | grep -i global | cut -d":" -f6,7,8,9 | cut -d"/" -f1) | |
IPV6=${FIRST}:a${SECOND} | |
for SUFFIX in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do | |
ip -6 route add "${IPV6}${SUFFIX}"/128 dev docker0 |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"html/template" | |
"io" | |
"log" | |
"net" | |
"net/http" | |
"time" |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
) | |
type Fetcher interface { | |
// Fetch returns the body of URL and | |
// a slice of URLs found on that page. | |
Fetch(url string) (body string, urls []string, err error) |
This file contains hidden or 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
package main | |
import "code.google.com/p/go-tour/tree" | |
import "fmt" | |
// Walk walks the tree t sending all values | |
// from the tree to the channel ch. | |
// FIXME: In this way how to close a channel when function returns the last value to terminate a loop | |
func Walk2(t *tree.Tree, ch chan int) { | |
if t.Left != nil { |
This file contains hidden or 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
require 'chef/knife' | |
module KnifeSolo | |
module NodeConfigCommand | |
def node_config | |
Pathname.new(@name_args[1] || "#{nodes_path}/#{node_name}/node.json") | |
end | |
end | |
end |