Skip to content

Instantly share code, notes, and snippets.

@vpack
vpack / HAProxy.md
Last active August 29, 2015 14:22
Running Jenkins on port 80 (Using HAProxy)

###Install HAProxy

yum install haproxy

###Update Config file for frontend and backend.

  • No need to change 'global' and 'defaults' section.
  • Sample Config : /etc/haproxy/haproxy.cfg
@vpack
vpack / verifySSLCert
Created June 8, 2015 14:25
Verify SSL Cert for a Site
https://www.digicert.com/help/
@vpack
vpack / CentosAWSCLI.sh
Created March 18, 2015 19:32
CentOS AWS CLI Installation
sudo yum install wget
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
sudo pip install awscli
@vpack
vpack / sts.sh
Created March 13, 2015 12:30
sts
aws --profile lab sts assume-role --role-arn "arn:aws:iam::97492:role/master" --role-session-name vpack --duration-seconds 3600 --external-id "myNewCreds"
@vpack
vpack / while.sh
Created March 13, 2015 01:11
Bash while loop reference
while true; do ; echo 'VV' ; done
@vpack
vpack / AWSTagUpdate.sh
Created March 13, 2015 01:05
Update Expiry Date Tag
aws --profile lab --region us-east-1 ec2 create-tags --tags Key=ExpirationDate,Value=$(date +%Y-%m-%d -d '+ 30 day' ) --resources i-c8efc8e6 i-aa5a8581 i-4e56cc1e
@vpack
vpack / SSLCertUpload.md
Last active August 29, 2015 14:16
AWS SSL Cert Upload

Uploading Renewed SSL Certs to AWS :

  • Download SSL cert from service provider.
  • Note down the ELBs that are using that certificate. More often i see there are many ELBs that use the same Cert.
  • Update and run the script.
  • Login to AWS console and reattach the new cert to ELB
@vpack
vpack / CloudTrail2MongoDB.sh
Created March 13, 2015 00:11
Ingest CloudTrail files to MongoDB
for x in `find . -name "*.json.gz"` ; do zcat $x | jq .Records[] | mongoimport --collection cloudtrail --jsonArray ; done
@vpack
vpack / chefdkInstall.sh
Last active August 29, 2015 14:16
Chef dk install in Amazon Linux
curl -L https://www.opscode.com/chef/install.sh | bash
or
curl -L https://www.opscode.com/chef/install.sh | bash -s -- -v 11
rpm -Uvh https://opscode-omnibus-packages.s3.amazonaws.com/el/6/x86_64/chefdk-0.4.0-1.x86_64.rpm
mkdir /var/chef
cd /var/chef
yum -y install git
@vpack
vpack / file2fs.sh
Created March 4, 2015 14:10
Mounting a file as a filesystem
# Create a new file
dd if=/dev/zero of=my_fs bs=1M count=1024
Or
truncate -s 30M my_fs
# Check if the device is not already in use before using it
sudo losetup /dev/loop0
sudo losetup /dev/loop0 my_fs
# Make a file system and mount it