In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
# you can make a text file of request times (in ms, one number per line) and import it here, or you can use a probability distribution to simulate request times (see below where setting req_durations_in_ms) | |
# rq = read.table("~/Downloads/request_times.txt", header=FALSE)$V1 | |
# argument notes: | |
# parallel_router_count is only relevant if router_mode is set to "intelligent" | |
# choice_of_two, power_of_two, and unicorn_workers_per_dyno are only relevant if router_mode is set to "naive" | |
# you can only select one of choice_of_two, power_of_two, and unicorn_workers_per_dyno | |
run_simulation = function(router_mode = "naive", | |
reqs_per_minute = 9000, |
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.
! __ ___ __ ___ ___ ___ _ _ _ __ ___ ___ ___ | |
! \ \/ / '__/ _ \/ __|/ _ \| | | | '__/ __/ _ \/ __| | |
! _ > <| | | __/\__ \ (_) | |_| | | | (_| __/\__ \ | |
!(_)_/\_\_| \___||___/\___/ \__,_|_| \___\___||___/ | |
! | |
!## Colors | |
#define S_base03 #191919 | |
#define S_base02 #073642 | |
#define S_base01 #586e75 | |
#define S_base00 #657b83 |
## IMPORTANT: | |
# Should work for any IDE that supports ssh but only tested on PyCharm | |
# These instructions are for systemd OS (Ubuntu 16.04 and up, Debian). | |
# For systems running upstart like 14.04, modify /etc/default/docker by adding DOCKER_OPTS | |
# | |
# | |
# | |
## First, we need to get Docker to accept ssh connections: | |
# | |
## Open /lib/systemd/system/docker.service |
# Adapted from https://tinyapps.org/blog/nix/201701240700_convert_asciidoc_to_markdown.html | |
# Using asciidoctor 1.5.6.1 and pandoc 2.0.0.1 | |
# Install pandoc and asciidoctor | |
$ sudo apt install asciidoctor | |
$ sudo wget https://github.com/jgm/pandoc/releases/download/2.0.0.1/pandoc-2.0.0.1-1-amd64.deb | |
$ sudo dpkg -i pandoc-2.0.0.1-1-amd64.deb | |
# Convert asciidoc to docbook using asciidoctor |