春有百花秋有月

春有百花秋有月

夏有凉风冬有雪

v2ray 一键安装脚本

参考:https://github.com/233boy/v2ray

bash <(wget -qO- -o- https://git.io/v2ray.sh)

请输入图片描述

阅读剩余部分 →

linux-debian init

    sudo su
    passwd root
    useradd appadmin
    passwd appadmin

打开SSH配置文件/etc/ssh/sshd_config,使用root权限进行编辑:

    vim /etc/ssh/sshd_config
 PermitRootLogin no                         //允许root登录      
 PasswordAuthentication yes                 //设置是否使用口令验证
    service sshd reload

**

*

apt install sudo -y

添加你的本地用户到 sudo 组,可以使用 usermod 命令,如下:

usermod -aG sudo linux265

校正日期和时间:
-- 时区列表

    timedatectl list-timezones

-- 修改系统时区为亚洲/上海

    sudo timedatectl set-timezone Asia/Shanghai

-- 查看

    timedatectl

进行系统更新:

    sudo apt update
    sudo apt upgrade -y

完成后安装常用软件:

阅读剩余部分 →

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:

阅读剩余部分 →

使用WARP套VPS

1.查看自已的ip:

curl ipinfo.io/ip

2.参考:https://github.com/P3TERX/warp.sh

3.一键脚本:

阅读剩余部分 →

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**集线器,同样的操作。

阅读剩余部分 →