Skip to content

Instantly share code, notes, and snippets.

#!/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 / 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 / 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 / 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 / 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"
@ffflorian
ffflorian / hosts.txt
Last active January 3, 2019 07:42
Block facebook tracking host file
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
@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}"
#!/usr/bin/env bash
###### Configuration ################################
USER=""
PASSWORD=""
IP_PROVIDER="ip4.ident.me"
#####################################################
INWX_API="https://dyndns.inwx.com/nic/update"
@ffflorian
ffflorian / update-all.sh
Last active March 20, 2018 14:28
Update all git projects in folder
#!/usr/bin/env bash
ERROR_FILE="$(mktemp)"
ERRORS=""
SEPERATOR="\\n\\e[90m-----------------------\\e[0m\\n"
# Change to script's directory to ensure we're in the correct folder.
# http://stackoverflow.com/questions/3349105/how-to-set-current-working-directory-to-the-directory-of-the-script
cd "${0%/*}" || exit 1
@ffflorian
ffflorian / cbor_text.js
Last active September 1, 2017 11:55
CBOR Text Coding Example
'use strict';
const CBOR = require('wire-webapp-cbor');
const text_encode = plaintext => {
const encoder = new CBOR.Encoder();
encoder.text(plaintext);
return new Uint8Array(encoder.buffer);
};