Skip to content

Instantly share code, notes, and snippets.

kwharrigan

Block or report user

Report or block kwharrigan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kwharrigan
kwharrigan / mks_git_checkpoints.py
Created Apr 12, 2012
MKS fast-import script for git
View mks_git_checkpoints.py
#!/usr/bin/python
#Copyright (c) 2012 Kyle Harrigan
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:
#
@kwharrigan
kwharrigan / scan.sh
Last active Mar 1, 2019
A simple script to form a multipage PDF using scanimage / sane. It is hard-coded to my MF4270 device id as provided by scanimage -L.
View scan.sh
outname=$1
startdir=$(pwd)
tmpdir=scan-$RANDOM
DEVICENAME=pixma:04A926B5_SFF780310398A
if [ $# -lt 1 ]
then
echo "Usage: scan.sh <filename.pdf>"
exit 1;
fi
@kwharrigan
kwharrigan / md5_test.c
Created Apr 15, 2012
Use openssl to produce an md5 hash of a file
View md5_test.c
#include <openssl/md5.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char**argv)
{
FILE *fh;
long filesize;
unsigned char *buf;
@kwharrigan
kwharrigan / inode_test.sh
Last active Apr 30, 2016
Play around with inode allocation
View inode_test.sh
# Example 1 - Remove file after every iteration... note inodes are
# often reused after each deletion
for i in {1..1000}; do
filename=/tmp/file$i
echo "Creating " $filename
echo "blahblah" > $filename
stat -c "%i" $filename
echo "Removing " $filename
rm $filename
done
@kwharrigan
kwharrigan / sha.sh
Created Mar 11, 2016
sha256 fingerprint on old ssh
View sha.sh
awk '{print $2}' ssh_host_rsa_key.pub | base64 -d | sha256sum -b | awk '{print $1}' | xxd -r -p | base64
View pandas_football.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View pandas_football.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Streaming sound in the notebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kwharrigan
kwharrigan / monitor.py
Created Oct 18, 2012
Server monitoring script
View monitor.py
#!/usr/bin/python
from twisted.internet import task
from twisted.internet import reactor
from subprocess import Popen, PIPE, STDOUT
logfile = open('status.txt', 'a')
def runEverySecond():
output = Popen(["ssh", "user@host", "date"], stdout=PIPE, stderr=STDOUT).communicate()[0]
@kwharrigan
kwharrigan / authen_msad.py
Created Jul 27, 2012 — forked from bollwyvl/authen_msad.py
A Python port of Perl's Apache::AuthenMSAD
View authen_msad.py
"""
authen_msad
A port of Perl's Apache::AuthenMSAD
Takes advantage of Microsoft Active Directory allowing a user to be verified
with 'user@domain' instead of searching for the distinguished name.
To merge as seamlessly as possible with existing systems (i.e. SharePoint,
etc.) munge the incoming "domain\user" into "user@domain".
You can’t perform that action at this time.