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

Cedric's questions

Martin Hope
Cedric
Asked: 2021-09-09 09:27:36 +0800 CST

如何从鼠标的侧键获取键码?

  • 0

在我的 .bashrc 中,我想添加这一行:

xmodmap -e "keycode 135 = Return"

其中键码编号是我鼠标侧键的编号。

为了从键盘上查找键码,我使用 xev,它给了我,例如:

(包含“keycode 135”的行是最重要的)

 KeyPress event, serial 38, synthetic NO, window 0x6400001,    
     root 0x7c3, subw 0x0, time 30530179, (-489,479), root:(1047,479),    
     state 0x0, keycode 135 (keysym 0xff0d, Return), same_screen YES,    
     XKeysymToKeycode returns keycode: 36 "   XLookupString gives 1 bytes: (0d) " "   XmbLookupString gives 1 bytes: (0d) "    
     XFilterEvent returns: False

但是,对于鼠标,它不显示键码:

ButtonRelease event, serial 38, synthetic NO, window 0x6400001,
    root 0x7c3, subw 0x0, time 30661669, (35,100), root:(1571,100),
    state 0x0, button 8, same_screen YES

如何从鼠标的侧键获取键码,使用命令 xmodmap,从鼠标键模拟键盘的按键?(例如,按下侧边按钮就像我在键盘上按下“a” - 并在文本编辑器中显示“a”)

keyboard mouse
  • 1 个回答
  • 511 Views
Martin Hope
Cedric
Asked: 2020-02-28 07:13:44 +0800 CST

DHCP 客户端在我的台式计算机上有用吗?

  • 0

DHCP 客户端在我的台式计算机上有用吗?

我的电脑主要用于办公目的(网页浏览/媒体消费/自由办公)。

当我设置一些防火墙规则时,我希望限制任何无用的进程。

linux dhcp
  • 2 个回答
  • 57 Views
Martin Hope
Cedric
Asked: 2018-09-10 18:12:38 +0800 CST

用数组中包含的东西迭代替换

  • -1
foo bar, foo bar, foo bar
foo bar

鉴于这首美丽的诗,怎么能全部bar被替换superman,但每次都有不同的结局,包含在一个数组中(is super, is blazing fast, is marvelous, cawabanga)

所以结果是:

foo superman is super, foo superman is blazing fast, foo superman is marvelous
foo superman cawabanga

我知道可以通过 sed 使用 for/loop 来做到这一点。但是有没有更短、更漂亮的解决方案呢?

awk sed
  • 2 个回答
  • 679 Views
Martin Hope
Cedric
Asked: 2018-02-23 05:14:56 +0800 CST

tail -f,在日志空闲 3 秒后插入换行符?

  • 15

执行时tail -f error.log,如何在没有任何内容被附加到文件 3 秒后以编程方式插入换行符?

(显然,一旦添加了一个换行符,在将其他文本行添加到日志文件之前,不应添加其他换行符)

例如,这些行被附加到 error.log :

foo
bar
boo [[wait 4 seconds]]
2far
2foo
2bar
2boo [[wait 40 seconds]]
2far

这将是控制台中的输出:

foo
bar
boo

2far
2foo
2bar
2boo

2far
shell-script text-processing
  • 3 个回答
  • 2156 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