AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-158931

nalzok's questions

Martin Hope
nalzok
Asked: 2024-04-25 00:26:14 +0800 CST

如何在 OpenBSD 中禁用逻辑处理器?

  • 7

众所周知,OpenBSD默认情况下禁用超线程。但是,htop显示 16 个 CPU:8 个在线和 8 个离线,这会占用屏幕上的额外空间并且信息量不大。

在此输入图像描述

此外,sysctl还看到 16 个逻辑 CPU。这对我来说没有意义:禁用超线程后,它是一个 8 核 8 线程处理器,所以我应该看到 8 个物理/逻辑 CPU。

$ sysctl hw
hw.machine=amd64
hw.model=AMD Ryzen 7 5800H with Radeon Graphics
hw.ncpu=16
hw.byteorder=1234
hw.pagesize=4096
hw.disknames=sd0:6d1abdce154d2fc8
hw.diskcount=1
hw.sensors.cpu0.frequency0=3900000000.00 Hz
hw.sensors.cpu2.frequency0=3900000000.00 Hz
hw.sensors.cpu4.frequency0=3900000000.00 Hz
hw.sensors.cpu6.frequency0=3900000000.00 Hz
hw.sensors.cpu8.frequency0=3900000000.00 Hz
hw.sensors.cpu10.frequency0=3900000000.00 Hz
hw.sensors.cpu12.frequency0=3900000000.00 Hz
hw.sensors.cpu14.frequency0=3900000000.00 Hz
hw.sensors.ksmn0.temp0=83.12 degC (Tctl)
hw.sensors.it0.temp0=83.00 degC
hw.sensors.it0.temp1=49.00 degC
hw.sensors.it0.temp2=200.00 degC
hw.sensors.it0.fan0=0 RPM
hw.sensors.it0.fan1=3835 RPM
hw.sensors.it0.fan2=2986 RPM
hw.sensors.it0.volt0=1.74 VDC (VCORE_A)
hw.sensors.it0.volt1=1.62 VDC (VCORE_B)
hw.sensors.it0.volt2=2.67 VDC (+3.3V)
hw.sensors.it0.volt3=3.71 VDC (+5V)
hw.sensors.it0.volt4=10.69 VDC (+12V)
hw.sensors.it0.volt5=-3.24 VDC (-12V)
hw.sensors.it0.volt6=0.57 VDC (-5V)
hw.sensors.it0.volt7=3.68 VDC (+5VSB)
hw.sensors.it0.volt8=2.16 VDC (VBAT)
hw.cpuspeed=3200
hw.setperf=100
hw.vendor=AZW
hw.product=SER
hw.version=Default string
hw.serialno=A58003LH80340
hw.uuid=00020003-0004-0005-0006-000700080009
hw.physmem=13840232448
hw.usermem=13840216064
hw.ncpufound=16
hw.allowpowerdown=1
hw.perfpolicy=manual
hw.smt=0
hw.ncpuonline=8
hw.power=1
hw.ucomnames=

如何禁用逻辑处理器,以便每个“CPU”都是物理处理器?

cpu
  • 1 个回答
  • 27 Views
Martin Hope
nalzok
Asked: 2022-07-05 08:21:41 +0800 CST

Fish shell 在选项卡完成时报告“数学:错误:缺少运算符”

  • 2

今天早上我注意到了这个错误,但我认为我昨晚没有改变任何东西,所以我现在很困惑。也许我更新了我系统上的一些实用程序,它以某种方式破坏了向后兼容性。基本上我math: Error: Missing operator在使用制表符完成时出错。

