Skip to content

Instantly share code, notes, and snippets.

View edwintorok's full-sized avatar
💭
I may be slow to respond.

Török Edwin edwintorok

💭
I may be slow to respond.
View GitHub Profile
@edwintorok
edwintorok / Makefile
Last active March 10, 2024 10:30
hledger-flow example
.PHONY: all clean
all: all-years.journal
clean:
rm -f all-years.journal
find import -name _manual_ -prune -o -name 1-in -prune -o -type f \( -name '*.journal' -o -name '*.csv' \) -print0 | xargs -0 rm -f
SOURCES=directives.journal
SOURCES+=$(wildcard import/me/_manual_/*/*.journal)
SOURCES+=$(wildcard prices/*/*.journal)
declare -a FILES
FILES=(comments document fontTable footnotes numbering settings styles theme1 webSettings)
if [ "$1" != "" ]; then
rm ./tmp -rf
unzip -o -j "$1" -d "./tmp"
for i in ${FILES[@]}; do
xmllint --format "./tmp/${i}.xml" > "./tmp/${i}-pretty.xml"
done
fi
#!/usr/bin/env python3
from docx import Document
from docx.oxml import ns
from docx.oxml.table import CT_TblWidth
from docx.oxml.shared import OxmlElement
from docx.oxml.ns import qn
# From python-docx _tag_seq
tag_seqs = (
(
dotnet restore
dotnet build --configuration Release --no-restore
dotnet OOXMLValidatorCLI/bin/Release/net6.0/OOXMLValidatorCLI.dll ../../reference.docx | json_reformat
otnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.125
Commit: e898a826c2
Runtime Environment:
#!/usr/bin/env bash
if [ "$1" != "" ]; then
unzip -o -j "$1" -d "./tmp"
xmllint --format "./tmp/document.xml" > "./tmp/document-pretty.xml"
xmllint --format "./tmp/styles.xml" > "./tmp/styles-pretty.xml"
xmllint --format "./tmp/settings.xml" > "./tmp/settings-pretty.xml"
fi
xmllint -noout -nonet -debugent \
#!/bin/sh
# to be run as root
# See https://llvm.org/docs/Benchmarking.html and https://docs.kernel.org/admin-guide/pm/amd-pstate.html
# Disable ASLR
echo 0 > /proc/sys/kernel/randomize_va_space
# Need to disable turbo boost, only know how to do that if it is set to passive
echo passive >/sys/devices/system/cpu/amd_pstate/status
cpupower frequency-set -g performance
let base = Char.code '0'
let rec string_of_int_rec b i n =
let i = i - 1 in
Bytes.unsafe_set b i (Char.unsafe_chr (base + n mod 10));
let n = n / 10 in
if n = 0 then i
else string_of_int_rec b i n
let int_min_str = string_of_int min_int
1250 files changed, 121864 insertions(+), 115011 deletions(-)
[root@db1993e8c429]/home/edvint/xen/xen# git diff --dirstat
5.5% xen/arch/arm/include/asm/
5.5% xen/arch/arm/
4.2% xen/arch/x86/cpu/
4.7% xen/arch/x86/hvm/
8.1% xen/arch/x86/include/asm/
3.3% xen/arch/x86/mm/
4.4% xen/arch/x86/x86_emulate/
10.2% xen/arch/x86/
#!/usr/bin/env python3
import browser_cookie3
import requests
import logging
logging.basicConfig(level=logging.DEBUG)
logging.debug("About to load Firefox cookiejar")
BASE = "https://discuss.ocaml.org"
cookiejar = browser_cookie3.firefox(domain_name="discuss.ocaml.org")
logging.debug("Got cookies: %r" % ([c.name for c in cookiejar]))
@edwintorok
edwintorok / inxi.txt
Last active December 27, 2021 18:48
mmap populate test
CPU: 12-Core AMD Ryzen 9 3900X (-MT MCP-) speed/min/max: 3800/2200/3800 MHz Kernel: 5.15.11-200.fc35.x86_64 x86_64 Up: 3h 40m
Mem: 3884.9/64274.8 MiB (6.0%) Storage: 24.99 TiB (7.7% used) Procs: 506 Shell: Zsh inxi: 3.3.09