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/env python | |
"""Export environment variables for AWS cli w/MFA. | |
eval $(aws-session-env.py $1) | |
""" | |
import argparse | |
import os | |
import boto3 |
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/env ruby | |
# use ./lpv.rb logstash_version plugin_name | |
# | |
# example: | |
# % ./lpv.rb 5.2.0 logstash-output-elasticsearch | |
# logstash-output-elasticsearch 6.2.4 https://github.com/logstash-plugins/logstash-output-elasticsearch/tree/v6.2.4 | |
require 'net/http' |
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 | |
KAFKA_URL='http://mirror.cogentco.com/pub/apache/kafka/0.8.2.1/kafka_2.10-0.8.2.1.tgz' | |
KAFKA_HOME='/tmp/kafka-es' | |
DATA_DIR_KAFKA='/tmp/kafka-logs' | |
DATA_DIR_ZOOKEEPER='/tmp/zookeeper' | |
ZOOKEEPER_PID=$KAFKA_HOME/zookeeper.pid | |
KAFKA_PID=$KAFKA_HOME/kafka.pid | |
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
require "benchmark/ips" | |
require "granola" | |
require "json" | |
require "msgpack" | |
require "multi_json" | |
require "oj" | |
require "yajl" | |
User = Struct.new(:name, :age) |
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 | |
KAFKA_URL='http://mirror.cogentco.com/pub/apache/kafka/0.8.2.1/kafka_2.10-0.8.2.1.tgz' | |
KAFKA_HOME='/tmp/kafka-es' | |
DATA_DIR_KAFKA='/tmp/kafka-logs' | |
DATA_DIR_ZOOKEEPER='/tmp/zookeeper' | |
ZOOKEEPER_PID=$KAFKA_HOME/zookeeper.pid | |
KAFKA_PID=$KAFKA_HOME/kafka.pid | |
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
# needs a repos variable with a list of organization/plugin items | |
echo "repository,last_tag,commits_ahead_master,changes_against_master" | |
for repo in "${repos[@]}"; do | |
last_tag=`curl -u "$CREDENTIALS" -s https://api.github.com/repos/$repo/tags | jq -r ".[0].name"` | |
if [ $last_tag == "null" ]; then | |
continue | |
fi | |
ahead_commits=`curl -u "$CREDENTIALS" -s https://api.github.com/repos/$repo/compare/$last_tag...master | jq -r ".ahead_by"` | |
if [ $ahead_commits != "null" ] && [ "$ahead_commits" -gt 0 ]; 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
" run command | |
" no stdin | |
" output displayed in "Press enter to continue" style | |
" current buffer untouched | |
:!uptime | |
" run command | |
" pipe range of text to command on stdin | |
" output replaces the range in the current buffer | |
:RANGE!grep foo |
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
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source. | |
# Will include all hosts the playbook is run on. | |
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html | |
- name: "Build hosts file" | |
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present | |
when: hostvars[item].ansible_default_ipv4.address is defined | |
with_items: groups['all'] |
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
# file for pressed | |
# password is empty | |
percona-server-server-5.6 percona-server-server/root_password password | |
percona-server-server-5.6 percona-server-server/root_password_again password | |
# playbook | |
--- |
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
- name: Group by Distribution | |
hosts: all | |
tasks: | |
- group_by: key=${ansible_distribution} | |
- name: Set Time Zone | |
hosts: Ubuntu | |
gather_facts: False | |
tasks: | |
- name: Set timezone variables |
NewerOlder