This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This is an easier-to-tweak version of Steffen Honig's i3lock | |
# script. If it doesn't work, it's his fault ;) | |
# | |
TEMP_FILE=/tmp/lock.png | |
TEMP_FILE_POST=/tmp/lock.modified.png | |
BAR_BG_COLOR="orange" | |
BAR_FONT_COLOR="white" | |
BAR_FONT="Source-Code-Pro-Black" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim:ts=2:sts=2:sw=2:et | |
#=========================================================== | |
# NTP Configuration Playbook | |
#=========================================================== | |
# This script will remove the 'ntp' daemon from each server | |
# and properly configure the 'systemd-timesyncd' daemon so | |
# that 'timedatectl' uses a specific NTP server. Remember | |
# to create a 'timesyncd.conf' file that holds your config | |
# in the same directory as this ansible playbook before | |
# running. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import combinations as comb | |
from pathlib import Path | |
from typing import Union | |
adjacent = [ | |
(1, 0, 0), | |
(0, 1, 0), | |
(0, 0, 1), | |
(-1, 0, 0), | |
(0, -1, 0), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
from typing import Union | |
from itertools import cycle | |
from dataclasses import dataclass | |
rocks = [ | |
[0b00000, 0b00000, 0b00000, 0b11110], | |
[0b00000, 0b01000, 0b11100, 0b01000], | |
[0b00000, 0b00100, 0b00100, 0b11100], | |
[0b10000, 0b10000, 0b10000, 0b10000], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include <Serial.h> | |
#define THRESHOLD 1.23 | |
String states[4] = { | |
"Ready to dock", // Phone is not in cradle || !ps1 & !ps2 & !ds | |
"Docking", // Phone is docking || ps1 & ps2 & !ds | |
"Is Docked", // Phone is docked in cradle || ps1 & ps2 & ds | |
"Ejecting" // Phone is ejecting || ps1 & ps2 & !ds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "$1 $2 $3 $4" >> ~/test.mcabber.log | |
EVENT_TYPE=$1 | |
EVENT_SUBTYPE=$2 | |
JID=$3 | |
FILE=$4 | |
TITLE="Google Hangouts" | |
SOUND_FILE="$HOME/.mcabber/sounds/alert_47.wav" | |
ICON="$HOME/.mcabber/images/chat.png" | |
TIMEOUT=10000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# So, you want to turn some buttons on... | |
import mido | |
from mido import Message | |
# We're aiming for some specific values. The hex for turning a light green | |
# is pretty simple: 90 <button> <state>. The '90' is the MIDI command | |
# for 'note_on'. The 'note_on' command has two values that come after it: | |
# the note and it's velocity. Since this is a controller, it uses the note | |
# to signify which button to adjust, and it uses velocity to tell it how to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Display some help text | |
usage() { | |
echo "clipcp - Copy the contents of a text file to the clipboard"; | |
echo "Usage: clipcp FILE"; | |
} | |
# 'Cat' the file and pipe it into the xsel program which throws whatever | |
# it gets onto the clipboard. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Switch; | |
# Grab the first line from 'mpc' and throw it into | |
@song = split("\n", `mpc 2>&1`); | |
switch ($song[0]) { | |
case /Connection refused/ { print "MPD not running\n" } | |
case /^volume/ { print "Music playback stopped\n"} |
NewerOlder