Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
# set -e: exit on command failure
# set -u: error on using undefined variables
# set -o pipefail: fail a pipeline if any command within it fails
set -euo pipefail
# ---------------------------------------------------------------------------
# CLI script that updates or reads a value from a JSON file using jq.
# By default, it targets /Applications/Cursor.app/Contents/Resources/app/product.json,
@realdimas
realdimas / reset_connect_via_direct_ssh_invocation.yml
Last active March 18, 2025 01:25
Manual reset_connection via local SSH invocation for Ansible v2.5.0 … v2.5.5 (fixed in v2.5.6)
# As of Ansible 2.5.2 reset_connection meta function is broken
# (see https://github.com/ansible/ansible/issues/27520)
# Below is reimplementation of reset_connect via local ssh command invocation
# Requires Ansible 2.5+ (config lookup plugin) and OpenSSH 5.9+ ("-O stop" command)
# *Update*
# Fixed in v2.5.6
# https://github.com/ansible/ansible/blob/stable-2.5/changelogs/CHANGELOG-v2.5.rst#bugfixes-9
- name: Reset persistent connection to host