This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SESSIONNAME="ctl" | |
tmux has-session -t $SESSIONNAME &> /dev/null | |
if [ $? != 0 ] | |
then | |
tmux new-session -s $SESSIONNAME -n dashboard -d sudo watch -n 5 podman ps -a | |
tmux split-window -v -l 70% top | |
tmux new-window -n flood-logs journalctl -u flood.service -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require games/cards racket/gui racket/class racket/unit) | |
;; Layout width and height: | |
(define WIDTH 5) | |
(define HEIGHT 4) | |
(define MAX-MATCHES (/ (* WIDTH HEIGHT) 2)) | |
;; Randomize | |
(random-seed (modulo (current-milliseconds) 10000)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/llnw/bbc_radio_hereford_worcester.m3u8#BBC Hereford & Worcester | |
http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/llnw/bbc_radio_one.m3u8#BBC Radio 1 | |
http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/llnw/bbc_1xtra.m3u8#BBC Radio 1Xtra | |
http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/llnw/bbc_radio_two.m3u8#BBC Radio 2 | |
http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/llnw/bbc_radio_three.m3u8#BBC Radio 3 | |
http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/nonuk/sbr_low/llnw/bbc_radio_fourfm.m3u8#BBC Radio 4 | |
http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/nonuk/sbr_low/llnw/bbc_radio_five_live.m3u8#BBC Radio 5 Live | |
http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_low/llnw/bbc_radio_five_live_sports_extra.m3u8#BBC Radio 5 Live Sports Extra | |
http://a.files.bbci. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Base16 - Gnome Terminal color scheme install script | |
[[ -z "$PROFILE_NAME" ]] && PROFILE_NAME="Tango Modified" | |
[[ -z "$PROFILE_SLUG" ]] && PROFILE_SLUG="tango-modified" | |
[[ -z "$DCONF" ]] && DCONF=dconf | |
[[ -z "$UUIDGEN" ]] && UUIDGEN=uuidgen | |
dset() { | |
local key="$1"; shift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'url-util) | |
(defun hjst/send-to-pocket () | |
"Send the URL at point to Pocket for reading later" | |
(interactive) | |
(let | |
((url (url-get-url-at-point))) | |
(start-process-shell-command "msmtp" "*send-to-pocket*" | |
(concat "printf 'Add:\n%s\n'" | |
url | |
"| msmtp add@getpocket.com")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl --head --silent --output /dev/null \ | |
--write-out "%{http_code}: %{url_effective}\n" \ | |
https://s3.amazonaws.com/bucket/foo/bar-2.[6-82].[0-9]-[1-9].baz.[0-9].tgz \ | |
| grep -v ^403 | |
# --head # do a HEAD, not a GET; understand the tradeoffs | |
# --silent # hush the usual output progress bars etc. | |
# --output /dev/null # hush the remaining output (header echoes) | |
# --write-out "%{http_code}: %{url_effective}\n" # output these specific fields on a line, suitable for grep | |
# .../bucket/foo/bar-2.[6-82].[0-9]-[1-9].baz.[0-9].tgz # URL pattern, usual bash syntax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PLANTUML_JAR_URL = https://sourceforge.net/projects/plantuml/files/plantuml.jar/download | |
DIAGRAMS_SRC := $(wildcard diagrams/*.plantuml) | |
DIAGRAMS_PNG := $(addsuffix .png, $(basename $(DIAGRAMS_SRC))) | |
DIAGRAMS_SVG := $(addsuffix .svg, $(basename $(DIAGRAMS_SRC))) | |
# Default target first; build PNGs, probably what we want most of the time | |
png: plantuml.jar $(DIAGRAMS_PNG) | |
# SVG are nice-to-have but don't need to build by default | |
svg: plantuml.jar $(DIAGRAMS_SVG) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws_set_mfa_env_vars () { | |
# This assumes you have the aws-cli tool already set up and working: | |
# http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html | |
# | |
# This is the ARN for your MFA device, it's found in the "Security | |
# Credentials" tab of your IAM user summary | |
mfa_arn="arn:aws:iam::01234567890:mfa/your.name.here" | |
# This function only takes one parameter: the current TOTP value | |
# shown on your MFA device (will be a 6 digit number) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
allFilms(first: 5) { | |
edges { | |
cursor | |
node { | |
nodeId | |
filmId | |
title | |
releaseYear | |
actors: filmActorsByFilmId { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on the two-pass suggestions here: https://trac.ffmpeg.org/wiki/Encode/H.264 | |
# | |
# Optional: for multiple VOB files you wish to concatenate, do so *before* reencoding: | |
ffmpeg -i "concat:VTS_01_1.VOB|VTS_01_2.VOB|VTS_01_3.VOB" -c copy CONCAT.VOB | |
# The target average bitrate (for -b:v switch) is calculated like so: | |
# For a video that's 600 seconds long and a target filesize of 200MB | |
# (200 MiB * 8192 [converts MiB to kBit]) / 600 seconds = ~2730 kBit/s total bitrate | |
# 2730 - 128 kBit/s (desired audio bitrate) = 2602 kBit/s video bitrate |
NewerOlder