Skip to content

Instantly share code, notes, and snippets.

View widlarizer's full-sized avatar
💭
Distracted

Emil J widlarizer

💭
Distracted
View GitHub Profile
@widlarizer
widlarizer / lol.py
Last active March 18, 2025 09:51
linear scale thingy for gamozo
import math, random
import numpy as np
import matplotlib.pyplot as plt
import csv
def read_iq_data(filename):
i_data = []
q_data = []
try:
with open(filename, 'r') as file:
08:49:25.536705 [0-0] * Host login.tailscale.com:80 was resolved.
08:49:25.536793 [0-0] * IPv6: 2a05:d014:386:202:4844:1954:f211:a255, 2a05:d014:386:202:c5e9:4c3f:9808:f2b0, 2a05:d014:386:202:f041:44b6:9559:668, 2a05:d014:386:202:6089:6a93:59a4:920a, 2a05:d014:386:202:30f5:de62:8eed:5c47, 2a05:d014:386:202:256c:6ede:f4f9:a51b, 2a05:d014:386:202:4277:1574:2e7b:d812, 2a05:d014:386:202:2697:66bf:c24a:a674, 2a05:d014:386:202:9501:5da3:6d45:8ca0, 2a05:d014:386:202:eee7:5001:722d:1156, 2a05:d014:386:202:1e36:2966:5bec:a911, 2a05:d014:386:202:9a01:a6fe:4251:8db8, 2a05:d014:386:202:4d:f871:20f3:6602, 2a05:d014:386:202:789e:cd8d:3b4b:df4d, 2a05:d014:386:202:b1ee:6525:7c95:d0f3, 2a05:d014:386:202:b88b:3cda:3907:3f2b
08:49:25.536841 [0-0] * IPv4: 3.74.105.242, 18.197.242.41, 3.125.149.81, 18.159.140.118, 3.70.110.84, 3.124.108.117, 3.69.76.60, 3.73.239.57, 3.78.132.46, 3.125.194.96, 18.159.235.209, 52.28.255.255, 18.194.180.142, 18.199.123.246, 18.197.213.150, 35.156.244.91
08:49:25.536877 [0-0] * [SETUP] added
08:49:25
@widlarizer
widlarizer / bad-configuration.nix
Created March 2, 2025 16:50
NixOS minimized configuration with weird networking issues
{ config, pkgs, lib, ... }:
let
dbus-sway-environment = pkgs.writeTextFile {
name = "dbus-sway-environment";
destination = "/bin/dbus-sway-environment";
executable = true;
text = ''
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
@widlarizer
widlarizer / flake.nix
Created February 21, 2025 10:40
goofy ass pdm backend error
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; }; in {
devShell = pkgs.mkShell {
@widlarizer
widlarizer / sway.log
Created January 22, 2025 15:15
Sway fullscreen wlr freeze in electron apps
00:00:00.000 [INFO] [sway/main.c:295] Sway version 1.10
00:00:00.000 [INFO] [sway/main.c:296] wlroots version 0.18.2
00:00:00.002 [INFO] [sway/main.c:81] Linux fridge 6.13.0 #1-NixOS SMP PREEMPT_DYNAMIC Sun Jan 19 23:51:45 UTC 2025 x86_64 GNU/Linux
00:00:00.002 [INFO] [sway/main.c:97] Contents of /etc/lsb-release:
00:00:00.002 [INFO] [sway/main.c:81] DISTRIB_CODENAME=warbler
00:00:00.002 [INFO] [sway/main.c:81] DISTRIB_DESCRIPTION="NixOS 25.05 (Warbler)"
00:00:00.002 [INFO] [sway/main.c:81] DISTRIB_ID=nixos
00:00:00.002 [INFO] [sway/main.c:81] DISTRIB_RELEASE="25.05"
00:00:00.002 [INFO] [sway/main.c:81] LSB_VERSION="25.05 (Warbler)"
00:00:00.002 [INFO] [sway/main.c:97] Contents of /etc/os-release:
@widlarizer
widlarizer / gist:5ee8d07b2b264adfddc89b7164c1683f
Last active January 10, 2025 18:22
system information fridge B580
Computer Information:
Manufacturer: Micro-Star International Co., Ltd.
Model: MAG B650 TOMAHAWK WIFI (MS-7D75)
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: AuthenticAMD
CPU Brand: AMD Ryzen 9 7900X 12-Core Processor
CPU Family: 0x19
CPU Model: 0x61
@widlarizer
widlarizer / ublockfilters.txt
Created January 9, 2025 22:44
twitch block sponsored stream elements
! click on extension
! bottom right "open the dashboard"
! My Filters tab
! Paste this in:
www.twitch.tv##.jmMgdG.Layout-sc-1xcs6mc-0
www.twitch.tv##.jiRTcI.Layout-sc-1xcs6mc-0
www.twitch.tv##.dyuMOQ.channel-skins-overlay__interactive.InjectLayout-sc-1i43xsx-0
@widlarizer
widlarizer / a.cpp
Created December 18, 2024 11:57
GlobalISel generic combiner example
// llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
bool CombinerHelper::matchBinOpSameVal(MachineInstr &MI) {
return matchEqualDefs(MI.getOperand(1), MI.getOperand(2)) &&
canReplaceReg(MI.getOperand(0).getReg(), MI.getOperand(1).getReg(),
MRI);
}
bool CombinerHelper::replaceSingleDefInstWithOperand(MachineInstr &MI,
unsigned OpIdx) {
assert(MI.getNumExplicitDefs() == 1 && "Expected one explicit def?");
Register OldReg = MI.getOperand(0).getReg();
@widlarizer
widlarizer / macc.md
Created April 10, 2024 22:19
big $macc with fries

Big $macc with fries

Oddities of the yosys $macc cell. To all "losses" in modifications, add in your head the necessity of creating a v2 cell with compatibility wrapping of some kind.

Factor length field has variable bit length

Length of the factor length fields, known as variable num_bits in docs and code, is recorded in the CONFIG parameter and capped at effectively 15. We can set it to const 16 for example, simplifying CONFIG parsing.

Gains: simplifies from_cell, to_cell, simlib.v,

@widlarizer
widlarizer / run.py
Last active March 8, 2024 14:34
Python r function: run commands even easier than in bash
import subprocess, functools
# Do you often use Python in place of bash?
# Do you want to simply just run thing and get output?
# Here's a wrapper function for automating whatever you'd like.
# Use shell=True and you can use pipes and env vars!
# Throw in a string! Throw in an arg list! Throw in a pathlib.Path maybe!
# Use it everywhere! 3 bazillion devices run r('foo')!
r = functools.partial(subprocess.check_output, text=True)