Skip to content

Instantly share code, notes, and snippets.

@garyjohnson
garyjohnson / UbuntuEC2Script
Created February 10, 2013 16:12
Getting Ubuntu EC2 instance up and running as Jenkins slave for Ruby
sudo apt-get install -f default-jdk
sudo apt-get install -f git-all
\curl -L https://get.rvm.io | bash -s stable
sudo apt-get --no-install-recommends install -y bash curl git patch bzip2
sudo apt-get --no-install-recommends install -y build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev
sudo apt-get install -y nodejs
@garyjohnson
garyjohnson / svnconfig
Created February 12, 2013 15:54
SVN config file
### This file configures various client-side behaviors.
###
### The commented-out examples below are intended to demonstrate
### how to use this file.
### Section for authentication and authorization customizations.
[auth]
### Set password stores used by Subversion. They should be
### delimited by spaces or commas. The order of values determines
### the order in which password stores are used.
@garyjohnson
garyjohnson / Compare-VB.ps1
Created March 7, 2013 15:44
Powershell script for comparing CS to VB file
Function Compare-VB($csFilePath) {
$tempFile = [System.IO.Path]::GetTempPath() + [guid]::NewGuid() + ".vb"
& 'C:\Program Files\InstantVB\InstantVB.exe' $csFilePath $tempFile
WaitForFile($tempFile)
& 'C:\Program Files (x86)\Beyond Compare 3\BCompare.exe' $csFilePath.Replace(".cs",".vb") $tempFile
}
Function WaitForFile($path) {
while(!(Test-Path $path)) {
Start-Sleep -s 1
# http://www.mono-project.com/Compiling_Mono_on_OSX
require 'formula'
class Mono < Formula
#url 'http://download.mono-project.com/sources/mono/mono-3.0.6.tar.bz2'
#sha1 'e2187f80366fcd65c55a1ab946f8d3b39e81be77'
url 'http://download.mono-project.com/sources/mono/mono-2.10.9.tar.bz2'
sha1 '1a6e8c5a0c3d88d87982259aa04402e028a283de'
@garyjohnson
garyjohnson / udp_ios.m
Created February 1, 2014 13:24
UDP Multicast Chat for Different Mobile Platforms
#import "ViewController.h"
#import <netinet/in.h>
#import <sys/socket.h>
#import <CFNetwork/CFSocketStream.h>
#include <arpa/inet.h>
@interface ViewController()
-(void)openSocket;
@garyjohnson
garyjohnson / rpi_disable_wifi_power_mgmt.sh
Created November 28, 2014 04:22
Raspberry Pi - Disable Wifi Power Management
#!/bin/bash
sudo echo -e "wireless-power off" >>/etc/network/interfaces
sudo echo -e "options 8192cu rtw_power_mgnt=0" >>/etc/modprobe.d/8192cu.conf
sudo echo -e "options 8188eu rtw_power_mgnt=0" >>/etc/modprobe.d/8188eu.conf
@garyjohnson
garyjohnson / build_qt5_raspbian.sh
Last active August 29, 2015 14:10
Build Qt5 natively on Raspberry Pi with distcc
#WIP
sudo apt-get update
sudo apt-get install gperf bison flex libfontconfig1-dev libdbus-1-dev libfreetype6-dev libudev-dev libicu-dev libsqlite3-dev libxslt1-dev libssl-dev libasound2-dev libavcodec-dev libavformat-dev libswscale-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev gstreamer-tools gstreamer0.10-plugins-good gstreamer0.10-plugins-bad libraspberrypi-dev libpulse-dev libx11-dev libglib2.0-dev libcups2-dev freetds-dev libsqlite0-dev libpq-dev libiodbc2-dev libmysqlclient-dev firebird-dev libpng12-dev libjpeg62-dev libgst-dev libxext-dev libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev libxi-dev libdrm-dev
mkdir ~/opt
cd ~/opt
git clone git://gitorious.org/qt/qt5.git
cd qt5
./init-repository
cd ~/opt/qt5
@garyjohnson
garyjohnson / virtualev-auto-activate.sh
Created February 13, 2015 14:13
virtualenv auto activate
#!/bin/bash
# virtualenv-auto-activate.sh
#
# Installation:
# Add this line to your .bashrc or .bash-profile:
#
# source /path/to/virtualenv-auto-activate.sh
#
# Go to your project folder, run "virtualenv .venv", so your project folder
# has a .venv folder at the top level, next to your version control directory.
@garyjohnson
garyjohnson / install_kivy_1.10.0_macos_python3
Last active February 24, 2019 04:51
Install Kivy 1.10.0 on macOS for Python3 without Kivy.app
#!/bin/bash
brew install sdl2 sdl2_image sdl2_ttf sdl2_mixer gstreamer
pip3 install --upgrade Cython==0.25.2
# USE_OSX_FRAMEWORKS=0 pip3 install kivy # currently doesn't work due to incompatibility with SDL_mixer: https://github.com/kivy/kivy/pull/5459
USE_OSX_FRAMEWORKS=0 pip3 install http://github.com/kivy/kivy/archive/master.zip
# --- NOTES ----
# This is so you don't need to use Kivy.app -- I prefer that these deps install via pip and run via python like everything else.
# For python2, just use python2 version of pip
# I'm assuming usage of virtualenv here -- if you want to install globally, pip3 may require `sudo -H`
#!/bin/bash
sudo echo -e "@reboot root /usr/local/bin/pigpiod\n" >>/etc/cron.d/pigpiod