Skip to content

Instantly share code, notes, and snippets.

@awilliams
awilliams / vnc_scan.sh
Created July 22, 2013 12:35
VNC nmap scan
#!/bin/sh
nmap -p 5900 192.168.2.0/24 --open | awk '/Nmap scan/ {print $5}'
@awilliams
awilliams / ar_mysql2_bug.rb
Last active December 19, 2015 00:18
ActiveRecord Mysql2 boolean casting error
# Must have mysql installed with user 'rails' and 'root', no password for either
# Tested on the rails dev box virtual machine - https://github.com/rails/rails-dev-box
#
# See https://github.com/rails/rails/issues/11119
TEST_DATABASE = 'ar_mysql2_boolean_quoting'
unless File.exists?('Gemfile')
File.write('Gemfile', <<-GEMFILE
source 'https://rubygems.org'
@awilliams
awilliams / mobile_concern.rb
Last active December 18, 2015 01:29
Rails controller concern to help with rendering mobile views
#
# Add this to your Gemfile
# gem 'rack-mobile-detect', :require => 'rack/mobile-detect'
#
module MobileConcern
extend ActiveSupport::Concern
included do
# Call this from a controller to enable mobile for a given action
# Example: enable_mobile :only => [:show]
@awilliams
awilliams / bq_curie_adb_setup
Last active December 17, 2015 11:09
BQ Curie Android Dev setup
## /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="2207", ATTR{idProduct}=="0010", MODE="0660", GROUP="plugdev", OWNER="root"
## ~/.android/adb_usb.ini
# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.
# USE 'android update adb' TO GENERATE.
# 1 USB VENDOR ID PER LINE.
0x2207
@awilliams
awilliams / screencapture.sh
Created March 3, 2013 11:30
quick bash script to do a screen capture on Ubuntu with xvidcap
#!/bin/bash
xvidcap --mf --audio no --file ${1:-screencapture.avi} --cap_geometry 800x600+0+0 --gui no

Development box installation guide

This guide will show how to setup a VirtualBox similiar to an Ubuntu 12.04.1 server for use with Amazon EC2.

Covered in this guide:

  • VeeWee: Tool for building base boxes which will be used by vagrant
  • Vagrant: Tool for managing virtual machines with an easy to use CLI
  • Librarian: Bundler for chef cookbooks
  • Chef-solo & Knife solo: Tool for automating installing and management of servers