Skip to content

Instantly share code, notes, and snippets.

View genbtc's full-sized avatar

genBTC genbtc

  • NJ, USA
View GitHub Profile
@genbtc
genbtc / extract_emojis_v2.py
Created September 26, 2025 15:43
extract_emojis_v2.py
#!/usr/bin/env python3
import re
import sys
import textwrap
# Regex covering most emoji ranges
emoji_pattern = re.compile(
"[\U0001F600-\U0001F64F" # Emoticons
"\U0001F300-\U0001F5FF" # Symbols & pictographs
"\U0001F680-\U0001F6FF" # Transport & map symbols
@genbtc
genbtc / hash_collision.py
Created September 23, 2025 15:37
hash_collision.py
#!/usr/bin/env python3
import math
import sys
def main():
if len(sys.argv) != 3:
print(f"Usage: {sys.argv[0]} <num_items> <bits>")
print("Example: ./hash_collision.py 1000000000 72")
sys.exit(1)
@genbtc
genbtc / ssh-exec9.sh
Created September 23, 2025 15:36
ssh-exec9.sh
#!/usr/bin/env bash
#
# Usage: ./ssh-exec9.sh alias1 alias2 ... aliasN (up to 9)
# Opens multiple tabs of xfce4-terminal for many ssh connections (easy run on startup)
#
CMD=(xfce4-terminal)
if [ $# -lt 1 ] || [ $# -gt 9 ]; then
echo "Usage: $0 alias1 [alias2 ... alias9]"
exit 1
@genbtc
genbtc / GPT-pyparsing-BNF.txt
Created March 3, 2025 19:30
GPT-pyparsing-BNF.txt
You said:
Prompt:
for python is pyparsing library using BNF?
ChatGPT said:
Not exactly — Pyparsing doesn’t use Backus-Naur Form (BNF) directly, but it provides a more Pythonic, object-oriented approach to defining grammars.
BNF is a formal way to describe the syntax of languages, often used in compiler design and language parsing. Pyparsing, on the other hand, lets you build grammars by combining objects representing different parsing rules — like literals, keywords, expressions, and patterns — using Python’s operators and methods.
@genbtc
genbtc / GPT-contents-boost-parser.cpp
Created March 3, 2025 18:49
GPT-contents-boost-parser.cpp
#include <iostream>
#include <fstream>
#include <string>
#include <boost/parser/parser.hpp>
#include <boost/hana/tuple.hpp>
namespace bp = boost::parser;
struct DirEntry {
std::string path;
@genbtc
genbtc / GPT-contents-parser-FUSION.cpp
Created March 3, 2025 18:39
GPT-contents-parser-FUSION.cpp
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <boost/spirit/include/qi.hpp>
#include <boost/phoenix/phoenix.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
namespace qi = boost::spirit::qi;
namespace ascii = boost::spirit::ascii;
@genbtc
genbtc / tmpfadt.py
Created January 25, 2025 01:12
/tmp/fadt.py
#!/usr/bin/python3
import logging
import os
import struct
def BIT(num):
"""Returns a bit shifted by num"""
return 1 << num
def check_fadt():
"""Check the kernel emitted a message specific to 6.0 or later indicating FADT had a bit set."""
found = False
@genbtc
genbtc / cled.py
Created August 6, 2023 01:24
cled.py
#!/usr/bin/env python3
import aioconsole
import colorama
import configparser
import json
import discord
from discord.ext import commands
import atexit, os, sys, readline
histfile = os.path.join(os.path.expanduser("~"), ".discord_history")
@genbtc
genbtc / lsmod-mullvad.txt
Last active June 26, 2023 19:20
lsmod for mullvad.txt
#List of modules triggered to load specifically by mullvad daemon.
Module Size Used by
nft_reject_inet 16384 6
nf_reject_ipv4 16384 1 nft_reject_inet
nf_reject_ipv6 16384 1 nft_reject_inet
nft_reject 16384 1 nft_reject_inet
nft_masq 16384 1
nft_ct 20480 8
nft_chain_nat 16384 1
nf_tables 241664 725 nft_ct,nft_reject_inet,nft_masq,nft_chain_nat,nft_reject
@genbtc
genbtc / Atheros-ATH9k-Comparison.txt
Created February 14, 2023 00:36
Atheros-ATH9k-Comparison.txt
922 PCI -> 928 PCIe
9220
3rd gen XSpan
9223
Oct2009 http://153.150.70.18/AR9223.pdf
2x2 MIMO "Mac/BB/Radio" 802.11n 2.4ghz
9271 USB
Nov2011 http://www.datasheet.es/PDF/788267/AR9271-pdf.html