分类 linux 下的文章

手动搭建一个vless+tcp+tls节点

需要的原料:1. 节点一枚

  1. 申请ssl证书

    wget -N https://gitlab.com/rwkgyg/acme-script/raw/main/acme.sh && bash acme.sh

    (一键脚本)

  2. 给证书权限

     # Xray 默认以 nobody 用户运行,证书权限适配
      chown -R nobody.$cert_group /{证书的文件夹}/*
  3. 安装xray

    bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install
  4. 获取uuid

    xray uuid
  5. 修改/usr/local/etc/xray/里的config文件

    {
        "log": {
            "loglevel": "warning"
        },
        "routing": {
            "domainStrategy": "AsIs",
            "rules": [
                {
                    "type": "field",
                    "ip": [
                        "geoip:private"
                    ],
                    "outboundTag": "block"
                }
            ]
        },
        "inbounds": [
            {
                "listen": "0.0.0.0",
                "port": {{端口}},
                "protocol": "vless",
                "settings": {
                    "decryption":"none",
                    "clients": [
                        {
                            "id": "uuid"
                            
                        }
                    ]
                },
                "streamSettings": {
                    "network": "tcp",
                  
                    "security": "tls",
            "tlsSettings": {
              "alpn": "http/1.1",
              "certificates": [
                {
                  "certificateFile": "xxx/cert.crt",//证书地址,下同
                  "keyFile": "xxx/private.key"
                }
              ]
            }
                }
            }
        ],
        "outbounds": [
            {
                "protocol": "freedom",
                "tag": "direct"
            },
            {
                "protocol": "blackhole",
                "tag": "block"
            }
        ]
    }
  6. 在v2rayN客户端添加节点,选择添加vless服务器

    image-20230714032519984

    别名:随便填

    地址:填域名

    端口:填端口

    id:填uuid

    tls:选择tls

    没有提到的不动,点击确定。

debian安装docker

首先,安装一些必要的软件包:

apt update
apt upgrade -y
apt install curl vim wget gnupg dpkg apt-transport-https lsb-release ca-certificates

然后加入 Docker 的 GPG 公钥和 apt 源:

curl -sSL https://download.docker.com/linux/debian/gpg | gpg --dearmor > /usr/share/keyrings/docker-ce.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-ce.gpg] https://download.docker.com/linux/debian $(lsb_release -sc) stable" > /etc/apt/sources.list.d/docker.list

国内机器可以用清华 TUNA的国内源:

curl -sS https://download.docker.com/linux/debian/gpg | gpg --dearmor > /usr/share/keyrings/docker-ce.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-ce.gpg] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian $(lsb_release -sc) stable" > /etc/apt/sources.list.d/docker.list

然后更新系统后即可安装 Docker CE:

apt update
apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin

此时可以使用 docker version 命令检查是否安装成功:

root@debian ~ # docker version
Client: Docker Engine - Community
 Version:           24.0.2
 API version:       1.43
 Go version:        go1.20.4
 Git commit:        cb74dfc
 Built:             Thu May 25 21:52:17 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          24.0.2
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.4
  Git commit:       659604f
  Built:            Thu May 25 21:52:17 2023
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Ubuntu下crontab的安装和使用

一、安装

安装:apt-get install cron
启动:service cron start
重启:service cron restart
停止:service cron stop
检查状态:service cron status
查询cron可用的命令:service cron
检查Cronta工具是否安装:crontab -l
  • crontab命令:

1.编辑/创建命令

[root@localhost]# crontab -e

当系统不存在crontab文件时,输入此命令即为创建,已存在文件即为编辑。

2.查看当前所有定时任务

[root@localhost]# crontab -l

3.删除当前所有定时任务

[root@localhost]# crontab -r

编辑/var/spool/cron/crontabs目录下面的root文件

image-20230623212224718

直接在下面加上时间规则和所要执行文件的地址

例如:

* * * * * /usr/local/xxxx/xxx

当执行定时任务出现错误时,默认将信息存储到相应用户下面的文件中/var/log/mail/${user}

玩客云刷机

需要用到的东西:玩客云一台,一条双usb线,一个u盘

第一步刷底包

把usb线的一端插到离hdmi接口近的那一个usb接口,另一个连电脑

然后用镊子短接图示的两个接口

20210703164557143

或者是用手摁住复位键,如果不想拆机的话就用取卡针捅着复位接口

然后接上电源,就可以看到下面这张图

20210703164317149

然后刷入底包 ,即 update.img

之后就是要先将旧的系统(armbian5.88.img)刷到u盘上,刷完之后将u盘插到离网口近的那个usb口。

等他闪灯,不闪了之后,就可以把u盘拔下来。

之后废物利用再给u盘刷上WKY-Armbian_20.12_5.9.0同样的操作再来一遍就可以了

之后就是ssh连接

用户名 root 密码 1234

刷入emmc(闪存):

cd /boot/install     #进入/boot/install目录
sudo ./install.sh    #运行install.sh

其他:

★内网穿透ssh远程登陆
cd /opt/ #进入/opt目录
mkdir cpolar #创建cpolar空文件夹
进入官网复制下载链接(要ARM的)
wget 【复制的链接】 #下载内网穿透工具
unzip 【下载的.zip压缩包】 #解压压缩包
(也可以删掉解压完成的压缩包用 rm -rf 【压缩包】)
./cpolar authtoken 【您的token】 #绑定您的token
./cpolar service install #下载cpolar服务
./systemctl start cpolar #启动cpolar服务
./systemctl enable cpolar #开机自启cpolar服务
./systemctl status cpolar #查看cpolar服务状态
官网查看地址和端口即可ssh远程登陆

★挂载硬盘(临时)
lsblk 或lsblk -f查看挂载情况
fdisk /dev/sda1(这里填你的硬盘目录) #给硬盘分区
mkfs -t ext4 /dev/sda1 #格式化硬盘选择ext4文件系统
mount /dev/sda1 【要挂载的目录】 #分区挂载到指定目录

★永久挂载
vim /etc/fstab #用vim打开文件
在最后填入
/dev/sda1(你的硬盘目录) /mydisk(要挂载的目录) ext4 defaulta 0 0
*这一步不要填错了要仔细

用到的文件

链接:https://pan.baidu.com/s/1Pp-Z0tyMus5vd8i03HXBAg?pwd=2fhx
提取码:2fhx

写在后面:

这个教程我之前就一直想出,但是一直没有写,今天看到备忘录上有就草草写一下,算是和玩客云告别了,感谢它曾经带给我一段美好的

warp

wrap简介:

支持 chatGPT,解锁奈飞流媒体
避免 Google 验证码或是使用 Google 学术搜索
可调用 IPv4 接口,使青龙和V2P等项目能正常运行
由于可以双向转输数据,能做对方VPS的跳板和探针,替代 HE tunnelbroker
能让 IPv6 only VPS 上做的节点支持 Telegram
IPv6 建的节点能在只支持 IPv4 的 PassWall、ShadowSocksR Plus+ 上使用

网上流行的warp的几个版本包括:

https://github.com/fscarmen/warp
https://github.com/P3TERX/warp.sh
https://gitlab.com/ProjectWARP/warp-go/-/tree/master/
https://github.com/yonggekkk/warp-yg
https://gitlab.com/Misaka-blog/warp-script

以 https://github.com/fscarmen/warp 为例进行演示。

1、首次运行

wget -N https://raw.githubusercontent.com/fscarmen/warp/main/menu.sh && bash menu.sh [option] [lisence]

2、再次运行

warp [option] [lisence]

3、参数参考github主页,我这里来一个极简演示:

wget -N https://raw.githubusercontent.com/fscarmen/warp/main/menu.sh && bash menu.sh 4