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

php_nub_qq's questions

Martin Hope
php_nub_qq
Asked: 2023-04-22 03:10:30 +0800 CST

USB 防止由于缺少固件而自动断开设备连接

  • 5

我有一个 TP LINK USB wifi 适配器。这是我插入时发生的情况:

[  153.838373] usb 2-1.1: new high-speed USB device number 5 using ehci-pci
[  153.951203] usb 2-1.1: New USB device found, idVendor=..., idProduct=..., bcdDevice= 0.00
[  153.951209] usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  153.951213] usb 2-1.1: Product: 802.11n NIC
[  153.951216] usb 2-1.1: Manufacturer: Realtek
[  153.951219] usb 2-1.1: SerialNumber: ...
[  153.951823] Chip Version Info: CHIP_8188E_Normal_Chip_TSMC_D_CUT_1T1R_RomVer(0)
[  153.997632] r8188eu 2-1.1:1.0 wlx503...: renamed from wlan0
[  154.028332] r8188eu 2-1.1:1.0: firmware: failed to load rtlwifi/rtl8188eufw.bin (-2)
[  154.028336] r8188eu 2-1.1:1.0: Direct firmware load for rtlwifi/rtl8188eufw.bin failed with error -2
[  154.028338] r8188eu 2-1.1:1.0: Firmware rtlwifi/rtl8188eufw.bin not available
[  154.028340] MAC Address = ...
[  154.126938] usb 2-1.1: USB disconnect, device number 5
[  154.130178] R8188EU: indicate disassoc

我知道这是由于缺少一些固件。

我不想在我的机器上安装这个固件,而是想将它安装到 VM 并让该 VM 使用加密狗。问题是设备立即自动断开连接,即使它是物理插入的,而且我无法使用 Qemu 转发 USB 设备。

是否可以防止设备立即断开连接?

debian
  • 1 个回答
  • 12 Views
Martin Hope
php_nub_qq
Asked: 2022-01-28 15:20:00 +0800 CST

如何从损坏的驱动器中浏览 img(恢复丢失的数据)

  • 0

目前我相信我遇到了驱动器 (HDD) 故障。它是用于额外存储的单个分区驱动器。当我尝试安装它时,出现以下错误:

# mount /dev/sdc1 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/sdc1,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

按照建议检查 dmesg:

# dmesg | tail
[12641.405658] blk_update_request: critical medium error, dev sdc, sector 2064
[12641.410139] Buffer I/O error on dev sdc1, logical block 2, async page read
[12641.415774] EXT4-fs (sdc1): couldn't mount as ext3 due to feature incompatibilities
[12641.420578] EXT4-fs (sdc1): couldn't mount as ext2 due to feature incompatibilities
[12644.186523] sd 5:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[12644.186543] sd 5:0:0:0: [sdc] tag#0 Sense Key : Medium Error [current] 
[12644.186556] sd 5:0:0:0: [sdc] tag#0 Add. Sense: Unrecovered read error
[12644.186570] sd 5:0:0:0: [sdc] tag#0 CDB: Read(10) 28 00 00 00 08 10 00 00 08 00
[12644.186580] blk_update_request: critical medium error, dev sdc, sector 2064
[12644.191255] EXT4-fs (sdc1): can't read group descriptor 1

正如我所说,我假设驱动器是夜间行驶,所以我想至少保存我在那里的所有信息(顺便说一句,这是更重要的一面)。我尝试从驱动器上切下 500GB,看看它是否可以工作:

# ddrescue -d -s 500G /dev/sdc data.img data.log

不幸的是,我在 ssh 上运行它并且我的管道坏了或其他东西,所以我最终得到了一个 ~150GB 的img文件,当我尝试挂载时,我得到了与尝试挂载驱动器本身时相同的错误(duh):

# mount data.img /mnt -o loop
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

如何获取应该保存的信息?

filesystems hard-disk
  • 1 个回答
  • 73 Views
Martin Hope
php_nub_qq
Asked: 2022-01-11 11:19:49 +0800 CST

PATH 中的通配符(环境变量)

  • 3

我在我的主目录中本地安装了一堆应用程序。为了让它们在全球范围内可用,我将它们添加PATH到.bashrc:

PATH="$PATH:/home/user/apps/app1/bin"
PATH="$PATH:/home/user/apps/app2/bin"
PATH="$PATH:/home/user/apps/appn/bin"

我怎样才能设置它,这样我就不必添加每个新的?我正在尝试这个,但它不起作用:

PATH="$PATH:/home/user/apps/*/bin"

注意:我知道我可以用循环添加它们,但我也担心我的PATH变量会变得太大,我想知道是否可以以某种方式对其进行通配符。

environment-variables bash
  • 3 个回答
  • 846 Views
Martin Hope
php_nub_qq
Asked: 2022-01-08 16:04:35 +0800 CST

性能很差,用户界面不稳定

  • 1

我在相当不错的硬件设置上使用 Debian 11。不幸的是,我看到了一些非常糟糕的性能——浏览网页感觉很笨拙,打开“活动”菜单没有动画,滚动非常不稳定,所有这些都是图形处理不佳的迹象。

