Skip to content

Instantly share code, notes, and snippets.

@tristanfisher
tristanfisher / Ansible-Vault how-to.md
Last active June 11, 2024 13:23
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

Working with ansible-vault


I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

@Myuzu
Myuzu / secure_random.ex
Last active August 7, 2022 20:09
Elixir ruby-like SecureRandom
# UPD from 2018:
# This gist was written for pre-1.0 version of Elixir and won't work on post-1.0 versions.
# You probably consider using something else!
defmodule SecureRandom do
@moduledoc """
Ruby-like SecureRandom module.
## Examples
@trent-boyd
trent-boyd / arrange-windows.applescript
Created February 9, 2013 01:24
Applescript: Arrange Windows w/ Moom
-- Move to Space 1
tell application "System Events" to keystroke (key code 105)
delay 1
tell application "Moom" to arrange windows according to snapshot named "Development Panel"
-- Move to Space 2
tell application "System Events" to keystroke (key code 107)
delay 1
tell application "Moom" to arrange windows according to snapshot named "Communication Panel"