Skip to content

Instantly share code, notes, and snippets.

View goetzc's full-sized avatar
🕉️

Götz goetzc

🕉️
View GitHub Profile
@goetzc
goetzc / on_pause_show_progress_bar.lua
Created August 12, 2016 05:23
mpv script to show the progress bar on pause.
-- mpv script to show the progress bar on pause. --
function on_pause(name, value)
if value == true then
mp.command("show-progress")
end
end
mp.observe_property("pause", "bool", on_pause)
@goetzc
goetzc / subdl.lua
Last active September 9, 2016 20:49 — forked from gim-/subdl.lua
Automatically download subtitles in mpv using subdl.
-- mpv script to download subtitles using subdl.
-- requires subdl (2016 Sep master branch): https://github.com/alexanderwink/subdl
-- default keybinding: B (capital B)
-- add the following to your input.conf to change the default keybinding:
-- keyname script_binding subdl_load_subs
local utils = require 'mp.utils'
function subdl_load()

Basics

generate key in batch mode using a custom profile

gpg --gen-key --batch gpgspecs

create a file with your fingerprint info and display the related information. A fingerprint is used as a robust key identifier

gpg --fingerprint

Best practices

@goetzc
goetzc / Vagrantfile
Created January 6, 2019 19:03 — forked from wosc/Vagrantfile
Build unison-2.51.2 deb, compatible with the MacOS binary release
Vagrant.configure("2") do |config|
config.vm.define "default" do |default|
default.vm.hostname = "unisonbuild"
default.vm.provider "lxc"
default.vm.box = "zeitonline/bionic64-lxc"
# default.vm.box = "bento/ubuntu-18.04"
end
end
@goetzc
goetzc / CloudwatchMonitoringScripts.json
Last active January 17, 2019 17:49
AWS IAM policy for CloudWatch monitoring scripts
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"cloudwatch:PutMetricData",
"cloudwatch:GetMetricStatistics",
"cloudwatch:ListMetrics",
"ec2:DescribeTags"

Keybase proof

I hereby claim:

  • I am goetzc on github.
  • I am goetzc (https://keybase.io/goetzc) on keybase.
  • I have a public key ASDPyx0QteogNQJAh9fAR00IGKfjdKN78IDdTw-aYUO-WAo

To claim this, I am signing this object:

@goetzc
goetzc / Scaling (Rails) Cron jobs
Last active November 14, 2020 00:30 — forked from wonjun27/Scaling Cronjobs
Rails Cron jobs
Scalr
http://highscalability.com/blog/2010/3/22/7-secrets-to-successfully-scaling-with-scalr-on-amazon-by-se.html
http://stackoverflow.com/questions/10061843/how-to-convert-linux-cron-jobs-to-the-amazon-way
Cron Jobs Are Hard To Distribute
Watch out when scaling out instances with cron jobs on them. Cron jobs aren't designed for the cloud. If the machine image holding your cron job scales out to 20 instances, your cron job will be executed 20 times more often.
This is fine if the scope of your cron job is limited to the instance itself, but if the scope is larger, the above becomes a serious problem. And if you single out a machine to run those cron jobs, you run the risk of not having it executed if that machine goes down.
@goetzc
goetzc / fix_codium.py
Last active April 17, 2021 17:26 — forked from rojnwa/fix_codium.py
Reverts to the old marketplace in VSCodium
#!/usr/bin/env python
import json
PRODUCT_PATH = "/usr/lib/code/product.json"
official_gallery = {
"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
"cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
"itemUrl": "https://marketplace.visualstudio.com/items",
@goetzc
goetzc / bash.generate.random.alphanumeric.string.sh
Created September 2, 2021 15:54 — forked from earthgecko/bash.generate.random.alphanumeric.string.sh
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@goetzc
goetzc / 99-noto-mono-color-emoji.conf
Created December 14, 2021 00:15 — forked from IgnoredAmbience/99-noto-mono-color-emoji.conf
Noto Emoji Color fontconfig for Konsole
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
Noto Mono + Color Emoji Font Configuration.
Currently the only Terminal Emulator I'm aware that supports colour fonts is Konsole.
Usage:
0. Ensure that the Noto fonts are installed on your machine.
1. Install this file to ~/.config/fontconfig/conf.d/99-noto-mono-color-emoji.conf