Skip to content

Instantly share code, notes, and snippets.

@brockoffdev
brockoffdev / CMakeLists.txt
Created January 27, 2023 23:01 — forked from dlime/CMakeLists.txt
Install Google Test and Google Mock on Ubuntu
cmake_minimum_required(VERSION 3.5)
project(example LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIRS})

Keybase proof

I hereby claim:

  • I am brockoffdev on github.
  • I am brockoffdev (https://keybase.io/brockoffdev) on keybase.
  • I have a public key whose fingerprint is B3B6 8C05 629E D60F 8FB4 2464 193D 4DB1 9459 A9B4

To claim this, I am signing this object:

@brockoffdev
brockoffdev / maintenance.sh
Created January 16, 2018 16:40
Maintaining Versioned Keys in Vault
#!/bin/bash
# Create a temporary orphaned Vault Token with
# permissions to make changes to the /versions mountpoint VTK=$(vault token-create ... )
# Get a list of the levels of the /versions mount
# and previous end date for tokens
MOUNTS=$(vault list /versions | sed 1,2d)
OLDER_THAN=$(date --date="6 days ago" +"%Y%m%d%H%M%S")
for mount in $MOUNTS; do
# Get a list of our "apps"
@brockoffdev
brockoffdev / rollback.sh
Last active January 23, 2018 05:37
Rollback with Versioning in Vault
#!/bin/bash
VAULT_PATH=/dev/single
DATETIME=$(date -u +"%Y%m%d%H%M%S")
PREVIOUS=${1:-previous}
echo "Rolling back application config to \"$PREVIOUS\"..."
# Create Tempfiles for writing to...
OLDTMPFILE=`mktemp /tmp/we.XXXXXX` || exit 1
NEWTMPFILE=`mktemp /tmp/we.XXXXXX` || exit 1
# Read our old configuration (and current), and save to tempfiles
@brockoffdev
brockoffdev / versioning.sh
Last active January 16, 2018 16:37
Example Versioning in Hashicorp Vault
#!/bin/bash
VAULT_PATH=/dev/single
DATETIME=$(date -u +"%Y%m%d%H%M%S")
# Loop through passed variables, add them to json
for VAR in "${@}"; do
VAR=$(echo $VAR | sed -E -e 's/\\/\\\\/g' -e "s/([^=]+)=(.*)/\"\1\"=\"\2\"/")
JQ="${JQ} | .${VAR}"
done