Skip to content

Instantly share code, notes, and snippets.

View monkeydom's full-sized avatar

Dominik Wagner monkeydom

View GitHub Profile
@monkeydom
monkeydom / extractAttachments.sh
Created February 9, 2023 14:34
extracting all the attachments of an .xcresults bundle with xcode tools being the only dependency
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then
@monkeydom
monkeydom / ks_changeset.sh
Created May 3, 2022 08:13
Script to put 2 folders into a single changeset git and diff it using ksdiff to see the changeset nicely
#!/bin/sh
# ks_changeset v0.9 - 2022-05-03
# Enable "safe" mode - see http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
if [[ $# -lt 3 ]]; then
echo "Usage: ks_changeset.sh <FolderA> <FolderB> <DestinationGit>"
Sehr geehrter Herr Eisenberg,
in der vorbezeichneten Angelegenheit kommen wir zurück auf Ir Schreiben vom 16. No-
ember 2021 und geben nachfolgende Unterlassungsverpflichtungserklärung ab.
Die Axel Springer SE verpflichtet sich - ohne Präjudiz für die Sach- und Rechtslage und
one Anerkennung einer Rechtspflicht, gleichwohl rechtsverbindlich - gegenüber
Frau Ines Aniol, es bei Meidung einer für den Fall der schuldhaften Zuwiderhandlung von
Frau Ines Aniol festzusetzenden, im Streitfall der Höhe nach vom zuständigen Gericht zu
Überprüfenden und an Frau Ines Aniol zu zahlenden Vertragsstrafe zu unterlassen, zU
verbreiten und/oder verbreiten zu lassen und/oder öffentlich zugänglich zu machen
und/oder öffentlich zugänglich machen zu lassen:
on seescriptsettings()
return {keyboardShortcut:"$@o", shortDisplayName:"New Document", displayName:"New Document with Date"}
end seescriptsettings
to secsToHMS(secs)
tell (1000000 + secs div hours * 10000 + secs mod hours div minutes * 100 + secs mod minutes) as string ¬
to return text 2 thru 3 & ":" & text 4 thru 5 & ":" & text 6 thru 7
end secsToHMS
set {year:y, month:m, day:d, time:t} to current date
@monkeydom
monkeydom / videoconvert.sh
Created February 16, 2021 11:32
My MediathekView convert to h265 video script
#!/bin/sh
mkdir -p Converting
mkdir -p Source
mkdir -p Converted
for f in *.mp4; do
o=${f##*/}
t=${o%.*}.h265.mp4
ffmpeg -i "$f" \
@monkeydom
monkeydom / normalize-pdf.sh
Created October 12, 2018 07:44
Takes a pdf, removes metadata and generates a deterministic version based on the contents so version control is happy.
#!/bin/sh
TEMP=${1}_tmp
QPDF=${TEMP}_qpdf
cp $1 $TEMP
exiftool -all:all= -overwrite_original_in_place $TEMP
qpdf --deterministic-id --linearize $TEMP $QPDF
perl -pi -ne 's/(\/ID\s*\[<*)([\d+a-fA-F]*)(>\s*<)([\d+a-fA-F]*)(>)/\1\4\3\4\5/g' $QPDF
cp $QPDF $1
rm $QPDF $TEMP
@monkeydom
monkeydom / swiftc.sh
Last active October 24, 2015 23:50
Script to be used in a hashbang to conditionally compile and then run the swift script referenced. usage #!/usr/bin/env swiftc.sh in your swift file, and put in path
#!/bin/sh
SWIFT=$(/usr/bin/env xcrun -f swift)
SCRIPTPATH=$1
COMPILEDPATH="$SCRIPTPATH.o"
SDKPATH=$(/usr/bin/env xcrun --show-sdk-path --sdk macosx)
#compile if necessary
dom@domair:~/bin$ cat swift-optparser.swift
#!/usr/bin/env xcrun swift -i
// add e.g. -sdk '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk'
// to be able to import Cocoa Frameworks
var argumentArray = Array<String>()
for index in 0..Int(C_ARGC) {
argumentArray.append(String.fromCString(C_ARGV[index]))
import Foundation
let argumentCount = Int(C_ARGC)
var argumentArray: Array<String> = Array<String>()
for index in 0..argumentCount {
argumentArray.append(String.fromCString(C_ARGV[index]))
}
@monkeydom
monkeydom / gist:8212210
Created January 1, 2014 22:28
command line help to download all congress session videos
#!/bin/sh
# before that do e.g. brew install lynx and brew install aria2
for x in `lynx http://cdn.media.ccc.de/congress/2013/mp4/ --dump | grep "http" | grep "30c3" | cut -c 7-`; do
echo "$x".torrent;
done > SessionTorrentList.txt
aria2c --seed-time=0 -Z -i SessionTorrentList.txt