Skip to content

Instantly share code, notes, and snippets.

View ChrisCummins's full-sized avatar

Chris Cummins ChrisCummins

View GitHub Profile
10 39 53 71 111 30
55 103 97 55 53
39 53 55 90 1
111 97 55 38 90 25
52 10 111 23 53
10 29 53 103 10 39 1
88 103 109 55
2 55 111 105 10 30
111 55 27 38 29 53 55
@ChrisCummins
ChrisCummins / unpack_bacbklaze_restore_zip_archive.sh
Last active March 22, 2022 10:38
A (paranoid) script for extracting Backblaze's zip restore archives.
#!/usr/bin/env bash
#
# Unpacking Backblaze archives
# ----------------------------
#
# A paranoid script for extracting a zip file into the current directory. It
# attempts to validate against common gotchas: it checks the list of extracted
# files against the list of archive contents, it valids the zipfile's contents
# checksums, and it uses "ditto" over "unzip" because it handles non-ASCII
# filenames properly.
@ChrisCummins
ChrisCummins / opt_wtf.py
Last active February 9, 2022 17:55
Evaluating binary sizes of CHStone benchmarks when compiled using different combinations of clang / opt flags
"""Script to evaluate binary sizes of CHStone benchmarks when compiled using
different combinations of clang / opt flags.
Requires latest CompilerGym:
python -m pip install compiler_gym -U
Usage:
python opt_wtf.py
@ChrisCummins
ChrisCummins / find-dropbox-conflicts.sh
Created February 1, 2017 11:02
Find and optionally remove conflicted Dropbox files.
#!/usr/bin/env bash
#
# Find and optionally remove conflicted Dropbox files.
# Feb 2017 Chris Cummins <chrisc.101@gmail.com>
#
# Usage:
# ./find-dropbox-conflicts.sh # list conflicted files
# ./find-dropbox-conflicts.sh --rm # remove conflicted files
#
if [[ "$1" == "--rm" ]]; then
@ChrisCummins
ChrisCummins / omni.py
Created September 15, 2016 20:35
Send OmniFocus item to Mail Drop from the command line
#!/usr/bin/env python2
"""
omni - add a task to OmniFocus inbox from the command-line.
Requirements:
* A working 'mail' interface, for sending email over the command-line.
For OS X, see: http://codana.me/2014/11/23/sending-gmail-from-os-x-yosemite-terminal/
* An OmniFocus Mail Drop account. See the OmniFocus help.
@ChrisCummins
ChrisCummins / remove-jpg-sidecars.sh
Last active February 1, 2017 11:03
Remove the jpg sidecar files from RAW+JPG imports.
#!/usr/bin/env bash
#
# remove-jpg-sidecars.sh
#
# A script to remove the .jpg sidecar files which are generated by
# cameras capturing in JPG+RAW mode.
#
# How it works:
#
# 1) It generates a list of all dng files in the current directory.
@ChrisCummins
ChrisCummins / gravepinger
Last active August 29, 2015 13:56
Automatically grab the contents of a web page on a timer and discard the results. Useful for debugging servers or pretending your website's more popular than it is (sure we can justify the extra dyno now that we're seeing a bump in traffic!).
#!/bin/sh
#
# gravepinger - Pings a website on a timer.
#
test -n "$2" || {
echo "Usage: gravepinger <target> <frequency>" >&2
echo "" >&2
echo "Invokes wget on <target> every <frequency> timespan." >&2
echo "Target can be any web page, e.g. \`http://chriscummins.cc'." >&2
echo "Timespan may be any number suffixed with \`s' for seconds," >&2
@ChrisCummins
ChrisCummins / git-rewrite-author.sh
Created July 23, 2013 11:04
It was frustrating to have have to look up how to rewrite git credentials each time, so here's a script to do such.
#!/bin/bash
#
# git-rewrite-author.sh
#
# Change the author credentials in a git repository. Execute with "--help"
# argument for usage information.
print_usage()
{
echo "Usage: $(basename $0) <new author> <new email>"
@ChrisCummins
ChrisCummins / server.sh
Last active December 19, 2015 17:38
A small script to provide convenient day-to-day management of a local file server.
#!/bin/bash
#
# server.sh
#
# Copyright (C) 2013 Chris Cummins
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.