Skip to content

Instantly share code, notes, and snippets.

path "secret/barapp/*" {
policy = "read"
}
{
{{with $secret := secret "secret/vaultpoc/mysql" }}
"user": "{{$secret.Data.user}}",
"password": "{{$secret.Data.password}}",
"host": "{{$secret.Data.host}}",
{{end}}
"dns": "{{key "vaultpoc/dns"}}",
"debug": "{{key "vaultpoc/debug"}}"
}
@skarnecki
skarnecki / main.rs
Created February 28, 2017 12:10
Rust fork-bomb ~ defused
#[allow(unconditional_recursion)]
fn main(){
thread();
}
#[allow(unconditional_recursion)]
fn thread(){
loop {
std::thread::spawn(thread);
@skarnecki
skarnecki / fork.rs
Created March 7, 2017 10:44
rust forkbomb
use std::io::prelude::*;
use std::fs::File;
use std::process::Command;
// Since rust have nice thread handling and unwrapping - there is no way to fork bomb using rust only
// So I'm using bash to nuke the system
#[allow(unconditional_recursion)]
fn main(){
let f = File::create("boom");
assert_eq!(f.is_ok(), true);
let res = f.unwrap().write_all(b":(){ :|:& };:");
@skarnecki
skarnecki / run.sh
Last active September 6, 2017 09:24
run.sh
#!/usr/bin/env sh
#Required libs
#ca-certificates wget curl-dev py-pip jq
# Get consul template
wget -O envconsul.zip wget https://releases.hashicorp.com/envconsul/0.6.2/envconsul_0.6.2_linux_amd64.zip
unzip envconsul.zip
mv envconsul /usr/bin/
@skarnecki
skarnecki / run.sh
Last active November 28, 2019 02:39
run.sh
#!/usr/bin/env sh
#Command to run
COMMAND=$1
#Requires
#wget curl-dev py-pip jq
# Get consul template
wget -O envconsul.zip wget https://releases.hashicorp.com/envconsul/0.6.2/envconsul_0.6.2_linux_amd64.zip
unzip envconsul.zip
@skarnecki
skarnecki / set_java_home.sh
Created November 16, 2022 09:03
ASDF - update java home
#!/usr/bin/env bash
JDK_VERSION=`asdf current java|awk -v FS=' ' '{print $2}'`
echo "export JAVA_HOME=/Users/ext.skarnecki/.asdf/installs/java/$JDK_VERSION/"