Skip to content

Instantly share code, notes, and snippets.

View MatthewRDodds's full-sized avatar

Matthew Russell Dodds MatthewRDodds

View GitHub Profile
@MatthewRDodds
MatthewRDodds / gist:ece289354765c384fc99
Last active November 17, 2016 18:19
Helpful Links for Future Problems.
@MatthewRDodds
MatthewRDodds / resize_boot2docker.md
Last active August 29, 2015 14:25 — forked from joost/resize_boot2docker.sh
Resize boot2docker VirtualBox image

Resize boot2docker VirtualBox image

Steps we will take:

  1. Change boot2docker image type (this will take long)
  2. Resize image
  3. Resize partion (using GParted)

Stop boot2docker

boot2docker stop
@MatthewRDodds
MatthewRDodds / gist:18362df68b09f23aff6f
Last active August 29, 2015 14:25
Batch rename files in folder
# Should rename test_controller.coffee to test.coffee
for old in ./*_controller.coffee; do
new=$(echo $old | sed -e 's/_controller//')
echo "moving $old to $new"
mv -v "$old" "$new"
done
@MatthewRDodds
MatthewRDodds / gist:2a8fce99aa3c86411231
Created July 15, 2015 18:53
Finding A Docker Compose Container's IP Address on Boot2docker Host

Find copy ID of container to search for using docker ps

docker inspect CONTAINER_ID | grep IPAddress
wait4eth1() {
CNT=0
until ip a show eth1 | grep -q UP
do
[ $((CNT++)) -gt 60 ] && break || sleep 1
done
sleep 1
}
wait4eth1
@MatthewRDodds
MatthewRDodds / gist:2f99e1422a2ef7709eb4
Last active August 29, 2015 14:24
Temporary workarounds for current Docker issues

Temporary workarounds for current Docker issues

x509: certificate is valid

boot2docker ssh
sudo curl -o /var/lib/boot2docker/profile https://gist.githubusercontent.com/MatthewRDodds/7d4423dc579d5306fd17/raw/3d09c77aae38b4f2809d504784965f5a16f2de4c/gistfile1.txt
sudo halt
boot2docker up
@MatthewRDodds
MatthewRDodds / gist:e59f0dcd373025ce5f27
Last active August 29, 2015 14:23
MelissaData JSON Request Ruby Example
require 'json'
require 'rest-client'
message = {
'TransmissionReference' => 'Sample',
'CustomerID' => ENV['CUSTOMER_ID'],
'Actions' => 'Check',
'Options' => nil,
'Columns' => nil,
'Records' => [{
@MatthewRDodds
MatthewRDodds / gist:3ad29d0dd67a77d66810
Created June 2, 2015 15:13
Travis Changelog Update Check
#!/usr/bin/env bash
# This script is run as part of the travis CI process to ensure that the
# changelog in every app has been updated when working on a feature branch.
# If there is no update to the changelog file (CHANGELOG.md), it exits with
# an error causing the travis build to fail.
# Only run this when ci script is executed by travis
${CI?"Not excuted by travis"}
@MatthewRDodds
MatthewRDodds / gist:ab3a8f9e3be60d248c65
Created May 12, 2015 17:52
Clear all redis things test
require 'redis'
# Redis.new(url: ENV['REDIS_URL']).flushall
Redis.new(url: ENV['REDIS_URL']).dbsize
@MatthewRDodds
MatthewRDodds / gist:dca5eb1739da9bf16d3b
Last active August 29, 2015 14:21
testing remote script scope access
app_name=$(basename `pwd`)
echo $app_name
exit 1