Skip to content

Instantly share code, notes, and snippets.

Avatar

pythoninthegrass

View GitHub Profile
@pythoninthegrass
pythoninthegrass / ccdl.command
Last active Apr 10, 2021 — forked from ayyybe/ccdl.command
Adobe Offline Package Generator v0.1.2 (macOS only)
View ccdl.command
#!/bin/bash
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
clear
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
clear
@pythoninthegrass
pythoninthegrass / autorun.sh
Created Feb 20, 2021
QNAP /tmp/config/autorun.sh for disabling advanced power management (APM) for noisy HDDs
View autorun.sh
#!/usr/bin/env bash
# SOURCES:
# https://www.brainbytez.nl/tutorials/qnap-nas-fix-the-seagate-chirp-sound/
# Disable advanced power management (APM) for noisy Seagate drives
# qcli_storage
hdparm -B 255 /dev/sda
hdparm -B 255 /dev/sdb
hdparm -B 255 /dev/sdc
@pythoninthegrass
pythoninthegrass / Proxmox reload services
Created Feb 15, 2021 — forked from kevin39/Proxmox reload services
Proxmox reload services properly (services order is important)
View Proxmox reload services
service pve-cluster restart && service pvedaemon restart && service pvestatd restart && service pveproxy restart
@pythoninthegrass
pythoninthegrass / lambda_vs_itemgetter.py
Created Jan 29, 2021 — forked from nickholt-driver/lambda_vs_itemgetter.py
Benchmark for lambdas versus itemgetter
View lambda_vs_itemgetter.py
import random
from operator import itemgetter
import timeit
def random_point():
return (random.randint(0, 100), random.randint(0, 100), random.randint(0, 100))
points = None # Global because of timeit scoping
def test_lambda():
@pythoninthegrass
pythoninthegrass / Change Jamf Pro Activation Code.sh
Created Dec 2, 2020 — forked from talkingmoose/Change Jamf Pro Activation Code.sh
Programmatic method to change a Jamf Pro server's Activation Code via the Classic API.
View Change Jamf Pro Activation Code.sh
#!/bin/bash
# server connection information
URL="https://jss.talkingmoose.net:8443"
userName="JSSAPI-Editor"
password="password"
# XML data to upload
THExml="<activation_code>
<organization_name>Talking Moose Industries</organization_name>
@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 Mar 22, 2021
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}