Skip to content

Instantly share code, notes, and snippets.

View Karunamon's full-sized avatar

Mike Parks Karunamon

View GitHub Profile
@Karunamon
Karunamon / gist:9218604
Last active August 29, 2015 13:56
Keybase proof
### Keybase proof
I hereby claim:
* I am karunamon on github.
* I am mparks (https://keybase.io/mparks) on keybase.
* I have a public key whose fingerprint is 941B F3C3 0864 E10C F14C 6BBF B553 9BD4 1632 3550
To claim this, I am signing this object:
@Karunamon
Karunamon / conf_cli_add_datefields.rb
Created March 3, 2014 18:08
Appends month/day/year fields to CSV files - useful because you apparently can't target blog entries by title in Confluence CLI without specifying their date separately.
#!/usr/bin/env ruby
#Add date fields for mass operations on blogs with Atlassian CLI.
#WTFPL
require "csv"
fail "Specify path to input file" unless ARGV[0]
fail "Specify path to output file" unless ARGV[1]
hdr=true
CSV.open(ARGV[1], 'w') do |csv|
CSV.foreach(ARGV[0], :headers => true, :skip_blanks => true) do |row|
date = row["Created"].match(/(?<month>\d+)\/(?<day>\d+)\/(?<year>\d+)/)
@Karunamon
Karunamon / distribute_ssh_keys.rb
Created April 14, 2014 15:09
SSH Key Distribution
#!/usr/bin/env ruby
# distribute_ssh_keys.rb
# Jason Boxman <jasonb@edseek.com>
# 20110624
# From http://blog.edseek.com/archives/2011/06/27/ssh-key-distribution-with-ruby-and-netsshm/
# Unsure of the license on this. Tread carefully.
#
# Sanely deploy ssh public key to multiple hosts.
@Karunamon
Karunamon / tomcat7.sh
Last active August 29, 2015 14:01 — forked from miglen/Apache Tomcat 8 Start stop script init.d script
Tomcat 7 init.d script
#!/bin/bash
#
# Tomcat 7 start/stop/status script
# Forked from: https://gist.github.com/valotas/1000094
# @author: Miglen Evlogiev <bash@miglen.com>
#
# Release updates:
# Updated method for gathering pid of the current proccess
# Added usage of CATALINA_BASE
# Added coloring and additional status
@Karunamon
Karunamon / verify.sh
Last active August 29, 2015 14:04
Shell script integrity verification
#!/usr/bin/env bash
#Add this function to any shell script. You require a HTTP(preferrably HTTPS)
#server to serve up a .asc file named identically to your script. Your public key
#must also be installed on the server. Requires curl and gpg.
#To generate the signature file: gpg -a --detach-sig <script filename>
verify-integrity(){
base=$(basename $0)
temp=`mktemp /tmp/$(basename $0).XXXXX`
curl -sS http://someserver/$base.asc -o $temp >/dev/null 2>&1
#System language
lang en_AU
#Language modules to install
langsupport en_AU
#System keyboard
keyboard us
#System mouse
@Karunamon
Karunamon / nowplaying.rb
Last active August 29, 2015 14:07
Lame Icecast now playing badge creator
#!/usr/bin/ruby
require 'xmlsimple'
require 'net/http'
require 'erb'
###CONFIG
#Stream mount point on the server
$mountpoint = 'live.ogg'
#URL to the icecast server root on the web, including trailing slash
$server = "http://isengard.tkware.us:8000/"
@Karunamon
Karunamon / programming.go
Created December 1, 2014 20:30
Hello World - In go - but not the way you're used to
//programming.go - Hello world, with an acerbic twist
//Michael Parks, 2014, WTFPL
package main //Every standalone program begins with this package
import "fmt" //We need this to output to the screen
//All languages suck, usually at the same things, so let's just declare our insults head of time to save space.
//All string constants, note the reverse declaration order (name) (type)
const InsultVerbosity string = "Why not just write in COBOL instead? Why is this crap so verbose?"
@Karunamon
Karunamon / AnyConnectLocalPolicy.xml
Created December 30, 2014 17:30
Anyconnect Policy XML
<?xml version="1.0" encoding="utf-8"?>
<AnyConnectLocalPolicy acversion="str1234">
<FipsMode>false</FipsMode>
<BypassDownloader>true</BypassDownloader>
<RestrictWebLaunch>false</RestrictWebLaunch>
<StrictCertificateTrust>false</StrictCertificateTrust>
<RestrictTunnelProtocols>false</RestrictTunnelProtocols>
<RestrictPreferenceCaching>false</RestrictPreferenceCaching>
<ExcludePemFileCertStore>false</ExcludePemFileCertStore>
<ExcludeWinNativeCertStore>false</ExcludeWinNativeCertStore>
"Thy Dungeonman - Part Deux" by TK
Book 1 - Items, definitions, and other folderol
Part 1 - Meta stuff
Rule for printing a parser error:
say "wat?" instead.
A thing can be ungettable. Instead of taking an ungettable thing: say "You can't get [noun]."; rule fails.