标签 wget 下的文章

说明:以前一直宝塔习惯了,体验了一下纯ipv6的小鸡,宝塔不支持,试了好几个方法,都没成功。在下愚钝,手动搭建环境也没成功。然后尝试了oneinstack,失败。最后使用lnmp一键安装包成功了。

安装

1.screen -S lnmp 如果网络断线,重新连接SSH,再执行screen -r lnmp就会看到你的lnmp安装进程
2.wget http://soft.vpser.net/lnmp/lnmp1.6.tar.gz -cO lnmp1.6.tar.gz && tar zxf lnmp1.6.tar.gz && cd lnmp1.6 && ./install.sh lnmp 跟着提示一步一步执行即可
详见:https://lnmp.org/install.html

添加网站

1.lnmp vhost add 跟着提示一步步执行
相见:https://lnmp.org/faq/lnmp-vhost-add-howto.html

重载nginx

修改了配置文件后需要用到
路径vi /usr/local/nginx/conf/vhost/域名.conf
/usr/local/nginx/sbin/nginx -s reload

说明:上次说到微博图床的解决办法,但是不完美,考虑到以后,还是先下载下来。

数据库备份

先备份一次数据库,如果出错还有救。方便下面操作,数据库命名为:190425.sql

图片本地化

1.xshell切换到数据库目录
2.查找微博图片
grep -Eo 'https?://w[a-z][0-9].sinaimg.cn[a-Z0-9/]+?.(jpg|png|gif)' 190425.sql
TIM20190516150835.png
3.下载所有图片到服务器
for i in `grep -Eo 'https?://w[a-z][0-9].sinaimg.cn[a-Z0-9/]+?.(jpg|png|gif)' 190425.sql`;do wget $i;done

修改图片路径

1.搜索了下MySQL不支持正则替换。我不是专业的,会的大哥些请指正
UPDATE typecho_contents SET text = REPLACE( text, 'ws1.sinaimg.cn', 'sixu.life');
暂时发现的微博域名有以下这些:

ws1.sinaimg.cn
ws2.sinaimg.cn
ws3.sinaimg.cn
ws4.sinaimg.cn

wx1.sinaimg.cn
wx2.sinaimg.cn
wx3.sinaimg.cn
wx4.sinaimg.cn

ww2.sinaimg.cn
ww4.sinaimg.cn

参考:https://hqidi.com/144.html

前言:
v2ray通过cloudflare拯救被封的IP,之前一直用的233blog的一键脚本,奈何nfp的ovz换了4次系统都没能成功实现,所以手动搭建了,顺便开个记录贴

域名解析

1.使用cloudflare解析域名,为了方便测试,可以先把云朵点灰、关闭cdn(非必要,如果点灰了最后记得再次点亮云朵图标开启cdn)

安装宝塔面板

1.根据自己的系统使用正确的命令安装:

Centos安装命令
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install.sh && sh install.sh

Debian安装命令
wget -O install.sh http://download.bt.cn/install/install-ubuntu.sh && bash install.sh

2.安装完成后,登录BT面板,安装nginx
3.添加站点
输入自己的网址,ftp、数据库、php都不用
4.申请ssl
点击「设置」——SSL——Let’s Encrypt,成功申请SSL后,保存
5.更改 配置文件
再次点击站点「设置」的「配置文件」选项,在最后一个}前添加如下代码:

    location / {
    proxy_redirect off;
    proxy_pass http://127.0.0.1:25534;#25534是v2ray的端口号,注意和之后安装的一致
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
    }

6.重启Nignx

安装v2ray

