Skip to content

Instantly share code, notes, and snippets.

@utoddl
utoddl / av-filter
Last active July 31, 2024 18:52
Filter for "ansible-vault"ing YAML Data Values
#!/usr/bin/env python
"""Filter for "ansible-vault"ing YAML Data Values
https://gist.github.com/utoddl/66baa4154618ba1fc8ec8127483e7e89
This script allows an ansible user to pass lines of yaml data
through it to get string values vaulted and/or already-vaulted values
unvaulted, thus simplifying the maintenance of vaulted strings in
Ansible vars files and eliminating the need to vault entire files.
@da-rth
da-rth / komorebi_named_pipe.py
Created October 25, 2021 18:09
An example of how to have komorebi subscribe and send events to a named pipe in python
import win32pipe
import win32file
import pywintypes
import subprocess
import json
import time
KOMOREBI_BUFF_SIZE = 64 * 1024
KOMOREBI_PIPE_NAME = "yasb"
#!/usr/bin/env python3
import select
import asyncio
import Pyro4
@Pyro4.expose
class GreetingMaker(object):
@KartikTalwar
KartikTalwar / Documentation.md
Last active August 11, 2024 01:52
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@santiycr
santiycr / import_and_run.py
Created December 13, 2012 06:44
Run python unit tests from a different python script
import unittest
import test_example
unittest.main(module=test_example)