假设我输入fish,然后点击Tab以获取类似fish_configand的建议fish_add_path(这是一个 asciinema 截屏视频,以防您想看到它的实际效果:https ://asciinema.org/a/L3xr32eVMGHuCY0Gjr19gFzCu )

[I] ~ $ fishmath: Error: Missing operator
'Wed Dec 31 18:00:00 CST 1969 - 1655913830'
 ^
[I] ~ $ fish_config
fish                                                                               (command)
fish_add_path
fish_breakpoint_prompt
fish_clipboard_copy
…and 29 more rows

选项卡完成确实有效,但错误看起来很烦人。看起来我正在尝试评估数据字符串或其他东西。如何诊断错误?


我在 macOS Monterey 上。这是我的~/.config/fish/config.fish。

set -px PATH /opt/local/bin /opt/local/sbin
set -px PATH $HOME/.local/bin
set -px PATH $HOME/bin
set -px PATH /Applications/MacPorts/Alacritty.app/Contents/MacOS
set -px PATH $HOME/Foreign/drawterm
set -px PATH $HOME/google-cloud-sdk/bin

set -x XDG_CONFIG_HOME $HOME/.config
set -x PIPENV_VENV_IN_PROJECT 1
set -x PLAN9 /usr/local/plan9

set -px PATH $PLAN9/bin

if test -e $HOME/.config/fish/sensitive.fish
    source $HOME/.config/fish/sensitive.fish
end

if status is-interactive
    # Commands to run in interactive sessions can go here
    alias vi='/opt/local/bin/nvim'
    set -gx EDITOR /opt/local/bin/nvim
    source /opt/local/share/fzf/shell/key-bindings.fish
end

set -g fish_key_bindings fish_hybrid_key_bindings

alias matlab='/Applications/MATLAB_R2021b.app/bin/matlab -nodisplay'

zoxide init fish | source

direnv hook fish | source

# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/qys/google-cloud-sdk/path.fish.inc' ]; . '/Users/qys/google-cloud-sdk/path.fish.inc'; end
shell command-line
  • 2 个回答
  • 126 Views
Martin Hope
nalzok
Asked: 2019-09-09 06:47:36 +0800 CST

oneko:错误并退出

  • 0

我正在开发运行 Raspbian GNU/Linux 10 (buster) 的 Raspberry Pi Zero W。其他 X11 应用程序,如xlogo、xclock、xosview,甚至xeyes运行得很好,但我没有运气运行oneko。

pi@nalzoks-pi:~ $ oneko
Display not supported shape extension.
oneko: Error and exit.
BadAccess (attempt to access private resource denied)
pi@nalzoks-pi:~ $ oneko -noshape
oneko: Error and exit.
BadAccess (attempt to access private resource denied)
pi@nalzoks-pi:~ $ sudo oneko
sudo: oneko: command not found

我在本地网络中通过 SSH 访问 Pi 并使用 X11 转发。

任何想法?


如果您需要,这里有更多信息

在 Pi Zero 上(使用 SSH 服务器访问ssh -X [email protected])

pi@nalzoks-pi:~ $ echo $DISPLAY
nalzoks-pi:11.0
pi@nalzoks-pi:~ $ sudo lsof -i -P -n | grep LISTEN
autossh   1608    pi    3u  IPv4  19696      0t0  TCP 127.0.0.1:30001 (LISTEN)
ssh       1613    pi    4u  IPv6  19718      0t0  TCP [::1]:30000 (LISTEN)
ssh       1613    pi    5u  IPv4  19719      0t0  TCP 127.0.0.1:30000 (LISTEN)
sshd      1719  root    3u  IPv4  20283      0t0  TCP *:22 (LISTEN)
sshd      1719  root    4u  IPv6  20289      0t0  TCP *:22 (LISTEN)
sshd      7110    pi   10u  IPv4  38831      0t0  TCP *:6010 (LISTEN)
sshd      7110    pi   11u  IPv6  38832      0t0  TCP *:6010 (LISTEN)
sshd      7394    pi   10u  IPv4  40700      0t0  TCP *:6011 (LISTEN)
sshd      7394    pi   11u  IPv6  40701      0t0  TCP *:6011 (LISTEN)
pi@nalzoks-pi:~ $ xdpyinfo
name of display:    nalzoks-pi:11.0
version number:    11.0
vendor string:    The X.Org Foundation
vendor release number:    11804000
X.Org version: 1.18.4
maximum request size:  16777212 bytes
motion buffer size:  256
bitmap unit, bit order, padding:    32, LSBFirst, 32
image byte order:    LSBFirst
number of supported pixmap formats:    7
supported pixmap formats:
    depth 1, bits_per_pixel 1, scanline_pad 32
    depth 4, bits_per_pixel 8, scanline_pad 32
    depth 8, bits_per_pixel 8, scanline_pad 32
    depth 15, bits_per_pixel 16, scanline_pad 32
    depth 16, bits_per_pixel 16, scanline_pad 32
    depth 24, bits_per_pixel 32, scanline_pad 32
    depth 32, bits_per_pixel 32, scanline_pad 32
keycode range:    minimum 8, maximum 255
focus:  None
number of extensions:    2
    BIG-REQUESTS
    XC-MISC
default screen number:    0
number of screens:    1

screen #0:
  dimensions:    1440x878 pixels (381x232 millimeters)
  resolution:    96x96 dots per inch
  depths (7):    24, 1, 4, 8, 15, 16, 32
  root window id:    0x111
  depth of root window:    24 planes
  number of colormaps:    minimum 1, maximum 1
  default colormap:    0x21
  default number of colormap cells:    256
  preallocated pixels:    black 0, white 16777215
  options:    backing-store NO, save-unders NO
  largest cursor:    32x32
  current input event mask:    0x1a0000
    StructureNotifyMask      SubstructureNotifyMask   SubstructureRedirectMask
  number of visuals:    80
  default visual id:  0x22
  visual:
    visual id:    0x22
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits
  visual:
    visual id:    0xc1
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits

  ... similar line omitted for brevity ...

在 MacBook Pro(SSH 客户端)上

$ echo $DISPLAY
:0
$ xdpyinfo
name of display:    :0
version number:    11.0
vendor string:    The X.Org Foundation
vendor release number:    11804000
X.Org version: 1.18.4
maximum request size:  16777212 bytes
motion buffer size:  256
bitmap unit, bit order, padding:    32, LSBFirst, 32
image byte order:    LSBFirst
number of supported pixmap formats:    7
supported pixmap formats:
    depth 1, bits_per_pixel 1, scanline_pad 32
    depth 4, bits_per_pixel 8, scanline_pad 32
    depth 8, bits_per_pixel 8, scanline_pad 32
    depth 15, bits_per_pixel 16, scanline_pad 32
    depth 16, bits_per_pixel 16, scanline_pad 32
    depth 24, bits_per_pixel 32, scanline_pad 32
    depth 32, bits_per_pixel 32, scanline_pad 32
keycode range:    minimum 8, maximum 255
focus:  None
number of extensions:    25
    Apple-DRI
    Apple-WM
    BIG-REQUESTS
    DAMAGE
    DOUBLE-BUFFER
    GLX
    Generic Event Extension
    MIT-SCREEN-SAVER
    MIT-SHM
    Present
    RANDR
    RECORD
    RENDER
    SECURITY
    SGI-GLX
    SHAPE
    SYNC
    X-Resource
    XC-MISC
    XFIXES
    XINERAMA
    XInputExtension
    XKEYBOARD
    XTEST
    XVideo
default screen number:    0
number of screens:    1

screen #0:
  dimensions:    1440x878 pixels (381x232 millimeters)
  resolution:    96x96 dots per inch
  depths (7):    24, 1, 4, 8, 15, 16, 32
  root window id:    0x111
  depth of root window:    24 planes
  number of colormaps:    minimum 1, maximum 1
  default colormap:    0x21
  default number of colormap cells:    256
  preallocated pixels:    black 0, white 16777215
  options:    backing-store NO, save-unders NO
  largest cursor:    32x32
  current input event mask:    0x1a0000
    StructureNotifyMask      SubstructureNotifyMask   SubstructureRedirectMask
  number of visuals:    80
  default visual id:  0x22
  visual:
    visual id:    0x22
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits
  visual:
    visual id:    0xc1
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits

  ... similar line omitted for brevity ...
ssh
  • 1 个回答
  • 181 Views
Martin Hope
nalzok
Asked: 2019-04-10 08:58:56 +0800 CST

将 Linux stat(1) 命令翻译成 BSD stat(1) 命令

  • 1

背景

CLion 的远程项目功能目前不支持 FreeBSD 作为远程主机操作系统,但我想做一些黑客攻击,看看它是否有效。通过阅读日志文件,我想我已经发现了(其中一个)问题。

2019-04-10 00:13:55,850 [2221079]  DEBUG -         #com.jetbrains.ssh.nio - UnixSshFS:: SshCommandRunner.execute: test -e "/tmp" 
2019-04-10 00:13:55,851 [2221080]  DEBUG - ellij.ssh.SshConnectionService - Executing SSH command: env "LC_ALL"="C" "JETBRAINS_REMOTE_RUN"="1" test -e "/tmp" within SSH session @3aa57c95 to <user>@<host>::22 
2019-04-10 00:13:55,963 [2221192]  DEBUG -         #com.jetbrains.ssh.nio - UnixSshFS:: SshCommandRunner.execute: stat --printf "%W%i%F%F%F%F%X%Y%s" "/" 
2019-04-10 00:13:55,963 [2221192]  DEBUG - ellij.ssh.SshConnectionService - Executing SSH command: env "LC_ALL"="C" "JETBRAINS_REMOTE_RUN"="1" stat --printf "%W%i%F%F%F%F%X%Y%s" "/" within SSH session @3aa57c95 to <user>@<host>:22 
2019-04-10 00:13:56,071 [2221300]   INFO -         #com.jetbrains.ssh.nio - 
Exit code 1 

基本上,在Linux和FreeBSDstat(1)上的行为不同,因此以下命令在 FreeBSD-12.0 上失败,停止整个设置过程:

$ stat --printf "%W%i%F%F%F%F%X%Y%s" "/"
stat: illegal option -- -
usage: stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file|handle ...]

