Giter VIP home page Giter VIP logo

vps_setup's Introduction

GitHub stars GitHub forks

🔔 我們雖然窮,但是不能說謊,也不能打人;不是我們的東西,我們不能拿;

💯 要好好讀書,長大要做個對社會有用的人。



😍Linux 简单命令工具和简易脚本

点击展开内容

XPath Helper 简单使用方法

1.开启插件 (ctrl+shif+x)
2.鼠标移动到一个标题上方
3.按 shift 键,提取xpath
4.删除xpath尾部[方括号]
  
/a 链接文件    /a/@href  链接地址
  
/html/body[@class='home  pace-done']/section[@class='container']/div[@class='content-wrap']/div[@class='content']/article[@class='excerpt']/header/h2/a/@href

grep ip 并计数

grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sort | uniq -c| sort -nrk 1

# 应用: 统计自己电信服务商IP动态变化
cat /var/log/udp2raw.log \
  | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sort | uniq -c| sort -nrk 1

# 统计哪些IP在扫描你的vps
cat /var/log/auth.log \
  | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sort | uniq -c| sort -nrk 1

# 查询IP信息
https://www.ipip.net/ipquery.html

一些表情例子 EMOJI

  • 😄 😆 😵 😭 😰 😅 😢 😤 😍 😌
  • 👍 👎 💯 👏 🔔 🎁 ❓ 💣 ❤️ ☕ 🌀 🙇 💋 🙏 💢
:smile: :laughing: :dizzy_face: :sob: :cold_sweat: :sweat_smile:  :cry: :triumph: :heart_eyes: :relieved:
:+1: :-1: :100: :clap: :bell: :gift: :question: :bomb: :heart: :coffee: :cyclone: :bow: :kiss: :pray: :anger:

安装工具 tmux 和 fish 等

apt install tmux fish  -y

GCP_AZ_AWS_Virmach等小内存优化,htop 或者 systemctl查看有的任务

systemctl | grep running

systemctl disable   google-accounts-daemon.service
systemctl disable   google-clock-skew-daemon.service
systemctl disable   google-network-daemon.service
systemctl disable   google-osconfig-agent.service

systemctl disable  unattended-upgrades.service
systemctl disable  fail2ban
systemctl disable  rsyslog
systemctl disable  cron
systemctl disable  [email protected]
systemctl disable  console-getty.service

微软B1ls 内存只给420M运行Docker崩溃只好开虚拟内存

# WALinuxAgent (waagent) 卸载
systemctl disable walinuxagent

# Swap 交换空间

fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile

echo "/swapfile swap swap defaults 0 0"  >>  /etc/fstab


# 其他优化设定
vim /etc/sysctl.conf

vm.min_free_kbytes = 18600
vm.swappiness = 5

sysctl -p


网上找了文章  《Azure 乞丐版 B1ls 的正确使用姿势 压榨极致性能》
先凑合着用吧,反正是备用机,续签的 99刀应该可以用一年
----------------
## crontab -l
1   *   */7  *  *   reboot
59  *    *   *  *    wget -qO- git.io/fxxlb | bash
8  */8   *   *  *   docker run --rm  hostloc  用户 密码

在Android手机上安装Termux应用,测试学习10个秘密和酷命令!

1) apt install sl
     sl
2) factor "Any Number"
3) apt install fish
     fish
4) apt install figlet
     figlet "Any Text"
5) apt install cmatrix
     cmatrix
6) apt install fortune
     fortune
7) apt install toilet
     toilet "Any Text"
     toilet -f mono12 -F gay "Any Text"
8) apt install w3m
     w3m "any websites"
     example:- w3m google.com
9) ifconfig
10) apt install cowsay
      cowsay "Any Text"
#!/usr/bin/env sh

# https://github.com/Neilpang/acme.sh/wiki/说明

# 安装ssl依赖 和 acme.sh工具
apt-get install socat netcat -y
curl  https://get.acme.sh | sh

# 设置域名
DOMAIN=ssl.srgb888.ga

# 生成域名ssl证书
~/.acme.sh/acme.sh  --issue -d ${DOMAIN}  --webroot  /var/www/html --standalone -k ec-256 --force

如果你用的nginx服务器,以后可以使用一行命令更新证书

~/.acme.sh/acme.sh  --issue -d ssl.srgb888.ga  --nginx  --standalone -k ec-256 --force

Linux 使用代理 加速git 和安装软件

#!/bin/bash
# socks5tohttp.sh

brook socks5tohttp -s 127.0.0.1:1080 -l 0.0.0.0:8010 &
ps aux | grep -E brook

export http_proxy="http://127.0.0.1:8010"
export https_proxy="http://127.0.0.1:8010"
  • Windows 系统脚本 VPN --> socks5 --> http代理 给手机使用
::  Brook 开启 socks5  再转http
start /b  brook socks5 -l :1080 -i 0.0.0.0
sleep 1
start /b  brook socks5tohttp -s 127.0.0.1:1080 -l 0.0.0.0:8010

安装 brook 用来 Socks5 转 HTTP 代理

