Skip to content

Instantly share code, notes, and snippets.

View daryltucker's full-sized avatar

Daryl Tucker daryltucker

  • Neo-Retro Group
  • Salem, Or
View GitHub Profile
@daryltucker
daryltucker / gist:ae3b42251f3da7bcd311f0554eaf3738
Created December 12, 2019 22:25 — forked from andrewlkho/gist:e9a8c996c4bc1df23cd2
How to secure debian with two factor authentication (TOTP/HOTP)

First, install the necesssary packages:

% apt-get install libpam-oath oathtool

Generate a key and write it to /etc/users.oath (NB the key will be in hexadecimal; if you are using Authy you will want to convert it to BASE32):

% KEY=$( head -c 1024 /dev/urandom | openssl sha1 | awk '{ print $2 }' )
% echo "HOTP/T30/6 andrewlkho - ${KEY}" >> /etc/security/users.oath
% chmod 600 /etc/users.oath
@daryltucker
daryltucker / config
Created October 15, 2019 18:26
Cycle through i3wm Workspaces on active Monitor only
#bindsym $mod+Tab workspace next
#bindsym $mod+Shift+Tab workspace prev
bindsym $mod+Tab workspace next_on_output
bindsym $mod+Shift+Tab workspace prev_on_output
@daryltucker
daryltucker / glados.sh
Created August 11, 2019 01:38 — forked from ArtBIT/glados.sh
GLaDOS eSpeak
random_pitch() {
local delta=${1:-50}
local value=$(( ($RANDOM % $delta) - $delta/2 ))
echo "+${value}" | sed 's/+-/-/'
}
glados() {
local pitch=70
local speed=180
local lang=en
@daryltucker
daryltucker / CR-10S.patch
Last active August 19, 2022 21:41
Patch for CR-10S against Marlin 1.1.9
diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 2e95701c2..b2058c312 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -123,7 +123,8 @@
*
* :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000]
*/
-#define BAUDRATE 250000
+//#define BAUDRATE 250000
@daryltucker
daryltucker / focus_window_under_mouse.sh
Created July 27, 2019 21:55
Focus the Window currently under the Mouse Cursor
# Focus the Window currently under the Mouse Cursor
xdotool windowfocus $(xdotool getmouselocation --shell | grep "WINDOW=" | sed 's/WINDOW=//g')
@daryltucker
daryltucker / faceoff_usb_hid.txt
Last active July 24, 2019 02:53
FaceOff Wired Pro Controller USB Descriptors
Usage Page (Desktop), ; Generic desktop controls (01h)
Usage (Gamepad), ; Gamepad (05h, application collection)
Collection (Application),
Logical Minimum (0),
Logical Maximum (1),
Physical Minimum (0),
Physical Maximum (1),
Report Size (1),
Report Count (14),
Usage Page (Button), ; Button (09h)
@daryltucker
daryltucker / pokken_usb_hid.txt
Created July 24, 2019 02:48
Pokken Controller USB Descriptors
Usage Page (Desktop), ; Generic desktop controls (01h)
Usage (Gamepad), ; Gamepad (05h, application collection)
Collection (Application),
Logical Minimum (0),
Logical Maximum (1),
Physical Minimum (0),
Physical Maximum (1),
Report Size (1),
Report Count (13),
Usage Page (Button), ; Button (09h)
@daryltucker
daryltucker / gist:7c269ec91377c8217c004ab647a70e20
Created June 24, 2019 16:07
Disable .cue in cmus to prevent album duplication
# Cue files show up as cue://path/to/file.cue/$TRACK_NUMBER
:fset cue=filename="cue://*"
:factivate !cue
@daryltucker
daryltucker / tailclear
Created June 21, 2019 00:53
Tail logfile $1 and limit output by $2. Clear the terminal and re-run tail after a line matches both $2 and $3
#!/bin/bash
# @daryltucker
# Clear the terminal and resume tailing after finding a specific match
# $ tailclear /var/log/syslog programname "Termination String"
STOPTAILING=
PID=
cleanup(){
@daryltucker
daryltucker / feh-desktop-bg
Last active June 19, 2019 22:16
feh stuff
#!/bin/bash
# ~/.bin/feh-desktop-bg
# Similar to `xsetroot -solid "${colour}"`
function feh-desktop-bg(){
[[ -z $1 ]] && image="${HOME}/Pictures/desktop.png" || image="$1"
[[ -z $2 ]] && colour='#f1fa8c' || colour="$2"
feh --bg-center "${image}" --image-bg "${colour}"
}