Skip to content

Instantly share code, notes, and snippets.

View deanrather's full-sized avatar

Dean Rather deanrather

View GitHub Profile
@deanrather
deanrather / LockHelper.php
Last active August 29, 2015 14:02
PHP Locking and Queuing
<?php
namespace application\helper
{
use nutshell\Nutshell;
use application\helper\SystemHelper;
use application\helper\OutputHelper;
use \exception;
class LockHelper
{
@deanrather
deanrather / Usage.md
Last active August 29, 2015 14:05
PHP Goole Drive Integration

Setup

  1. Create a new spreadsheet at http://docs.google.com
  2. The spreadsheet's name should match setSpreadsheet() variable File → Rename…
  3. The spreadsheet's tab should match the setWorksheet() variable
  4. The first row of the spreadsheet should contain headers matching your add() array keys
A B
#!/bin/bash
# Changes your machine's hostname
# Usage: bash <(wget -O - http://git.io/Kbt8oQ) MY_HOSTNAME
#
old=$(hostname)
new=$1
# Backup old hosts file
date=$(date +%F_%T | sed 's/:/-/g')
@deanrather
deanrather / minecraft-setup.md
Last active August 29, 2015 14:06
Setting up a Minecraft Server with Amazon Web Services

Setting up a Minecraft Server with Amazon Web Services

Creating the Instance

  • Login to https://console.aws.amazon.com/ec2/
  • Change to your availablility zone (top-right dropdown)
  • Create a new m3.medium Instance
  • Make sure to open port 25565 on TCP and UDP
  • Create & Save a private key
  • Note the IP address
@deanrather
deanrather / gconf.xml
Last active August 29, 2015 14:06
Gnome-Terminal Configuration
<?xml version="1.0"?>
<gconf>
<entry name="bold_color_same_as_fg" mtime="1410309937" type="bool" value="true"/>
<entry name="use_theme_colors" mtime="1411697226" type="bool" value="false"/>
<entry name="scrollback_unlimited" mtime="1411697226" type="bool" value="true"/>
<entry name="background_darkness" mtime="1411697226" type="float" value="0.69462400674819946"/>
<entry name="background_type" mtime="1411697226" type="string">
<stringvalue>transparent</stringvalue>
</entry>
<entry name="palette" mtime="1410309973" type="string">
@deanrather
deanrather / Using Expect.md
Last active August 29, 2015 14:07
Using Expect

Using Expect

expect is a program designed to interact with other programs.

Installation

sudo apt-get install expect

Usage

@deanrather
deanrather / Enabling Login via Keys.md
Last active August 29, 2015 14:07
Enabling Login via Keys

Enabling Login via Keys

On your Workstation

Replace user with the remote username, and 1.2.3.4 with the ip or hostname of the remote

pubkey="$(cat ~/.ssh/id_rsa.pub)" && ssh user@1.2.3.4 "echo $pubkey >> /home/user/.ssh/authorized_keys"

Back on your Workstation

@deanrather
deanrather / newtags.sh
Last active August 29, 2015 14:15
loop over new tags in a git repo
#!/bin/bash
# newtags.sh
# does a fetch, then loops over new tags
# get original list of tags
before_list="$(git tag)"
# fetch new tags, get new list of tags
git fetch --tags
after_list="$(git tag)"
@deanrather
deanrather / download-vrjam-finalists.sh
Created May 19, 2015 04:18
Download VR Jam Finalists
#!/bin/bash
submissions="36283
36166
36764
36258
36346
36556
36355
36358