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
| #!/bin/bash | |
| # Note on hybrid CPUs (P-cores/E-cores): | |
| # Linux /proc/cpuinfo reports only features common to ALL cores. | |
| # This script will correctly detect the lowest ISA level supported | |
| # across all core types, which matches glibc's behavior. | |
| get_x86_64_abi_version() { | |
| local FLAGS | |
| local DETECTED_LEVEL |
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
| import "github.com/mattn/go-isatty" | |
| func init() { | |
| if isatty.IsTerminal(os.Stdout.Fd()) { | |
| slog.SetDefault(slog.New(slog.NewJSONHandler(os.Stdout, nil))) | |
| } | |
| } |
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
| #!/bin/bash | |
| shopt -s nullglob | |
| cd /sys/class/nvme | |
| for CTRL in *; do | |
| echo "removing ${CTRL}" | |
| echo 1 >"${CTRL}/device/remove" | |
| done |
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
| @media -moz-pref("sidebar.verticalTabs") { | |
| :root { | |
| --tab-block-margin: 0 !important; | |
| --tab-min-height: 24px !important; | |
| } | |
| } | |
| #tabbrowser-tabs[orient="vertical"] { | |
| .tabbrowser-tab { | |
| padding-block: 0 !important; |
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
| #!/bin/bash | |
| echo -n 'Size: ' | |
| if [[ $OSTYPE == darwin* ]]; then | |
| stat -f %z "$1" | |
| else | |
| stat -c %s "$1" | |
| fi | |
| (tee < "$1" > /dev/null \ |
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
| #!/bin/bash | |
| set -euo pipefail | |
| : $CLUSTER_ID | |
| : ${PRIVATE:=false} # auto use private IP if public IP not available | |
| : ${MINUTES:=60} # defaults to 1 hour | |
| : ${SHOW_CLUSTER:=} | |
| : ${REGION_ID:=cn-shanghai} # choose nearest region as OpenAPI endpoint, don't need to match ACK cluster location | |
| echo >&2 '+ aliyun cs DescribeClusterUserKubeconfig' |
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
| #!/bin/sh /etc/rc.common | |
| START=90 | |
| STOP=01 | |
| USE_PROCD=1 | |
| start_service() { | |
| procd_open_instance | |
| procd_set_param command /bin/sh -c 'while :; do read < /sys/kernel/debug/ieee80211/phy1/mt76/tx_hang_reset; [ "$REPLY" -eq 0 ] || break; sleep 5; done; reboot' | |
| procd_close_instance |
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 collections.abc import Buffer, Generator | |
| from typing import TypeAlias | |
| import re | |
| Token: TypeAlias = int | bytes | str | |
| Result: TypeAlias = int | bytes | list['Result'] | dict[bytes, 'Result'] | |
| regexp = re.compile(rb'([del])|i(-?\d+)e|(\d+):') |
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
| #!/bin/bash | |
| tohex() { od -An -t x1 | tr -d '[:space:]'; } | |
| fromhex() { printf %b "$(echo "$1" | sed 's/../\\x&/g')"; } | |
| steamguard_otp() { | |
| SECRET_HEX=$(base32 -d <<<"$1" | tohex) | |
| DIGEST_HEX=$(fromhex "$(printf "%016x" "$(($(date +%s)/30))")" | openssl dgst -sha1 -mac HMAC -macopt hexkey:"${SECRET_HEX}" -binary | tohex) | |
| OFFSET=$((0x${DIGEST_HEX:39:1})) | |
| X=$((0x${DIGEST_HEX:$((OFFSET*2)):8}&0x7FFFFFFF)) |
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
| # dmidecode -t 0 | |
| Vendor: SeaBIOS | |
| Version: e623647 | |
| Release Date: 04/01/2014 | |
| # cat /proc/iomem | |
| 000c0000-000c91ff : Video ROM # https://gitlab.com/qemu-project/qemu/-/blob/3257fc8383b13856e6719d1390655ce24bafd071/pc-bios/vgabios-cirrus.bin | |
| 000c9800-000cbbff : Adapter ROM # https://gitlab.com/qemu-project/qemu/-/blob/3257fc8383b13856e6719d1390655ce24bafd071/pc-bios/kvmvapic.bin | |
| fffc0000-ffffffff : Reserved # dd if=/dev/mem bs=1024 skip=4194048 count=256 of=seabios.bin |
NewerOlder