Skip to content

Instantly share code, notes, and snippets.

View linuxlizard's full-sized avatar
💭
Writing a Makefile source level debugger

David Poole linuxlizard

💭
Writing a Makefile source level debugger
View GitHub Profile
@linuxlizard
linuxlizard / bssmap.cc
Created September 25, 2023 13:22
storing a unique_ptr<> in a std::map
// gcc -g -Wall bssmap.cc -lstdc++ -std=c++20 -o bssmap
#include <cstring>
#include <iostream>
#include <memory>
#include <map>
#include <string>
//
// simple demo shim of the C struct BSS
@linuxlizard
linuxlizard / line.rs
Last active June 6, 2023 13:53
Bresenham's line algorithm in Rust via ChatGPT
struct Point {
x: i32,
y: i32,
}
// via ChatGPT4 (!!!)
fn teleport(p1: Point, p2: Point) -> Vec<Point> {
let mut points = Vec::new();
let mut x1 = p1.x;
let mut y1 = p1.y;
@linuxlizard
linuxlizard / line.rs
Created June 6, 2023 13:50
Bresenham's line algorithm in Rust via Google Bard
// via bard.google.com
use std::iter::Iterator;
struct Bresenham {
x1: i32,
y1: i32,
x2: i32,
y2: i32,
}
@linuxlizard
linuxlizard / hostapd.conf
Created January 6, 2022 13:58
hostapd.conf with invalid UTF8 SSID
driver=nl80211
interface=wlp1s0
logger_syslog=-1
logger_syslog_level=2
logger_stdout=127
logger_stdout_level=2
ctrl_interface=/var/run/hostapd-wlp1s0
hw_mode=g
utf8_ssid=1
uapsd_advertisement_enabled=1
@linuxlizard
linuxlizard / gist:45914f588d49fd077205c851c62fa013
Created January 19, 2020 18:08
Preliminary output of 'iw' with 802.11ax support. Work in progress.
VHT operation:
* channel width: 1 (80 MHz)
* center freq segment 1: 138
* center freq segment 2: 0
* VHT basic MCS set: 0xfffc
Unknown IE (195): 03 30 30 30 30
print_extension_ie len=29 23 0d 01 08 1a 40 00 04 60 4c 89 7f c1 83 9c 01 08 00 fa ff fa ff 79 1c c7 71 1c c7 71
HE Capabilities: HE capabilities:
HE MAC capabilities:
* +HTC HE Support
@linuxlizard
linuxlizard / test.json
Created June 2, 2019 14:23
scandump output 20190602
{
"bss" :
[
{
"SSID" : "Color Correction",
"bssid" : "00:30:44:2d:cb:58",
"channel" : 36,
"frequency" : 5180,
"ie" :
{
@linuxlizard
linuxlizard / fixphotos.py
Created November 3, 2014 16:50
Fix Halloween photos with Python PIL and multiprocessing
#!/usr/bin/env python3
# Fix Halloween photobooth photos
# (Also an excuse to play with thread pools some more)
#
# http://pillow.readthedocs.org/en/latest/index.html
# https://medium.com/@thechriskiehl/parallelism-in-one-line-40e9b2b36148
#
# davep 03-Nov-2014
@linuxlizard
linuxlizard / keybase.md
Created September 23, 2014 16:49
keybase.md

Keybase proof

I hereby claim:

  • I am linuxlizard on github.
  • I am linuxlizard (https://keybase.io/linuxlizard) on keybase.
  • I have a public key whose fingerprint is A916 9B63 12D9 B58E C08A 2105 98A9 E560 CC96 E94E

To claim this, I am signing this object:

/* frustrating example of braces vs indent */
if (!pdev->dev.release)
pdev->dev.release = foo_release;
/*
* Get the Physical Resources
*/
if (foo_add_device(pdev)) {
BUG(); /* crash on fail? */