Skip to content

Instantly share code, notes, and snippets.

View allaryin's full-sized avatar

Ammon Lauritzen allaryin

  • Austin, TX
View GitHub Profile
@allaryin
allaryin / README.md
Last active January 4, 2017 20:01 — forked from killercup/README.md
Unicorn, init.d - native ruby, no rvm/rbenv/etc...

This is my take of the init script system I've seen tossed around. Because I don't run RVM on servers, I have removed it in favor of assuming the user can define the correct path to unicorn themselves. If you need RVM, see the upstream version of this gist.

Installation

  1. Have a server with 1+ working unicorn instances with config defined in config/unicorn.rb.
  2. Create /etc/unicorn/[APPNAME].conf for each app on the server.
  3. Install init script at /etc/init.d/unicorn.
  4. sudo update-rc.d unicorn defaults

Bugfixes

@allaryin
allaryin / install-perforce.sh
Created April 22, 2016 20:01
A couple of simple p4 management scripts.
#!/bin/sh
# Reference: https://www.perforce.com/perforce-packages
# - This includes the expected key fingerprint, etc...
wget http://package.perforce.com/perforce.pubkey
if [ $? -ne 0 -o ! -f perforce.pubkey ]; then
echo "Unable to download public key, aborting."
fi
gpg --with-fingerprint perforce.pubkey | tee perforce.fingerprint
@allaryin
allaryin / sync-dirs.sh
Last active April 19, 2016 16:45
Nice directory rsync
#!/bin/sh
BWLIMIT=1024
if [ ! -d "$1" -o ! -d "$2" ]; then
echo "$0 <orig dir> <new dir>"
exit 1
fi
SRC=`realpath "${1}"`/
#!/bin/sh
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
aptitude update
echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo /usr/bin/debconf-set-selections
aptitude install oracle-java8-installer
java -version
@allaryin
allaryin / fastpack.sh
Last active January 7, 2016 03:25
Script to invoke fastpack one-off on a single mod file
#!/bin/sh
JAR='MCU-FastPack-latest.jar'
URL='http://files.mcupdater.com/base/mods'
FORGE='10.13.4.1558'
MC='1.7.10'
##########
@allaryin
allaryin / auth.json
Last active December 13, 2015 18:53 — forked from copygirl/cord.ls
Fiddled-together IRC - Discord bridge bot
{
"irc": {
"server": "irc.esper.net",
"nick": "nick",
"password": "ircpass",
"userName": "MCU Discord-IRC Bridge",
"autoConnect": false,
"channels": ["#channelOne","#SomeOtherchannel"]
},
"discord": {
GoogleDoc: https://docs.google.com/document/d/1TEReZ4A9PszgoMTxjRY08J8tZXxESaYPHCuwaz6XH3Y/edit?usp=sharing
Confirmed:
- Forge v1517
- Advanced Generators v0.9.18.113
- AOBD v2.8.4
- Applied Energistics 2 rv2-beta33
- AE2Stuff v0.5.0.56
- ExtraCells v2.2.73b129
- Autopackager v.1.5.4
@allaryin
allaryin / ssh-all.sh
Last active October 12, 2015 15:41
Script to shotgun a command to a list of servers via ssh
#!/bin/sh
#HOSTS=""
HOSTS=`awk '/^(Host|## END)/ {if ($0 == "## END SSH-ALL ##") {exit 0;} else {$1=""; print $0;}}' ~/.ssh/config`
HOSTLIST=`mktemp hostlist.XXXXXX`
for HOST in ${HOSTS}; do
echo ${HOST} >> ${HOSTLIST}
done
HOSTS=`cat ${HOSTLIST} | sort`
@allaryin
allaryin / cost.rb
Created August 13, 2015 18:26
minecraft recipe cost calculator
#!/usr/bin/env ruby
require 'pp'
RECIPES = {
:excavator => [{
:steel_block => 21,
:steel_scaffolding => 23,
:light_engineering_block => 9,
:heavy_engineering_block => 13
[21:37:35] [Client thread/INFO] [TabbyChat/]: [CHAT] [IRC] <Scratch> not the pattern terminal?
[21:37:37] [Client thread/INFO] [inventorytweaks/]: acs.tabbychat.core.GuiChatTC
[21:37:38] [Client thread/INFO] [TabbyChat/]: [CHAT] <allaryin>: no
[21:37:48] [Client thread/INFO] [TabbyChat/]: [CHAT] [IRC] <smbarbour> We don't have a pattern terminal
[21:38:00] [Client thread/INFO] [inventorytweaks/]: net.minecraft.client.gui.inventory.GuiInventory
[21:38:00] [Client thread/INFO] [inventorytweaks/]: net.minecraft.inventory.ContainerPlayer
[21:38:04] [Client thread/INFO] [inventorytweaks/]: Automatic stack replacement.
[21:38:05] [Netty Client IO #1/INFO] [THAUMCRAFT/]: Restoring client configs.
[21:38:05] [Netty Client IO #1/INFO] [simplyjetpacks/]: Loading configuration files
[21:38:05] [Netty Client IO #1/DEBUG] [OpenMods/]: openmods.network.IdSyncManager.onDisconnect(IdSyncManager.java:124): Disconnected, restoring local data