谷歌翻译无法使用的处理方法

translate.googleapis.com 被墙,于是chrome浏览器自带的翻译用不了,解决方法如下:

hosts文件里添加
C:\Windows\System32\drivers\etc\hosts 

172.253.119.90 translate.googleapis.com
172.253.119.90 translate.google.com

下面项目IP能ping通基本就能用:


https://github.com/hcfyapp/google-translate-cn-ip/blob/master/packages/google-translate-ip/ips.txt

Debian10修改IPV6主机的DNS64(可访问IPV4网站) + 彻底修改debian10系统DNS

在 Debian 系统中修改 DNS 服务器地址通常涉及编辑 /etc/resolv.conf 文件。然而,从 Debian 版本 Buster(10)开始以及后续版本,包括 Bullseye(11)和 Bookworm(假设为未来版本),该文件可能由网络管理服务(如 systemd-resolved)自动管理,并且直接编辑它可能不是持久化更改的推荐方式。

对于使用 systemd-resolved 的系统:
临时修改: 如果系统使用了 systemd-resolved,可以通过命令行工具 resolvectl 来临时设置DNS服务器:

sudo resolvectl dns eth0 8.8.8.8 8.8.4.4

其中eth0是网卡名称

永久修改: 若要永久性地更改配置,应编辑 /etc/systemd/resolved.conf 文件并添加或修改 DNS= 行下的DNS服务器列表:

sudo nano /etc/systemd/resolved.conf

在其中找到或添加如下内容:


nameserver 8.8.8.8
nameserver 8.8.4.4
echo -e "nameserver 8.8.8.8\nnameserver 8.8.4.4" > /etc/systemd/resolved.conf
或者
nameserver 1.1.1.1
nameserver 1.0.0.1
echo -e "nameserver 1.1.1.1\nnameserver 1.0.0.1" > /etc/systemd/resolved.conf

修改后,重启 systemd-resolved 服务以应用更改:

sudo systemctl restart systemd-resolved.service

如果没有使用systemd-resolved 的系统,则可以直接修改 /etc/resolv.con文件

打开修改文件

nano /etc/resolv.conf

纯IPV6主机修改DNS64(NAT64),可访问IPV4地址

nameserver 2001:67c:2b0::4 
nameserver 2001:67c:27e4::64

最后查看是否生效:

cat /etc/resolv.conf

Cloudflare DNS64:


nameserver 2606:4700:4700::64
nameserver 2606:4700:4700::6400
echo -e "nameserver 2606:4700:4700::64\nnameserver 2606:4700:4700::6400" > /etc/resolv.conf

Go6Lab:


nameserver 2001:67c:27e4:15::6411
nameserver 2001:67c:27e4::64
echo -e "nameserver 2001:67c:27e4:15::6411\nnameserver 2001:67c:27e4::64" > /etc/resolv.conf

google nat64:


nameserver 2001:4860:4860::6464
nameserver 2001:4860:4860::64
nameserver 2001:4860:4860:0:0:0:0:6464
nameserver 2001:4860:4860:0:0:0:0:64
echo -e "nameserver 2001:4860:4860::6464\nnameserver 2001:4860:4860::64" > /etc/resolv.conf

nat64和DNS64不能同时使用:


nameserver 2001:4860:4860::8888
nameserver 2001:4860:4860::8844
echo -e "nameserver 2001:4860:4860::8888\nnameserver 2001:4860:4860::8844" > /etc/resolv.conf

Linux本地测速方法

speedtest 是一款使用 python 语言编写的轻量级的 linux 命令行测速工具,在 python2 以及 python3 的环境下都可以运行,基于 speedtest.net 基础框架来测量网络的上下行数据,安装也很简单,只要下载对应的 python 文件执行即可。

测速方法
1、先下载脚本(wget 下载或者下载好上传到服务器上)

wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py 

2、为脚本授权

chmod a+rx speedtest.py
chown root:root speedtest.py 

3、移至本机运行目录

mv speedtest.py /usr/local/bin/speedtest 

4、执行测速

speedtest 

如果出现找不到 python 环境的错误,对应以下解决即可!


[root@ecs-test ~]# speedtest 
/usr/bin/env: ‘python’: No such file or directory
[root@ecs-test ~]# python3 --version
Python 3.6.8
[root@ecs-test ~]# 
[root@ecs-test ~]# whereis python3
python3: /usr/bin/python3.6 /usr/bin/python3 /usr/bin/python3.6m /usr/lib/python3.6 /usr/lib64/python3.6 /usr/local/lib/python3.6 /usr/include/python3.6m /usr/share/man/man1/python3.1.gz
[root@ecs-test ~]# sudo ln -s /usr/bin/python3 /usr/bin/python
[root@ecs-test ~]# speedtest 
 

