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

s1n7ax's questions

Martin Hope
s1n7ax
Asked: 2024-01-12 20:33:44 +0800 CST

在 NixOS 中使用 axel 获取源代码,而不是使用curl 获取 fetchurl

  • 6

我正在尝试使用 Cuda 启动 shell。我有以下 shell.nix 文件

{ pkgs ? import <nixpkgs> { } }:

pkgs.mkShell {
  name = "cuda-env-shell";
  buildInputs = with pkgs; [
    unzip
    # other packages
    cudatoolkit
    # other packages
    binutils
  ];
}

但这由于以下错误而失败。我以前曾遇到过像 davinci-resolve 这样的大文件的情况。对于 davinci-resolve,我的解决方案是使用具有 10 个连接的 axel 创建一个新的 flake,并且每次都运行良好。现在我正面临着 Cuda 的这个问题。

[1/0/3 built, 4 copied (183.8/183.8 MiB), 42.8 MiB DL] building cuda_11.8.0_520.61.05_linux.run:                                  Dload  Upload   Total   Spent    Left
error: builder for '/nix/store/idz14mzbsv4k5v5ims095jcjk2r50glr-cuda_11.8.0_520.61.05_linux.run.drv' failed with exit code 1;
       last 7 log lines:
       >
       > trying https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run
       >   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
       >                                  Dload  Upload   Total   Spent    Left  Speed
       >  49 4135M   49 2044M    0     0   772k      0  1:31:20  0:45:08  0:46:12     0
       > curl: (56) Recv failure: Connection reset by peer

我想要 Cuda,但是我可以使用 axel 而不是curl 检索 src 吗?我尝试了类似以下的操作,但它似乎不是有效的语法?

    cudatoolkit.overrideAttrs
    (finalAttrs: previousAttrs: {
      pname = previousAttrs.pname + "-bar";
      src = runCommandLocal "${previousAttrs.pname}.run" rec { } ''
        axel \
          --num-connections=10 \
          --verbose \
          --insecure \
          --output $out \
          "https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run"
      '';
    })

错误:

        at /nix/store/0g53xyh39z3y90p4d8r341wbqyjy1zhl-source/pkgs/stdenv/generic/make-derivation.nix:395:7:

          394|       depsHostHost                = elemAt (elemAt dependencies 1) 0;
          395|       buildInputs                 = elemAt (elemAt dependencies 1) 1;
             |       ^
          396|       depsTargetTarget            = elemAt (elemAt dependencies 2) 0;

       error: Dependency is not of a valid type: element 13 of buildInputs for cuda-env-shell
curl
  • 1 个回答
  • 24 Views
Martin Hope
s1n7ax
Asked: 2023-07-31 01:42:22 +0800 CST

模糊查找目录速度慢

  • 5

我有以下 bash 脚本来查找 git 存储库。

echo "$(fd -I -i -H -E '.local' -E '.cargo' -E '.password-store' -t d ^.git$ ~ -x 'echo' '{//}' | sk)"

fd将搜索结果传送到sk(fzf rust 替代方案),因为它们被发现,但选择一项要等到fd完成。sk因此,从我选择实际使用的目录到实际编辑的目录,大约有 2 秒的延迟echo。我也可以看到同样的行为fzf。

有没有办法避免延误?

fzf
  • 1 个回答
  • 21 Views
Martin Hope
s1n7ax
Asked: 2023-07-07 00:02:20 +0800 CST

fd-find 没有找到任何东西

  • 6

fd-find 没有找到任何东西。当在主目录中搜索某些内容时,它会立即存在而不会出现任何错误。

❯ mkdir root

❯ cd root

❯ touch test

❯ ls -l
total 0
-rw-rw-r-- 1 s1n7ax s1n7ax 0 Jul  6 21:29 test

❯ which fd
/home/s1n7ax/.cargo/bin/fd

❯ fd --version
fd 8.7.0

❯ fd test

❯ fd -t f test

我也尝试使用 apt 包管理安装相同的二进制文件。它将8.3.1版本和二进制名称更改为 fdfind,但没有结果

fd
  • 1 个回答
  • 34 Views
Martin Hope
s1n7ax
Asked: 2022-09-19 20:40:41 +0800 CST

循环目录中的每个文件,但在没有文件时不抛出错误

  • 3
这个问题是从我们的讨论、支持和功能请求站点 Unix 和 Linux Meta Stack Exchange 迁移而来的。29 天前迁移 。

我想根据 .profiles/ 目录中的文件加载别名。

