Skip to content

Instantly share code, notes, and snippets.

View nshenry03's full-sized avatar

Nicholas Henry nshenry03

View GitHub Profile
@nshenry03
nshenry03 / crontab
Last active February 13, 2023 14:20
Cronjob to help keep track of water
0 9-19 * * 1-5 ${HOME}/.local/bin/drink-water.sh
@nshenry03
nshenry03 / jc-selinux.sh
Last active December 17, 2022 18:40
JumpCloud MFA SELinux Policy - Tested on CentOS 7
#!/bin/bash -
#===============================================================================
#
# FILE: jc-selinux.sh
#
# USAGE: ./jc-selinux.sh
#
# DESCRIPTION:
#
# OPTIONS: ---
@nshenry03
nshenry03 / .ackrc
Last active February 22, 2019 17:55
Bash configuration files
--ignore-dir=.kitchen
--ignore-dir=.terraform
--type-set=terraform:ext:tf
--type-set=terraformstate:match:/tfstate/
@nshenry03
nshenry03 / assert-tf-outputs.sh
Created February 14, 2019 23:34
Assert that all outputs have resources and all resources have at least one output
diff -rupN \
<(
ack "^\s*resource\s*" main.tf \
| awk '{print $2"."$3}' \
| sed -e 's/"//g' \
| sort -u
) \
<(
ack "^\s*value\s*=" outputs.tf \
| ack -o '[({ ,]\w*\.\w*\.?' \
@nshenry03
nshenry03 / assert-tf-variables.sh
Last active February 14, 2019 23:06
Assert that all variables are used and that all variables are defined.
diff -rupN \
<(
ack '^\s*variable\s*"' variables.tf \
| awk '{print $2}' \
| sed -e 's/"//g' \
| sort -u
) \
<(
ack -o "var\.\w+" main.tf \
| sed -e 's/var\.//' \
enable-ssh-support
pinentry-program /usr/bin/pinentry-curses
default-cache-ttl 60
max-cache-ttl 120
@nshenry03
nshenry03 / backend
Last active January 8, 2019 00:03
byobu config
BYOBU_BACKEND=screen
[user]
email = nshenry03@gmail.com
name = Nick Henry
[github]
user = nshenry03
---
- hosts: all
gather_facts: no
vars:
user_list:
- name: john.doe
git_config:
- user.name: John Doe
- user.email: john.doe@example.com
- user.signingkey: 0A46826A
@nshenry03
nshenry03 / ansible-role-test.sh
Created September 30, 2018 17:40 — forked from geerlingguy/ansible-role-test.sh
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "fedora29")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)