Skip to content

Instantly share code, notes, and snippets.

Ben Gardner unshift

Block or report user

Report or block unshift

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View install-docker.sh
#!/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
View example.js
const foo = {}
export default foo
foo.bar = 3
View wand.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View LICENSE.md

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:

View launch.js
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',
View install-chrome-ec2.sh
#!/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/
View citus.sh
#!/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
View backup-postgres.sh
#!/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)"
View pg_extensions.sh
#!/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
View aws-example.go
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"
You can’t perform that action at this time.