Skip to content

Instantly share code, notes, and snippets.

View Karunamon's full-sized avatar

Mike Parks Karunamon

View GitHub Profile
@Karunamon
Karunamon / syslog_generator.rb
Last active August 29, 2015 14:25
Syslog Generator
#!/usr/bin/env ruby
#Log message generation utility for testing syslog config
#Apache License - Michael Parks <mparks@tkware.info>
require 'random-word'
require 'trollop'
require 'syslog_protocol'
require 'socket'
$opts = Trollop::options do
banner <<-EOS
@Karunamon
Karunamon / terminal-control.sh
Last active August 29, 2015 14:26 — forked from bcap/terminal-control.sh
Useful terminal control characters
# Terminal output control (http://www.termsys.demon.co.uk/vtansi.htm)
TC='\e['
CLR_LINE_START="${TC}1K"
CLR_LINE_END="${TC}K"
CLR_LINE="${TC}2K"
# Hope no terminal is greater than 1k columns
RESET_LINE="${CLR_LINE}${TC}1000D"
@Karunamon
Karunamon / config.ini
Created December 26, 2015 17:24
irc3 python bot shenanigans
[bot]
nick = AsrielBot
realname = Dreemurr
host = irc.rizon.net
port = 6697
ssl = true
ssl_verify = CERT_NONE
includes =
@Karunamon
Karunamon / web.py
Last active January 25, 2016 00:15
Flask Class Shenanignas
from flask import Flask
import thread
web = Flask(__name__)
class AwesomeClass(object):
def __init__(self):
thread.start_new_thread(web.run, ())
self.some_important_var = "spam"
@Karunamon
Karunamon / stripMirc.py
Created February 7, 2016 02:04
Python script for cleaning mIRC color codes from IRC logs
#!/usr/bin/env python
"""mIRC Color Code Stripper
Removes mIRC color codes from provided files.
Usage:
stripMirc.py <filename> [OUTPUT]
If OUTPUT is not specified, filename will be the original filename, with a _FIXED extension.
"""
@Karunamon
Karunamon / SMCGP.md
Last active February 14, 2016 21:50
SMCGP

%%%%%%%%%%%%%%%%%%%%%%%%%%%

Title = "Short Message Chess Game Protocol"
abbrev = "Short Message Chess Game Protocol"
category = "info"
docName = "smcgpv1-draft"
ipr = "full3978"

[pi]

private = "yes"

@Karunamon
Karunamon / triples.java
Last active May 16, 2016 15:30
Pythagorean triple finders, comparing a basic for loop vs a parallelStream
import java.util.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.stream.*;
class Main {
private static class tripleCandidate {
BigDecimal a;
BigDecimal b;
@Karunamon
Karunamon / redbot.service
Created July 22, 2016 15:43
Systemd unit for a Twitch bot
[Unit]
Description=Red-DiscordBot
After=Network.target
[Service]
Type=simple
#Yeah, it's discouraged to run as root, but this is a single purpose VM. Change user appropriately, and make sure to update the workingdirectory.
User=root
ExecStart=/usr/bin/python3.5 /root/Red-DiscordBot/red.py
Restart=on-abort
@Karunamon
Karunamon / gist:7e4773825308e6c12da9b2bc5d57b910
Created July 26, 2016 15:26
Install mu with the EMACS var
$ EMACS=$(which emacs) brew install mu --with-emacs --verbose
=> Downloading https://github.com/djcb/mu-releases/raw/master/mu-0.9.16.tar.gz
Already downloaded: /Library/Caches/Homebrew/mu-0.9.16.tar.gz
==> Verifying mu-0.9.16.tar.gz checksum
tar xvzf /Library/Caches/Homebrew/mu-0.9.16.tar.gz
x mu-0.9.16/
x mu-0.9.16/COPYING
x mu-0.9.16/TODO
x mu-0.9.16/Makefile.in
x mu-0.9.16/guile/
@Karunamon
Karunamon / gist:4818b245b7cfe42f8a235dd8fdede447
Created July 26, 2016 15:29
Install mu without the EMACS var
$ brew install mu --with-emacs --verbose
==> Downloading https://github.com/djcb/mu-releases/raw/master/mu-0.9.16.tar.gz
Already downloaded: /Library/Caches/Homebrew/mu-0.9.16.tar.gz
==> Verifying mu-0.9.16.tar.gz checksum
tar xvzf /Library/Caches/Homebrew/mu-0.9.16.tar.gz
x mu-0.9.16/
x mu-0.9.16/COPYING
x mu-0.9.16/TODO
x mu-0.9.16/Makefile.in
x mu-0.9.16/guile/