Skip to content

Instantly share code, notes, and snippets.

View muzi502's full-sized avatar
🐳
touch 🐟 ing

Reimu muzi502

🐳
touch 🐟 ing
View GitHub Profile
╭─reimu@macdock ~
╰─$ ssh 172.20.0.25
Warning: Permanently added '172.20.0.25' (ECDSA) to the list of known hosts.
Linux kube-registry-01 4.19.0-17-amd64 #1 SMP Debian 4.19.194-2 (2021-06-21) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
@muzi502
muzi502 / docker-cli.sh
Created August 14, 2021 11:24
docker-cli
# Create a docker context use ssh
╭─reimu@macbook ~
╰─$ docker context create us-oracle-arm --docker "host=ssh://arm3"
us-oracle-arm
Successfully created context "us-oracle-arm"
# Set default context for docker-cli
╭─reimu@macbook ~
╰─$ docker context use us-oracle-arm
us-oracle-arm
#!/bin/bash
set -xue
url="https://yande.re/post"
tag=$1
max=$2
ck="SHdqM1cyWGJTQlWI3Z2V0TWk1VTNOMi9ld1pRY2tVUXg4UXNHdUxNYVRHOHhKU0FqUk1RPT0tLTJKUllqUUhHeE5nUWdxRUQyV1piWGc9PQ"
mkdir -p ${tag}
:> ${tag}/${tag}.list
for i in $(seq ${max})
@muzi502
muzi502 / registry_gc.sh
Last active November 5, 2020 01:01
use shell to gc instead /bin/registry command , delete all old images blobs only save the tag latest images blobs
#!/bin/bash
set -x
v2=$1
v2=${v2:="/var/lib/registry/docker/registry/v2"}
cd ${v2}
all_blobs=/tmp/all_blobs.list
: > ${all_blobs}
# delete unlink blob's link file in _layers
for link in $(find repositories -type f -name "link" | grep -E "_layers\/sha256\/.*"); do
link_sha256=$(echo ${link} | grep -Eo "_layers\/sha256\/.*" | sed 's/_layers\/sha256\///g;s/\/link//g')
#!/bin/bash
# data: 2020-03-31
# author: muzi502
# for: Fuck GFW and download some raw file form github without proxy using jsDelivr CDN
# usage: save the .she to your local such as /usr/bin/rawg, and chmod +x /usr/bin/rawg
# use rawg https://github.com/ohmyzsh/ohmyzsh/blob/master/tools/install.sh to download
set -xue
# GitHub rul: https://github.com/ohmyzsh/ohmyzsh/blob/master/tools/install.sh
# jsDelivr url: https://cdn.jsdelivr.net/gh/ohmyzsh/ohmyzsh/tools/install.sh
@muzi502
muzi502 / 00-webp-server-go_test.log
Last active March 6, 2020 03:43
webp server test log
## 8 core
| file_size_range | file_num | src_size | dist_size | total | user | system | cpu | core |
| :-------------: | :------: | :------: | :-------: | :-----: | :------: | :----: | :--: | :--: |
| (10KB,500KB) | 4600 | 1.3G | 310M | 1:44.49 | 905.41s | 9.55s | 875% | 8 |
| (500KB,1MB) | 3500 | 2.4G | 361M | 2:04.81 | 1092.50s | 7.98s | 881% | 8 |
| (1MB,4MB) | 2000 | 3.8G | 342M | 2:32.64 | 1345.73s | 10.84s | 888% | 8 |
| (4MB,32MB) | 500 | 3.6G | 246M | 1:44.53 | 916.91s | 12.03s | 888% | 8 |
## 1,2,4,8 core
./webp-server -jobs 8 -config config.json -prefetch
905.41s user 9.55s system 875% cpu 1:44.49 total
src dist num
1.3G 310M 4600
63304866.png 495K 40K
40881097.jpg 495K 118K
21045662.jpg 495K 94K
67888534.png 495K 73K
50136421.jpg 495K 62K
./webp-server -jobs 8 -config config.json -prefetch
1092.50s user 7.98s system 881% cpu 2:04.81 total
src dist num
2.4G 361M 3500
44937735.png 974K 74K
56343106.png 974K 49K
@muzi502
muzi502 / 1M-4M_size.log
Created March 5, 2020 14:52
webp server go test
src dist num
3.8G 342M 2000
73839511.png 4.1M 293K
66504933.png 4.1M 107K
78316050.png 4.1M 319K
74264931.png 4.1M 330K
74412671.png 4.1M 186K
77414892.png 4.1M 227K
76442741.png 4.0M 191K
Prefetch will convert all your images to webp, it may take some time and consume a lot of CPU resource. Do you want to proceed(Y/n)
y
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x9f6ee19 pc=0x864169]
runtime stack:
runtime.throw(0x96edc3, 0x2a)
/usr/local/go/src/runtime/panic.go:1112 +0x72
runtime.sigpanic()
/usr/local/go/src/runtime/signal_unix.go:671 +0x46a