Skip to content

Instantly share code, notes, and snippets.

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

Reimu muzi502

🐳
touch 🐟 ing
View GitHub Profile
@muzi502
muzi502 / cloudSettings
Last active March 9, 2022 12:40
VSCode
{"lastUpload":"2022-03-09T12:40:41.433Z","extensionVersion":"v3.4.3"}
#!/bin/bash
# for: bulk merge bilibili UWP download file *.flv
# by: blog.502.li
# date: 2019-01-12
# 将该脚放到 UWP 客户端下载缓存主目录下执行,安装 ffmpeg、jq
set -xu
download_dir=$(pwd)
mp4_dir=${download_dir}/mp4
mkdir -p ${mp4_dir}
#!/bin/bash
# for: download conoha wallpaper
# by: muzi502
# date: 2020-02-11
set -xue
p=$(curl https://conoha.mikumo.com/wallpaper/ \
| grep li | grep data-wallpaper-design= \
| sed -e 's/<li//g' | sed -e 's/">//g' | sed -e 's/^[ \t]*//g' \
| sed -e 's/data-wallpaper-design="//g' \
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
@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
./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
./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
@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
#!/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 / 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')