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 / st3b3207.mkd
Last active April 7, 2019 16:30
Sublime Text April 2019 HIDPI/DPI Setting Updates

dpi_scale => ui_scale

Value examples: 1.0 = 100% 1.5 = 150% 0.5 = 50%

Rename dpi_scale to ui_scale, or add and set ui_scale to fix issues with Sublime Text 3 Build 3207 (v 3.2.1) displaying huge fonts and menus. It seems that Sidebar honors ui_scale (yay), so you may also need to remove any Packages/User theme hacks you've created.

@daryltucker
daryltucker / .Xresources
Last active April 7, 2019 19:14
Linux HiDPI/DPI Settings
Xft.dpi: 120
@daryltucker
daryltucker / aesgcm
Created May 21, 2019 18:03
Download and decrypt AESGCM (XMPP/Jabber) Files
#!/bin/bash -e
# https://github.com/dino/dino/issues/419#issuecomment-437841957
# SETUP
# mkdir -p ~/src/ ; cd ~/src/
# git clone https://github.com/moparisthebest/ImageDownloader && cd ImageDownloader
# gcc aesgcm.c -lcrypto -o aesgcm
set -e
IFS=# read -a fields <<< "${1/#aesgcm/https}"
filename="$(basename "${fields[0]}")"
@daryltucker
daryltucker / trailtrim.sh
Last active May 23, 2019 21:01
Remove trailing whitespace from directories.
#!/bin/bash
[ -n "$1" ] && DIRECTORY="$1" || DIRECTORY="./"
find "${DIRECTORY}" -type d -name "*\ "| while read d; do x=$(echo -e "${d}" | sed -e 's/[[:space:]]*$//'); echo "Moving $d "; mv "$d " "$x"; done
@daryltucker
daryltucker / dkms.patch
Created May 27, 2019 20:38
Patch for Debian/Ubuntu DKMS (2.2.1.0)
--- dkms 2019-05-27 13:36:23.339741746 -0700
+++ dkms 2019-05-27 13:36:59.941199651 -0700
@@ -3123,7 +3123,7 @@
die 7 $"There was a problem creating your ${create_type}."
echo $""
echo $"DKMS: mk${create_type} completed."
- invoke_command "mv '$temp_dir/${debian_package}-dkms_${module_version}_${debian_build_arch}.deb' '$deb_basedir'" "Moving built files to $deb_basedir"
+ invoke_command "mv '$temp_dir/${debian_package}-dkms_${module_version}_all.deb' '$deb_basedir'" "Moving built files to $deb_basedir"
;;
bmdeb)
@daryltucker
daryltucker / NetworkManager.conf
Created May 30, 2019 19:29
"ADDRCONF(NETDEV_UP): wlpNxN: link is not ready" on boot
# /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile
[ifupdown]
managed=false
[device-mac-randomization]
wifi.scan-rand-mac-address=no
@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}"
}
@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 / 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 / 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)