Skip to content

Instantly share code, notes, and snippets.

View uid0's full-sized avatar

Ian Wilson uid0

View GitHub Profile
@uid0
uid0 / onstart.hook
Created August 6, 2020 05:51
Taskwarrior On-Modify Hook for 'stup' integration
import sys
import json
import os
# Hook should extract all of the following for use as Timewarrior tags:
# UUID
# Project
# Tags
# Description
# UDAs
### Keybase proof
I hereby claim:
* I am uid0 on github.
* I am imroot (https://keybase.io/imroot) on keybase.
* I have a public key whose fingerprint is 9672 A26E 537D C9D2 8F4C F7D6 B2B3 0BF4 AA21 5C5B
To claim this, I am signing this object:
@uid0
uid0 / gist:3719797
Created September 14, 2012 04:33
Init.d script for CentOS/RHEL systems
#!/bin/bash
# myapp daemon
# chkconfig: 345 20 80
# description: myapp daemon
# processname: myapp
DAEMON_PATH="/home/ec2-user/Development/projects/myapp"
DAEMON=myapp
DAEMONOPTS="-my opts"
@uid0
uid0 / clone-disk.sh
Created August 9, 2012 23:34
Script to clone an android device for forensic use.
#!/bin/bash
CLIENT="${1}"
CASE="${2}"
TAG="${3}"
SERIALNO="${4}"
SOURCEDEV="${5}"
DESTPATH="${6}"
OUTPUTPATH=$DESTPATH/$CLIENT/$CASE/$TAG-$SERIALNO
LOGFILE=$OUTPUTPATH/log/$TAG-$SERIALNO.log
STDERRLOG=$OUTPUTPATH/log/$TAG-$SERIALNO.stderr.log
@uid0
uid0 / gist:3145680
Created July 19, 2012 17:59
Git prompt thingie
function parse_git_branch_and_add_brackets {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \[\1\]/'
}
PS1="\h:\W \u\[\033[0;32m\]\$(parse_git_branch_and_add_brackets) \[\033[0m\]\$ "
@uid0
uid0 / alertsms.py
Created February 18, 2012 20:41
Using twilio as a nagios sms gateway
#!/usr/bin/env python
from twilio.rest import TwilioRestClient
import getopt, sys
def usage():
print "Usage Instructions for alertsms.py"
print " -h --help: Shows this text, exits"
print " -o --output [number]: sends SMS to that number"
print " -v: enables verbose output"
print " -i --input [message]: message to send"
@uid0
uid0 / gist:1612998
Created January 14, 2012 21:42
Add to .bash_profile to determine which git repository you're in
function parse_git_branch_and_add_brackets {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \[\1\]/'
}
PS1="\h:\W \u\[\033[0;32m\]\$(parse_git_branch_and_add_brackets) \[\033[0m\]\$ "
@uid0
uid0 / gist:1562153
Created January 4, 2012 21:09
Bash Script to check PDF's
#!/bin/bash
# This script should iterate through the 13K PDF's that I have, and hopefully
# tell me which ones are different.
# Check to see that yes, we actually got an argument...
[ "$#" -eq 1 ] || die "1 argument required, $# provided"
# Let's read the output from diff, and then iterate through the list.
#
@uid0
uid0 / gist:1562142
Created January 4, 2012 21:06
Script for Checking Images...
#!/bin/bash
# This script should iterate through the 13K PDF's that I have, and hopefully
# tell me which ones are different.
#
# Check to see that yes, we actually got an argument...
[ "$#" -eq 1 ] || die "1 argument required, $# provided"
# Let's read the output from diff, and then iterate through the list.
@uid0
uid0 / gist:1561361
Created January 4, 2012 18:29
Email Testing
import org.apache.commons.mail.*;
public class EmailTest {
/**
* @param args
*/
public static void main(String[] args) {
System.out.println("Attempting to send email");
Email email = new SimpleEmail();