View script-fu-overlay.scm
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
;; script for automatically overlaying two images, | |
;; for comparison, in gimp. | |
;; | |
;; 1. save the file in your scripts directory | |
;; (/Applications/Gimp.app/Contents/MacOS/Resources/share/gimp/2.0/scripts/ or | |
;; /Users/[user]/Library/Application Support/GIMP/2.8/plug-ins on my mac) | |
;; 2. generate two images to compare | |
;; 3. run: | |
;; bash: /Applications/Gimp.app/Contents/MacOS/gimp-2.8 -b '(script-fu-overlay "image1.pdf" "image2.jpg")' | |
;; |
View bash_args_template.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
#!/bin/bash -e | |
# cobbled together from various of stackoverflow posts | |
# saner programming env: these switches turn some bugs into errors | |
set -o errexit -o pipefail -o noclobber -o nounset | |
# -allow a command to fail with !’s side effect on errexit | |
# -use return value from ${PIPESTATUS[0]}, because ! hosed $? | |
! getopt --test > /dev/null |
View ubuntu_snippets
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
# disk usage | |
sudo du -cha --max-depth=1 / | grep -E "M|G" | |
# ubuntu boot log, for previous boot | |
journalctl -b-1 --no-pager |
View bash_snippets
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
# remove spaces from files | |
for f in *\ *; do mv "$f" "${f// /_}"; done | |
View bash_snippets
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
# remove spaces from files | |
for f in *\ *; do mv "$f" "${f// /_}"; done | |
View test_data.tsv
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
date | close | |
---|---|---|
1-May-12 | 582.13 | |
30-Apr-12 | 583.98 | |
27-Apr-12 | 603.00 | |
26-Apr-12 | 607.70 | |
25-Apr-12 | 610.00 | |
24-Apr-12 | 560.28 | |
23-Apr-12 | 571.70 | |
20-Apr-12 | 572.98 | |
19-Apr-12 | 587.44 |
View triangle_dict.py
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
# Copyright 2013, Alex Ausch | |
# Free to use under attribution license: http://creativecommons.org/licenses/by/2.0/ca/ | |
try: | |
from collections.abc import Mapping | |
except ImportError: | |
from collections import Mapping | |
class TriangleDictionary(Mapping): |
View iterate_gzipped_s3_file.py
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
#!/usr/bin/env python3 | |
import boto3 | |
import gzip | |
import io | |
import sys | |
import tempfile | |
BUCKET = 'SOME_BUCKET' |
View static_file_scanner_demo.py
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
# Copyright 2013, Alex Ausch | |
# Free to use under attribution license: http://creativecommons.org/licenses/by/2.0/ca/ | |
from twisted.web.resource import Resource | |
from twisted.application import service | |
from StaticFileScanner import StaticFileScanner | |
root = Resource() | |
root.putChild('static', |
View StaticFileScanner.py
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
# Serves static files from multiple local directories at a single external url | |
# usage demo: https://gist.github.com/aausch/7348230 | |
# | |
# Copyright 2013, Alex Ausch | |
# Free to use under attribution license: http://creativecommons.org/licenses/by/2.0/ca/ | |
from twisted.web.resource import Resource | |
from twisted.web.static import File | |
class StaticFileScanner(Resource): |
NewerOlder