$ curl -L https://github.com/txthinking/brook/releases/download/v20200909/brook_linux_amd64 -o /usr/bin/brook
$ chmod +x /usr/bin/brook

# 32位系统安装
$ curl -L https://github.com/txthinking/brook/releases/download/v20200909/brook_linux_386 -o /usr/bin/brook

  • Socks5 转 HTTP 代理
$ brook socks5tohttp -s 127.0.0.1:1080  -l 127.0.0.1:8010
  • 中继: 可以将地址中继到远程地址。 它可以中继任何tcp和udp服务器
$ brook relay -f :9999 -t 1.2.3.4:9999
  • brook socks5 运行一个独立的标准socks5服务器(TCP和UDP)
$ brook socks5 -l :1080 -i 0.0.0.0

Linux 让终端走代理的几种方法

ssh保持长连接的方式,方法有以下三种:

1.修改server端的etc/ssh/sshd_config

ClientAliveInterval 60 #server每隔60秒发送一次请求给client,然后client响应,从而保持连接
ClientAliveCountMax 3 #server发出请求后,客户端没有响应得次数达到3,就自动断开连接,正常情况下,client不会不响应

systemctl reload sshd

2.修改client端的etc/ssh/ssh_config添加以下:(在没有权限改server配置的情形下)

ServerAliveInterval 60 #client每隔60秒发送一次请求给server,然后server响应,从而保持连接
ServerAliveCountMax 3  #client发出请求后,服务器端没有响应得次数达到3,就自动断开连接,正常情况下,server不会不响应

3.在命令参数里ssh -o ServerAliveInterval=60 这样子只会在需要的连接中保持持久连接, 毕竟不是所有连接都要保持持久的

Docker 版 RISC-V 交叉编译器和执行 riscv-pke 的环境 在线阅读

Hugo编译 C语言入门教程文档 Html静态网站制作 在线阅读

Xshell 7 操作 Docker Python3 学习编程 在线阅读

Linux Command 命令大全 命令列表 离线包

公益中小学教学视频 - 免费观看 在线阅读

旧手机烂手机不要换锈钢脸盆,安装Linux Deploy做移动服务器 在线阅读

群晖NAS部署自动PT工具 感谢大神TaterLi 在线阅读

一键 WordPress 博客安装脚本,同时也是 LNMP 套件 在线阅读

宇宙第一大站 IPT 刷上传,守株待兔也能活 在线阅读

Typecho 自用博客笔记安装 上篇 下篇:Typecho-theme-DUX 主题安装

Oracle VM VirtualBox 安装虚拟机 Debian 10 挖坑填坑笔记 在线阅读

Arch Linux 安装简易版 For VirtualBox 安装虚拟机 填坑笔记 在线阅读

黑五变态机有救,可以用NFS挂载一个僚机 在线阅读


网友视频和白话文档

Debian 10 Buster 管理员手册 在线阅读

  • Debian 开发者和 Debian 手册作者 Raphaël Hertzog 宣布面向 Debian 11 的最新版本 Debian 管理员手册已上线。

vps_setup's People

Contributors

hongwenjun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vps_setup's Issues

win7 64位 家庭普通版,tunsafe1.4,1.5均APPcrash

APPCRASH
应用程序名: TunSafe.exe
应用程序版本: 0.0.0.0
应用程序时间戳: 5bbe1248
故障模块名称: TunSafe.exe
故障模块版本: 0.0.0.0
故障模块时间戳: 5bbe1248
异常代码: c000001d
异常偏移: 000000000000f9bd
OS 版本: 6.1.7600.2.0.0.768.2
区域设置 ID: 2052
其他信息 1: 9b4e
其他信息 2: 9b4ea178303605071ea294765227c765
其他信息 3: 292b
其他信息 4: 292b9bfbf2f10d4e4897ed3846ed0635

vmess服务间连接不上

