Skip to content

Instantly share code, notes, and snippets.

@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
@miku
miku / 945526.945527.pdf
Last active June 7, 2021 09:45
Dijkstra 1965 (Go)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@miku
miku / .gitignore
Last active January 17, 2022 23:30
Lightning talk, Notes on Storage
golangleipzig.cdx
golangleipzig.warc.gz
@miku
miku / .gitignore
Last active February 17, 2023 09:55
A data deduplication example with Go
Extra.md
@miku
miku / disassembler.go
Created December 15, 2020 16:36 — forked from grantseltzer/disassembler.go
Full disassembler
package main
import (
"debug/elf"
"fmt"
"log"
"os"
"github.com/bnagy/gapstone"
)
@miku
miku / makecomb.py
Created December 14, 2020 22:17
Generate combinations from a list
#!/usr/bin/env python
"""
Turn:
a
b
c
into: