$ add-apt-repository ppa:duggan/bats --yes
gpg: keyring `/tmp/tmp_ijpu6ti/secring.gpg' created
gpg: keyring `/tmp/tmp_ijpu6ti/pubring.gpg' created
gpg: requesting key 5F28EA3F from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp_ijpu6ti/trustdb.gpg: trustdb created
gpg: key 5F28EA3F: public key "Launchpad PPA for Ross Duggan" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
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 | |
usage() { | |
echo "Usage: $(basename $0) -e|--elb ELB_NAME -t|--target TARGET | |
-e|--elb elb name | |
-t|--target target protocol (http|tcp) | |
-h|--help show this help message and exit | |
" | |
exit 0 | |
} |
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 | |
TD_CONF=/etc/td-agent/td-agent.conf | |
# /usr/sbin/td-agent --user td-agent --group td-agent --dry-run -q --use-v1-config -c $TD_CONF | |
/usr/sbin/td-agent --user td-agent --group td-agent --dry-run -q -c $TD_CONF | |
STATUS=$? | |
IFS=$'\n' | |
for LINE in $(grep cmdline $TD_CONF); do | |
CONFIG_FILE=$(echo $LINE | sed -e 's/ */ /' | egrep -o "(-c|--config) (.+?)" | awk '{print $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
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'uri' | |
require 'json' | |
uri = URI.parse('http://127.0.0.1:8500/v1/status/leader') | |
http = Net::HTTP.new(uri.host, uri.port) | |
res = http.start { |
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
# https://gist.github.com/tkuchiki/543e277a2f7221a7833a | |
yum install -y bison |
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
curl -L -O http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz | |
tar zxf autoconf-2.69.tar.gz | |
cd autoconf-2.69 | |
yum install -y openssl-devel | |
./configure | |
make && make install |
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
##### setup start | |
BATS_TEST_NAME: test_example_status_and_output-2c_lines | |
BATS_TEST_FILENAME: /home/bats/test.bats | |
BATS_TEST_DIRNAME: /home/bats | |
BATS_TEST_NAMES: test_example_status_and_output-2c_lines | |
BATS_TEST_DESCRIPTION: example status and output, lines | |
BATS_TEST_NUMBER: 1 | |
BATS_TMPDIR: /tmp | |
##### setup end | |
example 1 |
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 | |
usage() { | |
echo "Usage: $(basename $0) -v|--value VALUE -k|--key KEY [--min MIN] [--max MAX] [-l|--log LOG] | |
-v, --value find value (grep pattern) | |
-k, --key find key (grep pattern) | |
-l, --log log file path | |
--min min response time | |
--max max response time | |
" |