1024社区 | 1024.day
12K subscribers
406 photos
6 videos
3 files
1.06K links
这是一个分享VPS资讯以及Linux学习频道。
Download Telegram
#haha
唠叨一下v2ray的log吧,v2ray的日志是非常清晰的,主要记录你的IP和访问网站、时间戳。有没有看黄片,有没有浏览境外反动网站,清清楚楚。
比如,俺想屏蔽bt,俺甚至能屏蔽掉哪些预谋犯罪(预谋bt),还没犯罪(还没bt下载)的用户。也就是你在浏览bt网站阶段就被俺逮住了。
所以,那些爱国爱党的机场,大家还是上点心吧。
随手改了改萌咖的DD脚本,本来是自用的,精简了下,剔除了Centos相关代码,重新分了一下区,简单配置一下,增加些常用软件。分享出来骗点赞吧。
可DD Ubuntu18.04、20.04, Debian 9、10 四个系统,适用于支持DHCP服务的VPS或是杜甫,傻瓜式操作,只要运行脚本就行了。
项目地址:
https://github.com/yeahwu/InstallOS
#centos selinux
CentOS更换源和关闭SELinux

CentOS更换源

1、更换CentOS-Base.repo源:

centos 6版本
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

centos 7版本
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

centos 8版本
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo

2、运行 yum makecache

3、安装epel源
yum -y install epel-release

关闭SELinux

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

sed -i 's/SELINUX=permissive/SELINUX=disabled/g' /etc/selinux/config

最后重启: /sbin/reboot

4、
CentOS 7 关闭打开防火墙

1、启动防火墙: systemctl start firewalld

2、禁用防火墙: systemctl stop firewalld

3、设置开机启动: systemctl enable firewalld

4、停止并禁用开机启动: sytemctl disable firewalld

5、重启防火墙: firewall-cmd --reload

6、查看状态: systemctl status firewalld
俺平时用的比较多的是 Shadowsocks-libev 和 v2ray-wss 代理,于是就随手写了个两种代理的搭建脚本,可以选择单独安装或一起安装。本来想把https正向代理一起写进去,想到没啥使用场景,也就算了。

支持Debian、Ubuntu、Centos,支持amd、arm多平台。

项目地址:https://github.com/yeahwu/v2ray-wss
#golang
安装golang脚本,也适用于甲骨文arm机器:

#!/bin/sh
is64=`uname -m`
if [ "$is64" = "x86_64" ];then
wget https://studygolang.com/dl/golang/go1.16.6.linux-amd64.tar.gz -O - | tar -xz -C /usr/local/
sleep 3s
else
wget https://studygolang.com/dl/golang/go1.16.6.linux-arm64.tar.gz -O - | tar -xz -C /usr/local/
sleep 3s
fi
echo -e "export PATH=\$PATH:/usr/local/go/bin\nexport PATH=\$PATH:\$HOME/.cargo/bin\nexport GOROOT=/usr/local/go\nexport GOBIN=\$GOROOT/bin\nexport PATH=\$PATH:\$GOBIN" >> ~/.profile
source ~/.profile


脚本运行后:

source ~/.profile

go version
正式介绍一下,此脚本支持 V2ray+ Nginx + WebSocket 和 Shadowsocks-libev 代理,有域名的可选择wss代理,没域名的可选择ss代理,支持 Debian、Ubuntu、Centos 系统,支持 AMD 和 ARM 平台(已测试过甲骨文arm机型),傻瓜式安装。如果需要自己一步步搭建,可参考俺博客内容。
https://github.com/yeahwu/v2ray-wss
Forwarded from 1024社区 | 1024.day
#haha
既然大家喜欢看姥爷吹牛逼,那么姥爷就吹吹美帝几大廉价机房吧,分别是 CC机房、MC机房、鲨鱼机房,没用过好机房,毕竟穷,汗!

