Skip to content

Instantly share code, notes, and snippets.

View gregorycoleman's full-sized avatar

gregorycoleman

View GitHub Profile
hub:
image: selenium/hub
ports:
- "4444:4444"
container_name: hub
node:
image: selenium/node-firefox
links:
- hub
environment:
hub:
image: selenium/hub
ports:
- "4444:4444"
container_name: hub
drupal:
image: drupal/latest
container_name: drupal
ports:
- "8080:80"
## This will be fixed by
find /var/www -type d -exec chmod 755 {} \;
find /var/www -type f -exec chmod 644 {} \;
@gregorycoleman
gregorycoleman / slack_webhook_post.py
Created August 5, 2017 09:33 — forked from devStepsize/slack_webhook_post.py
POST a JSON payload to a Slack Incoming Webhook using Python requests
'''
This is an example of how to send data to Slack webhooks in Python with the
requests module.
Detailed documentation of Slack Incoming Webhooks:
https://api.slack.com/incoming-webhooks
'''
import json
import requests
@gregorycoleman
gregorycoleman / add-dns-record.sh
Created November 6, 2017 06:01 — forked from justinclayton/add-dns-record.sh
CLI to add DNS Records in Route53
#!/bin/bash -eo pipefail
## Allows for creation of "Basic" DNS records in a Route53 hosted zone
function main() {
record_name=$1
record_value=$2
[[ -z $record_name ]] && echo "record_name is: $record_name" && exit 1
[[ -z $record_value ]] && echo "record_value is: $record_value" && exit 1
@gregorycoleman
gregorycoleman / ubuntu-eol.md
Created November 17, 2017 14:10 — forked from dergachev/ubuntu-eol.md
What to do when your ubuntu distro is End-of-Life

Let's say you're using Ubuntu 13.04 (Raring Ringtail, released in April 2013) and it just went End-of-Life on you, because it's supported for only 6 months, and the deprecated packages are taken down after 12 months.

You'll probably figure this out the hard way. When you run sudo apt-get update, it will eventually report these errors:

Ign http://archive.ubuntu.com raring-updates/universe Sources/DiffIndex
Err http://security.ubuntu.com raring-security/main Sources
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com raring-security/universe Sources
  404  Not Found [IP: 91.189.91.15 80]
azure
account
list [options] #List the imported subscriptions
show [options] [subscriptionNameOrId] #Show details about a subscription
set [options] <subscriptionNameOrId> #Set the current subscription
clear [options] #Remove a subscription or environment, or clear all of the stored account and environment info
import [options] <file> #Import a publishsettings file or certificate for your account
download [options] #Launch a browser to download your publishsettings file
env... #Commands to manage your account environment
@gregorycoleman
gregorycoleman / README
Created December 3, 2017 21:23 — forked from sasha-id/README
MongoDB multiple instance upstart scripts: mongodb, mongod --configsvr and mongos
MongoDB upstart scripts for Ubuntu.
Run following commands after installing upstart scripts:
ln -s /lib/init/upstart-job /etc/init.d/mongoconf
ln -s /lib/init/upstart-job /etc/init.d/mongodb
ln -s /lib/init/upstart-job /etc/init.d/mongos
To start services use:
@gregorycoleman
gregorycoleman / show-indexes.js
Created January 21, 2018 06:27
wget -qO- http://goo.gl/????? | mongo --quiet <db-name>
#You can also output all your indexes together with their size:
rs.slaveOk();
db.getCollectionNames().forEach(function(coll) {
print("db." + coll + ".ensureIndex(" + tojson(index.key) + ")");
db.[coll].stats().indexSizes
});
@gregorycoleman
gregorycoleman / pgsql-docker
Created February 2, 2018 02:11 — forked from bobmaerten/pgsql-docker
Start/Stop/Status Shell script for managing docker-postgresql container from @kamui
#!/usr/bin/env bash
PGSQL_DATA_PATH='/data/pg'
SERVER_CONTAINER="postgresql-server"
DATA_CONTAINER="postgresql-data"
function getStatus(){
CONTAINER_ID=$(docker ps -a | grep -v Exit | grep $SERVER_CONTAINER | awk '{print $1}')
if [[ -z $CONTAINER_ID ]] ; then
echo 'Not running.'