Skip to content

Instantly share code, notes, and snippets.

Avatar

pythoninthegrass

  • Denver
View GitHub Profile
@pythoninthegrass
pythoninthegrass / disco.ahk
Created Oct 18, 2020
Disco Elysium mouse remap to become completely playable without the keyboard
View disco.ahk
#IfWinActive ahk_exe disco.exe
RButton::
Click,
Click, down
KeyWait, RButton
Click, up
return
MButton::ESC
@pythoninthegrass
pythoninthegrass / .bash_aliases
Last active Sep 12, 2020
Proxmox .bashrc + .bash_aliases. $PATH adds `qm` that was missing by default in pve 6.2-1
View .bash_aliases
# ALIAS
alias mkdir='mkdir -pv' # Preferred 'mkdir' implementation
alias ll='ls -FGlAhp' # Preferred 'ls' implementation
alias ..='cd ../' # Go back 1 directory level
alias ...='cd ../../' # Go back 2 directory levels
alias diff='diff -W $(( $(tput cols) - 2 ))' # Full Terminal Width in Side-by-Side Mode
alias ip="ifconfig | grep 'inet' | grep -v '127.0.0.1' | awk '{print \$2;exit}'" # Private IP address
alias ex-ip='curl icanhazip.com' # Your public IP address
alias open-ports='sudo lsof -i | grep LISTEN' # All listening connections
alias show-blocked='sudo ipfw list' # All ipfw rules in
@pythoninthegrass
pythoninthegrass / sysctl.conf
Last active Sep 12, 2020
Proxmox /etc/sysctl.conf
View sysctl.conf
#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
#
#kernel.domainname = example.com
# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3
@pythoninthegrass
pythoninthegrass / .screenrc
Created Aug 31, 2020
Scroll `screen` buffer
View .screenrc
# scroll buffer
termcapinfo * ti@:te@
@pythoninthegrass
pythoninthegrass / wsl_adb
Created Aug 22, 2020
Share ADB server with WSL 2 guest
View wsl_adb
#!/usr/bin/env bash
# SOURCE: https://github.com/microsoft/WSL/issues/4619#issuecomment-596990676
# On Windows host run:
# adb -a -P 5037 nodaemon server
ip_addr=$(cat /etc/resolv.conf | tail -n1 | cut -d " " -f 2)
adb kill-server
export ADB_SERVER_SOCKET=tcp:${ip_addr}
@pythoninthegrass
pythoninthegrass / passpass.py
Created Aug 16, 2020
Python credentials boilerplate with decouple and getpass
View passpass.py
from decouple import config
from getpass import getpass
import os
# Dynamic prompt for creds stored as tuple
# 0: eml_addr
# 1: passwd
# print(dyn_creds[0:]) # ('nopez@no.com', 'yesnononoyes')
def hardcode_death():
eml_addr = input('Please enter your email address: ')
@pythoninthegrass
pythoninthegrass / 21-ethtool
Created Jul 16, 2020
`ethtool` script to mitigate Plex buffering specifically on LAN with direct play
View 21-ethtool
#!/usr/bin/env bash
# SOURCES
# https://forums.plex.tv/t/massive-buffering-solved/155491/11
# https://serverfault.com/a/779496
# USAGE
# vim /etc/NetworkManager/dispatcher.d/21-ethtool
# sudo chmod 751 /etc/NetworkManager/dispatcher.d/21-ethtool
# chown root:root /etc/NetworkManager/dispatcher.d/21-ethtool
@pythoninthegrass
pythoninthegrass / dosbox.conf
Created Jul 6, 2020
Windows & macOS dosbox.conf tailored to DOS 6.22 + Windows 3.1 + Write Camera Action game
View dosbox.conf
# This is the configurationfile for DOSBox 0.74. (Please use the latest version of DOSBox)
# Lines starting with a # are commentlines and are ignored by DOSBox.
# They are used to (briefly) document the effect of each option.
[sdl]
# fullscreen: Start dosbox directly in fullscreen. (Press ALT-Enter to go back)
# fulldouble: Use double buffering in fullscreen. It can reduce screen flickering, but it can also result in a slow DOSBox.
# fullresolution: What resolution to use for fullscreen: original or fixed size (e.g. 1024x768).
# Using your monitor's native resolution with aspect=true might give the best results.
# If you end up with small window on a large screen, try an output different from surface.
@pythoninthegrass
pythoninthegrass / userChrome.css
Created Jun 9, 2020
Fix Firefox 77's ridiculous URL bar and some other QOL items
View userChrome.css
/*** Megabar Styler General - version 2020-04-19 ***/
/* SOURCES:
https: //www.userchrome.org/megabar-styling-firefox-address-bar.html
https: //www.userchrome.org/how-create-userchrome-css.html */
/*** General Preferences ***/
:root {
/* Number of pixels of enlargement when URL bar is focused */
@pythoninthegrass
pythoninthegrass / jcds_upload.py
Created May 20, 2020
A quick-and-dirty script for uploading packages to a Jamf Cloud Distribution Server
View jcds_upload.py
#!/usr/bin/python
'''
JCDS package upload script
by G Pugh
Developed from an idea posted at
https://www.jamf.com/jamf-nation/discussions/27869#responseChild166021
Usage:
You can’t perform that action at this time.