我四处寻找,发现我(据说)没有使用我的显卡:

$ glxinfo | grep -i opengl
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 11.0.1, 256 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 20.3.5

我之前已经禁用Intel integrated graphics了我的 BIOS,所以出于好奇,我继续启用它:

$ glxinfo | grep -i opengl
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 4600 (HSW GT2)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 20.3.5

启用后,现在一切都感觉更流畅了,动画效果很好,但如果我有显卡,我仍然不想使用集成显卡。

我想远离 Nvidia 专有软件,但我似乎无法理解如何在nouveau不从源代码构建的情况下安装 FOSS 驱动程序?我对这个主题不是很熟悉,所以如果我不了解,请原谅我,但如果 nvidia 驱动程序可以在不构建的情况下安装,那么应该nouveau是这样。我找到了官方的 nouveau 网站,它显示了如何通过下载来安装它,nouveau-build-deps但它想要安装linux-headers-2-..,现在我使用的是第 5 版,所以我真的害怕不做任何事情。

此外,检查 nouveau 包显示我在 nouveau 网站上安装了建议的内容:

# apt search nouveau
Sorting... Done
Full Text Search... Done
bumblebee/stable 3.2.1-27 amd64
  NVIDIA Optimus support for Linux

libdrm-nouveau2/stable,now 2.4.104-1 amd64 [installed,automatic]
  Userspace interface to nouveau-specific kernel DRM services -- runtime

xfonts-jmk/stable 3.0-23 all
  Jim Knoble's character-cell fonts for X

xserver-xorg-video-nouveau/stable,now 1:1.0.17-1 amd64 [installed]
  X.Org X server -- Nouveau display driver

我怀疑可能在某个地方我删除了某些东西或更改了一些配置并且忘记了..

我怎样才能开始nouveau跑步?

编辑:

$ lspci -nnk | grep -iA2 vga 
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP107 [GeForce GTX 1050] [10de:1c81] (rev a1)
    Subsystem: Micro-Star International Co., Ltd. [MSI] GP107 [GeForce GTX 1050] [1462:8c97]
    Kernel driver in use: nouveau

$ glxinfo | grep -i device
    Device: llvmpipe (LLVM 11.0.1, 256 bits) (0xffffffff)

$ glxinfo | grep -i memory
    Video memory: 15974MB
    Unified memory: no

$ glxinfo | grep -i opengl
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 11.0.1, 256 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 20.3.5
...

$ cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

nouveau

$ 

AFAIKOpenGL vendor string应该说它Nouveau是否在使用中?

debian graphics
  • 2 个回答
  • 320 Views
Martin Hope
php_nub_qq
Asked: 2021-12-15 02:54:53 +0800 CST

如何以另一个用户身份运行 X 应用程序(vscode)

  • 0

基本上我想要的是运行 vscode 而不授予它读取我的主目录的权限。

所以我创建了一个新用户并从https://code.visualstudio.com/#alt-downloadsvscode下载了.tar.gz文件

现在我正在尝试以我的code身份vscode登录,如下所示:

~$ su - vscode -c "/home/vscode/code-stable-x64-1638855856/VSCode-linux-x64/bin/code --verbose"
Password: 
[8347:1214/125108.021461:ERROR:browser_main_loop.cc(1402)] Unable to open X display.
The futex facility returned an unexpected error code.
/dev/fd/3: No such file or directory
Server response:

我也尝试使用ssh -Y vscode@localhost然后code从内部开始,这很有效,但我想尽可能避免使用 ssh。

debian x11
  • 2 个回答
  • 487 Views
Martin Hope
php_nub_qq
Asked: 2021-12-14 09:40:54 +0800 CST

是否可以更改 gnome 应用程序的图标?

  • 0

我知道这可能与操作系统的功能完全无关,但我刚刚安装完 debian 11,我注意到 gnome 应用程序使用稍微过时的图标,尽管它们是较新的版本。

例如,在我的 ubuntu 20.04gnome-calculator版本3.36.0中,有这个图标:

在此处输入图像描述

虽然在 debian 11 中它是3.38.2并且有这个

在此处输入图像描述

这也适用于我使用的其他一些 gnome 应用程序,如果我能切换到我更喜欢的图标,我会非常高兴。

有可能这样做吗?

debian ubuntu
  • 1 个回答
  • 293 Views
Martin Hope
php_nub_qq
Asked: 2018-12-28 09:49:50 +0800 CST

将存储在变量中的空格分隔参数传递给命令

  • 6

我从互联网上劫持了一个非常简洁的备份脚本,但是在某个地方发生了这样的事情

DIRS="/home/ /var/www/html /etc"

tar -czf /backup/file.tar.gz "${DIRS}"

这恰好在我的机器上运行良好,但在我的服务器上它似乎认为它是一条路径并告诉我它不存在:

/bin/tar: /home/ /var/www/html /etc: Cannot stat: No such file or directory 
/bin/tar: Exiting with failure status due to previous errors

本地 tar 版本是 1.29 而服务器是 1.28

将目录与该变量分开提供 tar 的正确方法是什么?

bash command-line
  • 2 个回答
  • 3579 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