Skip to content

Instantly share code, notes, and snippets.

@shvchk
shvchk / compile-hostlist.sh
Last active November 7, 2024 05:50
ByeDPI
#! /bin/busybox sh
echo "Loading hostlists..."
tmp_list="/tmp/byedpi-$(head -c 512 < /dev/urandom | md5sum).list"
for l in $HOSTLISTS; do
[ -z "$l" ] && continue
[ "${l:0:1}" = "#" ] && continue
@shvchk
shvchk / overideconfig
Created November 10, 2023 10:13
efsprofiles/overideconfig
[SIPConfig:GeoLocation]
#enable or disable location info inclusion in regular calls
iEnableCellInfoInPANI = 0
#enable or disable location info inclusion in regular calls
iEnableLocInfoInNormalCall = 0
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 38 columns, instead of 6 in line 4.
# hostname,interval,timestamp,CPU,%usr,%nice,%sys,%iowait,%steal,%irq,%soft,%guest,%gnice,%idle[...],kbmemfree,kbavail,kbmemused,%memused,kbbuffers,kbcached,kbcommit,%commit,kbactive,kbinact,kbdirty,kbanonpg,kbslab,kbkstack,kbpgtbl,kbvmused,MOUNTPOINT,MBfsfree,MBfsused,%fsused,%ufsused,Ifree,Iused,%Iused[...]
localhost,2,2023-10-07 02:52:52 UTC,-1,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,100.00,767224,745460,87824,8.93,8832,75092,93532,9.52,35296,74736,16,30220,43980,2176,1140,20796,/,59144,1162,1.93,6.05,3896674,27294,0.70
localhost,2,2023-10-07 02:52:54 UTC,-1,0.13,0.00,0.13,0.00,0.00,0.00,0.00,0.00,0.00,99.75,767224,745460,87816,8.93,8832,75100,93532,9.52,35296,74736,24,30220,43980,2176,1140,20796,/,59144,1162,1.93,6.05,3896674,27294,0.70
localhost,2,2023-10-07 02:52:56 UTC,-1,0.00,0.00,0.13,0.13,0.00,0.00,0.00,0.00,0.00,99.75,767224,745476,87796,8.93,8840,75108,93532,9.52,35308,74844,56,30220,43984,2176,1140,20796,/,59144,1162,1.93,6.05,3896674,27294,0.70
localhost,2,2023-10-07 02:52:58 UTC,-1,0.00,0.
@shvchk
shvchk / update-podman.sh
Created September 30, 2023 06:32
Update podman to 4.3.1 on Ubuntu 22.04 jammy
#! /usr/bin/env bash
set -euo pipefail
echo 'deb http://archive.ubuntu.com/ubuntu/ lunar main universe' > /etc/apt/sources.list.d/lunar.list
cat > /etc/apt/preferences.d/podman.pref << EOF
Package: podman buildah golang-github-containers-common libsubid4 netavark
Pin: release n=lunar
Pin-Priority: 990

Launch

Wireguard

Before:

Average:    kbmemfree   kbavail kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit  kbactive   kbinact   kbdirty  kbanonpg    kbslab  kbkstack   kbpgtbl  kbvmused
Average:      3744992   3667684    102636      2,58      3392     73012    440220     11,06    120340      9280       184     57282     55428      3040      2664     16260
@shvchk
shvchk / bug-report.md
Last active September 17, 2023 14:49
На WI-CAT-AX / WIVE-NG-HQ не работают программы на Go

Проблема

Невозможен запуск любой, даже простейшей программы (Hello world) на Go на WI-CAT-AX. Программа падает с ошибкой fatal error: sigaction failed.

Вывод программы

Под каждой строкой с отылкой на исходный код рантайма Go я добавил #комментарий с собственно кодом, который содержится на этой строке рантайма Go.

package main
import "fmt"
func main() {
fmt.Println("hello world")
}
@shvchk
shvchk / rustdesk-update-deb.sh
Last active September 4, 2023 23:11
Script to update rustdesk from the official repo releases page. Run with `sudo`, since it uses `apt install`
#! /usr/bin/env bash
set -euo pipefail
repo="rustdesk/rustdesk"
release_url="https://api.github.com/repos/$repo/releases/latest"
cur_version=$(rustdesk --version)
new_version=$(curl -fsSL "$release_url" | jq -r '.tag_name')
tmp_dir=$(mktemp -d)
@shvchk
shvchk / test-open-files-limit.sh
Last active August 29, 2023 21:22
Test max open files limit, `ulimit -n` | Source: https://stackoverflow.com/a/68895690
#!/usr/bin/env bash
case $BASH_VERSION in
''|[1-3].*|4.0.*) echo "ERROR: Bash 4.1 or newer required" >&2; exit 1;;
esac
[[ $1 ]] || { echo "Usage: $0 number-of-files" >&2; exit 1; }
echo "Running as process $$" >&2
for ((i=0; i<$1; i++)); do
exec {fd_num}>/dev/null || {
@shvchk
shvchk / xiaomi-bloatware.txt
Created July 25, 2023 05:45
Xiaomi MIUI debloat list. Initially made for Poco M5, but will probably work fine for any recent Xiaomi phone
com.android.bips
com.android.bookmarkprovider
com.android.printspooler
com.android.providers.partnerbookmarks
com.android.stk
com.android.traceur
com.bsp.catchlog
com.facebook.appmanager
com.facebook.services
com.facebook.system