Skip to content

Instantly share code, notes, and snippets.

@benjamin-hering
benjamin-hering / keybase.md
Created January 14, 2019 02:33
keybase.md

Keybase proof

I hereby claim:

  • I am benjamin-hering on github.
  • I am benjaminhering (https://keybase.io/benjaminhering) on keybase.
  • I have a public key ASCCG2Ykeq1ASJnMj6SQ2zzROWw97OzOXCn6jsCPJRC7ego

To claim this, I am signing this object:

@benjamin-hering
benjamin-hering / gist:eba064d6f30c7206c58715c903596e88
Created November 12, 2018 22:56
Stuff to install to get GitHub Pages running locally
#!/bin/bash
# Ubuntu packages needed
sudo apt install ruby ruby-dev git vim gcc make g++ zlib1g zlib1g-dev -y
# From the directory containing the gem file
gem install bundle
bundle install
#!/bin/bash
# Takes an IP and a duration to test
# Writes a timestamp and packet loss to output
# Can then be piped to log files
if [ $# -ne 2 ]; then
echo 'takes two args. seconds count & IP'
echo 'example network-pingtest.sh 60 8.8.8.8'
exit 1
@benjamin-hering
benjamin-hering / duo-mfa-setup.sh
Last active October 27, 2023 16:28
Installs and configures pam duo for a Raspberry PI. You still need to add your api keys to /etc/duo/pam_duo.conf
#!/bin/bash
#
#
# Author: Benjamin Hering - bhering@lendingclub.com
#
#
# Sets up the Duo PAM module for SSH Jumphosts and the like
# See https://duo.com/docs/duounix for more info on the Duo setup
#
# Root check
@benjamin-hering
benjamin-hering / sts-honeypot.sh
Last active January 26, 2018 04:03
Sets up a simple WiFi honeypot to demonstrate STS header security
#!/bin/bash
# A script for setting up a demo server to show the benefits of STS on a Raspberry PI
# Cobbled together from http://blog.claytonn.com/raspberry-pi-creating-access-point/
# and https://andrewmichaelsmith.com/2013/08/raspberry-pi-wi-fi-honeypot/
# Tested on Raspberry Pi 3 with the built in wifi card
# Checking that it's run with root priviledges/sudo for install
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
@benjamin-hering
benjamin-hering / google-authenticator-totp-setup.sh
Last active February 11, 2018 01:53
A simple script to automate totp auth enabling on a Raspberry PI
#!/bin/bash
# Sets up MFA via Google Authenticator
# I'm not responsible if you lock yourself out of your own box running this script.
# Have backups. Test your MFA SSH login with an existing session open to roll back changes if something goes wrong.
# Built and tested for the raspberry pi, but should be the same or similar for Debian/Ubuntu based systems
# Installing the packages
sudo apt-get install libpam-google-authenticator -y
@benjamin-hering
benjamin-hering / unifi-install.sh
Last active April 12, 2019 02:04
Unifi-Controller-Install-on-Raspberry-Pi
#!/bin/bash
#
# Installation script to install the Ubiquiti UniFi Controller 5 on a Raspberry PI
# Steps shamelessly stolen from http://www.lowefamily.com.au/2016/06/02/installing-ubiquiti-unifi-controller-5-on-raspberry-pi
# Checking that it's run with root priviledges/sudo for install
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
@benjamin-hering
benjamin-hering / gist:4e80dbe6ba2be1ddb3a3
Created September 30, 2015 18:24 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>