This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Generic linux daemon base class for python 3.x.""" | |
import sys, os, time, atexit, signal | |
class daemon: | |
"""A generic daemon class. | |
Usage: subclass the daemon class and override the run() method.""" | |
def __init__(self, pidfile): self.pidfile = pidfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# After installing Ubuntu on a machine I run this script. It removes packages I don't use, | |
# improves the security situation slightly, and installs the minimal set of packages I need | |
# to do all my work. | |
# Usage: | |
# sudo chmod +x bootstrap.sh | |
# sudo ./bootstrap.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, skimage.io, skimage.exposure, numpy | |
for dir_name, dir_names, filenames in os.walk("/home/jim/Desktop/experiments/141111/kymograph"): | |
for image_name in filenames: | |
filename = "/".join([dir_name, image_name]) | |
original_image = skimage.io.imread(filename) | |
enhanced_image = skimage.exposure.rescale_intensity(original_image, in_range=tuple(numpy.percentile(original_image, (2, 98)))) | |
skimage.io.imsave(filename.split(".")[0] + "_enhanced.png", enhanced_image) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I use this to keep track of things I've done during the day. It's mostly a motivational tool. | |
# I find that the fear of a sparse log at the end of the day drives me to look for things I can | |
# accomplish in a short period of time. | |
# Creating an alias for the script is recommended. | |
# Usage: | |
# $ ./accomplish.sh refactored the robot-targeting code | |
# $ ./accomplish.sh | |
# Fri Aug 27 | refactored the robot-targeting code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# modified from https://faq.i3wm.org/question/5312/how-to-toggle-onoff-external-and-internal-monitors.1.html | |
# this script will toggle which monitors are on. after booting, all monitors will be clones of the main laptop monitor. | |
# after each execution, we cycle through the following modes: | |
# - external monitor only (work mode) | |
# - external and laptop on but not clones (presentation mode) | |
# - laptop monitor only | |
OlderNewer