Instantly share code, notes, and snippets.
📚
Studying...
PhD Student @ University of Trento, Fondazione Bruno Kessler. Photographer and basketball enthusiast.
- University of Trento
- Trento
- matteo.franzil.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # tombola_generator.py | |
| importrandom | |
| importos | |
| importre | |
| defclean_latex_string(text): | |
| replacements= { | |
| '&':' e ', |
mfranzil /dsstore_bruteforcer.py
CreatedJuly 10, 2024 09:39
Discover a directory structure of a website that forgot .DS_Store files This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| importos | |
| importqueue | |
| importsubprocess | |
| importrequests | |
| INITIAL_DS_STORE= ... | |
| OUT_FOLDER= ... | |
| BASE_PATH= ... | |
| seen=set() |
mfranzil /orgmode-pre-hook.sh
Last activeJuly 10, 2024 09:40
Compile your Orgmode files before committing to Git. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Copy this file in .git/hooks/pre-commit. | |
| # Find all the org files in the directory and compile them | |
| echo"Compiling Org files to PDF..." | |
| # Find all Org files | |
| ORG_FILES="$(find. -type f -iname'*.org')" |
mfranzil /generate_k8s_user.sh
Last activeJuly 10, 2024 09:40
Quickly generate Kubernetes users using the CertificateSigningRequest API This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| KUBEUSER=$1 | |
| shift | |
| KUBEGROUPS=$* | |
| echo"Creating user$KUBEUSER with groups$KUBEGROUPS" | |
| openssl genpkey -out${KUBEUSER}.key -algorithm Ed25519 | |
| if [[-z$KUBEGROUPS ]];then |
mfranzil /list_rbac_resources.md
Last activeDecember 17, 2025 05:36
Listing all API resources and subresources in Kubernetesmfranzil /anonymizer.sh
Last activeOctober 17, 2023 16:50
Anonimize repos to be sent for privacy-sensitive contexts and double blind reviews This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo"Current repository:$(git config --get remote.origin.url), at commit$(git rev-parse HEAD), stored in$(pwd)" | |
| echo"Warning. This script will rewrite commit history in the destination repository. This cannot be undone!" | |
| echo"The actions will be extremely destructive! Do not run this script unless you know what you are doing!" | |
| read -p"Press [Enter] to continue or Ctrl+C to abort." -n 1 -r | |
| git config --local user.email"anonymous.scholar@example.com" | |
| git config --local user.name"Anonymous User" | |
| git config --local user.signingkey"VERIFY" |
mfranzil /generate_draft.py
Last activeSeptember 30, 2022 09:13
Code for generating a draft order for Dunkest This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| importrandom | |
| importnumpyasnp | |
| people= [...] | |
| original_people=people.copy() | |
| attempts=0 | |
| print("Generating results. Please wait...") |
mfranzil /gtx-970-benchmark
Last activeDecember 14, 2021 13:54
Benchmarks for hashcat running on branchhttps://github.com/matrix/hashcat/tree/apple_m1_final This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| ❯ ./hashcat -b -D 2 | |
| hashcat (v2.01-8057-g3fd6dac52) starting in benchmark mode | |
| Benchmarking uses hand-optimized kernel code by default. | |
| You can use it in your cracking session by setting the -O option. | |
| Note: Using optimized kernel code limits the maximum supported password length. | |
| To disable the optimized kernel code in benchmark mode, use the -w option. | |
| * Device #1: WARNING! Kernel exec timeout is not disabled. | |
| This may cause "CL_OUT_OF_RESOURCES" or related errors. |