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
%!PS-Adobe-2.0 | |
%%Creator: dvips by Radical Eye Software | |
%%Title: brewsheet.dvi | |
%%Pages: 1 1 | |
%%BoundingBox: 0 0 612 792 | |
%%EndComments | |
%%BeginDocument: tex.pro | |
/TeXDict 200 dict def TeXDict begin /bdf{bind def}def /bop-aux{}bdf /@rigin{ | |
/@page-height exch def /@page-width exch def 72 Resolution div dup neg scale | |
translate}bdf /@letter{Resolution dup -10 mul 8.5 11 @rigin}bdf /@landscape{[ |
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 bash | |
# from http://www.linuxtutorialblog.com/post/solution-converting-flac-to-mp3 | |
OUT_DIR="/home/chris/Music/mp3" | |
[ ! -d ${OUT_DIR} ] && mkdir -p ${OUT_DIR} | |
# modify the lame options to your | |
# preference | |
lame_opts=" --vbr-new -V 2 -B 256 " | |
for x in "${@}" | |
do |
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 -x | |
# Send the CONTINUE lifecycle hook so the ASG knows our EC2 came up successfully. | |
# If the CONTINUE fails, don't care, assume it already was continued | |
REGION="us-east-1" | |
INSTANCE_ID=$1 | |
if [ -z $INSTANCE_ID ] ; then echo Specify INSTANCE_ID ; exit 1; fi | |
ASG_NAME=`aws --output text --region $REGION autoscaling describe-auto-scaling-instances --query 'AutoScalingInstances[?InstanceId==\`'$INSTANCE_ID'\`].AutoScalingGroupName|[0]'` |
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
A B C D E | |
Date (Euro) Item EUR EUR:USD USD | |
24/3/2019 ExpenseForThing -35,00 1,12965 -39,54 | |
D: Daily rate at mkt close: =index(GOOGLEFINANCE("CURRENCY:EURUSD";"close";A2;1);2;2) | |
E: Daily rate times cell C3: =index(GOOGLEFINANCE("CURRENCY:EURUSD";"close";A3;1);2;2)*C3 | |
Note: this is for a File->Spreadsheet Settings -> Locale: Spain | |
For US Locale, you have to use commas in the forula rather than semicolons. | |
The index() is because even a single day query gives back 2x2 cells with Date, Value headers so we have to pick out the numeric value |
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 | |
# Adapted from https://nedbatchelder.com/blog/200712/extracting_jpgs_from_pdfs.html | |
"""Extract jpg's from pdf's. Quick and dirty.""" | |
import sys | |
STARTMARK = b"\xff\xd8" | |
STARTFIX = 0 | |
ENDMARK = b"\xff\xd9" | |
ENDFIX = 2 |
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 | |
# Extract jpg's from pdf's. Quick and dirty. | |
# Adapted from https://nedbatchelder.com/blog/200712/extracting_jpgs_from_pdfs.html | |
import sys | |
pdf = open(sys.argv[1], "rb").read() | |
startmark = b"\xff\xd8" |
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
# .bashrc: NON-login shells | |
# .bash_profile: login shells (like iTerm launches, $0 = "-bash") | |
echo "# \$0=$0" | |
# if [ argv[0][0] == "-" ] I THINK THIS IS WRONG | |
# then | |
# echo "# \$0=$0 Login Shell " | |
# else | |
# echo "# \$0=$0 Non-login shell: arvg[0][0]" $arvg[0][0] " argv=$argv" argv[0]=$argv[0]" | |
# fi |
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/sh | |
# Based on ideas from shortjared/mac-idempotent-setup.sh | |
# First time takes a while; if all's installed, takes 30 seconds. | |
BREW_CASKS=( | |
alfred | |
authy | |
brave-browser # update to get DuckDuckGo | |
docker | |
dropbox |
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 | |
# https://boto3.amazonaws.com/v1/documentation/api/latest/guide/paginators.html | |
"""Loop over S3 videos looking for ones that need new thumbs. | |
Finds all the video/assetid/ prefixes and loops over them, then for each | |
with enough keys, looks to see if they have thumbs (so skip this one) or a | |
~orig. file we can use to create thumbs. | |
""" | |
import os |
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
# Use the Elasticsearch python bindings to connect to Elasticsearch or AWS | |
# ElasticsearchService (ES). For plain Elasticsearch we only need host and | |
# port. For ES, we need to create an AWS RequestAuth and pass those to the | |
# instantiation. This gets the launched EC2/Lambda instances' ID, KEY -- and, | |
# for Lambda, a TOKEN. See: https://github.com/davidmuller/aws-requests-auth | |
# Another approach is shown here: | |
# https://elasticsearch-py.readthedocs.io/en/master/#running-on-aws-with-iam | |
# using requests_aws4auth: https://pypi.org/project/requests-aws4auth/ | |
import os |
NewerOlder