Skip to content

Instantly share code, notes, and snippets.

View briancline's full-sized avatar

Brian Cline briancline

  • SoftLayer / IBM Cloud
  • Dallas, Texas
View GitHub Profile
@briancline
briancline / access_log.py
Last active August 9, 2023 02:18
Nifty flask snippets
@bp_one.before_request
@bp_two.before_request
def _log_request():
logger.info(
'[access] %s %s %s %s %s %s "%s"',
flask.request.remote_addr,
flask.request.remote_user or '-',
flask.request.scheme,
flask.request.environ.get('SERVER_PROTOCOL'),
flask.request.blueprint,
@briancline
briancline / rhel-crap.sh
Created August 16, 2024 02:00
Handy RHEL commands
## Way easier to read list of enabled repos
subscription-manager repos --list \
| tail -n +4 \
| tr '\n' '|' \
| sed -r \
-e 's/Repo ID:/\nRepo ID:/g' \
-e 's/Repo ID:\s+([^|]+)\|Repo Name:\s+([^|]+)\|Repo URL:[^|]+\|Enabled:\s+([01])\|{1,}/\3\t\1\t\2/g' \
| sed -r -e 's/^0/·/g' -e 's/^1/★/g' \
| sort --field-separator $'\t' -k2 \
| column -t -s $'\t'
@briancline
briancline / README.md
Created March 9, 2025 09:47 — forked from smoser/README.md
qemu to linux mapping of smbios / dmi information

Mappings for DMI/SMBIOS to Linux and dmidecode

Information can be put into dmi tables via some qemu-system hosts (x86_64 and aarch64). That information is exposed in Linux under /sys/class/dmi/id and can be read with dmidecode. The names are very annoyingly inconsistent. The point of this doc is to map them.

Mappings

Example qemu cmdline:

qemu-system-x86_64 -smbios type=<type>,field=value[,...]

qemu-system-x86_64 -smbios type=0,vendor=superco,version=1.2.3