Skip to content

Instantly share code, notes, and snippets.

@noahbliss
noahbliss / keybase.md
Created July 30, 2019 16:41
Keybase Proof

Keybase proof

I hereby claim:

  • I am noahbliss on github.
  • I am noahbliss (https://keybase.io/noahbliss) on keybase.
  • I have a public key ASC7gX7UHlwn3oDZh8-DNMTVMYXdSEsGz3fEs0WxkfdqEwo

To claim this, I am signing this object:

@noahbliss
noahbliss / gist:a931fbc42ae48e6c3f82bc066dbbefce
Created July 30, 2019 16:49
Getting Lutris on Debian working
Install Debian stable
Upgrade debian stable to sid
install the nvidia driver from the nvidia website (for dxvk it needs a driver newer than the debian repos have)
if you have gnome, you will need to purge gdm and reinstall at least gdm, (likely gnome-core) to get it working.
LightDM is far more stable/dependable with the nvidia driver.
Install lutris (see their website for debian instructions)
Install wine staging from apt (wine-staging I think)
Install runners in lutris.
To get steam for linux working, run apt-get download steam
@noahbliss
noahbliss / vdevctl
Created July 30, 2019 16:50
Manages devices to be passed to a VM using directed IO.
#!/usr/bin/env sh
#Wooo only running ash... adventurous. ;P
#Noah Bliss -- 2017.10.22
thisdevice=$(cat /sys/class/dmi/id/product_uuid)
configdir=$HOME/system_configs
devinfofile=device_info.conf
devtmpfile=/tmp/alldevs.lst
devtmphostfile=/tmp/hostdevs.lst
alldevs=$(lspci -nn > $devtmpfile)
trap "{ rm -f $devtmpfile; rm -f $devtmphostfile;}" EXIT SIGINT SIGTERM
@noahbliss
noahbliss / zshsnapfix.sh
Created October 17, 2019 13:33
Fix Snaps with ZSH (per user)
# anderssv on snapcraft forum
mkdir -p ~/.config/environment.d
echo "PATH=$PATH:/snap/bin\nXDG_DATA_DIRS=\"${XDG_DATA_DIRS:-/usr/local/share:/usr/share}:/var/lib/snapd/desktop\"" > ~/.config/environment.d/60-snap-icons-and-bin.conf
@noahbliss
noahbliss / macliketrackpad.txt
Created October 17, 2019 13:58
Mac-like trackpad settings. (no right click area, 2 finger click anywhere)
# For at least suse, the file to edit is "/usr/share/X11/xorg.conf.d/40-libinput.conf" restart display manager after changes.
# The important line to add is the ClickMethod one below. See https://wiki.archlinux.org/index.php/Libinput for more info.
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "Tapping" "On"
Option "ClickMethod" "clickfinger"
@noahbliss
noahbliss / regex-extract
Created September 18, 2020 20:08
Sed wizardry to extract regex from standard in or a file as arg 2.
sed -nE "s#.*($1).*#\1#p" "$2"
@noahbliss
noahbliss / tmuxbashrc
Last active October 26, 2020 22:44
tmux bashrc helpers
# Auto attach existing tmux session, if none exist, start one.
#if command -v tmux >/dev/null && ! [ $TERM == "screen" ]; then tmux a || tmux; fi
# Tell us if tmux is running or not, does _not_ auto attach.
if if command -v tmux >/dev/null && tmux ls &>/dev/null && ! [ "$TERM" == "screen" ]; then echo -e "------\n A TMUX session exists! Attach with \`tmux a\`\n------\n"; fi
@noahbliss
noahbliss / opensuse-nvidiaupdate.sh
Created November 12, 2019 14:50
Signs kernel module of proprietary NVIDIA driver on OpenSUSE.
#!/usr/bin/env bash
nvidiafile="$1"
# For OpenSUSE systems that are securebooted.
# You need the package: kernel-devel
# You need your own signing key in mok.
# sudo su
# cd
# openssl req -new -x509 -newkey rsa:2048 -keyout gpusigningkey.pri -outform DER -out gpusigningkey.pub -nodes -days 36500 -subj "/CN=Graphics Drivers"
# mokutil --import gpusigningkey.pub
@noahbliss
noahbliss / gawk-rshell.sh
Created July 15, 2020 21:48
gawk-rshell.sh
#!/usr/bin/gawk -f
BEGIN {
Port = 8080
Prompt = "bkd> "
Service = "/inet/tcp/" Port "/0/0"
while (1) {
do {
printf Prompt |& Service
@noahbliss
noahbliss / trendmicro-julia-apiclient.jl
Last active January 6, 2021 16:50
Reference TrendMicro API client written in Julia
#!/usr/bin/env julia
# Noah Bliss - 2020-1-6
using HTTP
using JSON
using JSONWebTokens
using Dates
using SHA
using Base64
# These will stay the same for your tenant. See below for more vars you need to fill.