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-153586

Bart Friederichs's questions

Martin Hope
Bart Friederichs
Asked: 2024-04-29 21:03:43 +0800 CST

ls 如何知道如何输出其结果?

  • 22

在创建 bash 脚本时,我发现这段代码ls将所有文件放在一行:

pi@raspberrypi:~/ptlrestinterface$ ls
update.sh   web.config   MyApp.runtimeconfig.json   

仍然ls | head -n1只打印第一个文件:

pi@raspberrypi:~/ptlrestinterface$ ls | head -n1
update.sh

我希望它输出整行,而不是第一个文件。

在通过管道输出时hexdump,我看到ls总是在每个条目后输出一个0a,但是在控制台上,它将它们放置在彼此旁边。

显然ls对控制台(或 的控制台ls)有一些了解。这是如何工作的?我在哪里可以找到有关此行为的文档?

linux
  • 2 个回答
  • 3164 Views
Martin Hope
Bart Friederichs
Asked: 2023-10-05 18:33:41 +0800 CST

我可以使用 ssh 将本地端口映射到远程服务器吗?

  • 6

我遇到的情况是,我需要在我的笔记本电脑上设置一个端口(位于防火墙后面的本地网络上),该端口对一般互联网开放,暂时用于测试目的。我们称这台机器为“LocalLaptop”

我有一个面向互联网的服务器,我可以完全控制该服务器,并通过 SSH 进行访问。我们将这台机器称为“RemoteServer”。

我正在考虑使用 来解决这个问题ssh -L,但这似乎并没有解决问题。

我正在寻找的是这样的:

Internet ---> RemoteServer:8888 ---(ssh-tunnel)---> LocalLaptop:80

我可以这样做吗ssh?我尝试了-L和-R选项,但无法让它们工作(它要么以错误的方式打开,要么仅限于127.0.0.1在 RemoteServer 上。

networking
  • 1 个回答
  • 14 Views
Martin Hope
Bart Friederichs
Asked: 2023-10-02 22:51:28 +0800 CST

当我设置了 Wants 时,为什么 systemd 没有在启动时启动我的服务?

  • 5

我希望我的服务(取决于 PostgreSQL)在启动时启动,因此我enable使用 进行了配置systemd,并在.service文件中将其称为Wantspostgres 服务:

[Unit]
Description=My service
Wants=postgresql-12

[Service]
User=root
WorkingDirectory=/path/to/myservice
ExecStart=/path/to/myservice/my_service -d

[Install]
WantedBy=multi-user.target

myservice启动时不会启动,因为 PostgreSQL 服务器还不存在(我可以在日志中看到)。当稍后使用 启动它时systemctl start myservice,它启动良好,因此看起来该.service文件是有效的。

为什么systemctl在开始服务之前不等待 Postgres?我也尝试检查systemd-analyze blame,但这似乎只显示正在运行的服务。

linux
  • 1 个回答
  • 13 Views
Martin Hope
Bart Friederichs
Asked: 2023-08-29 17:52:47 +0800 CST

VBoxNetFlt 不是基于 Fedora 38 构建的

  • 5

我已从 Fedora 38(6.4.11 内核)中删除并重新安装 VirtualBox,但它仍然无法构建以下模块之一:

[...]
  gcc -Wp,-MMD,/tmp/vbox.0/linux/.SUPR0IdcClient-linux.o.d -nostdinc -I./arch/x86/include -I./arch/x86/include/generated  -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -fmacro-prefix-map=./= -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -funsigned-char -std=gnu11 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=branch -fno-jump-tables -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mindirect-branch-cs-prefix -mfunction-return=thunk-extern -fno-jump-tables -mharden-sls=all -fpatchable-function-entry=16,16 -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-larger-than=2048 -fstack-protector-strong -Wno-main -Wno-unused-but-set-variable -Wno-unused-const-variable -Wno-dangling-pointer -ftrivial-auto-var-init=zero -fno-stack-clash-protection -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -falign-functions=16 -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wcast-function-type -Wno-stringop-truncation -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -Wno-array-bounds -Wno-alloc-size-larger-than -Wimplicit-fallthrough=5 -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wno-packed-not-aligned -g -include /tmp/vbox.0/include/VBox/SUPDrvMangling.h -fno-pie -Wno-declaration-after-statement -I./include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -D__KERNEL__ -DMODULE -DRT_WITHOUT_PRAGMA_ONCE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS -DRT_ARCH_AMD64  -DMODULE  -DKBUILD_BASENAME='"SUPR0IdcClient_linux"' -DKBUILD_MODNAME='"vboxnetflt"' -D__KBUILD_MODNAME=kmod_vboxnetflt -c -o /tmp/vbox.0/linux/SUPR0IdcClient-linux.o /tmp/vbox.0/linux/SUPR0IdcClient-linux.c  
# cmd_check_local_export /tmp/vbox.0/linux/SUPR0IdcClient-linux.o
  ./scripts/check-local-export /tmp/vbox.0/linux/SUPR0IdcClient-linux.o
# cmd_check_local_export /tmp/vbox.0/SUPR0IdcClientComponent.o
  ./scripts/check-local-export /tmp/vbox.0/SUPR0IdcClientComponent.o
# cmd_check_local_export /tmp/vbox.0/SUPR0IdcClient.o
  ./scripts/check-local-export /tmp/vbox.0/SUPR0IdcClient.o
# cmd_check_local_export /tmp/vbox.0/VBoxNetFlt.o
  ./scripts/check-local-export /tmp/vbox.0/VBoxNetFlt.o
/tmp/vbox.0/linux/VBoxNetFlt-linux.c: In function ‘vboxNetFltLinuxForwardToIntNetInner’:
/tmp/vbox.0/linux/VBoxNetFlt-linux.c:1561:40: error: implicit declaration of function ‘skb_gso_segment’; did you mean ‘skb_gso_reset’? [-Werror=implicit-function-declaration]
 1561 |             struct sk_buff *pSegment = skb_gso_segment(pBuf, 0 /*supported features*/);
      |                                        ^~~~~~~~~~~~~~~
      |                                        skb_gso_reset
/tmp/vbox.0/linux/VBoxNetFlt-linux.c:1561:40: warning: initialization of ‘struct sk_buff *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:252: /tmp/vbox.0/linux/VBoxNetFlt-linux.o] Error 1
make[1]: *** [Makefile:2050: /tmp/vbox.0] Error 2
make: *** [/tmp/vbox.0/Makefile-footer.gmk:117: vboxnetflt] Error 2

