Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@pythoninthegrass
pythoninthegrass / m3uparser.py
Last active October 24, 2023 02:31
Reconcile Amazon Music (csv) + MP3 library (m3u) to recreate a local playlist(s) with matching library files.
#!/usr/bin/env python3
# SOURCE: https://github.com/pythoninthegrass/m3u_prsr
import sys
class track():
def __init__(self, length, title, path):
self.length = length
@pythoninthegrass
pythoninthegrass / compile_python.sh
Last active October 14, 2023 22:28
Compile and install a specific version of Python from source
#!/usr/bin/env bash
# shellcheck disable=SC2046,SC2086,SC2164
cat << 'DESCRIPTION' >/dev/null
compile_python.sh compiles and installs a specific version of Python from source.
USAGE
./compile_python.sh "<version>"
@pythoninthegrass
pythoninthegrass / README.md
Last active October 19, 2023 05:44
Decompress/compress all directories ineither a given or current directory.

archive (all)

Usage

# clone
cd ~/Downloads
git clone https://gist.github.com/d76520b1bfa66713a5e27ead5e2c4e93.git archive

# create local bin directory
mkdir -p ~/.local/bin
@pythoninthegrass
pythoninthegrass / imperial_credit.py
Last active June 20, 2024 17:24
Convert Imperial Credits to US Dollars and vice versa
#!/usr/bin/env python3.11
import sys
"""
Convert Imperial Credits to US Dollars and vice versa.
Based on the exchange rate of 4.50 Imperial Credits to 1 US Dollar.
cf:
@pythoninthegrass
pythoninthegrass / font.yml
Last active September 15, 2023 03:43 — forked from mkubenka/sparsecheckout.yml
Install hack nerd-font via ansible shell out to git sparse-checkout
# code: language=ansible
---
- hosts: localhost
connection: local
gather_facts: true
any_errors_fatal: true
vars:
base_dir: "{{ home_dir }}/git/nerd-fonts"
repo_url: https://github.com/ryanoasis/nerd-fonts.git
@pythoninthegrass
pythoninthegrass / enable_vnc.sh
Created September 14, 2023 05:32
Enable VNC over SSH
#!/usr/bin/env bash
# SOURCE: https://discussion.fedoraproject.org/t/78971/7
sudo dnf -y install gnome-remote-desktop
read -s -p "VNC Password: " VNC_PASSWD
grdctl vnc enable
grdctl vnc disable-view-only
grdctl vnc set-auth-method password
grdctl vnc set-password "${VNC_PASSWD::8}"
@pythoninthegrass
pythoninthegrass / ge-proton.sh
Last active September 1, 2023 04:48
Working GE-Proton download snippet for NonSteamLauncher.sh
#!/usr/bin/env bash
set -x # activate debugging (execution shown)
set -o pipefail # capture error from pipes
set -eu # exit immediately, undefined vars are errors
# $USER
[[ -n $(logname >/dev/null 2>&1) ]] && logged_in_user=$(logname) || logged_in_user=$(whoami)
# $UID
@pythoninthegrass
pythoninthegrass / cloud-init.ubuntu.yml
Last active May 16, 2025 08:25
cloud-init (cloud-config) ubuntu template for latest python, docker, ansible, github ssh keys,dns, and shell config
#cloud-config
output: {all: '| tee -a /var/log/cloud-init.log'} # store logs inside vm
timezone: "America/Chicago"
hostname: ubuntu
package_update: true
package_upgrade: true
@pythoninthegrass
pythoninthegrass / README.md
Last active August 24, 2023 17:51
mvp for an unauthenticated smb share hosted on fedora linux, mounted on windows, accessible on macos

mvp smb

Setup

# get drive info (sans uuid)
lsblk

# unmount drive if already mounted by os
# `fuser -m <mount point>` to see what's using it
sudo umount <mount point>
@pythoninthegrass
pythoninthegrass / automatic.conf
Created August 23, 2023 22:38
Fedora Automatic Security Updates
# /etc/dnf/automatic.conf
# SOURCE: https://www.ctrl.blog/entry/how-to-dnf-automatic.html
[commands]
# What kind of upgrade to perform:
# default = all available upgrades
# security = only the security upgrades
upgrade_type = security
random_sleep = 0