Skip to content

Instantly share code, notes, and snippets.

Instructions

  1. Ensure config.hcl file is in config directory
  2. run docker compose up -d
  3. run docker compose exec vault chown -R vault:vault /vault
  4. run docker compose exec vault apk add curl
  5. run docker compose exec vault curl --request POST --data '{"secret_shares": 1, "secret_threshold": 1}' http://127.0.0.1:8200/v1/sys/init
  6. Save the output from the previous command, what should look like:

{

@magmax
magmax / README.md
Last active December 13, 2022 13:52
Run Vault with persistence using docker compose
#!/bin/bash
if [ ! -f "README.md" ]; then
(
echo "# FIXME"
echo
echo "Please, fill this file in"
) > README.md
fi
@magmax
magmax / fabfile.py
Last active August 29, 2015 14:13
Run a remote command in several machines, using just one password
from fabric.api import run
def execute(command):
run(command, shell=True)
@magmax
magmax / init.sls
Created March 25, 2014 09:33
Firefox module for SaltStack. Place it in salt/firefox/init.sls
firefox-bin:
archive.extracted:
- name: /srv/
- source: "https://download-installer.cdn.mozilla.net/pub/firefox/releases/28.0/linux-x86_64/en-US/firefox-28.0.tar.bz2"
- source_hash: md5=8264fda486828d925aa094de902eb182
- archive_format: tar
- tar_options: j
- if_missing: /srv/firefox/
/usr/local/bin/firefox:
@magmax
magmax / models.py
Created August 15, 2011 07:54
Django: Creación de un site (models.py)
class blog(models.Model):
title = models.CharField(max_length=50)
body = models.TextField()
creation = models.DateField()
@magmax
magmax / gist:1145865
Created August 15, 2011 07:42
Django: Ejecución del servicio básico.
$ python manage.py syncdb
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table auth_message
Creating table django_content_type
@magmax
magmax / settings.py
Created August 15, 2011 07:39
Django: configuración básica
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'database.db', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
@magmax
magmax / gist:1145852
Created August 15, 2011 07:33
Django: Creación de un site.
$ django-admin startproject myblog
$ cd myblog
$ python manage.py startapp blog
$ tree
.
|-- blog
| |-- __init__.py
| |-- models.py
| |-- tests.py
| `-- views.py
@magmax
magmax / gist:1145589
Created August 15, 2011 01:52
Enumerados con relación doble en Java
public enum NaveInterestelar {
PATRULLERA(-1),
ESCOLTA(0),
RESERVA(1000),
;
private int value;
private static final Map<Integer,NaveInterestelar> lookup
= new HashMap<Integer,NaveInterestelar>();
static {