Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am caspyin on github.
  • I am caspyin (https://keybase.io/caspyin) on keybase.
  • I have a public key whose fingerprint is 5708 1010 8836 C17B 7159 B919 F9DC 5371 F98B C2C9

To claim this, I am signing this object:

@btoone
btoone / Vagrantfile
Last active Aug 29, 2015
Setup VM and Install Docker
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
ENV['VAGRANT_DEFAULT_PROVIDER'] ||= 'virtualbox'
# Install Docker.io
# Adapted from https://docs.docker.com/installation/debian/
$script = <<SCRIPT
echo "[SCRIPT] Running as: `whoami`"
@btoone
btoone / curl.sh
Last active Aug 29, 2015
Attempt to get $resource and $http to hit mapmyrun api
View curl.sh
curl 'http://www.mapmyrun.com/vxproxy/v7.0/workout/782830271/?field_set=time_series&callback=success' \
-H 'Referer: http://www.mapmyrun.com/workout/782830271'
@btoone
btoone / gist:1151748
Created Aug 17, 2011
Ubuntu Packages for Rails Hosting
View gist:1151748

One command to rule them all

sudo aptitude install apache2 apache2-prefork-dev autoconf bison build-essential \
clang curl dnsutils git-core imagemagick libc6-dev libcurl4-openssl-dev libffi-dev \
libmagickwand-dev libmysqlclient16 libmysqlclient16-dev libreadline6-dev libsqlite3-0 \
libsqlite3-dev libssl-dev libxml2 libxml2-dev libxslt-dev libxslt1.1 libxslt1-dev \
libyaml-dev mysql-client mysql-server openssl sqlite3 wget zlib1g zlib1g-dev 
@btoone
btoone / ubuntu-lucid-setup-rails.md
Created Nov 17, 2011
Ubuntu Lucid Setup Guide for Rails
View ubuntu-lucid-setup-rails.md

This note will walk you though setting up and securing a Ubuntu 10.04 LTS then deploying a Rails application with mulit-stage deployment.

TODO:

  • Add section for NGINX setup

Server Setup

@btoone
btoone / gist:2230355
Created Mar 28, 2012
Load yaml from a string
View gist:2230355
require 'yaml'
y = <<-YAML
:one:
:two:
:development:
:adapter: mysql2
:host: 127.0.0.1
:database: app_development
:username: root
View remote-query.rb
require 'rubygems'
require 'active_record'
require 'mysql2'
require 'net/ssh/gateway'
gateway = Net::SSH::Gateway.new(
'remotehost.com',
'username'
)
View parse-json.rb
require 'json'
json = '{
"description":"the description for this gist",
"public":true,
"files":{
"file1.txt":{
"content":"String file contents"
}
}
View change-dir.sh
# change directory
cd # back to the last one you were in
mkdir dir && cd !$ # cd into the director you just created
take dir # cd into the director you just created - a custom function
View apache-subdomain.sh
# Use .htaccess to redirect subdomains
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.yourwebsite.com
RewriteCond %{HTTP_HOST} ([^.]+)\.yourwebsite.com
RewriteRule ^(.*)$ /path_to_your_site/httpdocs/work_out.php?url=%1
You can’t perform that action at this time.