首先是 CC 机房,全称是 ColoCrossing,这个机房几乎是廉价 VPS 的标配,比如 VirMach 和 RackNerd 都在用,这个机房线路表现比较好的是洛杉矶和圣何塞、欧洲三个地方。IP 基本被 Google 列入黑名单了,跳 Google 验证,最差机房,没有之一。

其次是MC机房,全称是 Multacom Corporation,这个机房一些 VPS 也比较常用,比如 CloudCone 和 RackNerd 家的 DC2 用的就是这个机房产品,线路速度和 CC 机房差不多,有些 IP 段自带防 D,比如 173.82.105.* ,推洛杉矶线路。唯一的好处的是 IP 不会跳 Google 验证。

最后是鲨鱼机房,全称是 Sharktech,这个机房号称 CN2,其实狗屁。线路和速度稍微比 MC 和 CC 好点,但有限,推洛杉矶线路。好处是全系 IP 防 D,建个网站挺好的,Google 不会跳验证。它家自己有 VPS 销售,RackNerd 家的防 D 线路用的也是它家的,还有就是贵。
姥爷推荐的vps商家,基本没啥线路好坏,路由都是跑到哪算哪,俺更看重价格和性能、安全。所以俺推荐的vps大家谨慎购买。这算是俺的免责声明吧!
Forwarded from 1024社区 | 1024.day
#haha
关于vps线路说几句:
线路的好坏取决于,idc商家有没有和中国isp商合作。比如电信或联通拉根线,这样的商家到国内线路差不了。
比如:斯巴达用的是CeraNetworks机房,而cera机房又从联通拉了一根线;搬瓦工又和电信有合作。等等。

其它国外没合作的商家,路由基本就是小孩子尿尿,尿到那算那。运气好的能碰上好线路,不好也没辙。
比如:cc机房,mc机房等等。这些没有和中国isp商掺和的商家,无疑更安全一点。

所以,对于国外商家也不要在意什么线路了。你更应该关注配置和安全。
Forwarded from 1024社区 | 1024.day
VPS退款教程

首先提工单,一般提交到 Sales Department 部门,也就是销售部门

标题:REFUND REQUEST

内容:
I selected the wrong instance, so I need a refund.

Invoice # 933083
后面的数字是你的单号

有的VPS会确认你退款,一般不会确认,就直接给你退了,如果确认的话,你可以回复:

I agree to refund.
Windows或者其他系统登录 SSH 的一个简单方法:

#ssh #vscode
简单点讲,就是下载微软 Visual Studio Code 编辑软件,相信大家平时也用得上

VS Code 官网下载: https://code.visualstudio.com/

下载安装后,编辑器里安装一个扩展 Remote - SSH 就可以在 VS Code 上登录远程服务器,可命令操作,可在 VS Code 上同步编辑文件等。
用了大半年国内华为云,简单评价下吧。
优点:
1、先说CPU吧,这家cpu不限性能,而且国内cpu性能强劲,用的都是 Intel gold cpu。国外cpu性能差点
2、这家线路是不错的,基本不绕路,而且内网专线为主
缺点:
1、自带的系统有私货,俺专门查过。到手就DD吧。
2、自带出网,入网规则复杂,需要面板上放行
3、在线率国外服务器好于国内服务器,因为国外服务器没有收到任何维护信息,国内经常收到维护信息,虽然是在半夜。俺很反感租台服务器,经常收到维护信息。
4、贵,需要实名
总结一下,这家服务器总体还是不错的,性能和线路都没话说,其它也就是一些小缺点。
#linux #kernel
Debian/Ubuntu 降级 Linux 内核

大多数时候都是升级内核,而且网上教程比较多。今晚就讲讲怎么降级内核,因为有时新内核用着会发现bug或者不习惯,俺们就需要降级内核了。

首先查看内核启动菜单:
grep menuentry /boot/grub/grub.cfg

