centos/AlmaLinux/RockLinux 9安装php缺libzip oniguruma扩展包解决办法

最近安装php发现编译失败, 搜索一圈后发现软件包仓库改crb去了,稍微改一下脚本判断就解决了.

sed -i  's/enabled=0/enabled=1/g' /etc/yum.repos.d/*-{crb,plus}.repo

 如果不想改repo配置,则安装的时候启用一下crb源.

 dnf  -y --enablerepo=crb install  libzip-devel oniguruma-devel rrdtool-devel

https://mirror.stream.centos.org/9-stream/CRB/x86_64/os/Packages/

 

另外libc-client-devel的包暂时也没找到, 用remi的源安装uw-imap-devel替代解决了.

dnf install -y http://rpms.remirepo.net/enterprise/remi-release-9.rpm
dnf -y --enablerepo=remi install uw-imap-devel

powerdns用pdnsutil 添加记录

IP="168.192.in-addr.arpa
10.10.in-addr.arpa
"; 
for list  in $IP
do 
pdnsutil create-zone $list ns1.server.com
pdnsutil add-record $list @ NS ns2.server.com
pdnsutil replace-rrset $list . SOA 'ns1.server.com. ns2.server.com. 0 10800 3600 604800 3600'
pdnsutil increase-serial $list
done


for i in {0..255}; do 
    for o in {0..255}; do 
        pdnsutil add-record 168.192.in-addr.arpa $o.$i PTR test.example.com
        done;
done; 

whmcs Error: Call to a member function isEnabled() on null in

whmcs自定义模版调用login.tpl模版报错

Error: Error: Call to a member function getButtonClass() on null in

Error: Error: Call to a member function isEnabled() on null in

 

主要问题在$captcha上, {if $captcha->isEnabled()} 和{$captcha->getButtonClass($captchaForm)}

自定义php文件里面引入一下Captcha()类就解决了.

    $smartyvalues["captcha"] = new WHMCS\Utility\Captcha();

TimeMachine直连备份samba

官方指引:https://wiki.samba.org/index.php/Configure_Samba_to_Work_Better_with_Mac_OS_X

smb.conf配置后TimeMachine直接可以备份数据.

[Global]
vfs objects = fruit streams_xattr  
fruit:metadata = stream
fruit:model = MacSamba
fruit:posix_rename = yes 
fruit:veto_appledouble = no
fruit:nfs_aces = no
fruit:wipe_intentionally_left_blank_rfork = yes 
fruit:delete_empty_adfiles = yes 

[TimeMachineBackup]
fruit:time machine = yes
#  fruit:time machine max size = SIZE

 

不用再设置什么虚拟磁盘进行挂载了, 当airport一样用.

 

 

常用looking-glass记录

https://lg.he.net/
https://lg.sgix.sg
https://www.cogentco.com/en/looking-glass
https://www.cmi.chinamobile.com/en/looking-glass
https://lg.ibeo.hgc-intl.com/
https://lg.ix.br/
https://lg.ntt.lt/
https://www.gin.ntt.net/looking-glass-landing/
https://lookingglass.consoleconnect.com/
https://lookingglass.centurylink.com/
http://lg.level3carrier.com/lg/lg.cgi
https://lg.telia.net/
https://lg.twelve99.net/
https://ipms.chinatelecomglobal.com/public/lookglass/lookglassDisclaimer.html?lang=zh_CN
https://stixlg.singtel.com/dashboard

https://lg.globalsecurelayer.com/

raid5/6劝退

个人经验

1.RAID5/6 如同泡水的卫生纸, 出了问题的时候碎得渣, 很难救.

2.仅次于比RAID0安全一点点,安全性低于RAID1

3. RAID5/6掉盘或者迁移主机, 恢复慢导入硬盘慢容易崩.

4.RAID50 RAID60 没用过不评价.

最后总结: 一块盘或者一块以上, 数据无所谓要空间和速度组RAID0就无所谓;

两块盘要安全首选RAID1, 低成本安全储存方案;

只有三块硬盘的时候建议追加一块, 跨入最低门槛用四块硬盘直接组RAID10, 兼顾安全和速度以及一半硬盘的容量,

换阵列卡或者迁移到其他机箱, 导入快rebuild同步快, 掉了一块盘即使跑半年也不用担心坏.

 

hyperglass

https://hyperglass.dev/docs/getting-started

stripe微信付款接口

#composer require stripe/stripe-php

<?php
require_once('vendor/autoload.php');
Stripe\Stripe::setApiKey('sk_test_51zX1hSDCA8Q8MfjPdZLR7oFRlQeJQ1z1W1SoguoffuZbu2WfHyliWa3BAXie3ma45UAgIkQ369cR4bnRNSCh2e6200nbfrbxQb');

$source =  Stripe\Source::create(["type" => "wechat", "amount" => 20000,'currency' => 'usd', "metadata" => ["invoice_id" => 'test'],  'redirect'=> [ 'return_url'=>'https://www.xxx.host/callback.php?id=260040&amount=8120&currency=cny'  ]    ]);

?>

 

返回二维码连接

     [status] => pending
    [type] => wechat
    [usage] => single_use  
    [wechat] => Stripe\StripeObject Object
        (
            [qr_code_url] => https://stripe.com/sources/test_source?client_secret=src_client_secret_B6l7vfg6XqH7nXPRlFsAEj6r&source=src_1MKdUyDCAxQ8MBjPec73jd1Z
        )

超微和AMI的IPMI web端进行远程操作开关电源的一些数据

首先是超微的一些资料

超微现成的车轮https://github.com/serverzone/Supermicro-ipmi/

获取登陆信息的数据

SESSION_ID=$(curl -s "http://${IPMI_HOST}/cgi/login.cgi" --data "name=${IPMI_USER}&pwd=${IPMI_PASS}" -i | awk '/SID=[^;]/ { print $2 }')
TOKEN=`curl -s "https://${IPMI_HOST}/cgi/url_redirect.cgi?url_name=sys_info" -H "Cookie: ${SESSION_ID}" --insecure |grep CSRF_TOKEN  |  cut -d\" -f 4`

#rest bmc
curl "https://${IPMI_HOST}/cgi/BMCReset.cgi?time_stamp=Thu%20Sep%2011%202014%2017%3A07%3A02%20GMT-0500%20(CDT)&_="  -H "CSRF_TOKEN:$TOKEN;"    -H "Cookie: ${SESSION_ID}" --insecure  -I


#电源操作
curl "http://${IPMI_HOST}/cgi/ipmi.cgi" -H "CSRF_TOKEN: $TOKEN" -H "Cookie: $SESSION_ID" -H "Referer: http://${IPMI_HOST}/cgi/url_redirect.cgi?url_name=man_chassis" --data 'GET_POWER_INFO.XML=(0%2C0)' --insecure

#必须要带TOKEN 带 Referer url_name=man_chassis才能操作电源

 

操作电源选项接口信息 (抓取地址https://xxxxx.xxxx.xxx/cgi/url_redirect.cgi?url_name=man_chassis)

          url    = '../cgi/ipmi.cgi';
            pars   = '?SET_POWER_INFO.XML=(1,0)&time_stamp=' + (new Date ());

电源状态判断 currentPwrStatus == 0  status Power Off 

 

阅读剩余部分...

Fedora, RHEL, CentOS, AlmaLinux, Rocky Linux DNF更新慢解决方法

cat>> /etc/dnf/dnf.conf<<EOF
max_parallel_downloads=10
fastestmirror=True
EOF

xenserver磁盘xva转raw

官方下载没了http://datahack.se/datastore/xvatool/xvatool-1.1.tar.gz ,只能从github上克隆.

 原文出处https://docs.onapp.com/mg/migration-from-xenserver

yum install make git gcc
git clone  https://github.com/mindo/xvatool
cd xvatool
cmake .
make
make install

安装后就可以解压tar后开始合并文件变成raw了.

cd /tmp
mkdir /tmp/VM1
tar -xf vm1.xva -C  /tmp/VM1
chmod -R 755 VM1
xvatool -p disk-export VM1/Ref\:X/ disk.raw 

frpc指定出口IP

由于frp客户端没有指定出口网卡或者ip设置

只能临时解决方案

useradd -s /sbin/nologin  frp
IP=出口IP
UserID=`id -u  frp`
iptables -t mangle -A OUTPUT -m owner --uid-owner $UserID -j MARK --set-mark $UserID
iptables -t nat -A POSTROUTING -m mark --mark $UserID -j SNAT --to-source $IP

用iptables绑定uid指定出口IP

 

#这里假设frpc配置文件名为xxbb.ini
sed -i 's/User=nobody/User=frp/g'    /usr/lib/systemd/system/[email protected]
 systemctl daemon-reload
 systemctl enable [email protected]
 systemctl restart [email protected]

 

重启后ps aux|grep frp 查看进程启动用户是frp就成功了

ipxe安装系统踩坑笔记

时间久了怕记不住, 还得写文本

 

esxi的 boot.cfg要把/斜杠剔除掉, 才能ipxe安装

xenserver安装引导内核没有dns参数, ipxe的源地址只能ip地址不能用域名.

或者xenserver版本信息在iso目录下的 .treeinfo 文件里面

# cat .treeinfo
[platform]
name = XCP
version = 2.4.0

[branding]
name = XenServer
version = 7.3.0

[build]
number = release/inverness/master/15

[keys]
key1 = RPM-GPG-KEY-XS-7-LCM
key2 = RPM-GPG-KEY-XS-7
key3 = RPM-GPG-KEY-Platform-V1

 

windows识别iso需要wimtools

命令

#wiminfo  sources/install.wim  | grep -vE "Boot|Description"|grep -A2 "Index:"|awk -F: '{print $2 }'|sed 's/[\t ]\+/ /g'

 

 

Juniper EX交换机配置实例

转载自:https://www.cnblogs.com/chenfuhai/p/14683296.html

阅读剩余部分...

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