Skip to content

Instantly share code, notes, and snippets.

View philcryer's full-sized avatar
💭
Mostly harmless

Phil Cryer philcryer

💭
Mostly harmless
View GitHub Profile
@philcryer
philcryer / installer_base.sh
Created June 7, 2017 18:14
Sample bash script to build an installer with
#!/usr/bin/env bash
# PiVPN: Trivial OpenVPN setup and configuration
# Easiest setup and mangement of OpenVPN on Raspberry Pi
# http://pivpn.io
# Heavily adapted from the pi-hole.net project and...
# https://github.com/StarshipEngineer/OpenVPN-Setup/
#
# Install with this command (from your Pi):
#
# curl -L https://install.pivpn.io | bash
@philcryer
philcryer / lynis_autorunner.sh
Last active September 15, 2019 04:23
Download and run a Lynis audit scan on your system with this shell script.
#!/bin/sh
# This script will automatically:
# * download [Lynis](https://cisofy.com/lynis/), an open source security auditing tool
# * run a full audit check, either privileged, or non-privileged if not logged in as root
# * cleanup by removing the downloaded archive, and the extracted directory it ran out of
# * save the audit report to your local directory (YYYYMMDD-lynis-report)
#
# This script requires:
# * awk
@philcryer
philcryer / bootstrap_instance.sh
Created May 19, 2016 00:38 — forked from philfreo/bootstrap_instance.sh
AWS User script to bootstrap any instance
#!/bin/bash -x
# User script to bootstrap any instance.
# This will set up, array, and format every instance storage
# drive present in the instance (if any)
#
# The disk format/layout is read from an EC2 tag "DiskLayout"
# (defined in the cloudformation templates) and it defaults to
# "raid0". Possible values are:
# * raidN: grabs all available instance storage drives, creates a
@philcryer
philcryer / letsupdate
Created February 26, 2016 20:48
auto renewal script for Let's Encrypt
#!/bin/bash
#
# this is going to be a rewrite of this:
# https://github.com/defsdoor/letsencrypt-autorenew/blob/master/get_certificates
# example file mycerts:
## EMAIL admin@example.com
## HOSTS www.example.com
## EMAIL admin@mail.example.com
@philcryer
philcryer / www-time
Created February 4, 2016 16:45
A curl one liner to test a site's response time - outputs various metrics - just include the target URL after the command.
curl -s -w '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nAppCon time:\t%{time_appconnect}\nRedirect time:\t%{time_redirect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' -o /dev/null ${1}
@philcryer
philcryer / git-todo.sh
Created November 7, 2015 21:47
Using git to manage todos
#!/bin/bash
# Using Git to Manage Todos
# by Jezen Thomas
# http://jezenthomas.com/using-git-to-manage-todos/
set -e
main() {
while IFS= read -r todo; do
@philcryer
philcryer / file under: feminist punk
Last active October 2, 2015 21:14
An idea for background music during a discussion about feminism.
## timeless, anthems
Crass "Bata Motel"
Fugazi "Suggestion"
Huggy Bear "Her Jazz"
War On Women "Say It"
Perfect Pussy "Driver"
Bikini Kill "Rebel Girl"
Sleater-Kinney "#1 Must Have"
Team Dresch "Remember Who You Are"
@philcryer
philcryer / hubot_service.sh
Last active April 10, 2018 21:04 — forked from mattsgarrison/hubot_service.sh
Start/Stop script to manage Hubot (with Slack support) with Monit
#!/bin/sh
### BEGIN INIT INFO
# Provides: hubot
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the hubot service
# Description: starts the Hubot bot for the Campfire rooms
#!/bin/bash
# inspired by Mattias Geniar's post:
# https://ma.ttias.be/how-to-read-an-ssl-certificate-info-from-the-cli/
# could it mimic the functionality of this online one ssl testing tool?
# https://www.ssllabs.com/ssltest/analyze.html
if [[ ! $1 ]]; then
echo " ERR: please provide a site to check"
@philcryer
philcryer / coreid.sh
Last active April 19, 2017 07:00
Get the Amazon CoreOS AMI ID and URL
#!/bin/bash
build=alpha # define build ["stable", "beta", "alpha"]
disk=hvm # define disk backing ["pv", "hvm"]
if [ "x$1" = "x" ]; then
echo "Usage: $0 REGION"; exit 1
fi
#### deprecated