Skip to content

Instantly share code, notes, and snippets.

View hermzz's full-sized avatar

Hermann Käser hermzz

View GitHub Profile
@hermzz
hermzz / test.py
Created February 1, 2024 17:00
Sentry-Jira integration demo
import hashlib
import datetime
import sys
import jwt
import requests
from typing import Any, Mapping, Optional, Sequence
# Grab from jira integration config, I think it's usually `<sentry_host>.jira`
JIRA_KEY = "sentry.example.com.jira"
@hermzz
hermzz / concatenate.md
Last active April 15, 2020 21:44
FFMPEG
echo "file video1.mp4" >> filelist.txt
echo "file video2.mp4" >> filelist.txt
ffmpeg -f concat -i filelist.txt -c copy timelapse.mp4
ffmpeg -i video1.mp4 -i video2.mp4 -filter_complex "[0:v:0] [1:v:0] concat=n=2:v=1 [v]" -map "[v]" output.mp4
@hermzz
hermzz / extractor.bash
Created December 9, 2017 21:20
Flickr exporter
#!/bin/bash
FLICKR_API_KEY="..."
GOOGLE_MAPS_KEY="..."
CURL="curl --silent"
BASE_URL="https://api.flickr.com/services/rest/?api_key=${FLICKR_API_KEY}&format=json&nojsoncallback=1"
PAGE=1
TOTAL_PAGES=$(${CURL} "${BASE_URL}&method=flickr.people.getPhotos&user_id=85777547@N00&page=${PAGE}&per_page=${PER_PAGE}" | jq -r '.photos.pages')
PER_PAGE=100
@hermzz
hermzz / Git.md
Last active January 26, 2017 09:14

Receive a git push --force

git fetch
git reset --hard $remote/$branch

Rebase remote branch into local

git checkout $local

git rebase $remote/$branch $local

@hermzz
hermzz / README.md
Last active September 22, 2016 18:46
UKU Nationals 2016

See the open_rounds.txt file for how I mapped out the different rounds into something that sort of makes sense. The first_two_rounds.json is just an attempt to convert that format into JSON.

@hermzz
hermzz / Docker tips.md
Last active November 28, 2016 10:58
Docker tips

Docker compose

Run bash on an image

docker-compose run --rm ${image_name} bash

Straight up docker

Clean unused volumes
@hermzz
hermzz / Prepare negative
Created April 2, 2015 15:20
Inverts and white balances a negative film scan
; Negtive processing script based on:
; https://code.google.com/p/mcclanahoochie/source/browse/gimp_scripts/auto-wb-lce.scm
;
; It applies:
; - Invert
; - Auto White Balance
; - Local Contrast Enhancement
; effects to an image.
;
; Requires Fx-Foundry (gimp-plugin-registry)

Receive a key

gpg --recv-keys --keyserver [keyserver.example.com] [0xKEY]

Verify a signature

gpg --verify file.sig file

Sign a key

#! /bin/sh -
#
# Install OpenVPN connections for all available
# regions to NetworkManager
#
# Requirements:
# should be run as root
# python and openvpn (will be installed if not present)
#
# Usage:
@hermzz
hermzz / byobu.patch
Last active August 29, 2015 14:06
byobu arrows fix
=== modified file 'usr/share/byobu/keybindings/f-keys.screen'
--- usr/share/byobu/keybindings/f-keys.screen 2012-02-17 05:54:13 +0000
+++ usr/share/byobu/keybindings/f-keys.screen 2012-09-27 23:46:21 +0000
@@ -46,10 +46,10 @@
bindkey "^[[1;2C" focus down # shift-right | focus down
# No ctrl-shift-F3 (move pane) in Screen
# No ctrl-shift-F4 (move pane) in Screen
-bindkey "^[[1;5A" resize +1 # ctrl-up | resize +1
-bindkey "^[[1;5B" resize -1 # ctrl-down | resize -1
-bindkey "^[[1;5D" resize -1 # ctrl-left | resize -1