Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@pythoninthegrass
pythoninthegrass / bootstrap
Created April 4, 2023 07:25
Compile known good Citra build on M1 Mac
#!/usr/bin/env bash
# shellcheck disable=SC2046,SC2155,SC2164
brew install doxygen pkgconfig sdl2 qt5 ffmpeg cmake openssl
brew link --force openssl
pkg-config --modversion openssl
git clone --recursive https://github.com/citra-emu/citra-nightly.git
cd citra-nightly/
git checkout d380980

Loading variables from .env files in Ansible

Ansible has various ways of looking up data from outside sources, including plain text password files, CSV files and INI files. But it doesn't seem to have a lookup for .env files, as used in Laravel projects, also available for PHP, Ruby, Node.js, Python and others.

One option is to launch Ansible with the Ruby dotenv command line script... But that requires Ruby, which seems like overkill to me.

So here is a simpler solution that I use. It consists of:

  1. The .env file itself
  2. A small shell script that loads the .env file into environment variables - ansible-playbook.sh
@pythoninthegrass
pythoninthegrass / fp
Last active May 12, 2023 06:08
flatpak shim until they're added to path as expected
#!/usr/bin/env zsh
# SOURCES:
# https://github.com/magical-heyrovsky
# https://github.com/flatpak/flatpak/issues/994#issuecomment-1484158855
# https://apple.stackexchange.com/questions/296477/my-command-line-says-complete13-command-not-found-compdef
# https://unix.stackexchange.com/questions/353076/how-to-indent-an-heredoc-inside-an-heredoc-the-right-way
# * leading tabs: indent here-document (heredoc)
# * spaces: indent code within heredoc
@pythoninthegrass
pythoninthegrass / Diablo II.ahk
Created June 13, 2023 22:03 — forked from fabd/Diablo II.ahk
A script I use to center the game window and play at exactly 2x the original resolution to avoid stretching and blurry image.
; Diablo II LoD
;
; Instructions:
;
; 1) Start the game in windowed mode (eg. "-sndbkg -skiptobnet -w" options in shortcut).
;
; 2) Press Ctrl Alt f , Ctrl Alt h to set game to 1600x1200 centered on the desktop.
;
;
; Ctrl Alt f Toggle active window title bar.
@pythoninthegrass
pythoninthegrass / known_good_output.md
Last active June 24, 2023 12:42
Playwright TimeoutError traceback
Navigating to listings...
Skipping job #1008290115390 ...
Skipping job #1006634612910 ...
Skipping job #1005925012735 ...
Skipping job #1008505155654 ...
Skipping job #1008470614446 ...
Skipping job #1008705290883 ...
Skipping job #1008494737160 ...
Skipping job #1007900113774 ...
@pythoninthegrass
pythoninthegrass / swap_off.sh
Last active June 26, 2023 17:06 — forked from anildigital/cleanup_swap.md
Cleanup swap space on macOS
#!/usr/bin/env bash
# To see current swap usage
sysctl -a | grep swap
# Monitor swap usage
vm_stat 60
# Use only when when your system is in a very bad shape
sudo pkill -HUP -u _windowserver
@pythoninthegrass
pythoninthegrass / video2gif
Last active June 27, 2023 01:03
Convert video to gif file
#!/usr/bin/env bash
# SOURCES
# https://superuser.com/a/1154859
# https://engineering.giphy.com/how-to-make-gifs-with-ffmpeg/
# https://www.displayninja.com/what-is-aspect-ratio/
# https://ffmpeg.org/general.html#toc-Supported-File-Formats_002c-Codecs-or-Features
# shellcheck disable=SC2086
@pythoninthegrass
pythoninthegrass / av_scan_windows.sh
Last active July 7, 2023 02:52
Run clamscan daemon (clamdscan) to scan Windows partition from a Linux live USB.
#!/usr/bin/env bash
# shellcheck disable=SC1091,SC2120,SC2317
# SOURCES
# https://askubuntu.com/a/978750
# https://unixcop.com/enabling-exfat-support-on-ubuntu-22-04/
# https://askubuntu.com/a/51926
# https://wiki.archlinux.org/title/ClamAV
# https://github.com/extremeshok/clamav-unofficial-sigs/blob/master/INSTALL.md
@pythoninthegrass
pythoninthegrass / bootstrap
Last active July 13, 2023 23:18
Setup Docker on Vanilla OS
#!/usr/bin/env bash
# SOURCES:
# https://handbook.vanillaos.org/2022/02/05/install-docker.html
cat << 'DESCRIPTION' >/dev/null
Install docker on vanilla os
This script will install docker on vanilla os. It will also add the current user to the docker group so that docker commands can be run without sudo.
DESCRIPTION
@pythoninthegrass
pythoninthegrass / README.md
Last active September 7, 2025 13:18
Setup RDP on ChimeraOS
# unlock pacman
sudo frzr-unlock

# install pipewire
sudo pacman -S pipewire pipewire-media-session gst-plugin-pipewire 

# add pipewire group
sudo usermod -a -G pipewire $USER