Skip to content

Instantly share code, notes, and snippets.

@ihipop
ihipop / eth-irq
Last active March 24, 2026 07:12
Ethernet IRQ RPS CPU SMP Affinity
#!/bin/bash
match=eth0 # Network interface name
num_big_cores=2 # Number of high-performance cores to select
# Retrieve cpu_capacity for each core and sort in descending order
get_cpu_capacities() {
for cpu in /sys/devices/system/cpu/cpu[0-9]*; do
capacity_file="$cpu/cpu_capacity"
if [ -f "$capacity_file" ]; then
@ihipop
ihipop / lid-monitor.service
Last active January 8, 2026 09:33
根据外接显示器/笔记本盖子的情况 开启关闭 krfb-virtualmonitor
[Unit]
Description=Lid Monitor for Controlling KRFB Virtual Monitor
After=graphical-session.target
Requires=graphical-session.target
[Service]
ExecStart=/bin/bash %h/.local/bin/lid-monitor.sh
Restart=on-failure
Type=simple
@ihipop
ihipop / TcpOutRsts.sh
Created May 9, 2026 02:04
Monitor TcpOutRsts
#!/bin/bash
INTERVAL=5
THRESHOLD=5
echo "开始监控 TcpOutRsts..."
last_out_rsts=$(nstat -az TcpOutRsts | awk 'NR==2 {print $2}')
while true; do
sleep $INTERVAL
current_out_rsts=$(nstat -az TcpOutRsts | awk 'NR==2 {print $2}')
@ihipop
ihipop / README.md
Last active August 7, 2026 10:14
update komari agent manually
@ihipop
ihipop / br0-stack.sh
Last active August 12, 2026 08:08
Transactional br0 network stack for LibreELEC, ConnMan, DHCP and systemd-nspawn
#!/bin/sh
# Transactional br0 network stack for LibreELEC + ConnMan + DHCP client.
#
# Public commands:
# install - provision DHCP support and install/enable units and drop-ins
# enable - create br0.enabled and start bridge mode now
# disable - remove br0.enabled and return to the stock ConnMan
# status - show switch, service and network state
# fallback - force cleanup and return to the stock ConnMan
#