5、查看测速节点列表

speedtest --list 

6、对指定节点测速,14623是节点编号

speedtest  --server 14623 

Kimsufi-ks系列怎么配置ipv6

debian10:
ipv6 地址以及网关的获取方式:

美区账号登录:https://ca.api.kimsufi.com/
请求:https://ca.api.kimsufi.com/console/#/dedicated/server/%7BserviceName%7D/specifications/network~GET
(欧洲将链接中 ca 换成 eu )
填入主机名,Execute,便可找到:

 
{
        .....
-vmac: {
supported: true
}
-routing: {
-ipv6: {
gateway: "xx"
ip: "xx/128"
network: "xxx/56"
}
-ipv4: {
network: "xx"
ip: "xx"
gateway: "xx"
}
}
-vrack: {
type: null
bandwidth: null
}
}

编辑文件/etc/network/interfaces
添加以下代码

 
iface ens3 inet6 static    ##ens3为我的网卡,请修改成自己的网卡
    address 你的ipv6地址 
    netmask 128

post-up /sbin/ip -f inet6 route add IPv6_GATEWAY dev ens3
post-up /sbin/ip -f inet6 route add default via IPv6_GATEWAY 
pre-down /sbin/ip -f inet6 route del IPv6_GATEWAY dev ens3
pre-down /sbin/ip -f inet6 route del default via IPv6_GATEWAY
 
service networking restart
 
ping6 -c 4 google.com

网络DD重装Linux-已适配Oracle甲骨文免费主机

确保安装了所需软件:
#Debian/Ubuntu:

apt-get install -y xz-utils openssl gawk file

#RedHat/CentOS:
yum install -y xz openssl gawk file
如果出现了错误,请运行:
#Debian/Ubuntu:

apt-get update

1.新增对 Oracle AMD,Oracle ARM全面支持. 可支持从 Ubuntu, Oracle Linux 等系统网络重装.
2.更新 dd 镜像的基础系统版本.
3.移除对外部 wget 的依赖.
4.新增 -port 参数, 可更改默认SSH端口.
5.更新 内置的网络参数计算 逻辑.
6.更新 grub 配置文件定位逻辑, 可支持任意引导grub的系统.
默认密码:Vicer

以下系统已通过测试(其他自测):
Debian: 9, 10, 11;
Ubuntu: 18.04, 20.04;
CentOS: 6.10;
以下平台已通过测试(其他自测):
Oracle、Do、Azure

示例安装Debian10和Debian11(512M内存推荐使用Debian10):

bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 11 -v 64 -p "自定义root密码" -port "自定义ssh端口"

手动测试Oracle甲骨文免费主机安装Debian11,成功通过。
默认root密码:MoeClub.org
以上脚本支持IPV6,但是实用性不是很广,buyvm和dmit无法使用,dmit安装debian10成功

wget --no-check-certificate -O AutoReinstall.sh https://git.io/AutoReinstall.sh && bash AutoReinstall.sh

手动测试商家buyvm通过,默认密码:Pwd@Linux
这个脚本IPV4没问题对IPV6支持不太好,可能会出现模块无法加载的问题,但是实用性很广,几乎支持所有IDC

开机改密:

#!/bin/bash
echo root:Vicer |sudo chpasswd root
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
sudo reboot

支持centos7、8

bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -c 7 -v 64 -a
bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -c 8 -v 64 -a

 

 

Virmach 可用DD脚本 实测成功 Debian 10

wget -N --no-check-certificate https://down.vpsaff.net/linux/dd/network-reinstall-os.sh && \
chmod +x network-reinstall-os.sh && ./network-reinstall-os.sh

注意事项:
由于CentOS 7以上改变了安装机制,需要2G或更多内存才能完成网络重装;
CentOS 7和8 DD方式来自第三方,本站不作任何保证,好处就是不受VPS内存大小限制;
重装系统需要比较长的时间,请耐心等待,如果服务商有提供VNC可以查看全过程。
默认账户名为:root,密码为:IdcOffer.com
脚本来源:https://www.idcoffer.com/archives/7536

功能强大的linux系统一键DD重装脚本

一、Linux reinstall下载

网站:

    1. https://github.com/leitbogioro/Tools

脚本下载:
wget –no-check-certificate -qO InstallNET.sh ‘https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh’ && chmod a+x InstallNET.sh

默认密码是:LeitboGi0ro

