Skip to content

Instantly share code, notes, and snippets.

View cyyself's full-sized avatar

Yangyu Chen cyyself

View GitHub Profile
@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
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
#!/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

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:
#!/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/
Benchmark Local-Base Remote-Base Local-Peak Remote-Peak Base Ratio Peak Ratio
600.perlbench_s 6.443885 6.401963 7.026743 6.979114 1.00654830401238 1.00682450523089
602.gcc_s 9.370256 8.243327 10.057868 8.713593 1.1367080306289 1.15427332903889
605.mcf_s 6.961765 6.113316 7.593191 6.561309 1.13878703472878 1.15726770374631
620.omnetpp_s 5.763463 5.169357 6.872515 6.079968 1.11492841372728 1.13035381107269
623.xalancbmk_s 6.499653 6.420615 6.73422 6.677672 1.01231003572088 1.00846822066133
625.x264_s 9.541702 9.421099 9.950947 9.837194 1.01280137274855 1.01156356172299
631.deepsjeng_s 3.925493 3.553373 4.335625 3.895072 1.10472303357964 1.1131052262962
641.leela_s 3.502438 3.49985 3.758943 3.753351 1.00073946026258 1.00148986865337
648.exchange2_s 9.506407 9.502887 8.252384 8.711367 1.000370413749 0.947312172704927
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 9 columns, instead of 1. in line 8.
Benchmark,Intel DMP OFF,,,Default,,,Wall time Ratio,User Ratio
,wall,user,system,wall,user,system,,
time ./bfs -f benchmark/graphs/twitter.sg -n64 > benchmark/out/bfs-twitter.out,18.25,464.76,11.55,31.33,505.97,15.37,0.582508777529525,0.918552483348815
time ./pr -f benchmark/graphs/twitter.sg -i1000 -t1e-4 -n16 > benchmark/out/pr-twitter.out,177.38,5296.91,7.53,179.09,5445.54,7.23,0.990451728181361,0.972706104445106
time ./cc -f benchmark/graphs/twitter.sg -n16 > benchmark/out/cc-twitter.out,4.95,97.37,5.76,4.96,95.26,5.5,0.997983870967742,1.02214990552173
time ./bc -f benchmark/graphs/twitter.sg -i4 -n16 > benchmark/out/bc-twitter.out,172.66,5027.26,31.84,166.5,4882.11,37.98,1.036996996997,1.02973099745807
time ./bfs -f benchmark/graphs/web.sg -n64 > benchmark/out/bfs-web.out,44.9,834.17,16.53,45.69,843.93,17.74,0.982709564456117,0.98843505977984
time ./pr -f benchmark/graphs/web.sg -i1000 -t1e-4 -n16 > benchmark/out/pr-web.out,53.99,1458.04,7.68,59.13,1611.01,7.29,0.91307289024184,0.905047144338024
time ./c
@cyyself
cyyself / dr5364.md
Last active October 27, 2023 00:46

RAISECOM DR5364 Hack Note

Get Root Telnet

Backup configuration file in http://192.168.10.1/pc/index.html#/settings/system/backup.

You will found an entry <TelnetEntry Active="No" telnet_username="CMCCAdmin" telnet_passwd="aDm8H%MdA" telnet_port="23" />

replace "No" with "Yes" and write it back to get telnet root shell.

/dts-v1/;
/ {
compatible = "econet,en7523";
interrupt-parent = <0x01>;
#address-cells = <0x01>;
#size-cells = <0x01>;
chosen {
bootargs = "root=/dev/mtdblock3 ro console=ttyS0,115200n8 earlycon init=/sbin/init";