tips
Transformed from Logseq page
tips
-
{{query tips}}
Linked References (37)
晚上又随手试了试 (((6948aad7-f292-4333-bd9c-9b43d4841e56)) #tips #hardware #linux-kernel
-
#+BEGIN_QUOTE 🛠️ 针对USB总线的高级复位方案 一旦确认蓝牙从USB总线上消失,我们可以尝试从两个层面进行强制恢复: 方案A:复位整个USB控制器 (强力但有效) 根据你的lspci输出,系统很可能使用AMD芯片组,其USB控制器通常是xhci_hcd驱动。请尝试复位整个控制器: bash # 查找你的USB控制器,通常是 “USB controller” 字样 sudo lspci -v | grep -i "usb controller" -A 3 # 假设找到的控制器地址是 0000:00:14.0 (很常见) echo -n "0000:00:14.0" | sudo tee /sys/bus/pci/drivers/xhci_hcd/unbind sleep 5 # 等待几秒,让系统稳定 echo -n "0000:00:14.0" | sudo tee /sys/bus/pci/drivers/xhci_hcd/bind ⚠️ 注意:执行此操作会瞬间断开该控制器上的所有USB设备(包括你的键盘、鼠标)。请确保你有备用输入方式(如SSH连接),或提前在图形界面下打开一个具有sudo权限的终端。 #+END_QUOTE
-
plaintextroot@zyc-Laptop /d/shm# echo -n '0000:03:00.4' | tee /sys/bus/pci/drivers/xhci_hcd/unbind 0000:03:00.4⏎ root@zyc-Laptop /d/shm# echo -n '0000:03:00.3' | tee /sys/bus/pci/drivers/xhci_hcd/unbind 0000:03:00.3⏎ root@zyc-Laptop /d/shm# lsusb root@zyc-Laptop /d/shm [1]# echo -n '0000:03:00.3' | tee /sys/bus/pci/drivers/xhci_hcd/bind 0000:03:00.3⏎ root@zyc-Laptop /d/shm# echo -n '0000:03:00.4' | tee /sys/bus/pci/drivers/xhci_hcd/bind 0000:03:00.4⏎ root@zyc-Laptop /d/shm# lsusb Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 003: ID 8087:0029 Intel Corp. AX200 Bluetooth Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 002: ID 04f2:b6cb Chicony Electronics Co., Ltd Integrated Camera Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Why sudo 1.9.16 enables secure_path by default? | Sudo ↗ #tips #security
-
遇到这么个状况: 我把名为ecinfo的脚本放在/usr/local/sbin下,root身份和普通用户都能通过PATH访问到,但普通用户sudo ecinfo却找不到命令
-
交互行为引入的攻击,虽然低级但确实防不胜防,一般人也不会把所有执行的脚本看一遍
-
这时候又是行为分析的主场了,归根结底要确保
...actions = f(user action)
-
-
#+BEGIN_QUOTE ZhongYic00: top能否查看cpu占用图形,类似内存占用那样?或者如何更好地查看整体cpu占用情况(比如总计百分比) Terminal: 在 `top` 命令中,默认情况下会显示每个 CPU 核心的使用情况,但没有类似内存占用的图形化显示。如果你想查看整体 CPU 使用情况的总计百分比,可以使用以下方法: 1. **使用 `top` 命令:** 按下数字 `1` 键,可以展开每个 CPU 核心的使用情况。如果只想看整体,可以关注 `Cpu(s)` 一行中的 `us`(用户态占用)、`sy`(系统态占用)和 `id`(空闲)等字段。 2. **使用 `htop` 工具:** 安装 `htop`,它提供了更友好的界面,包括图形化的 CPU 和内存使用情况。 ```sh sudo apt install htop htop ``` 3. **使用 `mpstat` 命令:** `mpstat` 可以显示整体 CPU 使用率。 ```sh sudo apt install sysstat mpstat ``` 4. **使用 `sar` 命令:** `sar` 是另一个强大的工具,可以显示 CPU 使用率的历史数据。 ```sh sudo apt install sysstat sar -u 1 5 ``` 选择适合你的工具即可。 #+END_QUOTE
tailscale优先ipv6? #tips
-
https://github.com/tailscale/tailscale/issues/7811 ↗
-
It’s unofficial, but be10b52 ↗ added a
TS_DISCO_PONG_IPV4_DELAYenvironment variable so you can set e.g.TS_DISCO_PONG_IPV4_DELAY=300msand make your IPv4 look 300ms worse than you IPv6 if both are available.
-
-
taildrive
-
https://tailscale.com/kb/1369/taildrive?q=drive&tab=linux ↗
-
改tailnet的ACL(nodeAttrs和grant)
-
100.100.100.100:8080 client虚拟出来的网关?
-
-
DNS莫名其妙挂了 #tips
-
具体表现为:
-
浏览器能正常访问,疑似是代理的作用
-
dde认为网络异常,托盘icon有感叹号
-
开启tailnet dns时能访问部分网站但无法访问跳板机:
; WARNING: recursion requested but not available
-
-
诊断失败
-
nmcli dev show| grep IPV4.DNS出来好些项 -
resolvectl(为啥不是systemd-resolve)没用明白
-
-
最后直接重新连了一下WiFi,然后就神奇的好了
-
怀疑是由于dhcp重新配置了dns
-
-
Network configuration - ArchWiki ↗
-
太复杂了,一时半会整不明白
-
TODO 多组件有些耦合,日后看看能不能图化
-
clang standalone编译 #tips #compile
-
Standalone build for clang & lld, fix or remove? - #9 by kwk - LLVM Project - LLVM Discussion Forums ↗
vscode container中的身份与shell #tips #tool
-
Dynamically source the UID and GID when starting devcontainer on Linux · Issue #1155 · microsoft/vscode-remote-release · GitHub ↗
How to resolve hostnames in chroot? - Ask Ubuntu ↗ #tips #linux
-
echo 'nameserver 8.8.4.4' | sudo tee -a /etc/resolv.conf
将string作为object的key{[strvar]:xxx} #typescript #tips
Embedded Template Library ↗ #c++ #tips #embedded
-
嵌入式静态分配版STL
支付宝提现手续费是千分之1(1000块钱1块)。借呗利息一千块钱2毛线/天。所以,支付宝里有1万块钱,从借呗里借1万,然后支付宝还借呗。手续费从10块降到2块。 #tips #economics
-
gitignore只对未被跟踪的文件起效,对于需提交的配置,只能在本地忽略它
-
add to
.git/info/exclude -
git update-index --skip-worktree <file paths>
-
While our editorial board found that your manuscript was not without merit, there was also general consensus that the paper did not make a sufficient contribution
魔改代码时一定要注意,该注释的注释! #tips
use log2Ceil to calc bit width #tips
use chiselTypeOf to infer type #tips
C with inheritance: manually keep struct’s first fields same with super type to preserve mem-layout consistency #tips
8bit mask->epi8 MSB->blendv_epi8 intrinsic-inverse-to-mm-movemask-epi8 ↗ #tips
SPARQL无法count多列即count(?a ?b),暂时只好直接select多列手动计数替代了。。。 #tips
-
若支持子查询可先CONSTRUCT再
count(*) -
也是奇葩,能
count(*)不能选有限几列。。。
其中tmpfiles.d ↗ 似乎甚至能让btrfs自动建为子卷? #tips #linux
-
考虑的很周全啊,真不错
-
tmpfiles.d support creating btrfs subvolumes on ostree systems · Issue #18502 · systemd/systemd · GitHub ↗ 还有对OSTree的优化
-
ostree也属实是破坏一堆。。
-
大概还是语义耦合的问题
-
xxx in yyy的写法:[yyy].includes(xxx) #typescript #tips
vscode terminal启动时运行env.sh #tips
-
就很暴力,
"terminal.integrated.profiles.linux"里设args为["-c","source ../env.sh; xec bash"]
GCC extended ASM ↗ 例如register int a0 asm("a0"); #tips