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 | |
GROUP=worker | |
IDS=$(aws autoscaling describe-auto-scaling-groups \ | |
--auto-scaling-group-name $GROUP \ | |
--query AutoScalingGroups[].Instances[].InstanceId \ | |
--output text) | |
aws ec2 describe-instances \ | |
--instance-ids $IDS \ | |
--query Reservations[].Instances[].PrivateIpAddress \ |
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
class Node: | |
def __init__(self, value, next): | |
self.value = value | |
self.next = next | |
def dump(self): | |
print self.value | |
if self.next is not None: | |
self.next.dump() |
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" | |
"reflect" | |
) | |
type Foo struct { | |
FirstName string `tag_name:"tag 1"` | |
LastName string `tag_name:"tag 2"` |
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 -eux | |
curl http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key | sudo apt-key add - | |
sudo curl -o /etc/apt/sources.list.d/mosquitto-repo.list -L http://repo.mosquitto.org/debian/mosquitto-jessie.list | |
sudo apt-get update | |
sudo apt-get install mosquitto |
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 -eux | |
gm convert -font helvetica -fill blue -pointsize 36 -draw "text 15,50 'hello'" source.jpg destination.jpg |
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/sh | |
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264 | |
if [ "`/usr/bin/whoami`" != "root" ]; then | |
echo "You need to execute this script as root." | |
exit 1 | |
fi | |
cat > /etc/yum.repos.d/centos.repo<<EOF |
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 -eux | |
curl -Os https://storage.googleapis.com/kubernetes-release/release/v1.1.8/bin/linux/amd64/kubectl | |
chmod +x kubectl | |
./kubectl version --client |
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 -eux | |
function has-space { | |
[[ "$1" != "${1%[[:space:]]*}" ]] && return 0 || return 1 | |
} | |
if has-space "sadfsdf" ; then | |
echo "SPACE" | |
fi |
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 -eux | |
ARCH=${ARCH:-linux} | |
K8S_VER=${K8S_URL:-v1.1.8} | |
K8S_URL=https://storage.googleapis.com/kubernetes-release/release | |
curl -Lo /usr/local/bin/kubectl ${K8S_URL}/${K8S_VER}/bin/$ARCH/amd64/kubectl | |
chmod +x /usr/local/bin/kubectl |
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
$ gsutil ls -R gs://kubernetes-release/release/v1.2.0 | sed 's|gs://kubernetes-release|https://storage.googleapis.com/kubernetes-release|; /^.*:$/d; /^$/d' | |
https://storage.googleapis.com/kubernetes-release/release/v1.2.0/kubernetes-client-darwin-386.tar.gz | |
https://storage.googleapis.com/kubernetes-release/release/v1.2.0/kubernetes-client-darwin-386.tar.gz.md5 | |
https://storage.googleapis.com/kubernetes-release/release/v1.2.0/kubernetes-client-darwin-386.tar.gz.sha1 | |
https://storage.googleapis.com/kubernetes-release/release/v1.2.0/kubernetes-client-darwin-amd64.tar.gz | |
https://storage.googleapis.com/kubernetes-release/release/v1.2.0/kubernetes-client-darwin-amd64.tar.gz.md5 | |
https://storage.googleapis.com/kubernetes-release/release/v1.2.0/kubernetes-client-darwin-amd64.tar.gz.sha1 | |
https://storage.googleapis.com/kubernetes-release/release/v1.2.0/kubernetes-client-linux-386.tar.gz | |
https://storage.googleapis.com/kubernetes-release/release/v1.2.0/kubernetes-client-linux-386.tar.gz.md5 | |
https://storage.googleapis.com/kub |