海运的博客

debian12下initramfs-tools配置ip子网掩码255.255.255.255/32失败解决

发布时间:February 22, 2025 // 分类: // No Comments

先禁用自带的网络配置:

sed -i -e '/configure_networking\(\)/{n; a\' -e 'return 0' -e '}' /usr/share/initramfs-tools/scripts/functions

自定义配置ip脚本:

cat << EOF > /usr/share/initramfs-tools/scripts/init-premount/00-network
#!/bin/sh
PREREQ=""

prereqs() {
    echo "$PREREQ"
}

case "$1" in
    prereqs)
        prereqs
        exit 0
        ;;
esac

interface=$1
addr=$2
gateway=$3
netmask=$4
echo 'set ip'
ip link set $interface down
ip addr flush dev $interface
ip addr add $addr/$netmask dev $interface
ip link set $interface up
ip route add $gateway dev $interface
ip route add default via $gateway dev $interface

exit 0
EOF
chmod +x /usr/share/initramfs-tools/scripts/init-premount/00-network

重新生成initramfs:

update-initramfs -u -k all

iPhone查看屏幕供应商

发布时间:February 19, 2025 // 分类: // No Comments

通过系统生成Sysdiagnose报告日志查找屏幕代码,无需使用第三方软件,生成报告有下面2种方法:
1.同时按住音量加减键和电源键1到1.5秒,同时会有震动反馈
2.使用辅助功能触控,添加自定操作,如轻点两下启动分析

等待几分钟去隐私与安全性->分析与改进->分析数据处找到sysdiagnose开头的文件保存到文件,去文件管理打开压缩包找到ioreg->IODeviceTree文件,用文本打开查找raw-panel-serial-number值开头的3个字母就是厂商代码。

https://it-training.apple.com/tutorials/support/sup075/

光猫拨号ImmortalWrt/OpenWRT路由获取ipv6遇到的问题

发布时间:August 25, 2024 // 分类: // 1 Comment

光猫提供/60,二级路由有足够的子网分配,当光猫pppoe重新拨号后openwrt wan ipv6更新正常,但是ipv6前缀不能正常更新,需重启odhcp6才正常。
也有人遇到同样问题:https://github.com/openwrt/odhcp6c/issues/61

退而使用nat6,但是同样遇到问题,每次光猫pppoe重新拨号后wan ipv6过段时间会中断几分钟。

禁用wan6接口不使用odhcp6管理ipv6,使用linux内核管理ipv6才算正常。

uci set network.wan6.disabled="1"
uci commit network
sysctl -w net.ipv6.conf.eth1.accept_ra=2
sysctl -w net.ipv6.conf.default.accept_ra=2
sysctl -w net.ipv6.conf.all.accept_ra=2

php-fpm错误error_log日志配置

发布时间:May 26, 2024 // 分类: // No Comments

配置文件/etc/php/8.2/fpm/php.ini

#配置是否记录脚本错误日志
log_errors = On
#phpf-pm用户可写,如无配置此项或不可写会nginx error log记录错误信息
error_log = /var/log/php/php_errors.log
#是否在web界面显示错误信息
display_errors = Off

配置文件/etc/php/8.2/fpm/php-fpm.conf:

#只记录php-fpm进程运行日志
error_log = /var/log/php8.2-fpm.log
#同时也保存php脚本错误日志,同上
catch_workers_output = yes

配置文件/etc/php/8.2/fpm/pool.d/www.conf,不同的服务配置不同的日志文件,优先级高于php.ini。

#同php.ini内参数
php_flag[display_errors] = on
php_admin_value[error_log] = /var/log/php/www_error.log
php_admin_flag[log_errors] = off

有的程序内部错误php error_log不显示,如typecho插件有问题500 server error,需开启debug查看原因:

define('__TYPECHO_DEBUG__', true);

参考:
https://www.hawu.me/operation/2196

debian-12/bookworm安装mariadb10.3和mysql5.6

发布时间:May 26, 2024 // 分类: // No Comments

debian-12自带的mariadb10.11不太好用,通过下载debian-10的mariadb deb安装包可直接安装,没发现兼容性问题。

wget http://security.debian.org/debian-security/pool/updates/main/m/mariadb-10.3/mariadb-server_10.3.39-0+deb10u2_all.deb
wget http://security.debian.org/debian-security/pool/updates/main/m/mariadb-10.3/mariadb-server-10.3_10.3.39-0+deb10u2_amd64.deb
wget http://security.debian.org/debian-security/pool/updates/main/m/mariadb-10.3/mariadb-server-core-10.3_10.3.39-0+deb10u2_amd64.deb
wget http://security.debian.org/debian-security/pool/updates/main/m/mariadb-10.3/mariadb-client-core-10.3_10.3.39-0+deb10u2_amd64.deb
wget http://security.debian.org/debian-security/pool/updates/main/m/mariadb-10.3/mariadb-client-10.3_10.3.39-0+deb10u2_amd64.deb
wget http://security.debian.org/debian-security/pool/updates/main/m/mariadb-10.3/mariadb-common_10.3.39-0+deb10u2_all.deb
wget http://http.us.debian.org/debian/pool/main/r/readline5/libreadline5_5.2+dfsg-3+b13_amd64.deb

apt install ./libreadline*.deb ./mariadb-*.deb
apt-mark hold libreadline5 mariadb-client-10.3 mariadb-client-core-10.3 mariadb-server-10.3 mariadb-server-core-10.3 mariadb-server mariadb-common

如需安装mysql 5.x也可直接下载deb安装:

wget https://downloads.mysql.com/archives/get/p/23/file/mysql-server_5.6.51-1debian9_amd64.deb-bundle.tar
tar xf mysql-server_5.6.51-1debian9_amd64.deb-bundle.tar 
apt install ./mysql-common_5.6.51-1debian9_amd64.deb ./libmysqlclient18_5.6.51-1debian9_amd64.deb ./mysql-community-client_5.6.51-1debian9_amd64.deb ./mysql-client_5.6.51-1debian9_amd64.deb ./mysql-community-server_5.6.51-1debian9_amd64.deb ./mysql-server_5.6.51-1debian9_amd64.deb
apt-mark hold mysql-common mysql-community-client mysql-client mysql-community-server mysql-server

https://packages.debian.org/buster/mariadb-server
https://blog.iks.moe/archives/Debian-10-Buster-Package-Install-MySQL-56.html
https://downloads.mysql.com/archives/community/
https://archive.mariadb.org/

分类
最新文章
最近回复
  • 海运: 可能版本问题
  • 海运: 如果运营商限制型号
  • 海运: 没有
  • Mruru: 烽火猫切换rootfs的方法有么大佬?
  • nono: 修改光猫型号是做啥子用的
  • 960: root账号默认密码hg2x0 不对哇
  • rer: 感谢分享!~
  • opnfense: 谢谢博主!!!解决问题了!!!我之前一直以为内置的odhcp6就是唯一管理ipv6的方式
  • liyk: 这个方法获取的IPv6大概20分钟之后就会失效,默认路由先消失,然后Global IPV6再消失
  • 海运: 不好意思,没有。
归档