Skip to content

Instantly share code, notes, and snippets.

View osteele's full-sized avatar

Oliver Steele osteele

View GitHub Profile
@osteele
osteele / Email Scores to Students.ipynb
Created February 24, 2017 02:33
Email scores to students in a spreadsheet.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@osteele
osteele / docker-machine-rename
Last active April 19, 2017 18:59 — forked from alexproca/docker-machine-rename
Rename docker-machine
#!/usr/bin/env bash -eu
#copy this in a folder from path ex: /usr/local/bin
#usage: docker-machine-rename default my-default
# From https://gist.github.com/alexproca/2324c60c86380b59001f
# w/ comments from eurythmia
OLD_MACHINE_NAME=${1:-default};
NEW_MACHINE_NAME=${2:-my-default-2};
@osteele
osteele / docker-functions.sh
Created April 10, 2017 01:50
Bash functions for working on an npm package from within Docker
d.exec () {
docker run \
-v yarn_cache:/root/.cache/yarn \
-v `pwd`:/app \
-v signage_node_modules:/app/node_modules \
-p 3000:3000 \
-it \
node \
"$@"
}
@osteele
osteele / build_numpy.sh
Created May 30, 2017 13:45
Build numpy on macOS
brew install gcc
pip install nose numpy Tempita
python runtests.py -v
# SpaceTranslationPatch patches the MacOS Python IDE to convert spaces to tabs
# when a source file is opened, and back to spaces when it's saved.
#
# Drop this file on PythonIDE to install it. It requires
# http://www.strout.net/python/mac/PatchUtils.py in order to run.
#
# Version 2 released to the public domain 3 November 1999
# by Oliver Steele (steele@cs.brandeis.edu).
@osteele
osteele / find-malicious-conda-env-packages
Created September 15, 2017 14:30
Report malicious PyPI packages in conda environments
#!/bin/bash
# Report malicious PyPI packages in each conda environment.
# See discussion at https://news.ycombinator.com/item?id=15256121
packages=$(cat <<EOF
acqusition
apidev-coop
bzip
crypt
@osteele
osteele / vote-counter.py
Last active September 26, 2017 16:28
Count the votes in a Liquid Democracy Google Sheet
import pandas as pd
spreadsheet_key = '' # from the Google sheets Publish URL
spreadsheet_range = '' # e.g. B6:E15
url = 'https://docs.google.com/spreadsheets/d/e/{}/pub?gid=0&single=true&output=csv'.format(spreadsheet_key)
if spreadsheet_range:
url += '&range=' + spreadsheet_range
# TODO read this from the doc
Verifying my Blockstack ID is secured with the address 13WDbJK44r4ysJUH4nJUyHBkgGm7tFabNw https://explorer.blockstack.org/address/13WDbJK44r4ysJUH4nJUyHBkgGm7tFabNw
@osteele
osteele / README.md
Created April 24, 2018 12:30
Chris Morgan's bash-for-recording

A script bash-for-recording, for invocation by termrec. This does the following:

  • Set the window size to 80×24
  • Set HOME to a new empty directory
  • Set USER and NAME to dummy values (creating an actual new throwaway user account would be better here)
  • Set TERM to xterm-256color
  • Clear the environment (env -i)
  • Set a deliberately very simple and obvious prompt (which sets the title as well)
@osteele
osteele / chrome-tabs-to-md.sh
Last active July 10, 2019 19:55 — forked from samyk/chrome_tabs.osa
applescript to show all url+titles of Chrome tabs along with front window+tab url+title
#!/usr/bin/env bash
# shows all url+titles of Chrome along with front window+tab url+title
# Source: https://gist.github.com/osteele/704d40f90e17d7bc059d06731056bbe7
# Forked from: https://gist.github.com/samyk/65c12468686707b388ec43710430a421
# Original author: https://gist.github.com/samyk
(osascript << EOF
set titleString to ""
tell application "Google Chrome"