This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_providers { | |
tencentcloud = { | |
source = "tencentcloudstack/tencentcloud" | |
version = "1.59.14" | |
} | |
} | |
} | |
provider "tencentcloud" { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Google Drive (rclone) | |
After=network.target | |
[Service] | |
User=chih | |
Type=simple | |
ExecStart=/usr/bin/rclone mount gcrypt: /opt/rclone --allow-other --dir-cache-time 24h --drive-chunk-size 32M --timeout 1h --umask 002 | |
ExecStop=/usr/bin/fusermount -uz /opt/rclone | |
Restart=always |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DAVLockDB /home/httpd/DAV/DAVLock | |
<VirtualHost *:8080> | |
Alias /webdav /opt/rclone/webdav | |
<Directory /opt/rclone/webdav> | |
DAV On | |
AllowOverride None | |
AddDefaultCharset utf-8 | |
IndexOptions Charset=utf-8 | |
IndexOptions NameWidth=* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
for i in $(pacman -Qq) | |
do | |
grep -e "\[ALPM\] installed $i" -e "\[ALPM\] upgraded $i" /var/log/pacman.log | \ | |
sort -u -r | \ | |
head -1 | |
done | \ | |
sort -u | \ | |
sed -e 's/\[ALPM\] installed //' -e 's/(.*$//' | \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh -4 -L 0.0.0.0:8080:127.0.0.1:8080 -N -f -l chih 192.168.122.44 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start(){ | |
printf 'Starting the server\n' | |
pids=`getPid $APPID` | |
if ! [ -z "$pids" ];then #如果进程已经存在 -z 表示判空 | |
printf 'Existing process: %d\n' "$pids" | |
retval=1 | |
else #如果进程不存在 | |
#start | |
/bin/su $USER -c "mkdir -p $PROJECT_DIR/temp/" # 使用su切换到USER变量定义的用户,并执行命令mkdir,创建目录 | |
/bin/su $USER -c "mkdir -p $PROJECT_DIR/logs/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while [[ true ]] ; do | |
# performs synchronizations / copy | |
rclone sync .... | |
# waiting for something to change or it will pass 300 seconds | |
inotifywait --recursive --timeout 300 -e modify,delete,create,move SRC_DIR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 在 nat 表中创建新链 | |
iptables -t nat -N SHADOWSOCKS | |
# 跳过 shadowsocks 代理服务器 | |
iptables -t nat -A SHADOWSOCKS -p tcp --dport <远程主机端口> -j RETURN | |
iptables -t nat -A SHADOWSOCKS -d <远程主机 IP> -j RETURN | |
# 跳过本地 IP 段 | |
iptables -t nat -A SHADOWSOCKS -d 0.0.0.0/8 -j RETURN | |
iptables -t nat -A SHADOWSOCKS -d 10.0.0.0/8 -j RETURN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ system cat certbot.service | |
[Unit] | |
Description=Let's Encrypt renewal | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/bin/certbot renew --quiet --agree-tos --deploy-hook "systemctl reload nginx.service" | |
➜ system cat certbot.timer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo qemu-system-x86_64 --enable-kvm -m 2048 -cpu host -smp 4 -netdev tap,id=t0,ifname=virbr0-nic,script=no,downscript=no -device e1000,netdev=t0,id=nic0 --nographic -vnc 0.0.0.0:1 -k en-us ubuntu16.04-2.qcow2 |
NewerOlder