在 Linux 内核中,文档CONFIG_NUMA说:
Enable NUMA (Non Uniform Memory Access) support.
he kernel will try to allocate memory used by a CPU on the
local memory controller of the CPU and add some more
NUMA awareness to the kernel.
For 64-bit this is recommended if the system is Intel Core i7
(or later), AMD Opteron, or EM64T NUMA.
Run Code Online (Sandbox Code Playgroud)
我有一个 Intel Core i7 处理器,但 AFAICT 它只有一个 NUMA 节点:
$ numactl --hardware
available: 1 nodes (0)
node 0 cpus: 0 1 …Run Code Online (Sandbox Code Playgroud) 我在我的工作场所继承了 linux box 的管理;它是由一位现已离开的同事建立的。最近,我在系统中添加了一个新用户,并尝试给她 ssh 访问权限;大多数使用机器的人访问它的方式。这,我不能上班。
这是发生的事情:
scmb-bkobe03m:~ xzhang$ ssh -v -X -p 22 arwen@myServer
OpenSSH_5.2p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to myServer [152.98.xx.xx] port 22.
debug1: Connection established.
debug1: identity file /Users/xzhang/.ssh/identity type -1
debug1: identity file /Users/xzhang/.ssh/id_rsa type 1
debug1: identity file /Users/xzhang/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-6+squeeze2
debug1: match: OpenSSH_5.5p1 Debian-6+squeeze2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version …Run Code Online (Sandbox Code Playgroud) 在 Linux Mint 上,当我查看/etc/resolv.conf文件时,第一条评论指出该/etc/resolv.conf文件是由resolvconf(8).
~ $ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
Run Code Online (Sandbox Code Playgroud)
解释一下resolvconf(8)手册页:
resolvconf 程序由 dhclient 等 DHCP 客户端运行
我跑dhclient wlan0。
~ $ dhclient wlan0
Run Code Online (Sandbox Code Playgroud)
Dhclient 应该使resolvconf程序更新/etc/resolv.conf。该/var/lib/dhcp/dhclient.leases文件验证我是否能够租用名称服务器的 IP 地址 (192.168.0.6)。
~ $ cat /var/lib/dhcp/dhclient.leases
lease {
interface "wlan0";
. . .
option domain-name-servers 192.168.0.6;
. . .
}
Run Code Online (Sandbox Code Playgroud)
但是,该/etc/resolv.conf文件不会更新。该/etc/resolv.conf文件的名称服务器为 127.0.1.1。
~ $ cat /etc/resolv.conf …Run Code Online (Sandbox Code Playgroud) 在$HOSTNAME为您设置的 Bash 中,我只需使用以下内容即可计算提示行的总长度:
PS1_length=$((${#USER}+${#HOSTNAME}+${#PWDNAME}+12+${#PS1_GIT}))
这很有用,例如在创建这样的填充线时: 
但是zsh无法$HOSTNAME正确设置,我想不出一种方法来模拟其中的类似行为 - 有什么想法吗?
这是一个单线:有没有办法/命令来检查 X 服务器是以 root 还是以用户身份运行?
这应该是一个单行但唉......我最近升级了我的 Arch Linux 机器。升级后,我收到通知,X现在可以无根运行。我查看了官方 Arch Linux 页面,它指出:
X 现在在 systemd-logind 的帮助下是无根的 [...] [1]
这让我对如何检查是否X无根运行感兴趣。如何才能做到这一点?
我测试一组数据文件的内容是否至少包含一组字符中的一个,这些字符由打印和非打印字符组成。
我的最后一个问题是检测文件是否包含换行符。我的GNU grep 3.0声明每个输入都包含一个 LF ......为什么会这样?
echo -n "test" | grep -UF -e $'\x0a'
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?我怀疑一些隐含的 EOL/EOF 干扰。