Skip to content

Instantly share code, notes, and snippets.

@ffflorian
ffflorian / snippets.sh
Last active October 23, 2016 10:28
bash snippets
# Disable terminal bell
xset -b
# Disable touchpad (see device number with 'xinput list')
TOUCHPADID=$(xinput list | grep -i TouchPad | awk -F= '{ print $2}' | awk '{print $1}')
xinput set-prop $TOUCHPADID "Device Enabled" 0
# ufw: Allow all connections to port 3000 from within the local network
'use strict';
export const colors = {
'reset' : '\x1b[0m',
'hicolor' : '\x1b[1m',
'underline' : '\x1b[4m',
'inverse' : '\x1b[7m',
// foreground colors
'black' : '\x1b[30m',
'red' : '\x1b[31m',
'green' : '\x1b[32m',
@ffflorian
ffflorian / colors.sh
Last active December 7, 2016 10:53
Bash colors
#!/bin/bash
# Taken from https://github.com/gavingmiller/dotfiles/blob/master/bin/colors.bash
# Description: Small cheat sheet script because my memory is cruddy.
# tputcolors 1 - 7
# 1 red
# 2 green
# 3 yellow
# 4 blue
@ffflorian
ffflorian / dynv6.sh
Last active January 3, 2017 22:13
dynv6.net updater
#!/usr/bin/env bash
# Usage: dynv6.sh --token TOKEN --name NAME1,NAME2
# Created by @ffflorian (https://github.com/ffflorian)
# Licensed under the MIT license.
SCRIPT_NAME="${0##*/}"
_print_usage() {
cat <<EOF
@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';
@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 / appname.service
Created September 1, 2016 16:22
Example systemd service for a node.js app
# Create at /etc/systemd/system/ or ~/.config/systemd/user/
# Enable with systemctl enable appname.service
# Start with systemctl start appname.service
[Unit]
Description=Appname
# wait for network
After=network.target
[Service]
@ffflorian
ffflorian / gh-open.sh
Last active September 5, 2017 11:28
Print or browse a git repository's URL.
#!/usr/bin/env bash
# Print or browse a git repository's URL.
# @ffflorian, 2016
# MIT License
set -e
SCRIPT_NAME="${0##*/}"
_print_usage() {
@ffflorian
ffflorian / wire_build_install.sh
Last active October 17, 2017 15:52
Wire Desktop Build for Debian x64 and i386
# Wire build and installation for Debian x64
# Created by @ffflorian (https://github.com/ffflorian)
# Licensed under the MIT license.
# Prerequisites:
# * You need npm, git, g++ and dpkg.
# * You need to clone https://github.com/wireapp/wire-desktop.
# Usage: Run it in the folder of the wire-desktop repo.
@ffflorian
ffflorian / build_coax.sh
Last active January 23, 2018 10:23
Build coax on Debian
#!/usr/bin/env bash
# Build script for https://github.com/wireapp/coax
set -e
RUSTUP_SCRIPT_REMOTE="https://sh.rustup.rs"
RUSTUP_SCRIPT_LOCAL="install_rust.sh"
COAX_REPO="https://github.com/wireapp/coax.git"