在网上搜索时,我确实得到了一些资源,但都没有解决问题。

如何在 Fedora 38(内核 6.4.11)上安装 VirtualBox 7.0?

linux
  • 1 个回答
  • 25 Views
Martin Hope
Bart Friederichs
Asked: 2023-08-22 15:27:09 +0800 CST

使用 systemd 启动进程时 CPU 使用率过高

  • 5

我有这个service文件:

[Unit]
Description=MyService

[Service]
User=root
WorkingDirectory=/path/to/workingdir
ExecStart=/path/to/myservice

[Install]
WantedBy=multi-user.target

当我myservice从命令行启动时,它会启动并取消恶魔化。当我用-d(用于调试)启动它时,它不会去恶魔化,但在按 Enter 时停止。

但是,当我将其放入文件myservice中时service,它根本不会启动:

[root@localhost bin]# systemctl status myservice.service 
● myservice.service - MyService
   Loaded: loaded (/etc/systemd/system/myservice.service; enabled; vendor preset: disabled)
   Active: inactive (dead) since Tue 2023-08-22 09:20:21 CEST; 4min 1s ago
  Process: 1790032 ExecStart=/path/to/myservice (code=exited, status=0/SUCCESS)
 Main PID: 1790032 (code=exited, status=0/SUCCESS)

Aug 22 09:20:21 localhost.localdomain systemd[1]: Started MyService
Aug 22 09:20:21 localhost.localdomain myservice[1790033]: myservice started with:
Aug 22 09:20:21 localhost.localdomain myservice[1790033]: current working dir: /path/to/workingdir
Aug 22 09:20:21 localhost.localdomain systemd[1]: myservice.service: Succeeded.

当使用 启动它时-d,它会启动,但 CPU 使用率会提高到 90%。

我应该如何service为自己守护进程的程序配置文件?

systemctl
  • 1 个回答
  • 10 Views
Martin Hope
Bart Friederichs
Asked: 2023-07-05 19:46:47 +0800 CST

我可以修复无法识别自身的 SDD 驱动器吗?

  • 5

我有一个发生故障的 SDD(金士顿 SSDNOW KC300;480GB),当将其插入我的 Fedora 笔记本电脑时,我得到以下信息dmesg:

[18336.225549] usb-storage 1-3:1.0: USB Mass Storage device detected
[18336.225785] scsi host4: usb-storage 1-3:1.0
[18337.262289] scsi 4:0:0:0: Direct-Access     SandForc e{200026BB}      306A PQ: 0 ANSI: 0
[18337.262664] sd 4:0:0:0: Attached scsi generic sg0 type 0
[18337.262893] sd 4:0:0:0: [sdb] 64 512-byte logical blocks: (32.8 kB/32.0 KiB)
[18337.263183] sd 4:0:0:0: [sdb] Write Protect is off
[18337.263185] sd 4:0:0:0: [sdb] Mode Sense: 03 00 00 00
[18337.263476] sd 4:0:0:0: [sdb] No Caching mode page found
[18337.263478] sd 4:0:0:0: [sdb] Assuming drive cache: write through
[18337.264839] sd 4:0:0:0: [sdb] Attached SCSI disk

它显示没有分区,并且只有 32.8kB 的可用存储空间。打开时cfdisk,它会要求提供标签。当选择gpt或 时dos,只显示一个32kB的分区。

我可以采取什么措施来恢复该磁盘,或者它是否已损坏且无法修复?

hard-drive
  • 1 个回答
  • 31 Views
Martin Hope
Bart Friederichs
Asked: 2021-10-21 23:51:03 +0800 CST