相关说明:
支持各大云商,特别支持Oracle ARM机
支持 raid 0,仅限 Debian,要使用 raid 0 请添加 -raid “0”参数。单硬盘请不要添加此参数。有效性尚待测试。
DD Windows 方法和原版萌咖功能一样,该怎么用就怎么用,如果 DD 包无后缀名,默认使用 gz 解压方式,支持 xz 结尾的压缩包,如果要解压 xz 压缩包请添加参数 -filetype “xz”。
支持 RedHat 系新系统,包括 CentOS 9 Stream,RockyLinux 8+,AlmaLinux 8+,Fedora 34+,也支持从 OracleLinux/VzLinux 装到脚本支持的系统。
Debian 9+ 支持 xfs,这也是 Redhat 系默认的文件系统,抛弃老旧的默认 ext2。
如果要指定其他参数,比如镜像地址,系统后面必须带上版本,比如:-debian 11,不然会出错。
默认采用 DHCP 配置网络,如果确认是静态地址,请附带 –dhcp-static 参数,不过脚本仍然会自动检测,如果是 DHCP,还会改回来。
由于 RedHat 7 以后默认采用 firewalld 做防火墙,防火墙不放行的端口都用不了,所以通过强改 firewalld 配置文件来对 RedHat 系列的系统自定 s-s-h 端口号进行支持。此前旧版本仅支持 22 端口,不支持自定。
脚本对当前与运行系统的硬件架构作了判断和对要装的系统硬件架构名称做了自动转换,并且 -v 参数已经被废弃,用 -version 替代,如果不懂,不要再使用这个参数
国内机器不用指定安装源,脚本自动监测并切换到国内源。

注意事项:
脚本完善了对 grub2 的处理,使 Debian 和 Redhat 系可以无限互装而不受影响,萌咖的脚本只支持处理 grub1,这就导致从 Debian 系装到 Redhat 系,grub1 变成了 grub2,导致从 Redhat 系没法再装回 Debian 系。
AMD64 legacy boot 和 AMD64 UEFI boot 以及 ARM64 UEFI boot 的启动项处理参数完全不同,处理错了就是坑,能解决好才是支持主流各 CPU 架构和主板固件启动的基础。
已进行了大量测试,确认 Oracle 机器上跑没问题。
为什么 Debian IPv6 为什么没配置正确(双栈机)?检查一下你原系统是不是 /etc/default/grub 文件里是不是 GRUB_CMDLINE_LINUX=”” 里面带 net.ifnames=0 biosdevname=0 参数?如果带,系统网卡名称会统一变成 eth0 eth1 eth2 这种的,这样会干扰新系统里写入网络配置。有能力的自己在原系统里把相关配置清掉,确保网卡显示的是真实物理网卡的名称,而不是被系统重定向过的,脚本获取手段就是这个,你原系统配置不对,不要怪脚本怎么没在新系统内写入正确的。
多网卡,多ip请进新系统内手工配置,单网卡双栈机自动配置 ipv6 仅限 debian
由于 CentOS 6 的 grub1 脚本语法和其他系统 grub1 grub2 的完全不同,所以不再对装回 CentOS 6 和将 CentOS 6 重装成别的系统的支持。
Redhat 8 要求 2.5GB 内存,Redhat 9 要求 2GB 内存。

二、Linux reinstall使用
先安装依赖:

Debian series(Debian / Ubuntu):
apt update -y
apt install wget -y

Redhat series(CentOS / AlmaLinux / RockyLinux / OracleLinux / Fedora / VzLinux):
yum update –allowerasing -y
yum install wget -y
快速安装系统:

Debian 11系统

bash InstallNET.sh -debian
CentOS 9 stream系统

bash InstallNET.sh -centos
AlmaLinux 9系统

bash InstallNET.sh -almalinux
RockyLinux 9系统

bash InstallNET.sh -rockylinux
Fedora 37系统

bash InstallNET.sh -fedora
Ubuntu 20.04系统

bash InstallNET.sh –ubuntu

三、Linux reinstall参数

Linux reinstall详细的使用示例如下:
bash InstallNET.sh -debian/ubuntu/centos/almalinux/rockylinux/fedora(os type) 11(os version) -version 64(os bit) -port “your server port” -pwd “your server password” -mirror “a valid url for linux image source” -dd/–image “dd image url” -filetype “gz or xz” -timezone “like Asia/Tokyo etc” –dhcp-static/–ip-addr ‘x.x.x.x'(ip address) –ip-mask ‘x.x.x.x'(subnet mask) –ip-gate ‘x.x.x.x'(gateway) -firmware(Debian with hardware drivers)

