Skip to content

Instantly share code, notes, and snippets.

@miku
miku / fix.md
Created December 9, 2023 11:26 — forked from kitten/fix.md
Fix "Unknown Chipset" with nouveau

Booting from a Linux installation disk with a newer graphics card might trigger an "Unknown Chipset" error from nouveau.

Add nomodeset nouveau.modeset=0 to the kernel options to fix it.

In UEFI Boot Mode it might also hang at "Triggering uevents", which is the same issue without the error message.

@miku
miku / HowToOTGFast.md
Created September 9, 2023 11:26 — forked from gbaman/HowToOTGFast.md
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

@miku
miku / chatgptparseexport.go
Created July 7, 2023 10:01 — forked from wingedpig/chatgptparseexport.go
A Go program to parse ChatGPT export files
package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"sort"
@miku
miku / tri.py
Created February 13, 2023 09:25
langs = {
"de": [
"ein",
"ich",
"nde",
"die",
"und",
"der",
"che",
"end",
@miku
miku / lvz.sh
Last active January 24, 2023 11:26
lvz is a function
lvz ()
{
# go install github.com/ericchiang/pup@latest
for cmd in curl jq pup;
do
if [ ! $(command -v $cmd) ]; then
echo "$cmd required";
return;
fi;
done;
@miku
miku / .gitignore
Last active March 22, 2023 12:38
Minimal zipapp-ish thingy using shiv (https://github.com/linkedin/shiv)
app.zip
build/lib/hello.py
zhello.egg-info
@miku
miku / README.md
Last active July 4, 2022 07:39
Streaming through XML with a Python helper function

XML and large files

Python and stdlib

With Python standard lib only, xstream.py. Stream through a large file by looking, e.g. at one "record" at a time.

@miku
miku / README.md
Created August 21, 2021 20:39 — forked from obscurerichard/README.md
Simulates a low bandwidth, high-latency network connection

slow

This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.

slow 3G                   # Slow network on default eth0 down to 3G wireless speeds
slow reset                # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet  with a high latency
slow dsl -b 1mbps         # Simulate DSL with a slower speed than the default

slow modem-56k -d eth0 # Simulate a 56k modem on the eth1 device. eth0 is unchanged.

// func GetCpuForThread() uint64
TEXT ·GetCpuForThread(SB),7,$0
MOVQ $0xB,AX
XORQ CX,CX
CPUID
MOVQ DX,ret+0(FP)
RET
@miku
miku / .gitignore
Created July 23, 2021 16:03 — forked from tkf/.gitignore
A script to locate libpython associated with the given Python executable.
*.pyc
.pytest_cache