Skip to content

Instantly share code, notes, and snippets.

View webknjaz's full-sized avatar
🇺🇦
#StandWithUkraine: https://github.com/vshymanskyy/StandWithUkraine

Sviatoslav Sydorenko (Святослав Сидоренко) webknjaz

🇺🇦
#StandWithUkraine: https://github.com/vshymanskyy/StandWithUkraine
View GitHub Profile
$ MACOS_VM_VERSION=12.4
$ MACOS_VM_CODENAME=$(softwareupdate --list-full-installers 2>&1 | grep "Version:\s$(echo "${MACOS_VM_VERSION}" | sed 's#\.#\\.#g')[0-9.]*," | awk -F' macOS ' '{print$2}' | awk -F, '{print$1}' | uniq)
$ MACOS_VM_NAME="ansible-core-ci-template-macos-${MACOS_VM_VERSION}-playground"
$ MACOS_INSTALLER_NAME="Install macOS ${MACOS_VM_CODENAME}"
$ MACOS_INSTALLER_VOLUME_NAME="${MACOS_VM_CODENAME}"-"${MACOS_VM_VERSION}"
$ MACOS_INSTALLER_VOLUME_PATH="/Volumes/${MACOS_INSTALLER_VOLUME_NAME}"
$ MACOS_DOWNLOADED_INSTALLER_APP_PATH="/Applications/${MACOS_INSTALLER_NAME}.app"
$ MACOS_CREATEINSTALLMEDIA_BIN_PATH="${MACOS_DOWNLOADED_INSTALLER_APP_PATH}/Contents/Resources/createinstallmedia"
$ MACOS_ORIGINAL_INSTALLER_VOLUME_PATH="/Volumes/${MACOS_INSTALLER_NAME}"
@webknjaz
webknjaz / azure-devops-drop-batched-lines.js
Created June 27, 2022 14:51
This is a DevTools Console snippet for hiding the `Batched CI for` lines from the output
for (const line of $x('/html/body/div[1]/div/div/div[2]/div[2]/div[2]/div/div[5]/div/div/div/div/table/tbody/a')) {
if (!line.querySelector('.fontSizeMS>.text-ellipsis').textContent.includes("Batched CI for "))
{
continue;
}
line.style.display = 'none'; // don't .remove() because it breaks the page
}
@webknjaz
webknjaz / MPRIS.md
Created May 2, 2022 23:26
Awesome WM integration with MPRIS

MPRIS is a mechanism for controlling players (including in-browser ones). It is usually bound to multimedia key presses. DEs usually have this integrated but WMs don't. To make this work in Awesome WM, playerctl can be used. It's subcommands just need to be bound to the multimedia keys.

  1. Reproduce the launcher folder layout after the initial data sync
  2. Fingerprint
  3. Font size -> XL
  4. Night Mode / Vision Comfort / Digital Wellbeing
  5. Bitwarden
  6. FreeOTP+
  7. MojeID klíč
  8. SwiftKey
  9. Pair Bluetooth devices (like car audio, headphones, keyboards, trackballs etc.)
  10. SMS backup recovery / Truecaller
@webknjaz
webknjaz / wifi-6-mesh.md
Last active March 9, 2024 01:48
My research on building a well-covered high-speed network for the future new house with focus on effortless Wi-Fi client roaming with 802.11ax (tri-band WiFi 6E with 8x8 MU-MIMO capabilities), 3 APs, 802.11r, 802.11k, 802.11v, 802.11s, 802.11w and 10GB-compatible CAT6 Ethernet backchannel

💭 Thoughts

I want to have:

  • 3 APs that would approximately evenly cover:
    • ground floor
    • second floor
    • garage space
    • bonus: reach some of the backyard/garden
  • Multipath connections between the APs
  • Bonded channels between the APs and the managed network switches (LACP 1+1 = 2Gbps)
@webknjaz
webknjaz / predictable-build-constraints.md
Last active November 28, 2021 08:17
A few thoughts on enabling reproducible builds with PEP 517

Huh?

I've got an idea to fill the void of the non-existent PEP 517 build requirements provisioning. The problem is that currently there's no first-class citizen support for reproducible builds in the PEP 517 world. People usually set lower bounds on their build backend of choice and that's about it. Even if some will set exact pins in their pyproject.toml, it's not enough because those entries may contain unpinned (transitive) dependencies. One way to do this with python -m build is to set PIP_CONSTRAINTS environment variable (I haven't actually tested this yet but I expect it to work).

That workaround is suboptimal and leaves the users with no answer on how to manage the invocations and the

@webknjaz
webknjaz / init_subclass.py
Created November 17, 2020 17:19
This snippet showcases how to decorate methods declared in child classes
from contextlib import contextmanager
@contextmanager
def show_start_end():
print('START')
try:
yield
finally:
print('THE END')
$ python -m pip install --unstable-feature=resolver 'ansible-base @ https://github.com/ansible/ansible/archive/devel.zip#egg=ansible-base==2.10.0' 'ansible @ https://toshio.fedorapeople.org/ansible/acd/ansible/ansible-2.10.0.tar.gz#egg=ansible==2.10.0' -vvv
Non-user install because user site-packages disabled
Created temporary directory: /tmp/pip-ephem-wheel-cache-kp8fwlc8
Created temporary directory: /tmp/pip-req-tracker-pf3nk6ah
Initialized build tracking at /tmp/pip-req-tracker-pf3nk6ah
Created build tracker: /tmp/pip-req-tracker-pf3nk6ah
Entered build tracker: /tmp/pip-req-tracker-pf3nk6ah
Created temporary directory: /tmp/pip-install-7ishjhrc
Collecting ansible-base==2.10.0
Created temporary directory: /tmp/pip-unpack-r5dkz4c4