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
#!/bin/bash | |
exec 3<"$0" | |
flock -s 3 | |
for (( i=0; i<5; i++ )); do | |
( | |
sleeptime=$(( RANDOM % 6 )) | |
echo $(date) - $BASHPID sleeping $sleeptime | |
sleep $sleeptime |
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
#!/bin/bash | |
eval "$(go env)" | |
function clean_gopath() { | |
gopath="$1" | |
pkgpath="$gopath/pkg/${GOHOSTOS}_$GOHOSTARCH" | |
if [[ ! -e "$pkgpath" ]]; then | |
return | |
fi |
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
#!/bin/bash | |
docker=docker | |
docker=/home/phemmer/git/docker/bundles/latest/dynbinary/docker | |
cd $(mktemp -d) | |
cat > entrypoint.sh <<'EOF' | |
#!/bin/sh | |
cp /etc/resolv.conf /etc/resolv.conf.orig |
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
#!/bin/bash | |
docker=docker | |
cd $(mktemp -d) | |
cat > entrypoint.sh <<'EOF' | |
#!/bin/sh | |
cp /etc/resolv.conf /etc/resolv.conf.orig | |
echo "nameserver 127.0.0.1" > /etc/resolv.conf |
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/ruby | |
require 'rack' | |
require 'rack/server' | |
class HelloWorld | |
def response | |
[200, {}, 'Hello World'] | |
end | |
end |
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
#!/bin/bash | |
sed -i -e 's# --cloud-provider=aws##' /etc/systemd/system/kubelet.service | |
sed -i -e 's#ExecStart=/usr/bin/kubelet #ExecStart=/usr/bin/kubelet --cloud-provider=aws #' /etc/systemd/system/kubelet.service | |
systemctl daemon-reload | |
systemctl restart kubelet.service |
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
#!/bin/bash | |
set -e | |
. /run/coreos-kubernetes/options.env | |
: ${K8S_VER:=latest} | |
curl -s https://storage.googleapis.com/kubernetes-release/release/$K8S_VER/bin/linux/amd64/kubelet > /tmp/kubelet | |
mkdir -p /opt | |
install -m 0755 /tmp/kubelet /opt/kubelet-$K8S_VER |
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
package main | |
import ( | |
"testing" | |
) | |
var MyArray = [100]int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99} | |
var MyVar int | |
func BenchmarkArray(b *testing.B) { |
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
/* | |
Usage: go run main.go < /path/to/private-key.xml | |
Optionally takes base64 encoded input. | |
This is a very crude implementation. Any errors result in a panic. | |
*/ | |
package main | |
import ( |
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
package main | |
import ( | |
"crypto/md5" | |
"crypto/sha1" | |
"crypto/sha256" | |
"fmt" | |
"hash/crc32" | |
"testing" | |
) |