我正在使用 suckless 的 st 简单终端。我在启动时使用 运行 picom picom --backend glx
,终端是透明的。我喜欢终端一直透明,直到我尝试使用 Neovim,我觉得在编辑文件时看到桌面会分散注意力。有没有什么方法可以仅在 Neovim 打开时禁用这种透明度?
我尝试过用谷歌搜索,但只能找到关闭整个窗口透明度的方法,但这没有帮助,因为它不仅在 Neovim 打开时将其关闭。
我正在使用 suckless 的 st 简单终端。我在启动时使用 运行 picom picom --backend glx
,终端是透明的。我喜欢终端一直透明,直到我尝试使用 Neovim,我觉得在编辑文件时看到桌面会分散注意力。有没有什么方法可以仅在 Neovim 打开时禁用这种透明度?
我尝试过用谷歌搜索,但只能找到关闭整个窗口透明度的方法,但这没有帮助,因为它不仅在 Neovim 打开时将其关闭。
在 Linux Ubuntu 上,当我在终端运行sudo su
或sudo su -
系统创建一个具有新控制的新会话时pts
,即
ubuntu@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy
ubuntu@ubuntu:~$
ubuntu@ubuntu:~$ uname -a
Linux ubuntu 5.15.0-124-generic #134-Ubuntu SMP Fri Sep 27 20:20:17 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
ubuntu@ubuntu:~$
ubuntu@ubuntu:~$ ps
PID TTY TIME CMD
143254 pts/0 00:00:00 bash
143302 pts/0 00:00:00 ps
ubuntu@ubuntu:~$
ubuntu@ubuntu:~$ sudo su -
root@ubuntu:~#
root@ubuntu:~# ps
PID TTY TIME CMD
143304 pts/1 00:00:00 sudo
143305 pts/1 00:00:00 su
143306 pts/1 00:00:00 bash
143316 pts/1 00:00:00 ps
root@ubuntu:~#
这是预期的行为吗?
根据评论中的要求:
$ ps
PID TTY TIME CMD
146202 pts/0 00:00:00 bash
146231 pts/0 00:00:00 ps
$ sudo -s
root@ubuntu:/home/ubuntu# ps
PID TTY TIME CMD
146233 pts/1 00:00:00 sudo
146234 pts/1 00:00:00 bash
146240 pts/1 00:00:00 ps
每月一次,我发现我的一台 RedHat 9 服务器重新启动(实际上它是 AlmaLinux 9,但由于它是 RH9 的克隆,因此这个问题最好在 RH9 的环境中解决)。我试图找出导致崩溃的原因,但没有创建核心转储文件!
我已经按照这篇文章中的说明进行操作,但我的系统上似乎没有任何内容,但是当我使用以下命令触发核心转储时:
睡眠 3 并杀死 -SEGV $!
没有核心转储文件!
我确认基本设置如下:
[root@myhost ~]# cat /proc/sys/kernel/core_pattern
|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h
[root@myhost ~]# ulimit -c
unlimited
我必须设置其他内容才能创建转储文件吗?我怀疑是我自己的应用程序(非打包)导致了这个问题……但即使在保存应用程序的目录中也没有核心文件。
====更新====
我修改了 /etc/coredump.conf 并设置了 storage=external (其他所有内容都注释掉了),然后重新启动并运行以下命令:
[root@myhost ~]# sleep 3 & kill -SEGV $!
[1] 3583
[root@myhost ~]#
[1]+ Segmentation fault (core dumped) sleep 3
[root@myhost ~]# coredumpctl --all
TIME PID UID GID SIG COREFILE EXE SIZE
Sat 2024-10-26 12:56:46 EDT 3583 0 0 SIGSEGV none /usr/bin/bash -
[root@myhost ~]# ll /var/lib/systemd/coredump/
total 0
因此仍然没有可见的核心转储文件(请注意上面的“无”)。系统日志显示:
Oct 26 13:06:41 ngcvls1 systemd[1]: Started Process Core Dump (PID 4459/UID 0).
Oct 26 13:06:41 ngcvls1 systemd-coredump[4460]: Resource limits disable core dumping for process 4458 (bash).
Oct 26 13:06:41 ngcvls1 systemd-coredump[4460]: Process 4458 (bash) of user 0 dumped core.
因此我从命令行运行:
ulimit -c unlimited
并重复段错误测试,然后创建了一个核心文件!但重启后它就消失了。(尽管我在 coredump.conf 中设置了 storage=external)。我需要核心转储才能在重启后继续存在,否则我就不知道我的系统崩溃的原因了。越来越近了!我想让 ulimit -c 永久存在,只是不知道把它放在哪里(不喜欢其他帖子建议把它放在 .bashrc 中)
我有一台运行 Raspberry OS 的 Raspberry Pi 4B(简称:RPi4B)Debian GNU/Linux 12 bookworm
,我已将其配置为满足我的特定需求(安装多个软件包并进行各种设置)。由于我花了大量时间来设置一切,所以我想创建此设置的映像。理想情况下,我想从此映像制作可启动的 microSD 卡(简称:SDCard),以便以后可以将其安装在多个 RPi4B 上。这也可以作为我的备份。请参阅下图以了解我的组件的概览。
请注意,我有另一张 SDCard、两个 USB 读卡器(简称:CardReader)和另一台Debian GNU/Linux 12 bookworm
安装了标准 Raspberry OS 的 RPi4B。我读到最好在也运行的 PC 上创建自定义映像Debian GNU/Linux 12 bookworm
。
我以前从来没有这样做过,所以
我会这样做:
sudo dd if=/dev/sdX of=/path/to/backup/image.img bs=4M status=progress
(/dev/sdX
用正确的设备替换)sudo dd if=/path/to/backup/image.img of=/dev/sdY bs=4M status=progress
替换)/dev/sdY
根据社区的反馈,我现在将采取以下方法:
sudo dd if=/dev/sdX of=/path/to/backup/image.img bs=1M status=progress
(/dev/sdX
用正确的设备替换)sudo dd if=/path/to/backup/image.img of=/dev/sdY bs=1M status=progress
替换)/dev/sdY
我正在尝试编写一个严格符合 POSIX 标准的 shell,但标准没有明确说明如何从字节转换为字符。它说使用,这进一步链接到charmap 文件LC_CTYPE
的概念,但没有任何地方说明这些 charmap 文件位于何处以及如何读取它们。说它们通常位于,但这对我来说还不够。此外,在我的 Linux 系统上,该目录中的文件是 gzip 编码的,我认为这可能不符合标准,但我没有在任何地方找到有关它的任何信息。man 5 charmap
/usr/share/i18n/charmaps
我认为一定有一些标准的 C 实用程序可以获取当前字符编码的详细信息(否则怎么会有人使用它?),但我在网络搜索中找不到任何此类信息。有和函数setlocale
,nl_langinfo
后者可以为您提供当前使用的字符编码的名称,但这对我解码它没有帮助。
或者我应该提前知道并实现所有这些?
我使用 格式化了我的硬盘mkfs.exfat -n "HDD" /dev/sda1
,但它在 macOS 上无法识别。如果我在 macOS 上执行此操作,则在 Linux 上可以读取,但我希望能够在 Linux 上格式化,而不依赖于 macOS 的分区。
我运行了paru -Syu
,然后运行sudo pacman -Syu
了几次,结果相同。我收到此错误:
Total Installed Size: 3034.55 MiB
Net Upgrade Size: 49.01 MiB
:: Proceed with installation? [Y/n]
(222/222) checking keys in keyring [------------------------------] 100%
(222/222) checking package integrity [------------------------------] 100%
:: File /var/cache/pacman/pkg/plasma5-themes-sweet-full-git-r390.48a9050-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (checksum)).
Do you want to delete it? [Y/n]
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded.
当被要求删除该文件时,我回答“是”,然后出现失败消息。
sudo pacman-key --refresh-keys
然后,我成功运行sudo pacman -Syyu
,但得到了相同的结果。
当我通过 cd 进入 时/var/cache/pacman/pkg/
,我发现了一些plasma5-themes-sweet-full-git-r3*
预期的内容,但最新的是r389
,没有 的痕迹r390
,没有部分下载,什么都没有。
出于沮丧,我尝试了sudo rm
所有这些文件,但它们都被删除了,但并没有解决任何问题。这有点愚蠢,但我认为这并没有什么害处。
我真的不知道如何处理它抱怨不存在的文件这一事实,也许需要重置一些缓存...任何帮助都将不胜感激,感谢您的时间。
SNMP 似乎没有注册直通配置指令,这是我的配置文件:
snmpd配置文件
###########################################################################
#
# snmpd.conf An example configuration file for configuring the Net-SNMP agent ('snmpd') See snmpd.conf(5) man
# page for details
#
###########################################################################
# SECTION: System Information Setup
#
# syslocation: The [typically physical] location of the system.
# Note that setting this value here means that when trying to
# perform an snmp SET operation to the sysLocation.0 variable will make
# the agent return the "notWritable" error code. IE, including
# this token in the snmpd.conf file will disable write access to
# the variable.
# arguments: location_string
sysLocation Sitting on the Dock of the Bay
sysContact Me <[email protected]>
# sysservices: The proper value for the sysServices object.
# arguments: sysservices_number
sysServices 72
###########################################################################
# SECTION: Agent Operating Mode
#
# This section defines how the agent will operate when it
# is running.
# master: Should the agent operate as a master agent or not.
# Currently, the only supported master agent type for this token
# is "agentx".
#
# arguments: (on|yes|agentx|all|off|no)
master agentx
# agentaddress: The IP address and port number that the agent will listen on.
# By default the agent listens to any and all traffic from any
# interface on the default SNMP port (161). This allows you to
# specify which address, interface, transport type and port(s) that you
# want the agent to listen on. Multiple definitions of this token
# are concatenated together (using ':'s).
# arguments: [transport:]port[@interface/address],...
agentaddress 161
###########################################################################
# SECTION: Access Control Setup
#
# This section defines who is allowed to talk to your running
# snmp agent.
# Views
# arguments viewname included [oid]
# system + hrSystem groups only
view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
# rocommunity: a SNMPv1/SNMPv2c read-only access community name
# arguments: community [default|hostname|network/bits] [oid | -V view]
# Read-only access to everyone to the systemonly view
rocommunity public
#rocommunity public default -V systemonly
#rocommunity6 public default -V systemonly
#rocommunity public localhost
#view all included .1.3.6.1.4.1
#extend .1.3.6.1.4.1.9999.1 checkcommand /bin/sh /home/pi/snmp/snmp-cpu-temp
# SNMPv3 doesn't use communities, but users with (optionally) an
# authentication and encryption string. This user needs to be created
# with what they can view with rouser/rwuser lines in this file.
#
# createUser username (MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224) authpassphrase [DES|AES] [privpassphrase]
# e.g.
# createuser authPrivUser SHA-512 myauthphrase AES myprivphrase
#
# This should be put into /var/lib/snmp/snmpd.conf
#
# rouser: a SNMPv3 read-only access username
# arguments: username [noauth|auth|priv [OID | -V VIEW [CONTEXT]]]
#rouser authPrivUser authpriv -V systemonly
#rouser authOnlyUser
#
# Process Monitoring
#
# At least one 'mountd' process
proc mountd
# No more than 4 'ntalkd' processes - 0 is OK
proc ntalkd 4
# At least one 'sendmail' process, but no more than 10
proc sendmail 10 1
# Walk the UCD-SNMP-MIB::prTable to see the resulting output
# Note that this table will be empty if there are no "proc" entries in the snmpd.conf file
#
# Disk Monitoring
#
# 10MBs required on root disk, 5% free on /var, 10% free on all other disks
disk / 10000
disk /var 5%
includeAllDisks 10%
# Walk the UCD-SNMP-MIB::dskTable to see the resulting output
# Note that this table will be empty if there are no "disk" entries in the snmpd.conf file
#
# System Load
#
# Unacceptable 1-, 5-, and 15-minute load averages
load 12 10 5
# Walk the UCD-SNMP-MIB::laTable to see the resulting output
# Note that this table *will* be populated, even without a "load" entry in the snmpd.conf file
###############################################################################
#
# ACTIVE MONITORING
#
# send SNMPv1 traps
trapsink localhost public
# send SNMPv2c traps
#trap2sink localhost public
# send SNMPv2c INFORMs
#informsink localhost public
# Note that you typically only want *one* of these three lines
# Uncommenting two (or all three) will result in multiple copies of each notification.
#
# Event MIB - automatically generate alerts
#
# Remember to activate the 'createUser' lines above
iquerySecName internalUser
rouser internalUser
# generate traps on UCD error conditions
#defaultMonitors yes
# generate traps on linkUp/Down
linkUpDownNotifications yes
###############################################################################
#
# EXTENDING THE AGENT
#
#
# Arbitrary extension commands
#
extend test1 /bin/echo Hello, world!
extend-sh test2 echo Hello, world! ; echo Hi there ; exit 35
pass .1.3.6.1.2.1.25.1.8 /bin/sh /home/pi/snmp/snmp-cpu-temp
# include a all *.conf files in a directory
includeDir /etc/snmp/snmpd.conf.d
/etc/snmp/snmpd.conf.d
是空的,我已经重新启动了snmpd服务。
$ snmpget -v 2c localhost -c public .1.3.6.1.2.1.25.1.8
iso.3.6.1.2.1.25.1.8 = No Such Instance currently exists at this OID
$ sh /home/pi/snmp/snmp-cpu-temp -g .1.3.6.1.2.1.25.1.8
.1.3.6.1.2.1.25.1.8
gauge
62322
我正在尝试将可执行文件符号链接到 docker 脚本中的 bin 目录。我需要一种方法来识别可执行文件并返回布尔状态。我一直在尝试这个。它不起作用,我不明白为什么。
for i in ../src/u-boot/tools/*; do if ! [[ "readelf -h $i | grep -q DYN" ]]; then ln -s $i .; fi; done
如果我查看实际返回值,我会看到我期望的值:
root@0f1bca692c90:/home/work/bin# readelf -h ../src/u-boot/tools/mkimage |grep -q DYN
root@0f1bca692c90:/home/work/bin# echo $?
0
root@0f1bca692c90:/home/work/bin# readelf -h ../src/u-boot/tools/mkimage.c |grep -q DYN
readelf: Error: Not an ELF file - it has the wrong magic bytes at the start
root@0f1bca692c90:/home/work/bin# echo $?
1
我认为我误解了 bash 如何解释返回值。我尝试使用单括号和双括号,但得到了相同的行为。
更新 我能够让它像这样工作:
RUN for i in ../src/u-boot/tools/*; do if /usr/bin/readelf -h $i | grep -q DYN; then ln -s $i .; fi; done
我在使用 Debian 12。我在使用 apt 安装 python 库(numpy、pandas、sklearn)时犯了一个新手错误,现在每当我尝试安装或卸载任何东西时都会出现此错误。
安装时
thedude@192:~$ sudo apt install sl
[sudo] password for thedude:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
python3-bottleneck : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
Depends: python3-numpy-abi9
python3-contourpy : Depends: python3-numpy but it is not going to be installed
python3-matplotlib : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
Depends: python3-numpy-abi9
python3-numexpr : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
Depends: python3-numpy-abi9
python3-pandas : Depends: python3-numpy but it is not going to be installed
Depends: python3-numpy (>= 1:1.18.5~) but it is not going to be installed or
python3 (< 3.10) but 3.11.2-1+b1 is to be installed
python3-pandas-lib : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
Depends: python3-numpy-abi9
Recommends: python3-numba but it is not going to be installed
python3-pythran : Depends: python3-numpy but it is not going to be installed
python3-scipy : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
Depends: python3-numpy-abi9
python3-sklearn : Depends: python3-numpy but it is not going to be installed
python3-sklearn-lib : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
Depends: python3-numpy-abi9
python3-tables : Depends: python3-numpy but it is not going to be installed
python3-tables-lib : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
Depends: python3-numpy-abi9
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
卸载时:
thedude@192:~$ sudo apt remove python3-numpy
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'python3-numpy' is not installed, so not removed
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
python3-bottleneck : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
Depends: python3-numpy-abi9
python3-contourpy : Depends: python3-numpy but it is not going to be installed
python3-matplotlib : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
Depends: python3-numpy-abi9
python3-numexpr : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
Depends: python3-numpy-abi9
python3-pandas : Depends: python3-numpy but it is not going to be installed
Depends: python3-numpy (>= 1:1.18.5~) but it is not going to be installed or
python3 (< 3.10) but 3.11.2-1+b1 is to be installed
python3-pandas-lib : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
Depends: python3-numpy-abi9
Recommends: python3-numba but it is not going to be installed
python3-pythran : Depends: python3-numpy but it is not going to be installed
python3-scipy : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
Depends: python3-numpy-abi9
python3-sklearn : Depends: python3-numpy but it is not going to be installed
python3-sklearn-lib : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
Depends: python3-numpy-abi9
python3-tables : Depends: python3-numpy but it is not going to be installed
python3-tables-lib : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
Depends: python3-numpy-abi9
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
我apt fix-broken install
按照错误信息提示的那样尝试了。
thedude@192:~$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
fonts-lato icu-devtools libclang-cpp14 libffi-dev libicu-dev libllvm14
libncurses-dev libpfm4 libtinfo-dev libxml2-dev libz3-dev
llvm-14-linker-tools llvm-14-runtime llvm-14-tools nss-plugin-pem
python3-yaml sphinx-rtd-theme-common
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
python3-numpy
Suggested packages:
gfortran
The following NEW packages will be installed:
python3-numpy
0 upgraded, 1 newly installed, 0 to remove and 27 not upgraded.
Need to get 5,209 kB of archives.
After this operation, 28.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Err:1 http://deb.debian.org/debian bookworm/main amd64 python3-numpy amd64 1:1.24.2-1
404 Not Found [IP: 146.75.54.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/n/numpy/python3-numpy_1.24.2-1_amd64.deb 404 Not Found [IP: 146.75.54.132 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
我的理解是,产生错误的库是numpy。我发现它是通过键入以下内容安装的:
thedude@192:~$ sudo apt list python3-numpy
Listing... Done
python3-numpy/stable 1:1.24.2-1 amd64
但如图所示,我无法删除它。我尝试过更新,也--fix-missing
尝试过autoremove
thedude@192:~$ sudo apt --fix-broken install --fix-missing
[sudo] password for thedude:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
fonts-lato icu-devtools libclang-cpp14 libffi-dev libicu-dev libllvm14
libncurses-dev libpfm4 libtinfo-dev libxml2-dev libz3-dev
llvm-14-linker-tools llvm-14-runtime llvm-14-tools nss-plugin-pem
python3-yaml sphinx-rtd-theme-common
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
python3-numpy
Suggested packages:
gfortran
The following NEW packages will be installed:
python3-numpy
0 upgraded, 1 newly installed, 0 to remove and 27 not upgraded.
Need to get 5,209 kB of archives.
After this operation, 28.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Err:1 http://deb.debian.org/debian bookworm/main amd64 python3-numpy amd64 1:1.24.2-1
404 Not Found [IP: 146.75.54.132 80]
Unable to correct missing packages.
E: Failed to fetch http://deb.debian.org/debian/pool/main/n/numpy/python3-numpy_1.24.2-1_amd64.deb 404 Not Found [IP: 146.75.54.132 80]
E: Aborting install.
尝试过,update
效果很好,但没有什么区别。
我能做些什么来解决这个问题?