debian/ubuntu通过grub启动ipxe.iso

apt install grub-imageboot

官方版和netboot版本或者是其他自己的版本都可以自己选址.
mkdir /boot/images
wget http://boot.ipxe.org/ipxe.iso -O /boot/images/ipxe.iso
#wget https://boot.netboot.xyz/ipxe/netboot.xyz.iso -O   /boot/images/ipxe.iso

# Update GRUB menu to include this ISO
update-grub2
reboot

Centos8通过grub启动ipxe

#下载内核映像
wget -q  http://boot.ipxe.org/ipxe.lkrn -O /boot/ipxe.lkrn

#运行shell脚本
cat>/boot/boot.ipxe<<EOF
shell
EOF

#或者是netboot.xyz, 也可以通过chain --autofree启动自己的脚本地址
cat>/boot/boot.ipxe<<EOF
#!ipxe
cpuid --ext 29 && set arch x86_64 || set arch i686
ifopen
show mac
route
set net0/ip <ip>
set net0/netmask <netmask>
set net0/gateway <gateway>
set dns 1.1.1.1
isset ${ip} || dhcp || config
chain --autofree https://boot.netboot.xyz
EOF

#写入grub自定义脚本,此处的${SUBVOL}定义,是如果/boot是独立分区则需要移除,/boot是直接存放在根分区的情况需要带上.
echo '
if [ `grep -c  /boot /etc/fstab ` -ne 1 ];then SUBVOL="/boot";else SUBVOL='';fi
cat <<EOF
menuentry "iPXE boot" {
    linux16 ${SUBVOL}/ipxe.lkrn
    initrd16  ${SUBVOL}/boot.ipxe
}
EOF' >/etc/grub.d/custom.cfg
chmod 755 /etc/grub.d/custom.cfg

# 更新grub配置
. /etc/os-release
case ${ID} in
  centos|fedora)
    grub2-mkconfig -o /boot/grub2/grub.cfg
  ;;
  debian|ubuntu)
    update-grub
  ;;
  *)
    echo "Distribution not supported. Please upgrade grub configuration manually"
esac

#sed -i 's/GRUB_DEFAULT=.*/GRUB_DEFAULT="iPXE boot"/' /etc/default/grub
grub2-set-default "iPXE boot"
grub2-editenv list

 

参考文章https://www.haiyun.me/archives/1246.html

Windows11初始化安装修改注册表方案

阅读剩余部分...

WINDOWS11 KMS激活

slmgr -ipk W269N-WFGWX-YVC9B-4J6C9-T83GX
slmgr -skms kms.0t.net.cn
slmgr -ato

next-terminal堡垒机原生安装

官方原文https://next-terminal.typesafe.cn/docs/install/native-install.html

整理后可以直接安装, 不用那么费事.

大量管理ssh或者rdp的时候, 中心化管理比较方便.

#安装各种需要的工具包
yum install -y epel-release
yum install -y tcpdump net-tools  vim mtr git tar
yum install -y libguac-client-kubernetes libguac-client-rdp libguac-client-ssh  libguac-client-telnet libguac-client-vnc guacd fontconfig mkfontscale
#下载已编译好的最新版本
wget https://github.com/dushixiang/next-terminal/releases/latest/download/next-terminal.tar.gz -O -| tar xz -C /usr/local/;

#更新所需要的字体
cd  /usr/share/fonts/
wget https://gitee.com/dushixiang/next-terminal/raw/master/guacd/fonts/{Menlo-Regular.ttf,SourceHanSansCN-Regular.otf}
wget -c https://github.com/dushixiang/next-terminal/raw/master/guacd/fonts/{Menlo-Regular.ttf,SourceHanSansCN-Regular.otf}
mkfontscale
mkfontdir
fc-cache

mkdir /etc/guacamole/ 
cat>/etc/guacamole/guacd.conf<<EOF
[daemon]
pid_file = /var/run/guacd.pid
log_level = info
[server]
# 监听地址
bind_host = 127.0.0.1
bind_port = 4822
EOF
sed -i 's/User=/#User=/g'  /usr/lib/systemd/system/guacd.service
sed -i 's/Group=/#Group=/g'  /usr/lib/systemd/system/guacd.service

