Skip to content

Instantly share code, notes, and snippets.

View bryanpedini's full-sized avatar

Bryan Joshua Pedini bryanpedini

View GitHub Profile
@bryanpedini
bryanpedini / randomstring.go
Created July 12, 2022 16:38
Random variable-length string of uppercase or digit characters
import (
"fmt"
"math/rand"
"time"
)
func rnd(ln int) string {
str := ""
for idx := 0; idx < ln; idx++ {
rand.Seed(time.Now().UnixNano())
@bryanpedini
bryanpedini / full-system-backup.sh
Created March 21, 2021 21:44
/usr/local/bin/full-system-backup
#!/usr/bin/env bash
# Check if backup target is mounted, else, ask the user to
# select a device to mount (and use) instead
MOUNT=$(findmnt | grep "/mnt/backup" 2>/dev/null)
if [ "$MOUNT" = "" ]; then
fdisk -l | less
read -p "Enter backup device: " DEVICE
mount $DEVICE /mnt/backup
fi
@bryanpedini
bryanpedini / type.py
Created March 17, 2021 23:02
Real Estate bought quick
from pynput.keyboard import Key, Controller
import time
"""
Website in scope: https://establishedtitles.com
Country the script is programmed for: Italy
"""
kb = Controller()
@bryanpedini
bryanpedini / generate_spam_addresses.sh
Created July 24, 2020 22:08
Get e-mail addresses from Git log to be used in spam automation (not from me at least, but just a proof of concept that sadly it can be done)
#!/usr/bin/env bash
git clone "$1.git"
REPO=$(echo "$1" | sed -e 's/.*\///')
cd $REPO
git log | grep "Author:" | grep -e ".*@.*\..*" | sort | uniq | sed -e 's/.*<//' | sed -e 's/>//' >> ../spam_addresses.txt
cd ..
rm -rf $REPO