Skip to content

Instantly share code, notes, and snippets.

View matschundbrei's full-sized avatar

Jan 'Maub' Kapellen matschundbrei

View GitHub Profile
@matschundbrei
matschundbrei / git-commit-change-author-email.md
Created September 3, 2024 11:19 — forked from mikaello/git-commit-change-author-email.md
Change Git commit author / email in existing commits

Docs: https://github.com/newren/git-filter-repo/blob/main/Documentation/converting-from-filter-branch.md#changing-authorcommittertagger-information and https://htmlpreview.github.io/?https://github.com/newren/git-filter-repo/blob/docs/html/git-filter-repo.html#_filtering_of_names_amp_emails_see_also_name_callback_and_email_callback

git filter-repo \
  --email-callback ' return email if email != b"OLD_EMAIL" else b"NEW_EMAIL" ' \
  --name-callback 'return name.replace(b"OLD_AUTHOR", b"NEW_AUTHOR")' \
  --force \
  --refs HEAD~<NUMBER_OF_COMMITS>..<BRANCH_NAME> # This line is optional, remove to do the change in all commits (will rewrite complete history)
@matschundbrei
matschundbrei / pentesting_searchengines.md
Last active September 17, 2023 00:14
Copy of Searchengines for Pentesting (Twitter Post by @voldimmoral)
@matschundbrei
matschundbrei / update_docker_images.sh
Last active June 27, 2021 22:50
Update all locally pulled and tagged docker images
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
docker image ls | \
tail -n +2 | \
grep -v '<none>' | \
awk '{print $1 ":" $2 }' | \
xargs -n1 docker pull
#!/bin/bash
# unofficial bash strict mode
set -euo pipefail
IFS=$'\n\t'
# this is the target-dir for images
TARGET="all-images"
# find the images (change extension as needed)
IMG=$(find ./ -iname '*.jpg')
@matschundbrei
matschundbrei / ps2-squad-handbook.md
Last active January 11, 2021 02:43
Planetside 2 Squad Handbook

Keybase proof

I hereby claim:

  • I am matschundbrei on github.
  • I am maub (https://keybase.io/maub) on keybase.
  • I have a public key ASAka-L33hj478_0Jznqk7XcgLvp3CyCXSvGvrR5gLQGWwo

To claim this, I am signing this object:

@matschundbrei
matschundbrei / csv_switch_fieldseparator.py
Last active June 11, 2019 13:32
Switch out the field separator in a csv (for easy import in Excel)
#!/usr/bin/env python3
"""
small script to exchange the field separator in a CSV
"""
import csv
import argparse
import sys
def main():
@matschundbrei
matschundbrei / rpm-yum-reminder.md
Last active April 2, 2019 15:50
all the rpm/yum commands that I constantly fail to remember but need anytime I have to do something with rpm/yum

show me the description/details of the package

rpm -qip <yourpackage.rpm>
yum info <yourpackage>

show me what is inside the package

rpm -qlp <yourpackage.rpm>
repoquery -l 
@matschundbrei
matschundbrei / human_readable_to_bytes.py
Last active January 2, 2018 13:25 — forked from beugley/human_readable_to_bytes.py
Python function to convert a human-readable byte string (e.g. 2G, 10GB, 30MB, 20KB) to a number of bytes
# stolen from https://stackoverflow.com/questions/354038/how-do-i-check-if-a-string-is-a-number-float
def is_number(s):
"""
tries to convert to float and returns true if it works
"""
try:
float(s)
return True
except ValueError:
return False
@matschundbrei
matschundbrei / nsupdate.sh
Last active September 4, 2016 00:43
A bash script (relying on jq & awscli) to update/add single records in Route53
#!/bin/bash
# author: Matschundbrei <[email protected]>
# usage
USAGE="usage: `basename $0` name.domain.tld type value [ttl]"
# default ttl:
DEFTTL=3600
# AWS profile (in .aws/credentials) to use
AWSPROFILE="owndns"
if [[ $# -lt 3 ]]; then
echo $USAGE