-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f1393e
commit dcfdac6
Showing
15 changed files
with
300 additions
and
24 deletions.
There are no files selected for viewing
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@echo off | ||
|
||
ECHO 此批处理文件将包含一个循环,从 0 开始,每次增加 100 ,当数值达到或超过 1000 时停止。 | ||
|
||
setlocal enabledelayedexpansion | ||
FOR /L %%G IN (0,100,1000) DO ( | ||
SET "filename=%%G" | ||
ECHO !filename!.txt | ||
IF %%G GEQ 1000 GOTO :eof | ||
) | ||
|
||
REM 输出: | ||
REM 0.txt | ||
REM 100.txt | ||
REM 200.txt | ||
REM 300.txt | ||
REM 400.txt | ||
REM 500.txt | ||
REM 600.txt | ||
REM 700.txt | ||
REM 800.txt | ||
REM 900.txt | ||
REM 1000.txt |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
@echo off | ||
|
||
REM 循环用法见 for循环.bat | ||
|
||
ECHO 此批处理文件确保生成的文件名总是五位数,不足的部分会用零填充: | ||
|
||
setlocal enabledelayedexpansion | ||
FOR /L %%G IN (0,100,1000) DO ( | ||
SET "filename=0000%%G" | ||
SET "filename=!filename:~-5!" | ||
ECHO !filename!.txt | ||
IF %%G GEQ 1000 GOTO :eof | ||
) | ||
|
||
REM SET "filename=0000%%G" 将 filename 初始化为 "0000" 加上循环中的数字。例如,如果 %%G 是 100,filename 将被设置为 "0000100"。 | ||
REM SET "filename=!filename:~-5!" 通过截取字符串的最后五个字符来确保 filename 总是五位数。所以,如果 filename 是 "0000100",这个命令会将其改为 "00100"。 | ||
|
||
REM 本循环输出 , 常规输出 | ||
REM 00000.txt , 0.txt | ||
REM 00100.txt , 100.txt | ||
REM 00200.txt , 200.txt | ||
REM 00300.txt , 300.txt | ||
REM 00400.txt , 400.txt | ||
REM 00500.txt , 500.txt | ||
REM 00600.txt , 600.txt | ||
REM 00700.txt , 700.txt | ||
REM 00800.txt , 800.txt | ||
REM 00900.txt , 900.txt | ||
REM 01000.txt , 1000.txt |
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* CSS 创建常量变量 */ | ||
|
||
:root { | ||
--session-main-color: #4caf50; | ||
--session-main-color-hover: #45a049; | ||
--session-content-color: #95ec69; | ||
} | ||
|
||
.icon-button { | ||
background-color: var(--session-main-color); | ||
} | ||
|
||
.icon-button:hover { /* 鼠标悬停时的背景颜色 */ | ||
background-color: var(--session-main-color-hover); | ||
} | ||
|
||
#session-view { | ||
border: 1px solid var(--session-main-color); | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ date +%Y-%m-%d | |
# 传给变量: | ||
DATE=$(date +%Y%m%d) | ||
|
||
# 当前时间戳 | ||
date +%s | ||
|
||
# 获取明天的日期 | ||
date -d next-day +%Y%m%d | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# 设置服务器ssh远程连接时超时关闭的时间 | ||
|
||
ssh连接超时时间 | ||
通过下面的命令修改 sshd 配置文件 | ||
|
||
- Linux: `vim /etc/ssh/sshd_config` | ||
- Windows: `notepad %programdata%\ssh\sshd_config` | ||
|
||
## ClientAliveInterval | ||
|
||
表示服务器每隔多少时间发送一次请求给客户端,单位为s | ||
|
||
## ClientAliveCountMax | ||
|
||
表示服务器没有收到客户端的响应达多少次就会断开连接 | ||
|
||
## 计算方式 | ||
|
||
如果客户端长时间没有操作,断开的时间为: | ||
`ClientAliveInterval * ClientAliveCountMax` | ||
|
||
如果要设置断开时间,就要去掉这两行的注释并修改。 | ||
比如,设置 `ClientAliveInterval 60` , `ClientAliveCountMax 30` ,则断开时间为 `60 * 30 = 900s` ,即客户端 `30分钟` 没有操作将会断开。 | ||
|
||
## 修改完成之后,通过下面的命令重启sshd服务即可 | ||
|
||
- Linux: `systemctl restart sshd` | ||
- Windows: `net stop sshd && net start sshd` |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Windows 图片批处理 | ||
|
||
# 单行 | ||
|
||
for %x in (*.HEIC) do ("magick.exe" "%x" "%~nx.jpg") | ||
|
||
# bat 用 | ||
|
||
setlocal enabledelayedexpansion | ||
for %%x in (*.tif) do ( | ||
"magick.exe" "%%x" -rotate 90 "%%~nx.bmp" | ||
) | ||
|
||
setlocal enabledelayedexpansion | ||
for %%x in (*.ARW) do ( | ||
"magick.exe" "%%x" "%%~nx.png" | ||
) | ||
|
||
# Windows PDF转图片 | ||
|
||
choco install ghostscript -y | ||
mkdir out | ||
magick.exe "a.pdf" "out\a.png" |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
编译为只支持M处理器或Intel处理器 | ||
|
||
在 Build Settings 中将 $(ARCHS_STANDARD) 修改为 | ||
arm64 | ||
或者 | ||
x86_64 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
location /d/ { #/d/msd/cn | ||
# 捕获 /d/<variable>/<locale> 格式的 URI | ||
rewrite ^/d/([^/]+)/([^/]+)$ https://tongdy.com/download/#/$locale/f/$variable_upper/$variable_upper/- last; | ||
# 将变量转为大写 | ||
set $variable_upper $1; | ||
set $variable_upper_uppercase $variable_upper; | ||
if ($variable_upper ~* [a-z]) { | ||
set $variable_upper_uppercase $upstream_http_variable_upper; | ||
} | ||
# 根据条件处理 locale 变量 | ||
set $locale $2; | ||
if ($locale = "cn") { | ||
set $locale "zh-cn"; | ||
} | ||
} | ||
|
||
location /tongdydb {} | ||
|
||
location /d/msd/cn { | ||
rewrite ^/d/msd/cn$ https://tongdy.com/download/#/zh-cn/f/MSD/MSD/- permanent; | ||
} | ||
location /d/msd/en { | ||
rewrite ^/d/msd/en$ https://tongdy.com/download/#/en/f/MSD/MSD/- permanent; | ||
} | ||
location /d/pmd/cn { | ||
rewrite ^/d/pmd/cn$ https://tongdy.com/download/#/zh-cn/f/PMD/PMD/- permanent; | ||
} | ||
location /d/pmd/en { | ||
rewrite ^/d/pmd/en$ https://tongdy.com/download/#/en/f/PMD/PMD/- permanent; | ||
} | ||
location /d/tf9/cn { | ||
rewrite ^/d/tf9/cn$ https://tongdy.com/download/#/zh-cn/f/TF9/TF9/- permanent; | ||
} | ||
location /d/tf9/en { | ||
rewrite ^/d/tf9/en$ https://tongdy.com/download/#/en/f/TF9/TF9/- permanent; | ||
} | ||
location /d/tsp/cn { | ||
rewrite ^/d/tsp/cn$ https://tongdy.com/download/#/zh-cn/f/TSP/TSP/- permanent; | ||
} | ||
location /d/tsp/en { | ||
rewrite ^/d/tsp/en$ https://tongdy.com/download/#/en/f/TSP/TSP/- permanent; | ||
} | ||
location /d/em21/cn { | ||
rewrite ^/d/em21/cn$ https://tongdy.com/download/#/zh-cn/f/EM21/EM21/- permanent; | ||
} | ||
location /d/em21/en { | ||
rewrite ^/d/em21/en$ https://tongdy.com/download/#/en/f/EM21/EM21/- permanent; | ||
} | ||
|
||
#PROXY-START/file | ||
location ^~ /file/ | ||
{ | ||
proxy_pass http://127.0.0.1:31880/file/; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header REMOTE-HOST $remote_addr; | ||
|
||
add_header X-Cache $upstream_cache_status; | ||
|
||
#Set Nginx Cache | ||
|
||
|
||
|
||
set $static_filevL89DsyA 0; | ||
if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" ) | ||
{ | ||
set $static_filevL89DsyA 1; | ||
expires 12h; | ||
} | ||
if ( $static_filevL89DsyA = 0 ) | ||
{ | ||
add_header Cache-Control no-cache; | ||
} | ||
} | ||
|
||
#PROXY-END/file | ||
|
||
#PROXY-START/sysctl | ||
location ^~ /td0/sysctl/ | ||
{ | ||
proxy_pass https://172.17.0.1:10000/; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header REMOTE-HOST $remote_addr; | ||
# websocket | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
|
||
add_header X-Cache $upstream_cache_status; | ||
} | ||
#PROXY-END/sysctl | ||
|
||
#PROXY-START/desktop | ||
location ^~ /td0/desktop/ | ||
{ | ||
proxy_pass http://172.18.0.68:6080/; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header REMOTE-HOST $remote_addr; | ||
add_header X-Cache $upstream_cache_status; | ||
} | ||
location = /td0/websockify | ||
{ | ||
proxy_pass https://172.18.0.68:6080/websockify; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header REMOTE-HOST $remote_addr; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
add_header X-Cache $upstream_cache_status; | ||
} | ||
#PROXY-END/desktop | ||
|
||
#PROXY-START/docker | ||
location ^~ /td0/docker/ | ||
{ | ||
proxy_pass http://172.17.0.2:9000/; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header REMOTE-HOST $remote_addr; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
add_header X-Cache $upstream_cache_status; | ||
} | ||
#PROXY-END/docker | ||
|
||
location / | ||
{ | ||
try_files $uri $uri/ /index.php?$args; | ||
} | ||
|
||
rewrite /wp-admin$ $scheme://$host$uri/ permanent; |