cat>/usr/local/next-terminal/config.yml<<EOF
db: sqlite
# 当db为sqlite时mysql的配置无效
#mysql:
#  hostname: 172.16.101.32
#  port: 3306
#  username: root
#  password: mysql
#  database: next-terminal

# 当db为mysql时sqlite的配置无效
sqlite:
  file: 'next-terminal.db'
server:
  addr: 0.0.0.0:8088
# 当设置下面两个参数时会自动开启https模式(前提是证书文件存在)
#  cert: /root/next-terminal/cert.pem
#  key: /root/next-terminal/key.pem

# 授权凭证和资产的密码,密钥等敏感信息加密的key,默认`next-terminal`
#encryption-key: next-terminal
guacd:
  hostname: 127.0.0.1
  port: 4822
  # 此路径需要为绝对路径,并且next-terminal和guacd都能访问到
  recording: '/usr/local/next-terminal/data/recording'
  # 此路径需要为绝对路径,并且next-terminal和guacd都能访问到
  drive: '/usr/local/next-terminal/data/drive'

sshd:
  # 是否开启sshd服务
  enable: false
  # sshd 监听地址,未开启sshd服务时此配置不会使用
  addr: 0.0.0.0:8089
  # sshd 使用的私钥地址,未开启sshd服务时此配置不会使用
  key: ~/.ssh/id_rsa
EOF

cat>/etc/systemd/system/next-terminal.service<<EOF 
[Unit]
Description=next-terminal service
After=network.target

[Service]
User=root
WorkingDirectory=/usr/local/next-terminal
ExecStart=/usr/local/next-terminal/next-terminal
Restart=on-failure
LimitNOFILE=1048576

