Skip to content

Instantly share code, notes, and snippets.

View freman's full-sized avatar

Shannon Wynter freman

View GitHub Profile
@freman
freman / also.pl
Last active December 29, 2015 08:09
also.pl (https://github.com/asiekierka/asielauncher) - generate a local install (Bit of a mess, soz)
#!/usr/bin/perl
use 5.10.0;
use warnings;
use strict;
use Data::Dumper;
use Digest::MD5 qw/md5_hex/;
use JSON::XS;
use File::Slurp qw/read_file write_file/;
use File::Path qw/mkpath/;
@freman
freman / go.syntax
Created August 25, 2014 23:26
Go lang syntax for mcedit
# Based on http://go-lang.cat-v.org/text-editors/mcedit/go.syntax
context default
# keywords
keyword whole break magenta
keyword whole case magenta
keyword whole chan magenta
keyword whole const magenta
keyword whole continue magenta
keyword whole default magenta
keyword whole defer magenta
@freman
freman / gist:f7c6bed2fafd89f797d3
Created April 30, 2015 04:33
Docker-Registry-Cleaner
Can remove 7af8d8d44190e927d7795cb32b6851481e806ea2646ff443ac3333175d65e06b (tagged: [lb_appserver:1357])
Can remove 5944ecd2c2419dcb2947657001f71a9863c01c095e09f85974c9c6802c950e96 (used by: [lb_appserver])
Can remove 9ab6098916aa6167645f669d0666da18287865ff9d14dfad616b5009ac7b2342 (used by: [lb_appserver])
Can't remove bd659296f0f7f943098296a87a08df8c1742c8d57a978c6567e6734c9c458f87 it has 46 children
Tags: [lb_stackfix:1199]
Uses: [lb_app lb_appserver lb_feedcache lb_jobs lb_stackfix lb_static]
@freman
freman / blacklist.scpt
Created December 16, 2015 07:02
Spotify blacklist script.
repeat
if application "Spotify" is running then
tell application "Spotify"
set seenTrack to ""
repeat while player state is playing
if player state is playing then
set theAlbum to album of the current track
set theTrack to name of the current track
set theArtist to artist of the current track
set trackLength to duration of current track
@freman
freman / main.go
Created October 5, 2016 09:01
etcdlogd
package main
import (
"context"
"flag"
"fmt"
"log"
"os"
"strings"
"time"
@freman
freman / statsbucket.go
Created October 23, 2016 11:18
Bucket stats based on a start and end time
package main
import (
"bufio"
"flag"
"fmt"
"os"
"strings"
"time"
@freman
freman / Weinguard ESP-01.ino
Created January 20, 2017 10:48
Weingard on ESP-01 - reading bits from uart (as gpio), controlling buzzer/led from gpio pins
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#define LED 0
#define BEEP 2
// Read 0's from GPIO_1(TX) and 1's from GPIO_3(RX)
#define PIN0 1
#define PIN1 3
#define WEINGARD_BITS 34
@freman
freman / runme.sh
Created March 14, 2017 04:11
Convert go-micro to stdlib context
#!/bin/bash
NEW_USER="divisionone"
PACKAGES=(
"github.com/micro/go-micro"
"github.com/micro/protobuf"
)
SEDS=(
@freman
freman / evalmyoutput.sh
Created September 6, 2017 23:36
Re-create docker iptables rules
#!/bin/bash
echo "Recreating docker iptables rules and chains"
echo "iptables -N DOCKER"
echo "iptables -N DOCKER-ISOLATION"
echo "iptables -t nat -N DOCKER"
echo "iptables -A DOCKER-ISOLATION -j RETURN"
echo "iptables -A FORWARD -j DOCKER-ISOLATION"
echo "iptables -t nat -A PREROUTING -m addrtype -dst-type LOCAL -j DOCKER"
@freman
freman / omg.js
Created October 24, 2017 00:08
Not-Junk all the email in the outlook junk folder
var n = 0;
var repeats = 200
function omg() {
triggerEventOnPage('._lvv_W1', 'mouseup')
$('._n_41 button').click();
window.setTimeout(function() {
$('button span:contains("Not junk")').parent().click();
window.setTimeout(function() {
$('.popupShadow ._fce_V button.ms-bcl-tp-f').click();
n++;