Skip to content

Instantly share code, notes, and snippets.

@ffflorian
ffflorian / get-commit.yml
Created August 4, 2020 14:17
GH actions: Get commit message in a PR
name: Notify on Pull Request
on:
pull_request:
branches: [dev]
jobs:
send_notification:
runs-on: ubuntu-latest
@ffflorian
ffflorian / spon.js
Last active January 18, 2024 10:59
Spiegel Online Paywall
/**
* Read Spiegel Online Plus Articles, hidden behind a rot(1) "encryption"
* and a blur filter.
* Just copy this and paste it into your browser's console (press F12) -
* or use the minified version, see comments below.
* Try it out on any article at http://www.spiegel.de/spiegelplus/.
*
* @ffflorian, 2016
*/
@ffflorian
ffflorian / generate_ssh_key.sh
Created December 28, 2018 21:30
Quickly generate an SSH key
#!/usr/bin/env sh
SCRIPT_NAME="${0##*/}"
SSH_USER="${USER}"
KEY_DIR="${HOME}/.ssh"
KEY_TYPE="ed25519"
HOSTNAME="$(hostname)"
_log() {
[ "${QUIET}" != "quiet" ] && echo "[$(date +'%Y-%m-%d %H:%M:%S')] ${1}"
@ffflorian
ffflorian / bitwarden-update.sh
Last active May 14, 2022 14:52
Update (or install) the latest Bitwarden
#!/usr/bin/env bash
# Update (or install) the latest Bitwarden
# Optimized for Debian/Ubuntu + GNOME
# ffflorian 2019
set -e
SCRIPT_NAME="${0##*/}"
INSTALL_DIR="/opt/Bitwarden"
EXEC_BIN="${INSTALL_DIR}/bitwarden"
#!/usr/bin/env bash
# Update (or install) the latest NextCloud AppImage
# Optimized for Debian/Ubuntu + GNOME
# ffflorian 2021
set -e
SCRIPT_NAME="${0##*/}"
INSTALL_DIR="/opt/nextcloud"
APPIMAGE_FILE="nextcloud.AppImage"
@ffflorian
ffflorian / dislocker.sh
Last active November 1, 2020 03:31
Mount BitLocker drive with DisLocker
#!/bin/bash
HARDDRIVE=/dev/sdb2
BITLOCK_MOUNT=/media/bitlocker
DECRYPTED_MOUNT=/media/mount
USAGE="Usage: dislock [options]
Options:
-k, --recoverykey KEY The BitLocker recovery key to use for mounting
-u, --umount Unmount the mounted BitLocker volume
@ffflorian
ffflorian / helpers.ts
Created October 28, 2020 15:09
TypeScript Helpers
// -- Unwrapping values from an array inside an interface --
type Person = {
name: string;
birthDate?: string;
age: number;
hobbies: Array<{ title: string; location: string }>
}
type DeArrayify<A> = A extends Array<infer T> ? T : A;
@ffflorian
ffflorian / ublock-origin-custom-filter.txt
Last active September 1, 2020 10:56
uBlock Origin Custom Filterlist
||widgets.opinary.com/*
||widgets.outbrain.com/*
||ytwkco.com/$subdocument
||accounts.google.com/gsi/$3p
en.wikipedia.org##.banner
heise.de###usercentrics-button
techstage.de###usercentrics-button
dict.cc###snigel-cmp-framework
tagesspiegel.de###opinary-iframe
@ffflorian
ffflorian / Default (Linux).sublime-keymap
Last active August 21, 2020 09:28
Sublime text settings
[
{ "keys": ["f12"], "command": "save_all" },
{ "keys": ["ctrl+shift+o"], "command": "prompt_open_folder" },
{ "keys": ["ctrl+shift+r"], "command": "revert_all" },
{ "keys": ["ctrl+up"], "command": "swap_line_up" },
{ "keys": ["ctrl+down"], "command": "swap_line_down" },
{ "keys": ["ctrl+shift+up"], "command": "select_lines", "args": {"forward": false} },
{ "keys": ["ctrl+shift+down"], "command": "select_lines", "args": {"forward": true} },
]
@ffflorian
ffflorian / encrypt.js
Created July 10, 2016 11:54
Simple OpenPGP.js example with Promises for node.js
/*
* Simple OpenPGP.js example with Promises for node.js
* See: https://github.com/openpgpjs/openpgpjs
*/
'use strict';
const fs = require('fs');
const openpgp = require('openpgp');
const keyFile = 'pubkey.asc';