Skip to content

Instantly share code, notes, and snippets.

@ffflorian
ffflorian / relate.sql
Last active August 29, 2015 14:10
Relate two tables in PHPMyAdmin
-- Taken from http://bytes.com/topic/mysql/answers/742624-how-relate-between-two-tables-phpmyadmin
ALTER TABLE table1 ADD FOREIGN KEY (local_key) REFERENCES table2(foreign_key);
@ffflorian
ffflorian / interfaces
Last active August 29, 2015 14:20
/etc/network/interfaces – VirtualBox with two adapters
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# Host-only interface
auto eth0
iface eth0 inet dhcp

Keybase proof

I hereby claim:

  • I am ffflorian on github.
  • I am ffflorian (https://keybase.io/ffflorian) on keybase.
  • I have a public key whose fingerprint is CF62 D315 6F0B 5110 6F92 E1E3 5570 D938 BDA0 0C34

To claim this, I am signing this object:

@ffflorian
ffflorian / remove_bouncing.md
Created October 31, 2015 21:44
Linux Mint 17.2: Remove bouncing launcher icons in the panel
  • Open the file /usr/share/cinnamon/applets/panel-launchers@cinnamon.org/applet.js as root with a text editor like gedit
  • Set line 203 as comment like this:
// this._animateIcon(0);
  • logout and login again
@ffflorian
ffflorian / claw.sh
Created September 24, 2015 10:17
Three-Fingered Claw
# taken from http://stackoverflow.com/questions/1378274/in-a-bash-script-how-can-i-exit-the-entire-script-if-a-certain-condition-occurs
yell() { echo "$0: $*" >&2; }
die() { yell "$*"; exit 111; }
try() { "$@" || die "cannot $*"; }
'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 / 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 / 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
@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