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/sh | |
# | |
# Copyright (c) 2007 Javier Fernandez-Sanguino <[email protected]> | |
# | |
# This is free software; you may redistribute it and/or modify | |
# it under the terms of the GNU General Public License as | |
# published by the Free Software Foundation; either version 2, | |
# or (at your option) any later version. | |
# | |
# This is distributed in the hope that it will be useful, but |
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
2016/07/21 15:30:18 [DEBUG] terraform-provider-aws: Action=DescribeAutoScalingGroups&AutoScalingGroupNames.member.1=<redacted>&Version=2011-01-01 | |
2016/07/21 15:30:18 [DEBUG] terraform-provider-aws: ----------------------------------------------------- | |
2016/07/21 15:30:19 [DEBUG] terraform-provider-aws: 2016/07/21 15:30:19 [DEBUG] [aws-sdk-go] DEBUG: Response autoscaling/DescribeAutoScalingGroups Details: | |
2016/07/21 15:30:19 [DEBUG] terraform-provider-aws: ---[ RESPONSE ]-------------------------------------- | |
2016/07/21 15:30:19 [DEBUG] terraform-provider-aws: HTTP/1.1 200 OK | |
2016/07/21 15:30:19 [DEBUG] terraform-provider-aws: Connection: close | |
2016/07/21 15:30:19 [DEBUG] terraform-provider-aws: Transfer-Encoding: chunked | |
2016/07/21 15:30:19 [DEBUG] terraform-provider-aws: Content-Type: text/xml | |
2016/07/21 15:30:19 [DEBUG] terraform-provider-aws: Date: Thu, 21 Jul 2016 22:30:19 GMT | |
2016/07/21 15:30:19 [DEBUG] terraform-provider-aws: Vary: Accept-Encoding |
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 | |
# Place this file in your /usr/local/bin and then use darn instead of calling yarn | |
# This will wrap all your yarn calls to go through the same network mutex | |
# Calling yarn as before still works too if needed. | |
# --- Motivation --- | |
# Running multiple build jobs on CI servers like Jenkins will cause contention of | |
# shared yarnpkg resources (cache). This is going to end up badly for builds going | |
# out for deployment. This problem is usually not seen locally because devs rarely build |
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/python | |
# Quick and dirty script to kill containers older than some number of minutes | |
# Kills all containers older than 60 minutes by default! | |
import sys | |
import subprocess | |
from sets import Set | |
CMD_DOCKER_CONTAINERS_WITH_AGE = 'docker ps -a --format "{{.ID}} {{.Status}}"' |
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 | |
sudo apt-get update | |
sudo apt-get install -y \ | |
linux-image-extra-$(uname -r) \ | |
linux-image-extra-virtual | |
sudo apt-get install -y \ | |
apt-transport-https \ |
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 | |
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/ | |
# | |
ARGS=2 | |
E_BADARGS=99 | |
if [ $# -ne $ARGS ] # correct number of arguments to the script; | |
then |
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
# send 10% traffic | |
http-request set-header Host foo.bar.com if { rand(10) eq 0 } |
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 | |
CMD="curl --write-out %{http_code} --silent --output /dev/null http://169.254.169.254/latest/meta-data/spot/termination-time" | |
while true | |
do | |
if [ "$(${CMD})" != "404" ]; then | |
# 2 minute warning received. Do all your cleanup work. | |
echo "2 minute termination warning. Draining nomad node..." | |
nomad node-drain -yes -self -enable | |
echo "Hasta la vista baby, I will be back" | |
break |
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
docker save <image> | bzip2 | pv | ssh user@host 'bunzip2 | docker load' | |
## Credits: https://stackoverflow.com/questions/23935141/how-to-copy-docker-images-from-one-host-to-another-without-via-repository |
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
ip route get 8.8.8.8 | awk '{print $NF; exit}' |
OlderNewer