Skip to content

Instantly share code, notes, and snippets.

View pindlebot's full-sized avatar

Ben Gardner pindlebot

View GitHub Profile
#!/usr/bin/bash env
export AWS_DEFAULT_REGION=us-east-1
SG="ec2-webserver-$(openssl rand 3 -hex)"
DEFAULT_SG=$(aws ec2 describe-security-groups --group-name default | jq -r '.SecurityGroups[0].GroupId')
SUBNET_ID=$(aws ec2 describe-subnets | jq -r '.Subnets[0].SubnetId')
KEY_NAME=$(aws ec2 describe-key-pairs | jq -r '.KeyPairs[0].KeyName')
INSTANCE_TYPE=t2.micro
IMAGE_ID=$(aws ssm get-parameters --names /aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2 --query 'Parameters[0].[Value]' --output text)
package main
import (
"bytes"
"fmt"
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/session"
#!/bin/bash
export PATH=$PATH:/usr/pgsql-10/bin/
cd /tmp
git clone https://github.com/michelp/pgjwt.git && cd pgjwt
make && make install
cd /tmp
git clone https://github.com/unshift/pg_gen_uid.git && cd pg_gen_uid
#!/bin/bash
DATE=`date +%m-%d-%Y`
HOSTNAME=$(curl http://169.254.169.254/latest/meta-data/public-hostname)
AWS_BUCKET=postgres-data
AWS_REGION=$(curl http://169.254.169.254/latest/dynamic/instance-identity/document|grep region|awk -F\" '{print $4}')
export PGUSER=postgres
pg_dumpall | aws --region $AWS_REGION s3 cp - "s3://$AWS_BUCKET/$HOSTNAME/$DATE.bak"
echo "Backup saved on $(date)"
#!/bin/bash
export PATH=$PATH:/usr/pgsql-10/bin/
export PGUSER=postgres
yum group install -y "Development Tools"
yum install -y openssl-devel
cd /tmp && git clone https://github.com/citusdata/citus.git
cd citus && ./configure
make
#!/bin/sh
touch /etc/yum.repos.d/google-chrome.repo
echo -e "[google-chrome]\nname=google-chrome\nbaseurl=http://dl.google.com/linux/chrome/rpm/stable/\$basearch\nenabled=1\ngpgcheck=1\ngpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub" >> /etc/yum.repos.d/google-chrome.repo
touch /etc/yum.repos.d/centos.repo
echo -e "[CentOS-base]\nname=CentOS-6 - Base\nmirrorlist=http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os\ngpgcheck=1\ngpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6\n\n" >> /etc/yum.repos.d/centos.repo
echo -e "#released updates\n[CentOS-updates]\nname=CentOS-6 - Updates\nmirrorlist=http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=updates\ngpgcheck=1\ngpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6\n\n" >> /etc/yum.repos.d/centos.repo
echo -e "#additional packages that may be useful\n[CentOS-extras]\nname=CentOS-6 - Extras\nmirrorlist=http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=extras\ngpgcheck=1\ngpgkey=http://mirror.centos.org/centos/
const chromeLauncher = require('chrome-launcher')
const DEFAULT_ARGS = [
'--disable-background-networking',
'--disable-background-timer-throttling',
'--disable-breakpad',
'--disable-client-side-phishing-detection',
'--disable-default-apps',
'--disable-dev-shm-usage',
'--disable-extensions',

MIT License

Copyright (c) 2017-present Ben Gardner

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env bash
sudo yum update -y
sudo amazon-linux-extras install docker
sudo service docker start
sudo usermod -a -G docker ec2-user
docker info