1.安装命令
bash <(curl -L -s https://install.direct/go.sh)
2.修改v2ray配置文件,路径/etc/v2ray/config.json,修改后记得重启v2ray
参考配置:

{
    "log": {
        "access": "/var/log/v2ray/access.log",
        "error": "/var/log/v2ray/error.log",
        "loglevel": "warning"
    },
    "inbound": {
        "port": 25534,#自己的端口号需要对应
        "protocol": "vmess",
        "settings": {
            "udp": true,
            "clients": [
                {
                    "id": "e5cee2d4-d28b-4b8a-83ef-cf788bf1****",#自己的id
                    "level": 1,
                    "alterId": 233
                }
            ]
        },
        "streamSettings": {
            "network": "ws"
        }
    },
    "outbound": {
        "protocol": "freedom",
        "settings": {}
    },
    "outboundDetour": [
        {
            "protocol": "blackhole",
            "settings": {},
            "tag": "blocked"
        }
    ],
    "routing": {
        "strategy": "rules",
        "settings": {
            "rules": [
                {
                    "type": "field",
                    "ip": [
                        "0.0.0.0/8",
                        "10.0.0.0/8",
                        "100.64.0.0/10",
                        "127.0.0.0/8",
                        "169.254.0.0/16",
                        "172.16.0.0/12",
                        "192.0.0.0/24",
                        "192.0.2.0/24",
                        "192.168.0.0/16",
                        "198.18.0.0/15",
                        "198.51.100.0/24",
                        "203.0.113.0/24",
                        "::1/128",
                        "fc00::/7",
                        "fe80::/10"
                    ],
                    "outboundTag": "blocked"
                }
            ]
        }
    }
}

3.V2Ray可使用的命令:

sudo service v2ray start #启动V2Ray
sudo service v2ray stop #停止运行V2Ray
sudo service v2ray restart #重启V2Ray
sudo service v2ray status #查看V2Ray状态

说明:路由器新路由3作为客户端frpc,Google cloud香港有公网IP安装服务端frps

vps上安装服务端

1.下载服务端

#切换到root目录下
cd /root
#下载0.21版本
wget --no-check-certificate https://github.com/fatedier/frp/releases/download/v0.21.0/frp_0.21.0_linux_amd64.tar.gz
#解压
tar -xzvf frp_0.21.0_linux_amd64.tar.gz
#文件夹重命名
mv frp_0.21.0_linux_amd64 frp
#进入frp目录
cd frp
#赋予权限
chmod +x frps
#执行帮助命令测试frp是否能运行
./frps --help

2.写入配置文件

echo "[common]
bind_port = 7000
token = 12345678
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = admin
vhost_http_port = 10080
vhost_https_port = 10443
subdomain_host = sixu.life" > frps.ini

3.测试运行frps
./frps -c frps.ini
ctrl+c退出
4.开机启动

#编辑 开机启动文件
vi /etc/rc.local
#按 i 进入编辑模式并添加下面的命令到 exit 0 语句之前
nohup /root/frp/frps -c /root/frp/frps.ini &
#按 esc 退出编辑模式再按 :wq 保存并退出

路由器上配置

1.依次点击:花生壳内网版--frp
启用 frp 内网穿透 选中
启用 frpc 客户端 选中
2.修改配置文件

# ==========客户端配置:==========
[common]
server_addr = 对应服务器IP地址
server_port = 对应服务端的 bind_port
token = 对应服务端 token

#log_file = /dev/null
#log_level = info
#log_max_days = 3

[web]
remote_port = 对应服务端vhost_http_port
type = http
local_ip = 192.168.123.1
local_port = 80
subdomain = 自定义子域名,例如test.sixu.life,则此处自需要输入test
#host_header_rewrite = 
# ====================
EOF

3.点击应用本页设置
4.运行成功会看到类似的提示

login to server success, get run id [], server udp port [0]
start proxy success

image

域名解析

为了方便,可直接添加泛解析 * a记录指向服务器IP

其他

例如上文的设置来说:
1.登录服务端的 dashboard 的地址为:服务器ip:7500
2.外网访问地址为:test.sixu.life:10080
image

2019年6月28日更新
尝试了一下新的mtg
Github:https://github.com/cutelua/mtg-dist
Github:https://github.com/9seconds/mtg

安装
bash <(wget -qO- https://git.io/mtg.sh)

卸载

systemctl stop mtg && systemctl disable mtg
rm -f /usr/local/bin/mtg /lib/systemd/system/mtg.service /etc/mtg.conf

参考:https://sunpma.com/151.html

--------------分割线-------------

mt工具箱里的科学上网不智能,gfwlist模式很多网站都无效,暂时没找到解决办法。最近开始用的telegram也不能愉快的聊天,有现成工具就搭了个mtproto

逗逼一键脚本

#CentOS 7 / Debian 7+ / Ubuntu 14.04 + 
wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/mtproxy.sh && chmod +x mtproxy.sh && bash mtproxy.sh

阿里云centos7亲测失败,顺便贴个错误日志,Debian8成功安装

[信息] 开始安装/配置 依赖...
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
No packages marked for update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Package 1:openssl-devel-1.0.2k-12.el7.x86_64 already installed and latest version
Package zlib-devel-1.2.7-17.el7.x86_64 already installed and latest version
Package git-1.8.3.1-14.el7_5.x86_64 already installed and latest version
Package net-tools-2.0-0.22.20131004git.el7.x86_64 already installed and latest version
Nothing to do
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Maybe run: yum groups mark install (see man yum)
No packages in any requested group available to install or update
cp: ‘/usr/share/zoneinfo/Asia/Shanghai’ and ‘/etc/localtime’ are the same file
[信息] 开始下载/安装...
Cloning into 'MTProxy'...
remote: Enumerating objects: 183, done.
remote: Total 183 (delta 0), reused 0 (delta 0), pack-reused 183
Receiving objects: 100% (183/183), 293.80 KiB | 281.00 KiB/s, done.
Resolving deltas: 100% (74/74), done.
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"f9158e3129efd4ccdc291aefb840209791226a77\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -iquote common -iquote . -c -MP -MD -MF dep/mtproto/mtproto-proxy.d -MQ objs/mtproto/mtproto-proxy.o -o objs/mtproto/mtproto-proxy.o mtproto/mtproto-proxy.c
make: cc: Command not found
make: *** [objs/mtproto/mtproto-proxy.o] Error 127
[错误] MTProxy 编译失败!
另外,如果在上面几行看到 xxxxx option "-std=gnu11" 字样,说明是系统版本过低,请尝试更换系统重试!
rm -rf objs dep objs/bin || true

image

参考:https://doub.io/shell-jc7/

不能从老版本平滑升级,请卸载老版本工具箱后使用新版安装命令进行安装,卸载前请注意备份配置文件

卸载2.0旧版工具箱

按需使用,没安装或者在后台管理界面卸载过的无需此步骤
wget http://www.misstar.com/tools/uninstall.sh -O /tmp/uninstall.sh && chmod +x /tmp/uninstall.sh && /tmp/uninstall.sh

安装3.0工具箱

curl -s -k https://beta.misstar.com/download/$(uname -m)/mtinstall -o /tmp/mtinstall && chmod +x /tmp/mtinstall && /tmp/mtinstall

安装成功后工具箱的界面:
https://mt.misstar.com/
http://192.168.31.1:1314
http://192.168.31.1:1024 无需账号密码

image

注意事项

不支持OpenVZ的虚拟化构架
只适用于由GRUB引导的VPS
重装前请务必备份好重要数据,后果自负
重装需要20-40分钟不等的时间,期间无法连接服务器,请耐心等待,有vnc的面板可以通过vnc查看安装进度

原系统安装必备软件

Debian / Ubuntu 系统:

apt-get update
apt-get install -y gawk sed grep

RHEL / CentOS 系统:

yum install -y gawk sed grep

下载脚本

wget --no-check-certificate -qO DebianNET.sh 'https://moeclub.org/attachment/LinuxShell/DebianNET.sh' && chmod -x DebianNET.sh

使用方法

安装Debian 7 32位:
bash DebianNET.sh -d 7 -v 32 -a
安装Debian 7 64位:
bash DebianNET.sh -d 7 -v 64 -a
安装Debian 8 32位:
bash DebianNET.sh -d 8 -v 32 -a
安装Debian 8 64位:
bash DebianNET.sh -d 8 -v 64 -a
安装Debian 9 32位:
bash DebianNET.sh -d 9 -v 32 -a
安装Debian 9 64位:
bash DebianNET.sh -d 9 -v 64 -a

修改密码

默认root密码:MoeClub.org,安装完成后请立即更改密码.
passwd root

参考:https://www.zhujiboke.com/2017/09/803.html

Debian OpenVZ 魔改 BBR - lkl-rinetd 一键脚本

测试机器:
nfphosting 512m Debian GNU/Linux 7 (64 Bit) OpenVZ

要求以下:
OpenVZ 64 bit Ram >> 64M

Debian or Ubuntu
适用于 单网卡(单 IP) 服务器:

wget https://github.com/tcp-nanqinlang/lkl-rinetd/releases/download/1.1.0/tcp_nanqinlang-rinetd-debianorubuntu.sh
bash tcp_nanqinlang-rinetd-debianorubuntu.sh

适用于 多网卡(多 IP) 服务器,会为所有网卡(所有 IP)提供加速:

wget https://github.com/tcp-nanqinlang/lkl-rinetd/releases/download/1.1.0/tcp_nanqinlang-rinetd-debianorubuntu-multiNIC.sh
bash tcp_nanqinlang-rinetd-debianorubuntu-multiNIC.sh

在 /home/tcp_nanqinlang 进行安装,所以安装完成后不要动这个文件夹了(除非你想修改端口)。
vi /home/tcp_nanqinlang/config-port.conf
安装过程中,会提示输入端口号。多个端口号用空格隔开。不支持端口段。

2018年8月17日22点08分测试图
image

参考:https://github.com/tcp-nanqinlang/wiki/wiki/lkl-rinetd