Skip to content

Instantly share code, notes, and snippets.

View cyyself's full-sized avatar

Yangyu Chen cyyself

View GitHub Profile
#!/bin/zsh
numactl --physcpubind=0,1,2,3,4,5,6,7,8 ./mcf_s_peak.mytest-m64 inp.in &
pid=$!
echo $pid | tee /sys/fs/resctrl/mon_groups/group0/tasks
while ps -p $pid > /dev/null; do
sleep 1;
cat /sys/fs/resctrl/mon_groups/group0/mon_data/mon_L3_00/llc_occupancy >> llc_occupancy
done
#!/bin/sh
# If your system admin allows you to use `sudo mount`, this script will be useful
/usr/bin/sudo /usr/bin/mount -o bind /bin/bash /bin/mount;
/usr/bin/sudo /bin/mount -c "exec /bin/bash -c \"umount /bin/mount;$@\"";
#!/bin/zsh
while read -r host; do
zsh -c "out=\$(ssh $host uptime | cut -d ',' -f 3-5); echo \"\r $host \$out \"" &
done < node.txt
U-Boot SPL 2022.10 (Nov 28 2023 - 21:45:06 +0800)
imge: uboot load to 0 compress =1 src a500254 len=4cf2a
imge: uboot load to 0 compress =1 src a500254 len=9a710
U-Boot 2022.10 (Nov 28 2023 - 21:45:06 +0800)
CPU: rv64imafdcvsu
Model: kendryte k230 evb
DRAM: 512 MiB
U-Boot SPL 2022.10 (Nov 28 2023 - 21:45:06 +0800)
imge: uboot load to 0 compress =1 src a500254 len=4cf2a
imge: uboot load to 0 compress =1 src a500254 len=9a710
U-Boot 2022.10 (Nov 28 2023 - 21:45:06 +0800)
CPU: rv64imafdcvsu
Model: kendryte k230 evb
DRAM: 512 MiB
@cyyself
cyyself / ndp_helper.sh
Created March 26, 2024 15:14
Workaround for OpenWrt NDP Proxy
#!/bin/sh
master_if='usb0'
slave_if='br-lan'
master_inet6_global=$(ip addr show dev $master_if scope global | awk '{if ($1=="inet6") {print $2}}')
if [ $master_inet6_global ]; then
ip addr add $master_inet6_global dev $slave_if
fi
exit 0

Hardware: https://item.jd.com/100019632536.html

Tear down the wired controller and connect each button to RPi GPIO.

Add this configuration to /etc/kvmd/override.yaml:

kvmd:
    gpio:
        drivers:
#!/bin/bash
pushd /lib/modules/$(uname -r)/build
pushd scripts/basic/
sudo gcc fixdep.c -o fixdep
popd
pushd scripts/mod/
sudo gcc file2alias.c -c -o file2alias.o
sudo gcc sumversion.c -c -o sumversion.o
sudo gcc symsearch.c -c -o symsearch.o
sudo gcc modpost.c file2alias.o sumversion.o symsearch.o -o modpost
#!/usr/bin/env python3
import mailbox
import sys
mbox = mailbox.mbox(sys.argv[1])
mbox.update(enumerate(sorted(mbox, key=lambda x: x.get("Subject"))))
mbox.flush()

Build SPECCPU 2017 Tools for LoongArch64

Tested on LoongArch Archlinux (2023-10-09).

Fix config.guess

wget -O config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
wget -O config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
cp config.* ./make-4.2.1/config/