Skip to content

Instantly share code, notes, and snippets.

View SheatNoisette's full-sized avatar
🖥️
Beep boop

SheatNoisette

🖥️
Beep boop
View GitHub Profile
[747373.586454] usb 1-1: new full-speed USB device number 94 using xhci_hcd
[747373.714642] usb 1-1: New USB device found, idVendor=12d1, idProduct=0010, bcdDevice= 1.00
[747373.714647] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[747373.714648] usb 1-1: Product: KT USB Audio
[747373.714650] usb 1-1: Manufacturer: KTMicro
[747373.714651] usb 1-1: SerialNumber: 2021-07-19-0000-0000-0000-
[747373.716797] input: KTMicro KT USB Audio Consumer Control as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2/0003:12D1:0010.000A/input/input32
[747373.769639] input: KTMicro KT USB Audio as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2/0003:12D1:0010.000A/input/input33
[747373.770042] hid-generic 0003:12D1:0010.000A: input,hiddev96,hidraw1: USB HID v1.10 Device [KTMicro KT USB Audio] on usb-0000:00:14.0-1/input2
@SheatNoisette
SheatNoisette / example_audio.c
Last active June 7, 2023 10:07
Failed attempts to do machine learning using gennan
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "genann.h"
#include "stb_vorbis.c"
#define AUDIO_WINDOW 128
#define AUDIO_OUTPUT (AUDIO_WINDOW * 2)
@SheatNoisette
SheatNoisette / TechTips.md
Created May 12, 2022 22:53
NVIDIA kernel module missing. Falling back to nouveau. Fedora 36 upgrade

How to fix "NVIDIA kernel module missing. Falling back to nouveau." when upgrading from Fedora 35 to 36:

# Remove every kmod-nvidia from your system
sudo dnf remove kmod-nvidia-5.17.*
sudo dnf reinstall akmod-nvidia
sudo akmods --force

Then Reboot

@SheatNoisette
SheatNoisette / thinkfan.conf
Created April 1, 2022 08:46
Simple Thinkfan configuration for E480 Thinkpad
sensors:
- tpacpi: /proc/acpi/ibm/thermal
fans:
- tpacpi: /proc/acpi/ibm/fan
# Simple mode: each entry is a [FANSPEED, LOWER_LIMIT, UPPER_LIMIT] tuple.
levels:
- [0, 0, 41]
- [1, 38, 51]
- [2, 45, 56]
@SheatNoisette
SheatNoisette / emsdk.patch
Created December 7, 2021 19:14
Patch to force Emscripten SDK tool downloader to use IPv4 by default
diff --git a/emsdk.py b/emsdk.py
index 9bf7c9c..52d146d 100644
--- a/emsdk.py
+++ b/emsdk.py
@@ -4,8 +4,18 @@
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
+
from __future__ import print_function
@SheatNoisette
SheatNoisette / gameboy.glsl
Last active June 5, 2020 13:04
Gameboy shader made in shadertoy
// Simple GameBoy style shader in ShaderToy
// This require a texture/Webcam input on Channel0 in ShaderToy
// SheatNoisette (2020) - GNU GPL 3.0 Licensed
vec3 gameboy_palette[4];
vec3 gameboyify(vec3 color) {
// Create palette
gameboy_palette[0] = vec3(51, 44, 80);
gameboy_palette[1] = vec3(70, 135, 143);
@SheatNoisette
SheatNoisette / PPMViewerGimp.py
Created November 28, 2019 21:51
Simple B&W PPM Viewer in terminal
# /bin/python3
# Terminal PPM preview loader Quick'n'Dirty
# Print to terminal a preview of a PPM file in black and white generated by gimp
# Like:
# 100
# 010
# 001
# Usage: script.py <ppm file>
import sys
@SheatNoisette
SheatNoisette / GraphvizRenderExample.py
Last active November 23, 2019 17:26
Generate and export graph from dot file using Graphviz
"""
Render Graphviz dot file example
Ubuntu and Debian: sudo apt-get install graphviz && pip3 install graphviz
"""
from graphviz import Source
input_graph = """
graph {
0 [label = "ape"]
1 [label = "apt"]
@SheatNoisette
SheatNoisette / alpha_insert.py
Last active October 31, 2019 17:07
Insert a letter in alphabetical order in a list
#!/usr/bin/env python
# BASIC ALGORITHM
# Insert letter alphabetically in a list
# This quick and dirty example shows how to insert a letter in a list
# alphabetically
# CC-O for homework/class and Beerware Licence for other
test_1 = ["a", "b", "d", "e", "f"]
test_2 = ["i"]
@SheatNoisette
SheatNoisette / char_detect.py
Last active October 31, 2019 17:07
Naive characters detection in a 2D array
#!/usr/bin/env python
import os
# Find characters in a 2D array and return their position in the grid
# Basis for a simple optical recognition software
# MIT License
char_array = [
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,1,1,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0],