Skip to content

Instantly share code, notes, and snippets.

@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 / 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
@ffflorian
ffflorian / batterylevel.sh
Last active October 7, 2017 06:16
Linux Mint Cinnamon: Display a notification when battery is running low
# Original from http://unix.stackexchange.com/questions/60778/how-can-i-get-an-alert-when-my-battery-is-about-to-die-in-linux-mint
# Added a second notification
#!/bin/bash
POWERSUPPLY="/sys/class/power_supply/AC/online"
STATUS_LOW=25
STATUS_CRITICAL=10
NOT_CHARGING="0"
ICON_LOW="/usr/share/icons/Mint-X/status/scalable/battery-low-symbolic.svg"
ICON_CRITICAL="/usr/share/icons/Mint-X/status/scalable/battery-empty-symbolic.svg"
@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 $*"; }
@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

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 / .Xdefaults
Last active November 27, 2017 09:12
dotfiles
!! source: https://github.com/spazzpp2/dotfiles/blob/29819a5ac5e451bfa39bc324378aa508ef75cae8/Molokai.xrdb
! Molokai theme
URxvt*background: #101010
URxvt*foreground: #d0d0d0
URxvt*color0: #101010
URxvt*color1: #960050
URxvt*color2: #66aa11
URxvt*color3: #c47f2c
URxvt*color4: #30309b
@ffflorian
ffflorian / flux.sh
Last active January 14, 2018 10:51
Automatically download and start xflux
#!/usr/bin/env bash
SCRIPT_NAME="${0##*/}"
TMP_DIR="$(mktemp -d)"
LAT="52.51"
LONG="13.39"
FLUX_URL="https://justgetflux.com/linux/xflux64.tgz"
STR_RUNNING="xflux is already running! If you want to stop it, use '${SCRIPT_NAME} stop'."
STR_STOPPED="xflux is not running! If you want to start it, use '${SCRIPT_NAME} start'."