我以为gstatin 的实用程序coreutils是 GNU 版本stat,但结果我错了;它们是两个不同的命令。我也尝试过自己翻译它,但我最终得到了一些奇怪的东西:

$ stat -f "%B%i%T%T%T%T%a%Y%z" "/"
15006030802////15041781781024

问题

是否可以为 FreeBSD 重写命令stat --printf "%W%i%F%F%F%F%X%Y%s" "/",使其工作方式与在 GNU/Linux 上的对应方式相同?

command-line freebsd
  • 1 个回答
  • 502 Views
Martin Hope
nalzok
Asked: 2018-12-06 11:49:52 +0800 CST

谁以前访问过共享文件?

  • 0

我刚刚发现我们系统的权限设置有错误。这有点严重,因为它允许普通用户访问他们不应该看到的内容。目前错误已修复,但我想知道有多少用户访问过这些文件。通过“访问”,我的意思是从中读取,例如,(不vi保存),,,,,......lesscatcpscp

我能想到的一种策略是grep浏览用户的~/.history文件,但他们可能已经删除了相关命令。

security permissions
  • 1 个回答
  • 40 Views
Martin Hope
nalzok
Asked: 2018-02-06 04:25:32 +0800 CST

如何重命名具有不同扩展名的文件

  • 1

假设我有这些文件:

essay.aux                   essay.out
essay.dvi                   essay.pdf
essay.fdb_latexmk           essay.tex
essay.fls                   essay.toc
essay.log                   ......

我如何将它们重命名为:

new_name.aux                new_name.out
new_name.dvi                new_name.pdf
new_name.fdb_latexmk        new_name.tex
new_name.fls                new_name.toc
new_name.log                ......

问题是它们有不同的扩展名而不是不同的名称,所以我不能使用这个问题的答案。另外,我在没有rename命令的 macOS 上。

shell-script shell
  • 4 个回答
  • 1641 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve