Skip to content

Instantly share code, notes, and snippets.

View anrajme's full-sized avatar
🎯
Focusing

anraj anrajme

🎯
Focusing
View GitHub Profile
@anrajme
anrajme / ansible-vault.md
Created March 28, 2019 14:07
Ansible-vault example

Ansible vault example

New in Ansible 1.5, “Vault” is a feature of ansible that allows keeping sensitive data such as passwords or keys in encrypted files, rather than as plaintext in your playbooks or roles. These vault files can then be distributed or placed in source control. To enable this feature, a command line tool, ansible-vault is used to edit files, and a command line flag –ask-vault-pass or –vault-password-file is used. Alternately, you may specify the location of a password file or command Ansible to always prompt for the password in your ansible.cfg file. These options require no command line flag usage.

Requirements

@anrajme
anrajme / load-average.py
Created January 30, 2020 01:28
Load Average Per CPU
python3 -c "import os;import multiprocessing;avg=max(os.getloadavg());cpus=multiprocessing.cpu_count();print(avg/cpus)"
@anrajme
anrajme / findkeys.sh
Created July 6, 2024 13:35 — forked from patrickhulce/findkeys.sh
Find all keys without a TTL in Redis
#!/bin/sh
redis-cli keys "*" | head -n $1 > keys.txt
cat keys.txt | xargs -n 1 -L 1 redis-cli ttl > ttl.txt
paste -d " " keys.txt ttl.txt | grep .*-1$ | cut -d " " -f 1 | redis-cli del