春有百花秋有月
夏有凉风冬有雪Debian install typecho
tar -zvcf typecho.tar.gz
wget https://github.com/typecho/typecho/releases/download/ci/typecho.zip
2.解压
unzip typecho.zip
tar -zxvf typecho.tar.gz
3.为了防止权限出现问题, 修改全部文件的权限
chmod 777 -R /var/www/typecho
4.安装PHP及扩展
sudo apt-get -y install php8.2-sqlite3 php8.2-fpm p
<!--more-->
hp-mbstring php8.2-gd
5.启动php7.4-fpm, 默认监听9200端口
sudo systemctl start php8.2-fpm
service php8.2-fpm start
6.检查 PHP-FPM 配置:
打开 PHP-FPM 的配置文件,通常位于 /etc/php/8.2/fpm/pool.d/www.conf 中
确保 listen 配置项与 Nginx 的配置匹配。
/run/php/php8.2-fpm.sock
确保 listen.owner 和 listen.group 配置项与 Nginx 运行的用户和用户组匹配。
打开 Nginx 的虚拟主机配置文件,检查 fastcgi_pass 配置项。
fastcgi_pass unix:/var/run/php-fpm/www.sock;
确保此路径与 PHP-FPM 配置中的 listen 配置项一致。
阅读剩余部分 →Debian install acme
curl https://get.acme.sh | sh
2.生成证书:
/root/.acme.sh/acme.sh --issue --standalone -d passwd.313390.xyz
yum install socat
/root/.acme.sh/acme.sh --issue --standalone -d passwd.313390.xyz
systemctl stop nginx
/root/.acme.sh/acme.sh --issue --standalone -d passwd.313390.xyz
/root/.acme.sh/acme.sh --register-account -m bj.guozhong@gmail.com
/root/.acme.sh/acme.sh --issue --standalone -d passwd.313390.xyz --force
3.以下说明证书生成成功:
[Thu Jun 1 15:23:17 CST 2023] Your cert is in: /root/.acme.sh/passwd.20081014.xyz_ecc/passwd.20081014.xyz.cer
[Thu Jun 1 15:23:17 CST 2023] Your cert key is in: /root/.acme.sh/passwd.20081014.xyz_ecc/passwd.20081014.xyz.key
[Thu Jun 1 15:23:17 CST 2023] The intermediate CA cert is in: /root/.acme.sh/passwd.20081014.xyz_ecc/ca.cer
[Thu Jun 1 15:23:17 CST 2023] And the full chain certs is there: /root/.acme.sh/passwd.20081014.xyz_ecc/fullchain.cer
[Mon Jun 5 17:06:49 CST 2023] Your cert is in: /root/.acme.sh/www.313390.xyz_ecc/www.313390.xyz.cer
[Mon Jun 5 17:06:49 CST 2023] Your cert key is in: /root/.acme.sh/www.313390.xyz_ecc/www.313390.xyz.key
[Mon Jun 5 17:06:49 CST 2023] The intermediate CA cert is in: /root/.acme.sh/www.313390.xyz_ecc/ca.cer
[Mon Jun 5 17:06:49 CST 2023] And the full chain certs is there: /root/.acme.sh/www.313390.xyz_ecc/fullchain.cer
4.将生成的证书文件配置在nginx中:conf.d/20081014.xyz.conf
[root@ip-172-26-2-136 conf.d]# vi 20081014.xyz.conf
阅读剩余部分 →Debian Install fail2ban
Error:
Problem: problem with installed package selinux-policy-targeted-3.14.3-80.el8_5.2.noarch
- package fail2ban-server-1.0.2-3.el8.noarch requires (fail2ban-selinux if selinux-policy-targeted), but none of the providers can be installed
- package fail2ban-1.0.2-3.el8.noarch requires fail2ban-server = 1.0.2-3.el8, but none of the providers can be installed
- conflicting requests
- nothing provides selinux-policy >= 3.14.3-108.e
<!--more-->
l8_7.1 needed by fail2ban-selinux-1.0.2-3.el8.noarch
- nothing provides selinux-policy-base >= 3.14.3-108.el8_7.1 needed by fail2ban-selinux-1.0.2-3.el8.noarch
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
解决方式:
yum install --allowerasing fail2ban
apt-get install fail2ban
安装成功后增加规则文件:/etc/fail2ban/filter.d/shadowsocks-libev.conf
配置jail.local文件:
[DEFAULT]
backend = systemd
bantime = 36000
findtime = 600
banaction = iptables-multiport
destemail = bj.guozhong@gmail.com
[sshd]
enabled = true
port = 22
filter = sshd
logpath = /var/log/auth.log
maxretry = 5
[shadowsocks-libev]
enabled = true
port = 3381
filter = shadowsocks-libev
logpath = /var/log/auth.log
maxretry = 3
bantime = 36000
findtime = 3600
systemctl start fail2ban
systemctl status fail2ban
systemctl enable fail2ban
查看日志和监狱内容
tail -f /var/log/fail2ban.log
fail2ban-client status
查看某个规则下的baned状态:
fail2ban-client status sshd
解除限制:fail2ban-client set sshd unbanip ****
有可能产生的问题:
1.新主机安装fail2ban无法启动,提示:
阅读剩余部分 →bitwarden-backup-crontab
crontab -l
crontabl -e
0 0 * * * /opt/bitwarden-backup/bw-data-backup.sh >> /opt/bitwarden-backup/backup.log && find /home/appadmin/bitwarden-backup/ -type f -name "bw-data_backup_*" -mtime +7 -exec rm {} \;
更换到挂载存储之后超过七天的文件没有删除,不知道为什么,换一种方式试试:
0 0 * * * /opt/bitwarden-backup/bw-data-backup.sh >> /opt/bitwarden-backup/backup.log && find /home/appadmin/bitwarden-backup/ -type f -name "bw-data_backup_*" |xargs rm -f
压缩
tar -czvf /path/to/file.tar.gz file
解压
tar -xzvf /path/to/file.tar.gz
加密压缩
tar -czvf - file | openssl des3 -salt -k password -out /path/to/file.tar.gz
for example:
tar -czvf - runshtest | openssl des3 -salt -k password -out ../1.tar.gz
解密解压
openssl des3 -d -k password -salt -in /path/to/file.tar.gz | tar xzf -
for example:
阅读剩余部分 →mount onedrive by Rclone
在Windows电脑上下载Rclone,下载地址:> https://rclone.org/downloads/,然后解压,使用cmd进入解压后的文件夹:
rclone.exe authorize "onedrive"
ps:整个大括号就是token,包括大括号。
直接使用官方提供的一键脚本:
curl https://rclone.org/install.sh | bash
3.配置
安装完成后执行:
rclone config
rclone config
2021/03/03 15:00:17 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> onedrive
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / 1Fichier
\ "fichier"
2 / Alias for an existing remote
\ "alias"
3 / Amazon Drive
\ "amazon cloud drive"
4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, and Tencent COS
\ "s3"
5 / Backblaze B2
\ "b2"
6 / Box
\ "box"
7 / Cache a remote
\ "cache"
8 / Citrix Sharefile
\ "sharefile"
9 / Compress a remote
\ "compress"
10 / Dropbox
\ "dropbox"
11 / Encrypt/Decrypt a remote
\ "crypt"
12 / Enterprise File Fabric
\ "filefabric"
13 / FTP Connection
\ "ftp"
14 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
15 / Google Drive
\ "drive"
16 / Google Photos
\ "google photos"
17 / Hadoop distributed file system
\ "hdfs"
18 / Hubic
\ "hubic"
19 / In memory object storage system.
\ "memory"
20 / Jottacloud
\ "jottacloud"
21 / Koofr
\ "koofr"
22 / Local Disk
\ "local"
23 / Mail.ru Cloud
\ "mailru"
24 / Mega
\ "mega"
25 / Microsoft Azure Blob Storage
\ "azureblob"
26 / Microsoft OneDrive
\ "onedrive"
27 / OpenDrive
\ "opendrive"
28 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
29 / Pcloud
\ "pcloud"
30 / Put.io
\ "putio"
31 / QingCloud Object Storage
\ "qingstor"
32 / SSH/SFTP Connection
\ "sftp"
33 / Sugarsync
\ "sugarsync"
34 / Tardigrade Decentralized Cloud Storage
\ "tardigrade"
35 / Transparently chunk/split large files
\ "chunker"
36 / Union merges the contents of several upstream fs
\ "union"
37 / Webdav
\ "webdav"
38 / Yandex Disk
\ "yandex"
39 / Zoho
\ "zoho"
40 / http Connection
\ "http"
41 / premiumize.me
\ "premiumizeme"
42 / seafile
\ "seafile"
Storage> 26
** See help for onedrive backend at: https://rclone.org/onedrive/ **
OAuth Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id>
OAuth Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret>
Choose national cloud region for OneDrive.
Enter a string value. Press Enter for the default ("global").
Choose a number from below, or type in your own value
1 / Microsoft Cloud Global
\ "global"
2 / Microsoft Cloud for US Government
\ "us"
3 / Microsoft Cloud Germany
\ "de"
4 / Azure and Office 365 operated by 21Vianet in China
\ "cn"
region> 1
Edit advanced config? (y/n)
y) Yes
n) No (default)
y/n> n
Remote config
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes (default)
n) No
y/n> n
For this to work, you will need rclone available on a machine that has
a web browser available.
For more help and alternate methods see: https://rclone.org/remote_setup/
Execute the following on the machine with the web browser (same rclone
version recommended):
rclone authorize "onedrive"
Then paste the result below:
result> {"access_token":qqqqqqqqqq","expiry":"2021-03-03T15:54:34.7442912+08:00"}
token
Choose a number from below, or type in an existing value
1 / OneDrive Personal or Business
\ "onedrive"
2 / Root Sharepoint site
\ "sharepoint"
3 / Sharepoint site name or URL (e.g. mysite or https://contoso.sharepoint.com/sites/mysite)
\ "url"
4 / Search for a Sharepoint site
\ "search"
5 / Type in driveID (advanced)
\ "driveid"
6 / Type in SiteID (advanced)
\ "siteid"
7 / Sharepoint server-relative path (advanced, e.g. /teams/hr)
\ "path"
Your choice> 1
Found 1 drives, please select the one you want to use:
0: OneDrive (business) id=b!B6yHyawk7kq599Kb4wYXQFe1jafkFoFBqrwS7ZFYLJsUbhule-g-Rax7IpAhk6c8
Chose drive to use:> 0
Found drive 'root' of type 'business', URL: https://imissyou5201314-my.sharepoint.com/personal/codehero_imissyou5201314_onmicrosoft_com/Documents
Is that okay?
y) Yes (default)
n) No
y/n>y
--------------------
[onedrive]
type = onedrive
region = global
token = {"access_token":"O2bSfUr74YzUssTNQqL2bUzCbxlZMNHa5OEdJwZuOXPfv6IdCdk_E1jWMmjxHNIi7NLZ6GWqaOUARsqq_5JLTDEpo6F5VS5vbTOOVuDP3MhAcvL9aSXBk7BKxXu6yMoZp7uaynmCESg4ADFEFSSefwefwefsefwfgsalkfhsehjfg2bewo_EASPdtlIkjW0v5lCliU1cXxuPGZ_Lq1eOYyjPLMvAJ9pMiKg2-Iw1-844H67E0V9FCY8cBzH3qSui8rgQwt9nBI2PI0uaJ6KlVpQb0IiTQGapw2hgubwprnSVM39B5Z58WUon2ObcJ76CP7VPMvxIFIVnP5oq2gi1PRTxPgN3z64z3Q1hbwM59HqOrwX84uWIvCk63_i6ocVb0nasiY7EaLoF9fJHAnAw2qC3dOng","expiry":"2021-03-03T15:54:34.7442912+08:00"}drive_id = b!B6yHyawk7kq599Kb4wYXQFe1jafkFoFBqrwS7ZFYLJsUbhule-g-Rax7IpAhk6c8
drive_type=business
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:
Name Type
==== ====
onedrive onedrive
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q
e/n/d/r/c/s/q>
4.安装fuse
apt install fuse3
5.挂载OneDrive
-新建挂载目录
阅读剩余部分 →debian resolv.conf 重启丢失
执行:
apt-get install resolvconf
在/etc/resolvconf/resolv.conf.d/base中增加:
阅读剩余部分 →无线鼠标卡顿
电脑右键-->管理-->设备管理器-->点通用串行总线前面的小>展开-->USB根集线器右键-->属性-->电源管理-->取消选中允许计算机关闭此设备以节约电源
下面还有两个 通用USB**集线器,同样的操作。
tar file add passwd
使用tar对文件压缩加密:
tar -zcvf - pma|openssl des3 -salt -k password | dd of=pma.des3
完成将得到一个pma.des3的打包文件,用你设置的密码替换password。
使用tar对加密文件解压:
dd if=pma.des3 |openssl des3 -d -k password|tar zxf -
注意:命令最后有”-”,它将释放所有的文件。其中-k password可以不使用,这样执行完命令后会提示你输入密码,加上-k参数表示在程序中自动验证密码。
阅读剩余部分 →install chatgpt demo
#更新
sudo apt update
sudo apt upgrade
# 安装依赖
sudo apt install software-properties-common
# 添加 deadsnakes PPA 源
sudo add-apt-repository ppa:deadsnakes/ppa
#安装python
sudo apt install python3
python3 --version
sudo apt install python3-pip
pip3 --version
2.安装python虚拟环境
sudo apt install python3-venv
3.上传chatgpt-web-main.tar.gz,解压并进入到chatgpt-web-main目录
4.创建虚拟环境:
python3 -m venv newchat.env
5.进入虚拟环境
source /opt/chat/chatgpt-web-main/newchat.env/bin/activate
6.配置chatgpt-web-main应用中的openAi key,启动服务:
python3.10 /opt/chat/chatgpt-web-main/main.py
nohup python3.10 /opt/chat/chatgpt-web-main/main.py &
7.配置nginx文件:
server {
listen 443 ssl http2;
#listen [::]:443 ssl http2;
server_name chat.***.xyz;
ssl_certificate /root/.acme.sh/chat.***.xyz_ecc/chat.***.xyz.cer;
ssl_certificate_key /root/.acme.sh/chat.***.xyz_ecc/chat.***.xyz.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_session_cache builtin:1000 shared:SSL:10m;
proxy_buffering off;
location / {
proxy_redirect off;
proxy_pass http://127.0.0.1:8184/;
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_buffering off; 表示打字机效果,不加此行代码无打字机效果,等待输出结果之后一次性返回结果。
阅读剩余部分 →