Skip to content

Instantly share code, notes, and snippets.

View bmatthewshea's full-sized avatar

Brady Shea bmatthewshea

View GitHub Profile
@bmatthewshea
bmatthewshea / certbot_pip_install-debian_ubuntu.md
Last active April 18, 2024 16:40
Debian/Ubuntu - CERTBOT without SNAP/SNAPD

CERTBOT - Install using Python PIP

Install Certbot using Python PIP (Package Installer for Python) - without using SNAP, APT or SYSTEMD. (Debian/Ubuntu)


This guide will help you install LetsEncrypt / Certbot using venv PIP under Debian/Ubuntu.

  • This guide has been tested up to Debian 12 / Bookworm.
@bmatthewshea
bmatthewshea / example_output.txt
Last active April 3, 2024 18:41
Show public IP and other info from simple bash script or alias
Gateway:
192.168.1.1
Private:
192.168.1.101/24
Public:
199.199.199.199
@bmatthewshea
bmatthewshea / - postfix-geoip.pl
Last active March 28, 2024 17:26
Postfix GeoIP Blocking
#!/usr/bin/perl
# Brady Shea Feb 25 2019
# starting point:
# http://web.archive.org/web/20151128083440/https://www.kutukupret.com/2011/05/29/postfix-geoip-based-rejections/
use strict;
use warnings;
use Sys::Syslog qw(:DEFAULT setlogsock);
use Geo::IP;
use Regexp::Common;
@bmatthewshea
bmatthewshea / APT-KEY-Deprecated_Fix_Debian_Ubuntu.md
Last active March 15, 2024 19:21
Add gpg key for Debian/Ubuntu repo - New format

apt-key add (key) is deprecated

On Debian Bookworm when running apt-key add.

NOTE: RSPAMD is only used as an example. This method should work for any deprecated install instructions for apt-key.

While executing:
wget -O- https://rspamd.com/apt-stable/gpg.key | apt-key add -

The following is observed:

"Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details."

@bmatthewshea
bmatthewshea / whois-asn-ip
Last active March 11, 2024 09:41
BASH script that uses 'whois' to lookup ASN number and display all IP4 CIDR associated to it.
#!/bin/bash
# whois-asn-ip (bash script)
# By: Brady Shea - March 15th 2020
# https://www.holylinux.net
# https://gist.github.com/bmatthewshea/dc427f0c30b82429931d5896f548d550
# The whois server to use:
WHOISHOSTNAME=whois.ripe.net
# Uncomment to remove temp files
#DEL_TEMP=true
@bmatthewshea
bmatthewshea / RPI-FullUpgrade.md
Last active March 9, 2024 16:34
Commands needed to upgrade RPI Raspbian/Debian System

Upgrade "Raspbian" Bullseye to Bookworm

(should work for any upgrade if you update release names)

Prep

sudo apt-get update
sudo apt-get upgrade
sudo apt-get full-upgrade
# Update the 2 individual files yourself, or run this:

sudo sed -i -e 's/bullseye/bookworm/g' /etc/apt/sources.list /etc/apt/sources.list.d/raspi.list

@bmatthewshea
bmatthewshea / whattomine-hashtimes.py
Last active January 11, 2024 05:55
Python script to calculate time to win full block and revenue per day. (GPU MINING)
#!/usr/bin/python
# -*- coding: utf-8 -*-
# "Whattomine GPU Hash time calculator"
#
# This is not for CPU or ASIC calculations.
# Author: Brady Shea
# Email: Use github user: bmatthewshea or gist comments
# Origin: https://gist.github.com/bmatthewshea/90b120722e0561dd235adcdc231b6765
#
@bmatthewshea
bmatthewshea / system_update.sh
Last active December 8, 2023 16:24
Ubuntu-Debian APT upgrade script
#!/bin/bash
#
# Brady Shea - 18SEP2020 - conversion of system_update alias to bash script
# https://www.holylinux.net/
#
# Place this script in "/usr/local/sbin/system_update" or similar location under your $PATH
# It needs root permissions (SUDO) to execute.
#
# Change these settings to your liking:
#################################
@bmatthewshea
bmatthewshea / geoip2lookup.bash
Last active December 4, 2023 20:59
GeoIP Lookup scripts for use with new Maxmind MMDB database files
#!/bin/bash
#
# By: Brady Shea - 10FEB2020 - Last update 04DEC2023
#
# Usage (ip4 only):
# geoip2lookup IP_ADDRESS
#
# ** Install GeoIP Tool and Updater **
#
# sudo add-apt-repository ppa:maxmind/ppa
@bmatthewshea
bmatthewshea / check_up.sh
Last active October 2, 2023 00:14
When Do I Go Back Online? (Capture a combined ping/grep reply in a variable)
#!/bin/bash
# WHEN DO I GO BACK ONLINE?
# Brady M. Shea - 23SEP2023
# For a StackOverflow answer (https://stackoverflow.com/a/77164885/503621)
# Original link: https://gist.github.com/bmatthewshea/87b70e3d75f8f8576cacdf1445daf4a6
# Variables/command subs
sleepy=60 # PING every SLEEPY seconds. 1 minute recommended.
hosttoping=google.com # can be google.com/etc. Should be a name based host. Not an IP.