Skip to content

Instantly share code, notes, and snippets.

View hrickards's full-sized avatar

Harry Rickards hrickards

View GitHub Profile
#!/usr/bin/env bash
# check args
if [ "$#" -ne 2 ]; then
echo "You must pass 2 arguments. Call like:"
echo " ./move_photos.sh ./folder_containing_nefs ./target_folder_to_contain_selected_nefs"
exit 1
fi
SOURCE_DIR=$1
TARGET_DIR=$2
#!/usr/bin/env bash
# check args
if [ "$#" -ne 2 ]; then
echo "You must pass 2 arguments. Call like:"
echo " ./move_photos.sh ./folder_containing_nefs ./target_folder_to_contain_selected_nefs"
exit 1
fi
SOURCE_DIR=$1
TARGET_DIR=$2
@hrickards
hrickards / fix_encoding.sh
Created June 13, 2017 14:12
Transcode UTF8 files with broken chars to WINDOWS-1252
#!/usr/bin/env bash
[ $# -ne 2 ] && { echo "Usage: $0 <input_file.csv> <output_file.csv>"; exit 1; }
iconv -f UTF-8//TRANSLIT//IGNORE -t WINDOWS-1252 $1 > $2.csv
exit 0;
#!/usr/bin/env bash
OUTFILE=etranscript.pdf
PRINTDIR=/private/var/spool/cups
NRUSER=$(whoami)
sudo -E bash -c "
PRINTFILE=\$(ls -Atr $PRINTDIR/d* | tail -n 1)
pstopdf \$PRINTFILE -o $OUTFILE
chown $NRUSER: $OUTFILE
"
@hrickards
hrickards / 01_centos7_amis.json
Created June 2, 2017 13:48 — forked from gene1wood/AWS-CentOS-6-7-8-8-Stream-AMIs.md
AWS CloudFormation CentOS 7 AMIs
{
"Mappings": {
"RegionMap": {
"ap-northeast-1": {
"CentOS7x8664EBSHVM": "ami-eec1c380"
},
"ap-northeast-2": {
"CentOS7x8664EBSHVM": "ami-c74789a9"
},
"ap-south-1": {

Amida Contributor License Agreement

Adapted from the Apache Software Foundation Individual Contributor License Agreement ("Agreement") V2.0

In order to clarify the intellectual property license granted with Contributions from any person or entity, Amida must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of Amida and its users; it does not change your rights to use your own Contributions for any other purpose.

@hrickards
hrickards / cycle-pem.sh
Last active March 8, 2017 20:22 — forked from jsachs/cycle-pem.sh
shell script to replace authorized_keys in an EC2 instance
#!/bin/bash
# this script should be used in a dir with both the old
# private key and the new public key
oldpem=$1
user=$2
newpub=$3
newpem=$4

Keybase proof

I hereby claim:

  • I am hrickards on github.
  • I am rickards (https://keybase.io/rickards) on keybase.
  • I have a public key whose fingerprint is 16E5 1EB4 8E94 3E58 4587 0A76 C861 E1C4 5EE8 87FC

To claim this, I am signing this object:

@hrickards
hrickards / _.md
Last active March 18, 2016 13:14
test
% computes P(D|H_1)
% H_1: the fair coin hypothesis
% heads and tails are equally likely, so P = (1/2)^n where n is coin flip
% sequence length (= H + T, where H is the number of heads and T the number
% of tails)
function P = PDH1(H, T)
P = 1/(2^(H+T));
end