Skip to content

Instantly share code, notes, and snippets.

@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
'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 / 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 / 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'."
@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 / 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/[email protected]/applet.js as root with a text editor like gedit
  • Set line 203 as comment like this:
// this._animateIcon(0);
  • logout and login again

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 / 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 / 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 / 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"