This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from PIL import Image | |
from PIL.ExifTags import TAGS | |
import glob | |
import os | |
import sys | |
import math | |
#EXIF attribute identifier for "FocalLength" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
FMT="${1##*.}" | |
FILE=$(basename $1 .$FMT) | |
DIR=$(dirname $1) | |
ISO=$(exiftool "$DIR/$FILE.$FMT" -t -ISO | cut -f2) | |
echo "$FILE.$FMT :: Using ISO $ISO" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Ensure list exists | |
/usr/sbin/ipset list scanners 2>&1> /dev/null || \ | |
/usr/sbin/ipset create scanners hash:ip hashsize 4096 counters | |
# IPs that hit the 'spam' log >10 times get banned: | |
for file in /var/log/nginx/spam.log*; do | |
if [[ "$file" != *"gz" ]]; then | |
awk '{print $1}' $file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
# (c) Noah Bailey, 2022 | |
# | |
# This script addresses CVE-2022-26134 for Confluence Server | |
# See: https://confluence.atlassian.com/doc/confluence-security-advisory-2022-06-02-1130377146.html | |
# | |
# ASSUMPTIONS | |
# This script makes several assumptions about your system: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//get the stdin when piping data into a go program | |
func getPipe() string { | |
var lines string | |
scanner := bufio.NewScanner(os.Stdin) | |
for scanner.Scan() { | |
input := scanner.Text() | |
lines += input | |
} | |
return lines | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ElasticSearch server passed in as CLI param | |
# Example: ./speedmon.sh elastic-xy.gablogian.org | |
ELASTICSEARCH_SERVER="$1" | |
# Index suffix for current week of year | |
DATEFMT=$(date +%Y.%V) | |
# Select a random server from the 10 closest: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SERVER_IP="192.168.122.200" | |
SERVER_PORT="5000" | |
sudo apt-get install -y collectd-core | |
cat << EOF | sudo tee /etc/collectd/collectd.conf | |
BaseDir "/var/lib/collectd" | |
PIDFile "/run/collectd.pid" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
LOADBAL_SVC_IP=$(kubectl -n ingress-nginx get service ingress-nginx-controller \ | |
-o jsonpath='{.status.loadBalancer.ingress[0].ip}') | |
cat << EOF | ssh nat_update@firewall tee /etc/iptables/nat.rules | |
*nat | |
:PREROUTING ACCEPT [0:0] | |
:INPUT ACCEPT [0:0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eo pipefail | |
# Load the kernel module | |
modprobe br_netfilter | |
cat <<EOF | tee /etc/modules-load.d/k8s.conf | |
br_netfilter | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg-agent \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |
NewerOlder