Skip to content

Instantly share code, notes, and snippets.

View lrstanley's full-sized avatar
👋
Busy. All the time.

Liam Stanley lrstanley

👋
Busy. All the time.
View GitHub Profile
@lrstanley
lrstanley / jsonapi-v2.py
Last active August 29, 2015 13:56
JSONAPI basic HTTP Python API
#!/usr/bin/python
import json
from hashlib import sha256
from urllib2 import urlopen
from urllib import quote
# https://github.com/alecgorge/jsonapi/wiki/Analyzing-the-jsonapi-request-and-response-format
# http://alecgorge.github.io/jsonapi/
# NEW API USAGE: http://mcjsonapi.com/apidocs/
@lrstanley
lrstanley / shorten.py
Last active August 29, 2015 13:56
Weechat script to auto convert links into a shortened link, using http://links.ml (Put this in ~/.weechat/python/shorten.py)
import weechat as w
import re, urllib, urllib2, json
weechat = w
SCRIPT_NAME = "shorten"
SCRIPT_AUTHOR = "Liam Stanley <me@liamstanley.io>"
SCRIPT_VERSION = "0.2"
SCRIPT_LICENSE = "GPL3"
SCRIPT_DESC = "Convert/Shorten all links to http://links.ml/ links"
@lrstanley
lrstanley / dark_teal.css
Last active December 19, 2015 08:19
Custom PISG (Perl IRC Statistics Generator) Theme
a {
color: #0088FF;
}
a:link {
color: #0088FF;
}
a:visited {
color: #0088FF;
}
a:hover {
@lrstanley
lrstanley / media.php
Created December 13, 2013 13:38
Media based file indexer. (I.e, if you have a directory full of .png, .txt, or .doc, etc) this will cleanly list them (and remove the index.php from the list of files)
<!doctype html>
<html>
<head>
<title>File index</title>
<meta name="viewport" content="width=device-width">
<!--<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">-->
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootswatch/3.0.2/cosmo/bootstrap.min.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script type="text/javascript" src="https://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
</head>
@lrstanley
lrstanley / install_supervisor.sh
Created January 26, 2014 05:09
Supervisord basic install instructions for Debian (Ubuntu)
#!/bin/bash
# First, install supervisor. Don't install through your package manager because those packages are unupdated!
sudo apt-get install python-setuptools python-pip curl
easy_install supervisor
# Use pip too
pip install supervisor
@lrstanley
lrstanley / supervisord
Created January 26, 2014 05:01
Supervisord init.d script
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Supervisord initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@lrstanley
lrstanley / exiclean-old.py
Created June 25, 2016 19:15
Old Exiclean version, in Python. Here for reference.
#!/usr/bin/python
"""
Exiclean -- Exim mail queue cleaner/spam removal script
-----------------------------------------------------------------------------
LICENSE: The MIT License (MIT)
Copyright (c) 2016 Liam Stanley <me@liamstanley.io>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

Keybase proof

I hereby claim:

  • I am lrstanley on github.
  • I am lstanley (https://keybase.io/lstanley) on keybase.
  • I have a public key ASDXjT2anLGva2hcUOnyRZQokE_fN-yT1n66GzU3pPy6jgo

To claim this, I am signing this object:

@lrstanley
lrstanley / github-backup.sh
Created June 6, 2018 23:53
GitHub backup script, which utilizes python-github-backup
#!/bin/bash
USER="${1:?usage: $0 <user> <archive>}"
ARCHIVE_LOC="${2:?usage: $0 <user> <archive>}"
which github-backup > /dev/null 2>&1 || pip install github-backup
if [ -z "$GH_BACKUP_TOKEN" ];then
echo 'missing $GH_BACKUP_TOKEN...'
exit 1
@lrstanley
lrstanley / twss.json
Created June 8, 2018 01:08
TWSS entries for Code (Python IRC bot)
{"lines": ["why the fck would you pull out right when im coming", "come on guys 69 isnt even that hard someone do 69 infront of the class now", "hes not going to be able to get in the backdoor theres a stool in the way", "just no matter what keep making me take it even if you have to shove it down my throat", "make sure your grip on the shaft is tight and your strokes long and hard", "would you like the black one or the white one she answered it doesnt matter ill suck on both", "you have to go in hard and come out wet and breathless youll feel good when youre done", "i was lying on my back in bed playing with it and it exploded in my face", "best 4 inches ever", "hurry up its getting hard its getting hard without thinking i respond im trying but its getting all over my hands", "i cant go 2 minutes without getting railed from behind", "god i love cox", "its so awkward i hate how he always tries to have a conversation with me while hes in my mouth", "if you play with it in front of me im going to want to touch