0%

install

1
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

packages

1
2
3
4
5
6
7
8
9
choco install chocolateygui -y
choco install googlechrome -y --ignore-checksums
choco install geekuninstaller -y
choco install notepadplusplus.install -y
choco install git.install -y
choco install tortoisegit -y
choco install nvm.install -y
choco install fiddler -y
choco install ilspy -y

dd

1
2
3
curl -O https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh || wget -O reinstall.sh $_
bash reinstall.sh debian 12
bash reinstall.sh windows --image-name 'Windows Server 2022 SERVERDATACENTER' --lang zh-cn

ovz/lxc

1
wget -qO OsMutation.sh https://raw.githubusercontent.com/LloydAsp/OsMutation/main/OsMutation.sh && chmod u+x OsMutation.sh && ./OsMutation.sh

1panel

1
bash -c "$(curl -sSL https://resource.fit2cloud.com/1panel/package/v2/quick_start.sh)"

github

1
sed -i "/# GitHub520 Host Start/Q" /etc/hosts && curl https://raw.hellogithub.com/hosts >> /etc/hosts

nat64

1
echo -e "nameserver 2a00:1098:2b::1\nnameserver 2a01:4f9:c010:3f02::1 \nnameserver 2a01:4f8:c2c:123f::1" > /etc/resolv.conf

ssh

1
sed -i 's/#\?PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config && systemctl restart sshd
1
ssh-keygen -t rsa

/etc/ssh/sshd_config

1
2
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/id_rsa.pub
1
systemctl restart sshd

install

1
2
curl -fsSL https://get.docker.com | bash
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

daemon

/etc/docker/daemon.json

1
2
3
{
"registry-mirrors": ["https://mirror.ccs.tencentyun.com"]
}
1
2
systemctl daemon-reload
systemctl restart docker

nvm

1
2
nvm node_mirror https://npmmirror.com/mirrors/node/
nvm npm_mirror https://npmmirror.com/mirrors/npm/

npm

1
2
3
npm config get registry
npm config set registry https://registry.npmmirror.com
npm config set registry https://registry.npmjs.org

yarn

1
2
3
yarn config get registry
yarn config set registry https://registry.npmmirror.com
yarn config set ignore-engines true

pnpm

1
2
pnpm config get registry
pnpm config set registry https://registry.npmmirror.com

git

1
2
3
git config credential.helper store
git config --global --add safe.directory "*"
git commit --no-verify -m ""

时间段重叠

1
a_start <= b_end and a_end >= b_start

关闭端口

1
for /f "tokens=5" %a in ('netstat -ano ^| findstr :8080 ^| findstr LISTENING') do taskkill /pid %a /f

货币

1
123456.789.toLocaleString('zh', { style: 'currency', currency: 'CNY' })

百分比

1
0.75.toLocaleString('zh', { style: 'percent' })

相对时间

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Vue.filter('relativeTime', (date) => {
const diff = dayjs().diff(date, 'day')
if (diff === 0) {
return dayjs(date).format('HH:mm')
} else if (diff === 1) {
return '昨天'
} else if (diff < 7) {
return dayjs(date).format('dddd')
} else if (diff < 365) {
return dayjs(date).format('M月DD日')
} else {
return dayjs(date).format('YYYY年M月DD日')
}
})