[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload # 重载服务
systemctl enable next-terminal # 开机启动
systemctl start next-terminal # 启动服务
systemctl enable guacd
systemctl start guacd
systemctl status guacd
systemctl status next-terminal # 查看状态
service firewalld stop  #自己根据情况开放端口或者关闭系统防火墙

关闭rpcbind服务

systemctl stop rpcbind
systemctl stop rpcbind.socket
systemctl disable rpcbind
systemctl disable rpcbind.socket 

Centos9使用nmcli创建隧道

原文:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/configuring-ip-tunnels_configuring-and-managing-networking

 

创建隧道, 模式ipip, 接口名tun0 , 附带参数可以加-- ip-tunnel.mtu 1500 ip-tunnel.ttl 255

nmcli connection add type ip-tunnel ip-tunnel.mode ipip con-name tun0 ifname tun0 remote 198.51.100.5 local 203.0.113.10
nmcli connection modify tun0 ipv4.addresses '10.0.1.1/30'    #给tun0设置互联IP
nmcli connection modify tun0 ipv4.method manual      #设置网口为手动
nmcli connection up tun0    #启用tun0隧道

B端设置一样,改变下互联IP.

 

nmcli connection modify tun0 +ipv4.routes "172.16.0.0/24 10.0.1.2"     #可以添加ip路由表

查看网口

nmcli connection

删除隧道

 nmcli conn del tun0

开启内核转发

echo "net.ipv4.ip_forward=1" >>/etc/sysctl.conf
sysctl -p

 

改成一键添加

 

addtun(){
nmcli connection add type ip-tunnel ip-tunnel.mode ipip con-name $1 ifname $1  remote $2 local $3 -- ip-tunnel.mtu 1500 ip-tunnel.ttl 255
nmcli connection modify $1 ipv4.addresses $4
nmcli connection modify $1 ipv4.method manual   
nmcli connection up $1
}

addtun 网卡名 远程ip   本地IP  内网IP 

 

国内各大高校开源镜像站


CCNIC镜像站 : https://mirrors.cnnic.cn/
中科院软件所智能软件研究中心开源镜像站:https://mirror.iscas.ac.cn/
清华大学:https://mirrors.tuna.tsinghua.edu.cn/
北京大学:https://mirrors.pku.edu.cn/
北京外国语大学:https://mirrors.bfsu.edu.cn/
北京理工大学:https://mirrors.bit.edu.cn/web/
北京交通大学:https://mirror.bjtu.edu.cn/
北京邮电大学开源软件镜像站:https://mirrors.bupt.edu.cn/
高能物理研究所:http://mirror.ihep.ac.cn/
浙江大学:http://mirrors.zju.edu.cn/
上海交通大学:https://mirrors.sjtug.sjtu.edu.cn/ https://mirror.sjtu.edu.cn/
中国科学技术大学:https://mirrors.ustc.edu.cn/
南方科技大学:https://mirrors.sustech.edu.cn/
华南农业大学:https://mirrors.scau.edu.cn/
山东大学:https://mirrors.sdu.edu.cn/
山东女子学院开源软件镜像站:  https://mirrors.sdwu.edu.cn/       
重庆大学:https://mirrors.cqu.edu.cn/
云南大学:https://mirrors.ynu.edu.cn/
南京大学:https://mirrors.nju.edu.cn/
同济大学:https://mirrors.tongji.edu.cn/
兰州大学:http://mirror.lzu.edu.cn/
东北大学:http://mirror.neu.edu.cn/
哈尔滨工业大学:http://mirrors.hit.edu.cn/#/home
西北农林科技大学:https://mirrors.nwafu.edu.cn/
重庆邮电大学:http://mirror.cqupt.edu.cn/
大连理工大学:http://mirror.dlut.edu.cn/
东莞理工学院:https://mirrors.dgut.edu.cn/
南阳理工学院:https://mirror.nyist.edu.cn/
大连东软信息学院:http://mirrors.neusoft.edu.cn/
华中科技大学开源镜像站 :  https://mirrors.hust.edu.cn/        
武昌首义学院:  https://mirrors.wsyu.edu.cn/     
校园网联合镜像站:https://mirrors.cernet.edu.cn/

juniper的一些基本命令

1 Transit 过境 juniper设备第一次进入console口必须配置密码
2 help reference 命令显示相关配置选项的完整列表以及特定于命令语句的其他几个详细信息
3 ctrl+b 将光标向左移动一个字符
4 ctrl+a 将光标移动到命令行的开头
5 ctrl+f 将光标向右移动一个字符
6 ctrl+e 将光标移动到命令行的末尾
7 delete/backspace 删除光标前的字符
8 ctrl+d 删除光标上的字符
9 ctrl+k 从光标删除到行尾
10 ctrl+u 删除所有字符并取消当前命令
11 ctrl+w 删除光标左侧的整个单词
12 ctrl+i 重绘当前行
13 ctrl+p/ctrl+n 分别在命令历史记录中重复上一个和下一个命令
14 Esc+d 删除右侧的单词
15 Esc+b 将光标移回一个没有删除的单词
16 Esc+f 将光标向前移动一个字
17 show | |显示过滤输出
18 compare(filename|rollback n) 仅在配置模式下使用show命令。将配置更改与其他配置文件进行比较。

阅读剩余部分...

sshd 无法启动 Could not load host key: /etc/ssh/ecdsa_key

ssh-keygen -t ecdsa  -f /etc/ssh/ssh_host_dsa_key 
ssh-keygen -t rsa  -f /etc/ssh/ssh_host_rsa_key 
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key
ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key
/usr/sbin/sshd

Centos安装wimtools

最近在折腾ipxe安装系统,iso里面获取系统的版本选择手动有点麻烦, 找了下wimlib实现dism的一些功能,

 记录一下wimtools源码安装记录.

fedora copr源安装

yum -y copr enable  nalika/wimtools
yum -y install wimtools 

 

官方网站https://wimlib.net/

安装前提需要准备好编译环境以及ntfs-3g-devel(自己想办法)

yum install fuse-devel git -y
git clone git://wimlib.net/wimlib
cd wimlib
./bootstrap
./configure

ln -s  /usr/local/bin/mkwinpeimg /usr/sbin/
ln -s  /usr/local/bin/wim* /usr/sbin/

 

安装好后在目录/usr/local/bin/下可以看到命令全部.

# ls /usr/local/bin/wim*
/usr/local/bin/wimappend   /usr/local/bin/wimextract     /usr/local/bin/wimoptimize
/usr/local/bin/wimapply    /usr/local/bin/wiminfo        /usr/local/bin/wimsplit
/usr/local/bin/wimcapture  /usr/local/bin/wimjoin        /usr/local/bin/wimunmount
/usr/local/bin/wimdelete   /usr/local/bin/wimlib-imagex  /usr/local/bin/wimupdate
/usr/local/bin/wimdir      /usr/local/bin/wimmount       /usr/local/bin/wimverify
/usr/local/bin/wimexport   /usr/local/bin/wimmountrw

阅读剩余部分...

推荐一个在线svg编辑器

地址https://boxy-svg.com/app

https://editor.method.ac/

转:PROXMOX VE 加入/退出集群的方法

加入集群的方法

主节点在PVE的WEB端配置好后,启用两步认证。

来到从节点,进入SSH,输入pvecm add 主机名(如果你的主机证书是自己修改过的,需要输入对应证书的地址,而不是内网IP,否则会证书验证失败无法链接)

提示输入密码,然后会提示输入二次验证token,然后就会自动加入到集群了。

退出集群的方法

进入主节点,输入 pvecm delnode 需要删除的节点名,清除该节点。

停止集群 输入systemctl stop pve-cluster.service

修改/etc/corosync/corosync.conf 删除对应节点

启动集群 systemctl start pve-cluster.service

进入要退出集群的节点的SSH,输入以下指令

systemctl stop pve-cluster.service
systemctl stop corosync.service
pmxcfs -l
rm /etc/pve/corosync.conf
rm -rf /etc/corosync/*
killall pmxcfs
systemctl start pve-cluster.service

即可完成退出。如果是主节点需要退出,应先清除其他子节点再执行上述命令删除

 

转自:https://sakurabakiyoka.com/2020/12/19/proxmox-ve-cluster/

转:Windows系统初始化工具Cloudbase-init

原文地址:https://foxi.buduanwang.vip/windows/1789.html/

在Windows实现初始化工具叫做cloudbase-init。

 

Proxmox VE对于Windows类型的虚拟机,提供了一个叫作configdrive2的元数据服务,务必先看下面链接,了解Proxmox VE在Cloudinit方面的实现。

佛西博客 - Proxmox VE与Cloud-init (buduanwang.vip)

在Windows客户机中安装好Cloudinit-base软件包之后,下次开机会从配置的元数据列表中,搜寻现有的元数据,在Proxmox VE 元数据服务就是configdrive2,因此,Cloudbase-init会读取cloudinit信息,从而自定义虚拟机。

目前PVE支持的元数据类型有User,Network。所以目前能办到的就是修改ip或者dns,新建用户,修改密码等基本功能。

一 修改PVE代码

看过上面的链接,你应该注意到,对于任何类型的os,PVE都会将用户密码进行加密,再写入到cloudinit驱动器中。

然而Windows就只识别明文密码。所以不修改代码,在用户创建这块就会存在问题。

这里有一个热爱ProxmoxVE的团队做出了一个修改代码的补丁,本文就是根据此方案,给大家分享。

GECO-IT-PUBLIC/Geco-Cloudbase-Init - Geco-Cloudbase-Init - Version Control System

安装git

apt update && apt install git -y

克隆库

 cd /opt/ && git clone https://git.geco-it.net/GECO-IT-PUBLIC/Geco-Cloudbase-Init/

PVE6和PVE7代码不一样,因此有2个补丁,先确认自己是哪个版本,在终端执行pveversion

 

阅读剩余部分...

WHMCS Payment gateway module for Stripe Alipay

WHMCS Payment gateway module for Stripe Alipay

roudiappstripealipay.tar.gz

 

checkout.js版本(银行卡付款)

stripe_checkout.php