如果你想安装指定操作系统,请修改为以下的参数:

-debian 9/10/11 : Debian 9 and later

-centos 7/8/9-stream: CentOS 7 and later

-almalinux/alma 8/9: AlmaLinux 8 and later

-rockylinux/rocky 8/9: RockyLinux 8 and later

-fedora 34/35/36/37: Fedora 34 and later

-ubuntu 16.04/18.04/20.04: Ubuntu from 16.04 to 20.04

指定操作系统源:-mirror “a valid DIST mirror url”。有如下官方可供选择:

For Debian, official recommend mirror lists are here:

https://www.debian.org/mirror/list.html
For CentOS, official recommend mirror lists are here:

https://www.centos.org/download/mirrors/
For AlmaLinux, official recommend mirror lists are here:

https://mirrors.almalinux.org/
For RockyLinux, official recommend mirror lists are here:

https://mirrors.rockylinux.org/mirrormanager/mirrors
For Fedora, official recommend mirror lists are here:

https://admin.fedoraproject.org/mirrormanager/mirrors/Fedora
For Ubuntu, official recommend mirror lists are here:

https://launchpad.net/ubuntu/+cdmirrors
指定端口:

-port “”: you can pre-specify s-s-h port of system, range is 1~65535, both Redhat series or Debian series could be supported, 默认端口是’22’.

指定密码:

-pwd “”: you can pre-specify ssh password of system, both Redhat series or Debian series could be supported, 默认密码是’LeitboGi0ro’.

DD系统模式:

-dd/–image “DD image from a valid url”: This parameter is for DD mode in KVM or XEN virtualization platform, current os must be Debian series, for example, if you want to DD windows,。

-filetype “gz/xz”: To determine DD file type, not only “.gz”(default) but also “.xz” can be supported.

指定时区:

-timezone “like Asia/Tokyo etc”.

支持 raid 0,仅限 Debian:

-raid “0”: Only for raid 0 disk partition, if your machine has only one hard drive, don’t assign it!

以安装Debian 11示例如下(默认密码是:LeitboGi0ro):

bash InstallNET.sh -debian 11 -mirror “http://ftp.riken.jp/Linux/debian/debian/”

四、安装Windows系统
脚本并不提供任何Windows系统,你需要自己在网上找一些自己被DD好的Windows系统了。

用法示例:

如果是 KVM or XEN virtualization, Debian series only:

bash InstallNET.sh -dd “DD image download URL”
如果是 physical hardware, Intel network adapter, kimsufi etc:

Change netboot to rescue mode, receive mail, get temporary username and password, log into linux, execute:

wget -O- “DD download URL” | xzcat | dd of=/dev/sda
网上免费的 Windows DD images可以在这里找到:

Windows Server series from TeddySun(https://teddysun.com/):

Username: Administrator
Password: Teddysun.com

Windows Server 2022 Datacenter

Chinese: https://dl.lamp.sh/vhd/zh-cn_win2022.xz
English: https://dl.lamp.sh/vhd/en-us_win2022.xz
Japanese: https://dl.lamp.sh/vhd/ja-jp_win2022.xz

Windows Server 2019 Datacenter

Chinese: https://dl.lamp.sh/vhd/cn_win2019.xz
English: https://dl.lamp.sh/vhd/en_win2019.xz
Japanese: https://dl.lamp.sh/vhd/ja_win2019.xz

Windows Server 2012 R2 Datacenter

Chinese: https://dl.lamp.sh/vhd/cn_win2012r2.xz
English: https://dl.lamp.sh/vhd/en_win2012r2.xz
Japanese: https://dl.lamp.sh/vhd/ja_win2012r2.xz

Linux设置IPv4优先,IPv6靠后解析(包含关闭IPv6)

默认的安装中,IPv4 和 IPV6 并存,并且 IPv6 优先于 IPv4。

如果不需要彻底关闭 IPv6,也可以设置让 IPv4 优先于 IPv6。

配置方式如下:
第一种方法:

echo "precedence ::ffff:0:0/96 100" >>/etc/gai.conf 

第二种方法:

vim  /etc/gai.conf 

#precedence ::ffff:0:0/96 100
去掉这一行前面的#号

保存即可生效。

测试:

ping www.google.com -c 3 

测试下来平均可以减少10ms所有的访问时间。

或者
关闭IPv6:

echo -e "net.ipv6.conf.all.disable_ipv6=1\nnet.ipv6.conf.default.disable_ipv6=1\nnet.ipv6.conf.lo.disable_ipv6=1" >> /etc/sysctl.conf
sysctl -p