vagrant up
vagrant ssh -c "curl -L https://github.com/{your-username}.keys >> /home/vagrant/.ssh/authorized_keys"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Card | |
SUITS = %w(S H D C).freeze | |
RANKS = %w(2 3 4 5 6 7 8 9 10 J Q K A).freeze | |
RANKS_SCORES = RANKS.each_with_index.to_h | |
include Comparable | |
attr_reader :suit, :rank | |
def initialize(suit, rank) |
This Gist shows how you can encrypt/decrypt variables with KMS during your Ansible playbook execution. While google searching I couldn't find anything useful on the subject.
Let's say your project has a folder of playbooks called plays
.
In that folder, create a folder called filter_plugins
and insert kms_filters.py
(included in this gist)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python -c 'import yaml,sys;yaml.safe_load(sys.stdin)' < file.yml | |
Needs "pip install pyyaml". | |
Source: https://liquidat.wordpress.com/2016/01/21/short-tip-verify-yaml-in-shell-via-python-one-liner/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl --include \ | |
--no-buffer \ | |
--header "Connection: Upgrade" \ | |
--header "Upgrade: websocket" \ | |
--header "Host: example.com:80" \ | |
--header "Origin: http://example.com:80" \ | |
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \ | |
--header "Sec-WebSocket-Version: 13" \ | |
http://example.com:80/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
esphome: | |
name: dingtian-4ch | |
friendly_name: Dingtian 4CH | |
comment: "ESP32-D0WD v1.0" | |
# Change NPN module modbus speed to 19200 | |
# Baud rate corresponds to the number: 0: 1200 1: 2400 2: 4800 3: 9600 4: 19200 | |
#on_boot: | |
# ## configure controller settings at setup | |
# ## make sure priority is lower than setup_priority of modbus_controller | |
# priority: -100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.aliexpress.com/item/1005005848983315.html | |
# Pinout: | |
# GPIO0 - Button | |
# GPIO16 - Relay | |
# GPIO23 - LED | |
# ESP: ESP32-WROOM-32E (ESP32-D0WD V3, rev. 3.1) | |
substitutions: | |
name: 1ch-relay | |
friendly_name: 1CH Relay |
OlderNewer