Skip to content

Instantly share code, notes, and snippets.

View dylansm's full-sized avatar

Dylan Smith dylansm

View GitHub Profile
@dylansm
dylansm / aws-ssh-tunnel.md
Created December 17, 2016 19:31 — forked from todgru/ssh-tunnel.md
How to set-up a SSH tunnel for AWS RDS

SSH Tunnel

Our db is hosted on Amazon. Our web server can connect to the db. Connections to the db are not allowed outside of the web server.

Run ssh tunnel locally:

This creates a tunnel from my local machine to the web server:

ssh -N -L 3307:my-rds-db.us-east-1.rds.amazonaws.com:3306 ec2-my-web-server.compute-1.amazonaws.com
@dylansm
dylansm / tmux.md
Created July 26, 2016 05:07 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@dylansm
dylansm / Clojure_on_RaspberryPi_OSX.md
Created May 11, 2016 05:32 — forked from akiatoji/Clojure_on_RaspberryPi_OSX.md
Running Clojure on Raspberry Pi with OS X

Clojure on Raspberry Pi with OS X

"Clojure running on Raspberry Pi" sounded so cool that I just had to give it a try.

Install JDK

  • Download ARM JDK from Oracle and instlal on Raspberry Pi
  • Change visudo to contain the following
@dylansm
dylansm / Dockerfile for crond
Last active February 16, 2016 16:54 — forked from andyshinn/Dockerfile
BusyBox cron container example
FROM gliderlabs/alpine:3.3
COPY myawesomescript /bin/myawesomescript
COPY root /var/spool/cron/crontabs/root
RUN chmod +x /bin/myawesomescript
CMD crond -l 2 -f
@dylansm
dylansm / simple-capistrano-docker-deploy.rb
Created January 25, 2016 05:43 — forked from johnbintz/simple-capistrano-docker-deploy.rb
Simple Capistrano deploy for a Docker-managed app
# be sure to comment out the require 'capistrano/deploy' line in your Capfile!
# config valid only for Capistrano 3.1
lock '3.2.1'
set :application, 'my-cool-application'
# the base docker repo reference
set :name, "johns-stuff/#{fetch(:application)}"
@dylansm
dylansm / tmux-cheatsheet.markdown
Created November 28, 2015 18:40 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@dylansm
dylansm / gulp.js
Created November 25, 2015 00:56 — forked from Fishrock123/gulp.js
gulp & browserify (+watchify +babelify)
var gulp = require('gulp')
var browserify = require('browserify')
var watchify = require('watchify')
var babelify = require('babelify')
var source = require('vinyl-source-stream')
var buffer = require('vinyl-buffer')
var merge = require('utils-merge')
@dylansm
dylansm / gulpfile.js
Created November 17, 2015 18:11 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@dylansm
dylansm / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@dylansm
dylansm / Dockerfile
Last active August 29, 2015 14:12 — forked from philm/Dockerfile
FROM atlashealth/ruby:2.1.2
ENV DEBIAN_FRONTEND noninteractive
# If you don't want to use therubyracer gem or similar,
# install Node.js as your preferred JS runtime
RUN curl -sL https://deb.nodesource.com/setup | bash -
# Install dependencies needed by Rails, followed by cleanup
RUN apt-get update -q && \