Archive for 二月, 2023


一、安装打印服务及工具
pacman -S cups system-config-printer

二、启动打印服务
systemctl enable –now cups

三、安装DEB包转换工具
yay -S debtap

四、同步下各仓库信息
debtap -u

五、转换DEB包为ARCH可用的格式
debtap com.lanxum-ga30_1.0.0-21235_amd64.deb

六、安装GA3032dn驱动
pacman -U com.lanxum-ga30-1.0.0-1-x86_64.pkg.tar.zst

七、用system-config-printer添加网络打印机,或者http://localhost:631在administration页面添加

PS:立思辰A4激光黑白打印机GA3032dn驱动下载
https://www.cgprintech.com/product/348.html

@echo off

set /p KZM=请输入文件扩展名(以回车结束):
set /p XG=请输入要修改的文字(以回车结束):
set /p JG=请输入要改成的文字(若是删除则直接回车,以回车结束):

for /f “delims=” %%i in (‘dir /b /a-d “*.%KZM%”‘ ) do (
set tmp=%%i
setlocal EnableDelayedExpansion
set “tmp=!tmp:%XG%=%JG%!”
ren “%%i” “!tmp!”
endlocal
)

pause>nul

一、现象:
arch安装linux-lts和nvidia-lts后,若再次更新linux-lts则操作系统无法引导,启动引导在硬盘自检后卡住,只能进救援模式。卸载nvidia-lts驱动后,才能正常进入图形界面。

二、报错:
tail -f /var/log/Xorg.0.log
(EE) nvidia: failed to initialize the nvidia kernel module.
(EE) no devices detected
(EE) no screens foune(EE)

三、解决办法1:grub内核启动参数在KERNEL那一行的末尾加ibt=off。关闭CPU的安全特性Indirect Branch Tracking。

查看当前linux内核的启动参数:
cat /proc/cmdline

vi /etc/default/grub
# 将内核选项添加至 GRUB_CMDLINE_LINUX_DEFAULT 行
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash ibt=off”

然后重新生成 grub.cfg 文件:
grub-mkconfig -o /boot/grub/grub.cfg

四、解决办法2:安装nvidia-dkms驱动配合linux-lts更新,解决NV显卡驱动的问题。

@echo off
chcp 936 >nul 2>nul
sc config winmgmt start= auto >nul 2>nul
net start winmgmt >nul 2>nul
color 0a
echo 计算机名:
hostname
echo.
set URL=www.163.com
echo 电脑品牌是:
wmic csproduct get Vendor |findstr -v Vendor
echo 电脑型号是:
wmic csproduct get Name,version |findstr -v Name |findstr -v Version
echo 电脑序列号是:
rem wmic csproduct get IdentifyingNumber
wmic bios get serialnumber |findstr -v SerialNumber
echo CPU型号是:
wmic cpu get name |findstr -v Name
systeminfo | findstr -i 物理内存总量
echo.
echo 硬盘型号是:
wmic diskdrive get model |findstr -v Model
echo.
echo.
echo.
echo —===以下为网卡信息===—
rem for /f “tokens=4” %%a in (‘route print^|findstr 0.0.0.0.*0.0.0.0’) do (set IP=%%a)
for /f “tokens=16 delims= ” %%a in (‘ipconfig ^| find /i “IPv4″‘) do (set IP=%%a)
for /f “tokens=3” %%b in (‘route print^|findstr 0.0.0.0.*0.0.0.0’) do (set GW=%%b)
rem for /f “tokens=15 delims= ” %%b in (‘ipconfig /all ^| find /i “网关”‘) do (set GW=%%b)
for /f “tokens=15 delims= ” %%c in (‘ipconfig /all ^| find /i “掩码”‘) do (set SUB=%%c)
rem for /f “tokens=2 delims= ” %%c in (‘route print^|findstr /v 127.0.0.1^|findstr %IP%^|findstr /v 0.0.0.0^|findstr /v 240.0.0.0^|findstr /v 255.255.255.255’) do (set SUB=%%c)
for /f “tokens=15 delims= ” %%d in (‘ipconfig /all ^| find /i “dns”‘) do (set NS=%%d)
for /f “tokens=1 delims= ” %%e in (‘getmac /nh’) do (set MAC=%%e)
for /f “tokens=3* delims= ” %%f in (‘netsh interface show interface ^| findstr 已连接’) do (set card=%%g)
echo 接网线的网卡名是:
echo %card%
echo.
echo 局域网IP是:
echo %IP%
echo.
echo 网卡MAC是:
echo %MAC%
echo.
echo 子网掩码是:
echo %SUB%
echo.
echo 局域网网关是:
echo %GW%
echo.
rem echo 首选DNS是:
rem echo %NS%
echo 域名解析设置:
netsh interface ip show dnsservers|findstr “[0-9]*\.[0-9]*\.”
echo.
echo.
echo.
echo —===以下为网络连通性测试结果===—
echo.
ping %GW% -n 2 > nul
if %errorlevel% leq 0 (
echo 网关%GW%链接正常。
) else (
echo 网关%GW%访问异常,请检查IP和子网掩码或网关设置。
)
echo.
ping %URL% -n 2 > nul
if %errorlevel% leq 0 (
echo 网址%URL%访问正常。
) else (
echo 网址%URL%访问异常,请检查DNS设置。
)
echo.
echo.
echo.
echo 已检测完毕,按任意键关闭窗口。
pause>nul