Skip to content

Instantly share code, notes, and snippets.

@kwharrigan
kwharrigan / monitor.py
Created October 18, 2012 13:03
Server monitoring script
#!/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 / scan.sh
Last active November 4, 2024 20:49
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.
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 / dmtcp.py
Created April 4, 2014 01:50
Starcluster plugint to install dmtcp.
from starcluster.clustersetup import ClusterSetup
from starcluster.logger import log
class DMTCP(ClusterSetup):
def __init__(self, url, archive_file, install_hbict, hbict_url):
self.dmtcp_url = url
self.archive_file = archive_file
self.install_hbict = install_hbict
self.hbict_url = hbict_url
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

SVG fragment builds for reveal.js

Basic use case

  • make an SVG (maybe in inkscape)
    • save it someplace reveal.js can find it (maybe next to your presentation)
    • figure out how to identify them (maybe use named layers)
  • in reveal.js/index.html
    • add reveal-svg-fragment.js as a dependency
    • in a <section> of reveal.js markup
  • add data-svg-fragment="" to something, e.g.
git log -n 3 --pretty=format:'{%n "parent": "%P", %n "commit": "%H",%n "author": "%an <%ae>",%n "date": "%ad",%n "message": "%f"%n},' | sed -e '1i\
[' -e '$s/,/]/g' > tmp.json
@kwharrigan
kwharrigan / tree.js
Created July 22, 2014 06:11
Basics for visualizing GIT history using d3 from some json. Makes a tooltip out of the details.
var commits = [
{
"parent": "e98bb31",
"commit": "fb3a06f49b06fd7358c46c153b35ff6a29cd33cd",
"author": "Kyle Harrigan <[email protected]>",
"date": "Mon Mar 5 20:12:12 2012 -0500",
"message": "Fortran-examples-and-automake-scripts"
},
{
"parent": "3475367",
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.