Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View suhlig's full-sized avatar
😻
Happy

Steffen Uhlig suhlig

😻
Happy
View GitHub Profile
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# This is an updated version of https://lebkowski.name/docker-volumes
main() {
remove-exited-containers
remove-unused-images
@suhlig
suhlig / events.sql
Created May 17, 2020 21:21
In Grafana, show events stored in InfluxDB
# Insert an event into InfluxDB
use e5573;
INSERT events title="Disabled unattended-upgrades",description="We should see reduced bandwidth usage from here on",tags="apt,debug,bandwidth";
# Configure the annotation in Grafana
# https://grafana.com/docs/grafana/latest/features/datasources/influxdb/#annotations
SELECT title, description from events WHERE $timeFilter ORDER BY time ASC;
@suhlig
suhlig / git-duet-rebase.markdown
Created October 20, 2020 09:08
git-duet rebasing

from git-duet:

Rebasing (resets the committer to the committer of the current pair):

$ git rebase -i --exec 'git duet-commit --amend'
@suhlig
suhlig / imagemagick.txt
Created July 6, 2018 07:35
List of Fred's ImageMagick Scripts (http://www.fmwconcepts.com/imagemagick)
2colorthresh - Automatically thresholds an image to binary (b/w) format using an adaptive spatial subdivision color reduction technique
3Dbox - Generates a perspective view of a 3D box at any orientation with pictures pasted on each of its sides
3Dcover - Wraps an image around the front and left or right side of box viewed in rotated perspective
3Dreflection - Adds a fading reflection below an image and views it in perspective
3Drotate - Applies a perspective distortion to an image by providing three rotation angles, zoom, offsets, background color, perspective exaggeration and auto zoom/centering 3Dtext - Converts text into an image with a 3D extrusion effect accentedges - Applies accented edges to an image
adaptivegamma - Enhances the contrast/brightness in an image using a locally adaptive gamma method
anglegradient - Creates a gradient effect at a specific orientation angle
aspect - Resizes an image to a specific size allowing either cropping or padding to deal with the aspect ratio change
aspectcrop - Cr
@suhlig
suhlig / steampipe_hn.sh
Created May 23, 2021 11:23
Yesterdays Top HN as JSON
steampipe query --output json "
select
title, url, 'https://news.ycombinator.com/item?id=' || id as comments_url
from
hackernews_top
where
time > current_date - interval '24 hour'
order by
score desc
limit
@suhlig
suhlig / zsh-histdb-queries.sql
Created July 14, 2021 08:31
Useful queries against zsh-histdb
-- start sqlite monitor with _histdb_query
-- most-often used commands; top ones at the bottom
SELECT
commands.argv, count(*) as invocation_count
FROM
history
LEFT JOIN
commands
ON
@suhlig
suhlig / iCatcher-Top-10-2021.sql
Created December 18, 2021 16:14
Create my list of #TopTenPodcasts2021
SELECT
CAST(SUM(ZMEDIADURATION) / 60 / 60 AS INT) AS listened_hours,
ZPODCAST.ZTITLE as podcast,
ZURL as url
FROM
ZPODCAST,
ZPODCASTEPISODE
WHERE
ZPODCASTEPISODE.ZPODCASTFOREPISODE == ZPODCAST.Z_PK
AND
@suhlig
suhlig / recrawl-pinboard.js
Created April 9, 2021 13:38
Re-crawl pinboard links
$x("//a[@title='Click to re-crawl this link']").forEach(element => element.click());
@suhlig
suhlig / template-introspection.go
Created May 5, 2022 13:29
Golang Template Introspection
{{ printf "%#v" . }}