Skip to content

Instantly share code, notes, and snippets.

View s5unty's full-sized avatar

Sun Wuan s5unty

View GitHub Profile
@s5unty
s5unty / scm.conf
Created July 23, 2020 09:12
日志定期清理
/home/scm/.logrotate.dummy {
daily
su scm scm
rotate 0
create
ifempty
lastaction
cd /home/scm/instance/
/usr/bin/find . -path "*/logs/*old*" -type f -mtime +90 -delete
/usr/bin/find . -path "*/logs/*log*" -type f -mtime +90 -delete
@s5unty
s5unty / pack.sh
Last active September 8, 2020 14:07
pack huge directory(billion files) to multiple tar files
#!/bin/bash
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
export PACK_ROOT="${PACK_ROOT:-/}"
export PACK_NAME="${PACK_NAME:-$(shuf -zer -n5 {a..z})}"
export PACK_SIZE="${PACK_SIZE:-10000}"
export PACK_JOBS="${PACK_JOBS:-16}"
while [[ "$#" -gt 1 ]]; do
case $1 in
### Keybase proof
I hereby claim:
* I am s5unty on github.
* I am s5unty (https://keybase.io/s5unty) on keybase.
* I have a public key ASBD3QCGaxQ9fP9I0DDGtw7UPo1S07dr1rfh29oTXsV4hAo
To claim this, I am signing this object:
@s5unty
s5unty / weight.elv
Last active August 25, 2022 13:38
带权重的超强快码的单字字典
#!/usr/bin/env elvish
##
# 生成一份带权重的、单字版的超强快码字典
#
# [1]: https://elv.sh/get/
# [2]: (单字字频) https://lingua.mtsu.edu/chinese-computing/statistics/char/list.php?Which=MO
# [3]: (五笔字典) https://github.com/rime/rime-wubi/ (wubi86.dict.yaml)
####
use str