你好,我使用这个命令 bash <(curl -L -s https://git.io/v2ray_ss.sh)在Azure VM Ubuntu 20上安装了vmess服务。服务启动之后是可以正常使用的,但是过了几个小时候就连接不上了。我通过 bash <(curl -L -s https://git.io/v2ray_ss.sh) setup更改端口之后又可以正常连接使用,然后过了几个小时候后又连不上了,请问这个是什么问题。

wireguard安装脚本的优化(建议)

我今天尝试了使用这个脚本去一台新的vps上安装,发现有个悖论:smile:(解压winrar需要winrar.exe,而它在winrar.rar中:joy:)
image
一般vps的centos7都是minimal版本,都是不包含wget的,如果我不装wget,怎么下载脚本呢?
获取脚本是否改成curl -o更适合呢?curl是包含在minimal版本中的:smirk:

无法启动WireGuard

Feb 07 08:43:48 PlumpGummy-VM wg-quick[8192]: Warning: `/etc/wireguard/wg0.conf' is world accessible
Feb 07 08:43:48 PlumpGummy-VM wg-quick[8192]: wg-quick: `wg0' already exists
Feb 07 08:43:48 PlumpGummy-VM systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Feb 07 08:43:48 PlumpGummy-VM systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0.
Feb 07 08:43:48 PlumpGummy-VM systemd[1]: [email protected]: Unit entered failed state.
Feb 07 08:43:48 PlumpGummy-VM systemd[1]: [email protected]: Failed with result 'exit-code'.
# wg0.conf
[Interface]
PrivateKey = 2BiB+F5xJ/tWaeyGOvxyHkmitzfkz/cNB5sayc3Pbko=
Address = 10.0.0.1/24,  fd08:620c:4df0:65eb::1/64
PostUp   = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
ListenPort = 17812
DNS = 8.8.8.8, 2001:4860:4860::8888
MTU = 1420

[Peer]
PublicKey = gRvGtSRROABdXigoQo09by22otq4bNvOyq3nvi33SWM=
AllowedIPs = 10.0.0.188/32,  fd08:620c:4df0:65eb::188

[Peer]
PublicKey = G/5GCGyEIka1+Cft4ZptSKt0Udu0WD818cksCamDmns=
AllowedIPs = 10.0.0.8/32, fd08:620c:4df0:65eb::8

[Peer]
PublicKey = BrlYYr7GjkkLZMpkHtVfFLzopjgg7Rgh0o91BrchPkM=
AllowedIPs = 10.0.0.178/32, fd08:620c:4df0:65eb::178

[Peer]
PublicKey = j80T6WoK+QZnIB7MMnM7Fqrc4G0tUVlM01aXh5HYa18=
AllowedIPs = 10.0.0.186/32, fd08:620c:4df0:65eb::186

[Peer]
PublicKey = 85BcWVY0tfndn4tCT6OlMx2Z9D9Qk/npt6OIWfZuSXs=
AllowedIPs = 10.0.0.118/32, fd08:620c:4df0:65eb::118

[Peer]
PublicKey = iTlemsklnqPCJ0FFLuFKud5cClV0NMhGklF/PSRnUiA=
AllowedIPs = 10.0.0.158/32, fd08:620c:4df0:65eb::158

[Peer]
PublicKey = 0nKrsYR6uUVSNMWZvx/HqjMto5FsMzrk86ylM9T0oSs=
AllowedIPs = 10.0.0.198/32, fd08:620c:4df0:65eb::198

[Peer]
PublicKey = CD9T3A1wahF04vapV+tzEVSvsl6LGzChrxHlNLaso1o=
AllowedIPs = 10.0.0.168/32, fd08:620c:4df0:65eb::168

[Peer]
PublicKey = GOVCUC6KFojg2m7Ig4rCUc5or8cShHcGFqMDa8y0Iy4=
AllowedIPs = 10.0.0.9/32, fd08:620c:4df0:65eb::9

WireGuard + Speeder + Udp2Raw 一键脚本安装后,client 是ubuntu,有没有client的配置说明

WG+SPEED+UDP2RAW 原端口: 443 ; UDP2RAW伪装TCP后端口: 2999 ; 转发密码: password
使用一键脚本安装后wireguard 可以从443 正常访问,但是因为UDP Qos 本地还需要启UDP2RAW 的client么?

从脚本上看speederv2 转发了原443的数据,

# WG + Speeder + Udp2RAW 加速UDP TCP伪装
speederv2 -s -l127.0.0.1:8888  -r127.0.0.1:443  -f20:10 -k passwd --mode 0  >> /var/log/speederv2.log &
udp2raw   -s -l0.0.0.0:2999  -r 127.0.0.1:8888  -k ac0d2128 --raw-mode faketcp  >> /var/log/wg_udp2raw.log &

是否这种方式可行? 本地包先发给speederv2,随后转发给udp2raw 伪装, 随后多包转发给远程服务器端口(其中 10.0.0.1 是server wireguard 的虚拟地址)

speederv2 -c -l127.0.0.1:8888 -rserverip:2999  -k password  >> /var/log/speederv2.log &
udp2raw -c -l127.0.0.1:2999  -r127.0.0.1:8888 -k password --raw-mode faketcp --cipher-mode xor -a  >> /var/log/wg_udp2raw.log &

wg0.conf
Endpoint = 127.0.0.1:8888

Feature request's

Hi, thanks for your script. It's help me a lot. But I want to ask to add some options:
1 Let users to choose which one port they can use by WG
2 Let users to choose which one udp2raw mode to use. For example, I need to use ICMP cause faketcp and udp mode doesn't help me to bypass ISP traffic shapping. Manually there is no way to change that mode in script for now. So for me there is only one way within ICMP mode.

But all other things work smoothly and perfect. Thanks for your work.

Anomaly Redirection

Hello Wong,

Something odd to this setup. My instance got redirected to some website and got flagged.

新的路由防火墙规则在VPS端修改后只能ping通VLAN地址

使用老路由规则工作正常的GCP做测试更新路由规则后发现 ping VLAN地址工作正常,其他地址无法访问


PostUp = iptables -I FORWARD -i wg0 -j ACCEPT; iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT

请教关于一键脚本的问题

我曾经用您的脚本在服务器上部署过wireguard,到现在还在正常使用。但我最近重新在另一台服务器上部署,客户端和服务器端能连接上,但没有数据传输,无法打开墙外的网站。不知您是否改过脚本?请问应该如何解决这一问题?谢谢!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.