Skip to content

Instantly share code, notes, and snippets.

Avatar
🍵
418 I'm a teapot

Tim Abell timabell

🍵
418 I'm a teapot
View GitHub Profile
@timabell
timabell / rehash.sh
Created Oct 1, 2021
hashdeep orchestrator for data integrity checks in home folder
View rehash.sh
#!/bin/sh
for x in Music Downloads Documents Pictures Phone Dropbox repo; do
file="checksums-$x.txt"
echo ""
echo "#### hashing $x ####"
cd ~/$x
mv "$file" "$file.bak"
time hashdeep -c md5 -of -r -l . > "$file"
done
View update-docker-compose.sh
#!/bin/sh
# tag grabber from: https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
# original install instructions https://docs.docker.com/compose/install/
latest_tag=`curl --silent "https://api.github.com/repos/docker/compose/releases/latest"|grep '"tag_name":'|sed -E 's/.*"([^"]+)".*/\1/'`
target=~/Documents/programs/bin/docker-compose
curl -L "https://github.com/docker/compose/releases/download/$latest_tag/docker-compose-$(uname -s)-$(uname -m)" -o $target
chmod +x $target
View entity-relationship-diagram.dot
# erd for https://github.com/DFE-Digital/early-careers-framework/
# view: https://dreampuf.github.io/GraphvizOnline/?url=https://gist.githubusercontent.com/timabell/d12c9cde5f88ef618d03d7aacb84b7e7/raw/f2e4105632d8612484058b6366679cdc851f89ee/entity-relationship-diagram.dot
# dot source: https://gist.github.com/timabell/d12c9cde5f88ef618d03d7aacb84b7e7
# to regenerate this:
# - checkout branch `entity-relationship-diagram-outputs`
# - rebase on `develop`
# - `bundle`
# - `bundle exec erd --filetype=dot`
# - upload `tmp/entity-relationship-diagram.dot` to gist
# - link to gist with `https://dreampuf.github.io/GraphvizOnline/?url=`+your url
View move-phone-pics.sh
#!/bin/bash
# Clear older photos and videos of android phone.
# Combined with https://syncthing.net/
# Howto:
#
# *Warning* make sure you have good backups and multiple copies of things first!
#
# 1) Install synthing on the phone and a laptop. Configure sync of at least DCIM folder.
View json-irb.rb
#!/usr/bin/env ruby
require "json"
require "pry"
def load_json filename
puts "parsing #{filename} ..."
file = File.read filename
json = JSON.load file
puts "#{json.length} records loaded"
@timabell
timabell / .gitignore
Last active Jul 27, 2020
live reloading graphviz editing
@timabell
timabell / combine-cycliq.sh
Last active May 16, 2020
combine cycliq videos on a linux commandline
View combine-cycliq.sh
# https://gist.github.com/timabell/26716d7773b61d7b586c5a1babe8fb28
# make a picture in picture video from multiple front/back camera chunked video files
# expects files in folders `front/` and `back/`
mkdir -p output
# front
# concat file chunks together https://trac.ffmpeg.org/wiki/Concatenate
ls front/*.MP4 | awk '{print "file " "'\''" $0 "'\''"}' | tee front-files.txt
ffmpeg -f concat -i front-files.txt -c copy -flags +global_header -acodec libvo_aacenc output/front.mp4
View LogMockHelper.cs
using System;
using System.Linq.Expressions;
using Microsoft.Extensions.Logging;
using Moq;
using Moq.Language.Flow;
namespace YourProject.Unit.Tests
{
internal static class MockHelper
{
View schema-explorer-parameters.json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"resourceEnvironmentName": {
"value": ""
},
"customHostName": {
"value": ""
},
@timabell
timabell / schema-explorer-parameters.json
Last active Nov 11, 2019
simple azure ARM template for schema explorer docker image. Newer version: https://gist.github.com/timabell/ad51ef7ab1525ad2c4d929f427c535df
View schema-explorer-parameters.json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"containerName": {
"value": "s121d01-schema-explorer-test"
},
"location": {
"value": "westeurope"
},