会输出类似下面内容:
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
menuentry_id_option=""
export menuentry_id_option
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9092a863-35f2-4a22-98e9-65a45e4671bc' {
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-9092a863-35f2-4a22-98e9-65a45e4671bc' {
menuentry 'Debian GNU/Linux, with Linux 5.10.0-0.bpo.8-cloud-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.0-0.bpo.8-cloud-amd64-advanced-9092a863-35f2-4a22-98e9-65a45e4671bc' {
menuentry 'Debian GNU/Linux, with Linux 5.10.0-0.bpo.8-cloud-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.0-0.bpo.8-cloud-amd64-recovery-9092a863-35f2-4a22-98e9-65a45e4671bc' {
menuentry 'Debian GNU/Linux, with Linux 4.19.0-17-cloud-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.0-17-cloud-amd64-advanced-9092a863-35f2-4a22-98e9-65a45e4671bc' {
menuentry 'Debian GNU/Linux, with Linux 4.19.0-17-cloud-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.0-17-cloud-amd64-recovery-9092a863-35f2-4a22-98e9-65a45e4671bc' {

上面可以看到有两个新旧内核,那么怎么从5.10内核切换到4.19内核呢?往下看

修改Grub,设置内核启动版本:
vi /etc/default/grub

修改 GRUB_DEFAULT=0 修改成如下:
GRUB_DEFAULT="Advanced options for Debian GNU/Linux>Debian GNU/Linux, with Linux 4.19.0-17-cloud-amd64"

上面保存后,执行:
update-grub

最后 /sbin/reboot

上面测试的是 Debian,俺想 Ubuntu 也适用。
vps干啥都好,就是不要拿来挖矿,是个大坑。非常不划算,还有被封号的风险。
大家七夕快乐!愿有情人终成眷属。
#PATH #command
linux root用户下提示 bash:command not found

查看当前PATH
echo $PATH

更改PATH
export PATH=$PATH:$HOME/bin:/sbin:/usr/bin:/usr/sbin

之后
source ~/.profile
查看现有磁盘是否是4k对齐
#fdisk #linux #ssd
Linux上ssd硬盘如何4k对齐

1、查看现有磁盘是否是4k对齐
fdisk -l -u

如图,Start 为8的倍数则4k对齐,否则没有对齐

2、如何用fdisk 对齐分区
       fdisk /dev/vdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-208050, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-208050, default 208050):
Using default value 208050

Command (m for help): x

Expert command (m for help): b
Partition number (1-4): 1
New beginning of data (1-209714399, default 63): 128

Expert command (m for help): p

Disk /dev/vdb: 16 heads, 63 sectors, 208050 cylinders

Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID
1 00 1 1 0 15 63 1023 128 209714272 83
2 00 0 0 0 0 0 0 0 0 00
3 00 0 0 0 0 0 0 0 0 00
4 00 0 0 0 0 0 0 0 0 00

Expert command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
这样分区之后再用fdisk -l -u查看,已经是分区对齐了。
修得差不多了,姥姥抄的DD脚本,率先支持 Debian 11,支持 DHCP 服务的 VPS 或是杜甫都可以用这个脚本,傻瓜式操作,只要运行脚本就行了。
简单点讲,也就是重装vps或独服系统的脚本。
https://github.com/yeahwu/InstallOS
拆除甲骨文防火墙

1、在子网中的安全列表中对入口规则和出口规则进行更改,对0.0.0.0/0的所有协议进行放行。

打开实例 -- 子网 -- 点开安全列表里的内容 -- 然后设置成如上图

2、做完第一步是对网络的防火墙打开了,但是vps搭建的梯子还是不能连接,需要对机器的防火墙进行设置

#开放所有端口
sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -P OUTPUT ACCEPT
sudo iptables -F
#Oracle自带的Ubuntu镜像默认设置了Iptable规则,关闭它
apt-get purge netfilter-persistent
reboot

#强制删除
rm -rf /etc/iptables && reboot


姥姥昨天也跟风薅了一个甲骨文,结果还没测试完就被封号了。这个郁闷呐!