Skip to content

Instantly share code, notes, and snippets.

View thatmattlove's full-sized avatar

Matt Love thatmattlove

View GitHub Profile
@thatmattlove
thatmattlove / three_digit_anti_match.py
Last active March 26, 2020 00:16
Three Digit Anti Match Regex Pattern
def three_digit_anti_match(number, prefix=""):
"""Create a non-capturing regex pattern for a three digit number.
Optionally, add a prefix to the pattern.
Example:
Say one wants to match all BGP communities in range, except one,
without using magical features like a negative lookahead,
because, perhaps, your network vendor (looking at you, Juniper)
doesn't support them:
@thatmattlove
thatmattlove / bird_requirements_ubuntu1804.sh
Last active December 10, 2019 00:39
bird requirements
#!/bin/bash
# Since the BIRD docs are the suck, and every time I have to install BIRD it takes me a full 30 minutes
# to figure out which libraries are missing on vanilla Ubuntu and install them, try again, rinse,
# repeat, here's a script to do it for you.
DEPS="m4 bison flex libncurses5-dev libreadline-dev"
install_deps() {
sudo apt install -y $DEPS
}
@thatmattlove
thatmattlove / dank_neon.json
Created September 28, 2019 00:01
A danker, more neon theme for Windows Terminal
{
"name": "Dank Neon",
"black": "#191b2a",
"red": "#ff476e",
"green": "#39ffba",
"yellow": "#ffee7a",
"blue": "#94bfff",
"purple": "#ae81ff",
"cyan": "#01f7f7",
"white": "#eff0f6",
#!/usr/bin/env python3
import click
import subprocess
app_mapping = {
"termius": ("Termius", "termius-app"),
"googlechrome": ("Google Chrome", "google-chrome"),
"vscode": ("Visual Studio Code", "code"),
"hyper": ("Hyper", "hyper"),
"inkdrop": ("Inkdrop", "inkdrop"),
@thatmattlove
thatmattlove / getmyaddress.py
Created June 30, 2019 01:42
Get IPs, CIDR, Network, and Broadcast Addresses for Primary Interface
#!/usr/bin/env python3
"""
For: https://reddit.com/r/Python/comments/c70u0b/get_broadcast_ipv4_address/
Returns list of nested tuples for primary network interfaces, IP,
network, and broadcast addresses. Example:
[
(
'en0',
@thatmattlove
thatmattlove / common_as_path_regex.md
Last active April 22, 2019 06:48
Common AS_PATH Regular Expressions
Expression Match
.\* Anything
.+ One Character
^$ Local Routes
\_65000$ Originated by AS65000
^65000\_ Received from AS65000
_65000_ Via AS65000
_65000_65001_ Via AS65000 and AS65001
_(65000_)+ Multiple AS65000 in path

Keybase proof

I hereby claim:

  • I am checktheroads on github.
  • I am mattlove (https://keybase.io/mattlove) on keybase.
  • I have a public key ASAk9K8YeccgOAd22AtSJ7vtAhHIGSDpiJllQqR0RGGnwgo

To claim this, I am signing this object:

@thatmattlove
thatmattlove / pfxtopem.sh
Last active September 19, 2018 20:18 — forked from 5nizza/remove_pass_from_cert.sh
A quick and dirty script to remove password from SSL certificate. Source: http://serverfault.com/questions/515833/how-to-remove-private-key-password-from-pkcs12-container
#!/bin/bash
# the source: http://serverfault.com/questions/515833/how-to-remove-private-key-password-from-pkcs12-container
if [ $# -ne 2 ]
then
echo "Usage: `basename $0` YourPKCSFile YourPKCSPassword"
exit $E_BADARGS
fi