如何在 NFS 共享上映射用户 ID?

  • 9

我已成功将 NFS 共享从远程计算机安装到本地。但是,我想在远程机器上编辑的文件都归root.

如何挂载我的 NFS 驱动器,以便我的本地用户可以编辑这些文件?

我尝试了该idmap.conf文件,但我不知道是否应该在本地或远程机器上编辑它,以及我应该重新启动哪些服务(再次,本地或远程)以产生任何影响。

从过去,我记得uid=X,gid=X做这样的事情的选项,但我现在在这些选项上得到这个错误:

mount.nfs: an incorrect mount option was specified

我使用 Fedora 34 作为本地和 CentOS 7.6 远程。

linux mount
  • 2 个回答
  • 11727 Views
Martin Hope
Bart Friederichs
Asked: 2021-09-23 04:33:36 +0800 CST

如何在 Fedora 中打开带有 URL 的 .desktop 文件?

  • 5

我有一个.desktop包含以下内容的文件:

[Desktop Entry]
Type=Link
Name=FileName
URL=https://example.com

我想从命令行在我的默认浏览器中启动。

我怎样才能做到这一点?我试过gtk-launch了,但它说“没有这样的应用程序”:

[bf@localhost Playground]$ gtk-launch Somelink.desktop 
gtk-launch: no such application Somelink.desktop

[bf@localhost Playground]$ gtk-launch /home/bf/Playground/Somelink.desktop 
gtk-launch: no such application /home/bf/Playground/Somelink.desktop
command-line fedora
  • 2 个回答
  • 143 Views
Martin Hope
Bart Friederichs
Asked: 2021-06-30 00:03:23 +0800 CST

gcc-arm-linux-gnu 破坏了我的 Fedora 33

  • 5

我刚刚gcc-arm-linux-gnu使用 安装了软件包dnf,从那时起(似乎)我的整个 Fedora 安装都被破坏了。dnf给出信息

ImportError ... GLIBCXX_3.4.26 未找到(/lib64/libdnf.so.2 需要)

我不知道我能做些什么来解决这个问题;我不能再使用dnf来修复包,也不能使用yum.

我怎样才能让它再次工作?

linux fedora
  • 1 个回答
  • 34 Views
Martin Hope
Bart Friederichs
Asked: 2021-06-29 05:27:49 +0800 CST

如何在 x86/x64 Fedora 上运行动态链接的 ARM 二进制文件?

  • 7

我有一些动态链接的 ARM 二进制文件,根据这个页面,我可以安装一些包以便qemu-user在我的 x86/x64 Linux 上运行它们。但是,这些是 Debian 的说明,我正在运行 Fedora。我尝试使用dnf, 和在线寻找合适的软件包,但还没有找到。

如何在我的 x64 Fedora 33 上运行动态链接的 ARM 二进制文件?

直到现在我才知道:

[bf@localhost src]$ file ../bin/fabs
../bin/fabs: ELF 32-bit LSB executable, ARM, version 1 (ARM), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.0.0, stripped
[bf@localhost src]$ qemu-arm ../bin/fabs -V
/lib/ld-linux.so.2: Invalid ELF image for this architecture

当我运行一个简单的静态链接二进制文件时,它工作正常:

[bf@localhost src]$ file helloworld
helloworld: ELF 32-bit LSB executable, ARM, version 1 (ARM), statically linked, for GNU/Linux 2.0.0, with debug_info, not stripped
[bf@localhost src]$ qemu-arm helloworld
Hello World!
linux fedora
  • 1 个回答
  • 582 Views
Martin Hope
Bart Friederichs
Asked: 2020-02-07 11:48:25 +0800 CST

Fedora 30/31 live USB 记忆棒无法完全启动

  • 5

我最近购买了一台新的 Dell Latitude 笔记本电脑,我想在其上安装 Fedora Linux。这应该是一个十五分钟的工作,但现在它在很多地方都失败了。

我首先尝试了 UnetBootin,但由此产生的 USB 甚至没有被 BIOS 识别来启动。使用 Rufus,Fedora 31 给出了一个 syslinux 版本问题,尽管它确实启动了。不过,它只是在一段时间后停止了。

到目前为止,我得到的最远的是使用 Rufus 和 Fedora 30 Workstation Live ISO。它被 BIOS 识别为可启动并启动。有点儿。它陷入了一项永远等待的繁重工作。

我从来没有在 PC 上安装任何 Linux 时遇到过这么大的麻烦(即使是软盘上的 Slackware 也更容易)。我在这里错过了什么吗?我可以尝试更多的方法来让这台笔记本电脑上的 Fedora 吗?

boot usb
  • 1 个回答
  • 2371 Views

Sidebar

Stats

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

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    Vickel Firefox 不再允许粘贴到 WhatsApp 网页中? 2023-08-18 05:04:35 +0800 CST
  • Martin Hope
    Saaru Lindestøkke 为什么使用 Python 的 tar 库时 tar.xz 文件比 macOS tar 小 15 倍? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve