Skip to content

Instantly share code, notes, and snippets.

View adamcstephens's full-sized avatar
🍕
hello

Adam C. Stephens adamcstephens

🍕
hello
View GitHub Profile
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential git-core curl libssl-dev \
libreadline5 libreadline5-dev \
zlib1g zlib1g-dev \
libmysqlclient-dev \
libcurl4-openssl-dev \
libxslt-dev libxml2-dev
#!/bin/bash
[ -e /etc/os-release ] && . /etc/os-release
[ ! -z $ID ] && DIST=$ID
[ ! -z $ID_LIKE ] && DIST=$ID_LIKE
[ -e /etc/redhat-release ] && DIST='redhat'
[ -z $DIST ] && echo 'Unknown distribution.' && exit 2
export DIST
function install_pkg_aur () {
#!/bin/bash
#DoD Root Certificate Installer Version 2
#Downloads and installs the DoD root certificates so browsers like Google Chrome can open and use DoD sites without bugging the hell out of you.
#Marcus Dean Adams (marcusdean.adams@gmail.com) 30 September 2011
#Adam C Stephens (adam.c.stephens@noaa.gov) 26 November 2013
#Makes sure the script is running as a normal user, so the certificates will get imported into their personal certificate store, and not the one for the root account.
if [[ $EUID = 0 ]]; then
echo "This script must be run as your normal user account, if you REALLY want to import these certs as root, just edit this script and remove this whole section." 1>&2
exit 1
@adamcstephens
adamcstephens / gist:3dad4347ad278c1ed653
Last active August 29, 2015 14:05
bash_verbose_options
#!/bin/bash
REPOSYNC_LOG=/var/log/reposync.log
while getopts ":v:d" opt; do
case $opt in
v) # write to stdout instead of log
VERBOSE='yes'
;;
d)
#!/bin/sh
# we need to register with Red Hat Satellite before we run Puppet
# to ensure that we can install packages.
#
# On a brand new Vagrant installation, we run rhnreg_ks and copy the
# systemid file to the host computer.
#
# If you later run `vagrant destroy; vagrant up`, the systemid file
# will be present on the host and copied into the Vagrant.
#
provider "libvirt" {
uri = "qemu:///system"
}
resource "libvirt_volume" "centos7" {
name = "centos-stable"
source = "http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2"
}
resource "libvirt_volume" "centos" {
@adamcstephens
adamcstephens / Makefile
Last active July 9, 2019 14:57
backup files with make
files_dir := ./files
files = $(wildcard $(files_dir)/.[a-z]*)
all:
rsync -av $(files_dir)/ ${HOME}/
backup:
$(foreach file, $(files), rsync -av --delete ${HOME}/$(shell echo $(file) | sed "s/\.\/files\///") $(files_dir)/;)
.PHONY: all backup
@adamcstephens
adamcstephens / Corefile
Created July 18, 2020 21:28
pi-hole and coredns, multi-provider TLS upstreams with failover, using docker compose
private {
auto {
directory /config/zones
}
}
. {
errors
log
prometheus
@adamcstephens
adamcstephens / docker-compose.yml
Last active May 7, 2021 15:50
Traefik, Wildcard Cert, Pomerium, Docker Compose
version: "3.3"
services:
proxy:
image: traefik:latest
command:
- --global.sendAnonymousUsage=false
- --log.level=WARN
- --api.insecure=true
- --api.dashboard=true
#!/usr/bin/env bash
#
# generate aqua-registry package from github release.
# requires: curl, jq, fzf
if [ -z $2 ]; then
echo "Usage: $0 <repo_owner> <repo_name>"
exit 2
fi