Skip to content

Instantly share code, notes, and snippets.

View alexwitherspoon's full-sized avatar

Alex Witherspoon alexwitherspoon

View GitHub Profile
## **Brief (tweet-length)**
Summarise the work in a sentence or two. What’s the background and why is this in consideration. Remember, this is a bet — what are we betting on? Is it high-risk high-reward or a sure thing?
## **What’s the problem being solved?**
Is it business (make more money) or user (achieve a goal)? What is wrong with the current state, what problem are people facing? How can we improve this? What is the ideal outcome?
### **Customer feedback?**
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
https://mirror1.malwaredomains.com/files/justdomains
https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist
https://hosts-file.net/ad_servers.txt
https://blocklist.site/app/dl/ads
https://blocklist.site/app/dl/fraud
https://blocklist.site/app/dl/fakenews
https://blocklist.site/app/dl/malware
https://blocklist.site/app/dl/phishing
https://blocklist.site/app/dl/ransomware
# Core Server Hardware Documentation
## Server Platform
HPe DL380 G7
- SpecSheet: https://www.hpe.com/h20195/V2/Getdocument.aspx?docname=c04199811
- Compatible Parts: https://support.hpe.com/hpsc/doc/public/display?docId=emr_na-c02755440
CPU Total : 12 Cores 24 Threads 3.47GHz
- 2x Intel® Xeon® Processor X5690
- https://ark.intel.com/products/52576/Intel-Xeon-Processor-X5690-12M-Cache-3_46-GHz-6_40-GTs-Intel-QPI
root@core:~# smartctl -a /dev/disk/by-id/ata-ST5000NM0024-1HT170_Z4E0ADNF
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.9.0-8-amd64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Seagate Enterprise Capacity 3.5 HDD
Device Model: ST5000NM0024-1HT170
Serial Number: Z4E0ADNF
LU WWN Device Id: 5 000c50 07a0dc86e
Firmware Version: SN02
@alexwitherspoon
alexwitherspoon / shortcodes_hugo.md
Created October 29, 2018 01:13
Shortcodes for Hugo Website
@alexwitherspoon
alexwitherspoon / cleanup-zfs-snapshots
Created April 29, 2018 18:36 — forked from paulhandy/cleanup-zfs-snapshots
Clean up old zfs snapshots
https://serverfault.com/questions/340837/how-to-delete-all-but-last-n-zfs-snapshots#340846
You may find something like this a little simpler
zfs list -t snapshot -o name | grep ^tank@Auto | tac | tail -n +16 | xargs -n 1 zfs destroy -r
output the list of snapshot (names only) with zfs list -t snaphot -o name
filter to keep only the ones that match tank@Auto with grep ^tank@Auto
reverse the list (previously sorted from oldest to newest) with tac
limit output to the 16th oldest result and following with tail -n +16

Keybase proof

I hereby claim:

  • I am alexwitherspoon on github.
  • I am alexwitherspoon (https://keybase.io/alexwitherspoon) on keybase.
  • I have a public key whose fingerprint is A9F3 B3C6 C338 6263 233E 8DD3 2AB0 E282 2940 08DA

To claim this, I am signing this object:

#
# This is an example of /etc/network/interfaces
# Reference this manpage for configuration options: https://www.kernel.org/doc/Documentation/networking/bonding.txt
#
# It is important that the interfaces listed first are
# initialized first to last as described in the configuration file.
# For Example to Create a logical interface(a) on top of another logical interface(b)
# the logical interface(b) would need to already exist.
#
@alexwitherspoon
alexwitherspoon / Rate-Limit-SSH
Created December 23, 2013 18:48
Mitigating SSH Attacks Brute-force password-guessing attacks on SSH services are common on the Internet today. They are a threat for two reasons: A large number of SSH password-guessing attempts can result in a denial of service — by saturating network connections, consuming large amounts of CPU resources (and therefore power), and/or by filling…
# INPUT:
# First, we add any inbound SSH connection attempts to an
# 'ssh-clients' list.
iptables -A INPUT -i eth0 -p tcp -m tcp -m state --state NEW --dport 22 \
-m recent --set --name ssh-clients --rsource
# Then, we check to see if the source of the current packet has
# attempted to connect more than 5 times in the last 60 seconds. If
# it has, then we treat it as a brute-force attack and send it to the
# SSHATTACK chain, which does not return.
@alexwitherspoon
alexwitherspoon / LAMP_Copy_Shell_Script
Last active December 31, 2015 15:39
Script made to automatically create a copy of a LAMP style web site/app. Original use case was to regularly refresh a separate copy of a production instance of LAMP to test updates/upgrades etc. This is meant to be lightweight and should work on typical hosting accounts like bluehost/godaddy etc. Copy script to host, enable execution, set the pa…
#!/bin/sh
# Alex Witherspoon
# LAMP Copy Shell Script
# Description:
# Script made to automatically create a copy of a LAMP style web site/app.
# Original use case was to regularly refresh a separate copy of a production
# instance of LAMP to test updates/upgrades etc. This is meant to be lightweight
# and should work on typical hosting accounts like bluehost/godaddy etc.
# Copy script to host, enable execution, set the paths to the correct
# SOURCE and DESTINATION locations, and then schedule VIA cron at the interval