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 / 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 / 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 / init.lsyncd.sh
Last active April 27, 2016 16:26
Lsyncd2 init.d script for Debian Squeeze
#! /bin/sh
### BEGIN INIT INFO
# Provides: lsyncd
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the lsyncd daemon
# Description: starts lsyncd using start-stop-daemon
@hermzz
hermzz / postfix_howto.txt
Created January 13, 2014 10:50
postfix howto
## Queue
- List messages
postqueue -p
- Flush the queue:
postqueue -f
- Attempt deliver of one message
postqueue -i [ID]
- Delete message
postsuper -d [ID]
@hermzz
hermzz / owncloud-update.sh
Last active December 28, 2015 21:09
ownCloud update steps
rm -rf old.owncloud
cp -a owncloud old.owncloud
rm -rf owncloud-latest.tar.bz2
wget http://download.owncloud.org/community/owncloud-latest.tar.bz2
sed "s/maintenance' => false/maintenance' => true/g" owncloud/config/config.php
tar xf owncloud-latest.tar.bz2
chmod -R 775 owncloud/config owncloud/apps
sed "s/maintenance' => true/maintenance' => false/g" owncloud/config/config.php
@hermzz
hermzz / SSL notes.md
Last active December 17, 2015 18:59

Use namespace SSL cert

cat $HOST.key $HOST.crt > $HOST.pem
cat AddTrustExternalCARoot.crt COMODORSA* > sslbundle.crt

Generate self-signed SSL cert

openssl genrsa -des3 -passout pass:x -out $HOST.pass.key 2048
openssl rsa -passin pass:x -in $HOST.pass.key -out $HOST.key

rm $HOST.pass.key