This file contains hidden or 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 | |
| from sys import stdin | |
| import re | |
| def label2path(msg: str): | |
| ''' | |
| "[foo][bar] baz" -> "foo/bar: baz" | |
| For commit messages rewriting |
This file contains hidden or 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
| YEAR ?= $(shell date +"%Y") | |
| MONTH ?= $(shell date +"%m") | |
| DAY ?= $(shell date +"%d") | |
| export YEAR | |
| export MONTH | |
| export DAY | |
| PREFIX ?= $(YEAR)/$(MONTH)/$(DAY) |
This file contains hidden or 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 bash | |
| # https://everydaywithlinux.blogspot.com/2012/11/patch-strings-in-binary-files-with-sed.html | |
| function patch_strings_in_file() { | |
| local FILE="$1" | |
| local PATTERN="$2" | |
| local REPLACEMENT="$3" | |
| # Find all unique strings in FILE that contain the pattern |
This file contains hidden or 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 | |
| import subprocess | |
| def main(): | |
| storePaths = [ | |
| '5jrqcja5680bgm7ycdw6lpnvm65hga5y-qemu-8.0.0', | |
| '1nyg1fvhpz8bx3vn3r9f18zhra2rpbx9-glibc-2.37-8', | |
| '28wb2asziwwv2wxynqi9nxiigycsjjmg-zlib-1.2.13', | |
| 'hp8yk1q64r8qmxp1k6bava09asgx805z-pcre2-10.42', |
This file contains hidden or 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 bash | |
| MACHINE_NAME=win10 | |
| MACHINE_PATH=$PWD | |
| SPICE_LINK=/tmp/vm-spice-$MACHINE_NAME.socket | |
| # shellcheck disable=SC2054 | |
| qemu_cmd=( |
This file contains hidden or 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 bash | |
| # shellcheck disable=SC2054 | |
| # Tweakable options, comment to unset. | |
| # Passthrough the GPU (hardware) via PCI Passthrough (OVMF) | |
| EnableGPUPassthrough= | |
| # Whether or not add a sound device, connect to the system | |
| # EnableSystemSound= |
This file contains hidden or 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
| # TPM | |
| TPMSTATE=${TPMSTATE:-"$XDG_RUNTIME_DIR/tpm0"} | |
| mkdir -p $TPMSTATE | |
| TPMCMD=( | |
| swtpm | |
| socket | |
| -d | |
| --tpmstate dir=$TPMSTATE,mode=0600 | |
| --tpm2 | |
| --ctrl type=unixio,path=${TPMSTATE}/swtpm-sock |
This file contains hidden or 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
| start: expr; | |
| expr: expr_function; | |
| expr_function | |
| : identifier ':' expr_function | |
| | '{' formals '}' ':' expr_function | |
| | '{' formals '}' '@' identifier ':' expr_function | |
| | ASSERT expr ';' expr_function |
This file contains hidden or 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 bash | |
| # add-vfio.sh: detect iommu groups and override the driver of these devices to vfio-pci | |
| IsolatingDevice="$1" | |
| IOMMUGroup=$(ls "/sys/bus/pci/devices/$IsolatingDevice/iommu_group/devices") | |
| for Device in ${IOMMUGroup}; do | |
| DeviceDir="/sys/bus/pci/devices/$Device" |
This file contains hidden or 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 bash | |
| LLVM="$1" | |
| # LLVMBaseDirectory="$LLVM" | |
| # BuildMode="Release" | |
| # BuildDirectory="build-release" | |
| # BuildBase="${LLVMBaseDirectory}/${BuildDirectory}" | |
| # LLVMEnableProjects="clang;mlir" |