Skip to content

Instantly share code, notes, and snippets.

View cdw's full-sized avatar

Dave Williams cdw

View GitHub Profile
@cdw
cdw / Image KDE.ipynb
Created February 24, 2017 00:07
Plotting images on an XY plot with an opacity set by a KDE
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// StackProfileData
// This ImageJ macro gets the profile of all slices in a stack
// and writes the data for each slice to a separate CSV in the
// directory the images came from.
//
// Version 1.0, 24-Sep-2010 Michael Schmid
// Version 1.1 22-Feb-2016 Dave Williams
macro "Stack profile Data Action Tool - C059T3e16S [S]" {
if (!(selectionType()==0 || selectionType==5 || selectionType==6))
@cdw
cdw / modem_check_reset.py
Created October 27, 2015 03:51
modem_check_reset.py - check our internet connection and reset the modem if it doesn't seem to be up.
#!/usr/bin/env python
# encoding: utf-8
"""
modem_check_reset.py - check our internet connection and reset the modem if it
doesn't seem to be up. This is for a Motorola SB5101. This is intended to be run
from a cron script every 20 min or so, thus the following would be added to the
cron jobs:
0 * * * * /path/to/modem_check_reset.py
20 * * * * /path/to/modem_check_reset.py
40 * * * * /path/to/modem_check_reset.py
@cdw
cdw / gist:22094d73c41b6c99d3b0
Created April 28, 2015 22:36
Manage an aws cluster from user-data and SQS
#!/usr/bin/env python
# encoding: utf-8
"""
sqs_control_userdata_script.py - control an aws instance from a sqs queue
Run this guy on startup as a userdata script and he will connect to
s3 to download code to a directory, and run commands in it that are
provided by an SQS queue, one job at a time per core
Created by Dave Williams on 2011-02-08