Skip to content

Instantly share code, notes, and snippets.

View genbtc's full-sized avatar

genBTC genbtc

  • NJ, USA
View GitHub Profile
@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
@genbtc
genbtc / spattering-of-assorted-wifinames.txt
Created February 13, 2023 06:20
spattering-of-assorted-wifinames.txt
New Solutions:
NEW AP5881
WiFi 6/6E + BT 5.2 802.11ax/ac/a/b/g/n@ SiP Module, 1T1R
NEW WNFQ-269AX(BT)
WiFi 6/6E + BT 5.2 802.11ax/ac/a/b/g/n @ M.2 2230 (E KEY), 2T2R
NEW WPEQ-268AXI(BT)
WiFi 6/6E + BT 5.2 802.11ax/ac/a/b/g/n @ Half Size MPCIe, 2T2R
NEW WNFQ-268AXI(BT)
WiFi 6/6E + BT 5.2 802.11ax/ac/a/b/g/n @ M.2 2230 (E KEY), 2T2R
@genbtc
genbtc / github-beautiful.py
Created January 13, 2023 03:52
github-beautiful.py
#!/usr/bin/env python3
#Copyright 2023 - genr8eofl @IRC/gentoo
# github-beautiful.py - fetch GitHub repo "Description" (for many links at once)
# Makes 1 HTTPS connection per line, retreives the HTML page and parses it for <Title>
import requests
from requests import ReadTimeout, ConnectTimeout, HTTPError, Timeout, ConnectionError
from bs4 import BeautifulSoup
import sys
urlprefix="https://github.com/"
@genbtc
genbtc / github-beautiful.sh
Created January 13, 2023 03:48
github-beautiful.sh
#!/bin/bash
# Copyright 2023 genr8eofl @IRC/gentoo
# Fetch Github Repo Descriptions. Pre-reqs: bash / jq / (curl || gh)
while read REPO; do
#REPO="torvalds/linux" #test
API="https://api.github.com/"
#DESC=$(curl -s "${API}/repos/${REPO}" | jq '.description') # rate limited
DESC=$(gh api "/repos/${REPO}" | jq '.description') # need GITHUB_TOKEN
GH="https://github.com/"
echo "${GH}${REPO} - ${DESC}"