Skip to content

Instantly share code, notes, and snippets.

@vpack
vpack / shareAMI.sh
Created February 2, 2016 02:09
Sharing AWS AMIs with other AWS accounts
touch ~/.boto
rm ~/.boto
AMI=ami-284d6242
accounts="1 2 3 4 5"
echo "Current permissions :"
aws ec2 --region us-east-1 describe-image-attribute --image-id $AMI --attribute launchPermission
for act in $accounts
@vpack
vpack / Jenkins Private Repo.md
Created January 29, 2016 23:39
Jenkins - Private Repo Config

Generate Keys

$ ssh-keygen -f ~/.ssh/bitbucket.pem

Files bitbucket.pem and bitbucket.pem.pub will be generated.

Load this bitbucket.pem.pub key as a deploy key to your bitbucket repo.

@vpack
vpack / solo.md
Created January 29, 2016 22:29
Installing to local server via chef-Solo
# cat solo.rb 
cookbook_path "/tmp/cookbooks"

# cat runlist.json 
{
"run_list" : [ "recipe[haproxy]" ]
}
@vpack
vpack / HAProxy Frontend Config.txt
Created January 19, 2016 15:18
Jenkins - HAProxy Frontend Config
#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Global settings
@vpack
vpack / filebeat.md
Last active January 20, 2016 20:34
Filebeat testing

filebeatTest.sh

CONF="/tmp/f.yml"
cat << EOF >> $CONF
filebeat:
  registry_file: "/var/lib/filebeat/registry"
  prospectors:
    - 
      paths:
@vpack
vpack / athi.md
Created January 2, 2016 04:13
athi

test

@vpack
vpack / tricks.sh
Last active January 20, 2016 00:59
Tips and Tricks
# remove non-ascii character from a file.
tr -cd '\11\12\15\40-\176' < file-with-binary-chars > clean-file
==
yum install sysstat
mpstat -P ALL
sar -u 2 5
nohup sar -o output.file 12 8 >/dev/null 2>&1 &
iostat -xtc 5 3
@vpack
vpack / consul.json
Last active December 28, 2015 18:30
Consul Client agent installation
{
"acl_token": "anonymous",
"client_addr": "0.0.0.0",
"data_dir": "/var/lib/consul",
"datacenter": "sbox-us-east",
"enable_syslog": true,
"encrypt": "x==",
"log_level": "INFO",
"ports": {
"dns": 8600,
@vpack
vpack / ecr.md
Last active December 24, 2015 12:33
ECR - Docker Registry
$ aws --profile ssnp --region us-east-1 ecr get-login
docker login -u AWS -p <PEM Text> -e none https://xxxx8739xxxx.dkr.ecr.us-east-1.amazonaws.com

Docker saves config in '/root/.docker/config.json'

@vpack
vpack / gist:06233bab527bb1361b71
Created December 8, 2015 03:08
Jenkins Docker tutorials
Reference:
- http://live-rg-engineering.pantheon.io/news/jenkins-docker-proxies-and-compose
- https://engineering.riotgames.com/news/putting-jenkins-docker-container