When dealing with unstable systems, one often overlooked culprit is faulty RAM.
Faulty memory can cause random crashes, corrupted files, and a myriad of hard-to
-trace issues. While replacing bad RAM is the ideal solution, sometimes it’s not
immediately possible. In such cases, you can identify the defective memory regions
and prevent the operating system from using them by…
Welcome to HEV’s Blog! 
 Hello, I’m Hev! You might know me from my blog, where I share my thoughts, experiences, and projects related to technology, programming, and everything in between. I have a strong passion for creating lightweight, efficient, and open-source software solutions. Let me tell you a bit more about myself. 
 Who Am I? 
 I am a software developer and…
Issue 
 The dnsmasq can’t start to running. 
 Why? The ujail is enabled by default on OpenWrt 22.03, and no privilege to do some jail operation in systemd-nspawn container. e.g. mount /tmp/xxx to /dev/log 
 How to fix 
 Uninstall procd-ujail. 
 opkg remove procd-ujail

Control-flow graph 
 
 
 (a) an if-then-else 
 (b) a while loop 
 (c) a natural loop with two exits, e.g. while with an if…break in the middle; non-structured but reducible 
 (d) an irreducible CFG: a loop with two entry points, e.g. goto into a while or for loop 
 
 Java case 
 IrreducibleLoop.java 
 public class IrreducibleLoop {
 public static void…
function put_route () { 
 ip route del default dev pppoe-wanct proto static table 100 
 ip route add default dev pppoe-wanct proto static table 100 
 ip rule del pref 32760 
 ip rule add pref 32760 from ${ 1 } lookup 100 
 } 
 
 put_route ${ ip } 

Issue 
 /usr/libexec/sftp-server: not found
 Fix 
 -O Use the legacy SCP protocol for file transfers instead of the SFTP
 protocol. Forcing the use of the SCP protocol may be necessary for
 servers that do not implement SFTP, for backwards-compatibility for
 particular filename wildcard patterns and for expanding paths with
 a ‘~’ prefix for older SFTP servers.

Issue 
 usb 1-3.4: USB disconnect, device number 18
usb 1-3.1: new full-speed USB device number 19 using xhci_hcd
usb 1-3.1: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.54
usb 1-3.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
usb 1-3.1: Product: USB2.0-Ser!
ch341 1-3.1:1.0: ch341-uart converter detected
ch341-uart ttyUSB0: break…
The faccessat2 system call is denied by old systemd container, this is a workaround to make it works again and without re-build from source code. 
 faccessat function is a known way to use the faccessat2 system call in glibc, editing libc.so binary to fallback to the user-space implementation. 
 00000000000de3e0 <faccessat>:
 .....
 de448:	7100989f 	cmp	w4, #0x26
…
Socket options 
 IPv6 support some protocol-specific socket options that can be set with setsockopt and read with getsockopt. The socket option level for IPv6 is IPPROTO_IPV6. A boolean integer flag is zero with it is false, otherwise true. 
 IPV6_V6ONLY 
 If this flag is set to true (nonzero), then the socket is restricted to sending and receiving IPv6 packets only. In this case, an…
AA64: fmadd d, n, m, a: d = a + n * m
LA64: fmadd d, j, k, a: d = a + j * k

AA64: fmsub d, n, m, a: d = a + (-n) * m
 d = a - n * m
 d = - (n * m - a)
LA64: fnmsub d, j, k, a: d = - (j * k - a)
 d = a - j * k
 d = a + (-j) * k

AA64: fnmadd d, n, m, a: d = (-a) + (-n) * m
 d = - (n * m + a)
LA64: fnmadd d, j, k, a: d = - (j * k + a)
 d = (-a) +…
SafepointALot: Generate a lot of safepoints. This works with GuaranteedSafepointInterval. 
 HandshakeALot: Generate a lot of handshakes. This works with GuaranteedSafepointInterval. 
 DeoptimizeALot: Deoptimize at every exit from the runtime system. 
 ZombieALot: Create zombies (non-entrant) at exit from the runtime system. 
 WalkStackALot: Trace stack (no print) at every exit from…
The dnsmasq is enables rebind protection by default, this reject DNS records that contains reserved address (RFC1918). 
 Remove argument to disable it: 
 --stop-dns-rebind
 OpenWrt 
 Luci: 
 Menu: Network->DHCP and DNS 
 Unchecked Rebind protection.
The 64-bit ARM (AArch64) calling convention allocates the 31 general-purpose registers as:[2] 
 x31 (SP): Stack pointer or a zero register, depending on context.
x30 (LR): Procedure link register, used to return from subroutines.
x29 (FP): Frame pointer.
x19 to x29: Callee-saved.
x18 (PR): Platform register. Used for some operating-system-specific special purpose, or an…
Unable to negotiate with 192.168.0.1 port 22: no matching host key type found. Their offer: ssh-rsa
 Workaround: 
 Host 192.168.0.1
 HostkeyAlgorithms +ssh-rsa
 PubkeyAcceptedAlgorithms +ssh-rsa

This is an example of configuring transparent proxy(tproxy) with nftables. The tproxy application is hev-socks5-tproxy 
 Netfilter rules 
 DON’T FORGOT TO ADD UPSTREAM ADDRESS TO BYPASS IPSET!!
Or use nftables skuid/skgid match to exclude proxy process. 
 table inet mangle {
 set byp4 {
 typeof ip daddr
 flags interval
 elements = { 0.0.0.0/8, 10.0.0.0/8,
…
Enable bold font for GNOME Terminal: 
 0x01 
 # Get profile id 
 dconf dump /org/gnome/terminal/legacy/
 
 # Set bold font 
 dconf write /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/font ''Monospace Bold 14'' 
 0x02 
 Preferences->Profiles->->Colors:
Select “Show bold text in bright colors”
By default an exception can only occur during a function call or a throw. If we needs to catch excpetions thrown from trapping instructions, using the -fnon-call-exceptions . 
 Docs 
 
 -fnon-call-exceptions 
 Generate code that allows trapping instructions to throw exceptions. Note that this requires platform-specific runtime support that does not exist everywhere. Moreover, it…