for profile in ~/.profiles/*; do
    for file in ~/.s1n7ax/$(basename $profile)/alias/*; do
        include "$file"
    done
done

但是,当里面没有任何文件时,~/.s1n7ax/$(basename $profile)/alias/*它会引发错误。

/home/s1n7ax/.zshrc:117: no matches found: /home/s1n7ax/.s1n7ax/work/alias/*

我想优雅地处理这个问题,而不会向 sdt 输出错误。

zsh files
  • 1 个回答
  • 70 Views
Martin Hope
s1n7ax
Asked: 2020-02-25 13:55:34 +0800 CST

让拇指按钮工作 | 佐伊 ec2-b

  • 1

我是steam用来玩CS:GO的Arch Linux。到目前为止一切正常,但鼠标拇指按钮。我试图在游戏中映射它们,然后我意识到游戏根本无法识别这些键。我经历了拇指按钮 - 前进和后退,但我认为这里的问题evdev是没有将拇指按钮事件识别为按钮。(我正在使用Arch Linux++设置bspwm)sxhkd

xev向前拇指按钮的输出

LeaveNotify event, serial 33, synthetic NO, window 0x4c00001,
    root 0x1e6, subw 0x0, time 4046616, (2,420), root:(974,442),
    mode NotifyGrab, detail NotifyAncestor, same_screen YES,
    focus YES, state 0

EnterNotify event, serial 33, synthetic NO, window 0x4c00001,
    root 0x1e6, subw 0x0, time 4046777, (2,420), root:(974,442),
    mode NotifyUngrab, detail NotifyAncestor, same_screen YES,
    focus YES, state 0

KeymapNotify event, serial 33, synthetic NO, window 0x0,
    keys:  4294967270 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

xev后拇指按钮的输出

LeaveNotify event, serial 33, synthetic NO, window 0x4a00001,
    root 0x1e6, subw 0x0, time 3944070, (7,455), root:(979,477),
    mode NotifyGrab, detail NotifyAncestor, same_screen YES,
    focus YES, state 0

EnterNotify event, serial 33, synthetic NO, window 0x4a00001,
    root 0x1e6, subw 0x0, time 3944181, (7,455), root:(979,477),
    mode NotifyUngrab, detail NotifyAncestor, same_screen YES,
    focus YES, state 0

KeymapNotify event, serial 33, synthetic NO, window 0x0,
    keys:  4294967270 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0  

我也尝试xorg了以下配置。

Section "InputDevice"
  Identifier      "Evdev Mouse"
  Driver          "evdev"
  Option          "Name" "Kingsis Peripherals ZOWIE Gaming mouse"
  Option          "evBits"  "+1-2"
  Option          "keyBits" "~272-287"
  Option          "relBits" "~0-2 ~6 ~8"
  Option          "Pass"    "3"
  Option          "CorePointer"
EndSection

Section "ServerLayout"
  Identifier     "Default Layout"
  InputDevice    "Evdev Mouse" "CorePointer"
EndSection

我试过杀人sxhkd

根据this question中的解决方案,可以全局抓取密钥。只有潜在的应用程序才会sxhkd如此,所以我终止了该进程并尝试了xev窗口上的拇指按钮,但它给出了与上述相同的结果。

如何让拇指按钮工作?

arch-linux xorg
  • 2 个回答
  • 248 Views
Martin Hope
s1n7ax
Asked: 2019-09-29 10:22:12 +0800 CST

Ctrl-S后Vim冻结[重复]

  • 7
这个问题在这里已经有了答案:
为什么vim被冻结? (3 个回答)
3年前关闭。

我已经使用neovim了很长时间,我一直在使用Ctrl + s保存和Ctrl + q退出。

nmap <c-s> :w<CR>
imap <c-s> <Esc>:w<CR>a

nmap <c-q> :q<CR>
imap <c-q> <Esc>:q<CR>

由于 with 的意外行为,nvim我coc切换到vim. 它使用相同的配置,但Ctrl + s冻结编辑器并且Ctrl + q需要解冻它。我正在使用Simple Terminal,它不会冻结Ctrl + s。

NVIM v0.4.2
VIM - Vi IMproved 8.1
vim
  • 1 个回答
  • 3326 Views
Martin Hope
s1n7ax
Asked: 2019-07-04 21:11:03 +0800 CST

通过 wpa_supplicant 获取当前连接的 wifi 网络的 ssid

  • 4

我正在使用wpa_supplicant连接到我的 wifi 网络。由于我使用的是dwm,我想在面板中显示已连接网络的 SSID。有没有办法获取已连接网络的 SSID wpa_supplicant?

arch-linux wifi
  • 2 个回答
  • 3537 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