This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 3da240b059b1710b47d8774b27dc84bd05fb409c (HEAD -> master) | |
Author: Witold Baryluk <[email protected]> | |
Date: Wed Nov 30 02:56:29 2022 +0100 | |
Demangle D programming language (dlang) symbol names | |
diff --git a/coregrind/m_demangle/demangle.c b/coregrind/m_demangle/demangle.c | |
index 3fd7cb75f..a4031dc8a 100644 | |
--- a/coregrind/m_demangle/demangle.c | |
+++ b/coregrind/m_demangle/demangle.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
wget -c https://9front.org/iso/9front-9442.0e66f87316e571f7edf5274369ec69a5905507aa.amd64.iso.gz | |
gunzip -k 9front-9442.0e66f87316e571f7edf5274369ec69a5905507aa.amd64.iso.gz | |
if ! [ -f plan9.raw ]; then | |
qemu-img create plan9.raw 10G | |
fi | |
exec qemu-system-x86_64 -enable-kvm \ | |
-smp $(nproc) \ | |
-m $((8*1024)) \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# MIT License, Witold Baryluk, 2022 | |
# double dabble algorithm for convering binary numbers to decimal notation. | |
# This is program is not for speed, but just for ilustration and education. | |
# It works, and could be starting point to trying to understand | |
# how it works, and implement it for example on a microcontroller without | |
# division. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set firewall all-ping 'enable' | |
set firewall broadcast-ping 'disable' | |
set firewall config-trap 'disable' | |
set firewall group network-group inside-nets network '192.168.99.0/24' | |
set firewall group network-group inside-nets network '10.31.74.0/28' | |
set firewall ipv6-receive-redirects 'disable' | |
set firewall ipv6-src-route 'disable' | |
set firewall ip-src-route 'disable' | |
set firewall log-martians 'enable' | |
set firewall receive-redirects 'disable' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Copyright: Witold Baryluk, 2019-2024. MIT license | |
# This small program takes one parameter, a binary (or library), and outputs | |
# a dependency graph. This is done recursively for all subdependencies. | |
# Some common dependencies are ignored like this ones to glibc basic libraries. | |
# The ones related to stdc++ / gcc are not ignored (otherwise the graph would be very dense). | |
# | |
# To generate and render dependency graph in one go, use something like this: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def common_prefix(strings): | |
def _iter(): | |
for z in zip(*strings): | |
if z.count(z[0]) == len(z): # check all elements in `z` are the same | |
yield z[0] | |
else: | |
return | |
return "".join(_iter()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# NOTE: Deprecated. Use https://gist.github.com/baryluk/09cbabb215351117b32aee994e5619a0 instead | |
# This small program takes one parameter, a binary (or library), and outputs | |
# a dependency graph. This is done recursively for all subdependencies. | |
# Some common dependencies are ignored like this ones to glibc basic libraries. | |
# The ones related to stdc++ / gcc are not ignored. | |
# After script is done execute this command to generate dependency graph: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -x | |
# TODO(baryluk): Standard depencies required: cmake, ninja, repo, git, gcc/g++, wayland-client, libxcb, libxml2, python3, perl, llvm | |
# Optional: valgrind, go, ocaml. | |
# I think the llvm actually doesn't need to be installed, because it is a part of downloaded and patched repo. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Just a quick test of squashfs compression ratio using different settings. | |
I am looking for relatively good and fast compression, that also is quick to decompress. | |
I don't care about ultimate end size exactly tho. | |
Input (a Debian testing live build with 6240 installed packages): | |
$ sudo du -bs ./chroot | |
26566785410 ./chroot # 26.6GB | |
$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Comparing minimal practical (no assembler used, C library used) binaries | |
# for various languages and compilers. | |
# Mainly to test D programming language mode called betterC | |
time g++-10 -Os -g0 -fno-exceptions -fomit-frame-pointer miniCPP.cpp -o miniCPP_gcc | |
time gcc-10 -Os -g0 -fno-exceptions -fomit-frame-pointer miniC.c -o miniC_gcc | |
time clang++-10 -Os -g0 -fno-exceptions -fomit-frame-pointer miniCPP.cpp -o miniCPP_clang | |
time clang-10 -Os -g0 -fno-exceptions -fomit-frame-pointer miniC.c -o miniC_clang |
NewerOlder