Skip to content

Instantly share code, notes, and snippets.

View bmatthewshea's full-sized avatar

Brady Shea bmatthewshea

View GitHub Profile
@bmatthewshea
bmatthewshea / partiallocal.cf
Created December 29, 2019 19:08
Spamassassin Rule - AWS/Amazon Email Spoofing
# Add to end of /etc/spamassassin/local.cf
#
# AWS/amazon spoofing - simple check for dot appended on things like "console.aws.amazon.com.spoofdomain.com" (case insensitive)
# XXXXXXXXXXXXXXXXXXXXXX^###############
rawbody LOCAL_AWS_SPOOF1 /aws\.amazon\.com\./i
describe LOCAL_AWS_SPOOF1 Fake AWS URL in body extra dot on domain
score LOCAL_AWS_SPOOF1 10.0
@bmatthewshea
bmatthewshea / sa-testemail.bash
Last active August 25, 2022 18:33
Spamassassin - Command Line Test Email
#!/bin/bash
def_filename="test.eml"
tmp1="/tmp/emailresults.txt"
tmp2="/tmp/emailresults.log"
usage="
$(basename "$0") [-h] [mailmessage]
Send email through Spamassassin manually and view output
Flags:
@bmatthewshea
bmatthewshea / reddcoind.conf
Created October 10, 2019 19:39
Linux start file for reddcoind
#testnet=1
datadir=/opt/reddcoin
rpcuser=reddcoinrpc
# random characters here - running the binary once will show you a generated password you could use.
rpcpassword=(random chars here)
@bmatthewshea
bmatthewshea / gist:76bcac7189b5a311fa649036f83e9cf2
Last active October 10, 2019 19:34
Reddcoin/Litecoin/Bitcoin Ubuntu Prep
Run 'reddcoind' on fresh Ubuntu 18.04:
Open a SSH command line and install the following:
Copy/Paste this and hit enter:
sudo apt update && sudo apt install build-essential libboost-system1.65.1 libboost-filesystem1.65.1 libboost-program-options1.65.1 libboost-thread1.65.1 libminiupnpc10
Copy/Paste this and hit enter:
@bmatthewshea
bmatthewshea / .bash_aliases
Last active April 6, 2020 15:32
Some BASH aliases. APT upgrade alias/more
# SUDO
alias sw='sudo -u www-data'
alias beroot='sudo su -'
# NANO/EDITING
alias e='nano -\$wcS'
alias se='sudo nano -\$wcS'
# FILES-LS
alias l='ls -lah'
# PS SHOW ALL/TREE FORMAT/WIDE
@bmatthewshea
bmatthewshea / certbot-renew.sh
Last active September 6, 2019 23:26
Certbot renewal for standalone certificates. Run a script instead of 'certbot renew -q', only.
#!/bin/sh
# Brady Shea - 06SEP2019
#
# Alternative certbot.service file for use on standalone.
# If you use the apache2.service (or another webserver) please adjust.
#
# This will be run as root from systemd.timer/service.
# Verify '/lib/systemd/system/certbot.service' calls this script.
#
test -x /usr/bin/certbot && \
@bmatthewshea
bmatthewshea / nasa-earth-images-dscovr.py
Last active June 24, 2022 23:39
Python script to find images using the "Deep Space Climate Observatory" (DSCOVR) API for a given date.
#!/usr/bin/python3
# DSCOVR: Deep Space Climate Observatory :
# Earth Polychromatic Imaging Camera
# Daily Blue Marble API:
# https://epic.gsfc.nasa.gov/about/api
# Python Script by: Brady Shea
# 27 August 2019
import sys, json
@bmatthewshea
bmatthewshea / 50-custom-wordpress.ini
Last active August 8, 2019 15:41
Custom overrides for PHP7.x for general Wordpress using conf.d
; Place this file inside the /conf.d area.
; Examples:
; /etc/php/7.3/fpm/conf.d/50-custom-wordpress.ini
; /etc/php/7.3/apache2/conf.d/50-custom-wordpress.ini
;
; Since this is a custom file, you can safely let PHP system updates overwrite the main "php.ini" file(s).
; This file will remain untouched.
;
display_errors = Off
display_startup_errors = Off
@bmatthewshea
bmatthewshea / show-repos.sh
Created June 23, 2019 13:24
Show all APT repositories in use.
#!/bin/bash
# https://askubuntu.com/a/924587/169878
echo
echo "APT Repositories In Use"
echo
echo "Please wait while I update apt command.."
echo
sudo apt update > /dev/null 2>&1 && \
echo "Current repositores:" && \
sudo apt-cache policy | grep http | awk '{print $2 $3}' | sort -u
@bmatthewshea
bmatthewshea / just port 80
Last active June 10, 2019 15:54
Sample redirect from apache
<VirtualHost *:80>
ServerName domain.com
ServerAlias *.domain.com *.www.domain.com
ErrorLog ${APACHE_LOG_DIR}/domain.com-error.log
CustomLog ${APACHE_LOG_DIR}/domain.com-access.log common
Redirect 301 / https://www.domain.com/
</VirtualHost>
<VirtualHost *:443>
ServerName www.domain.com
ServerAlias *.domain.com *.www.domain.com