sudo apt install rdfind
rdfind -deleteduplicates true /media/faonecze/资料存档/
windows 用 DoubleKiller.exe 还挺方便的
代码人生:编织技术与生活的博客之旅
sudo apt install rdfind
rdfind -deleteduplicates true /media/faonecze/资料存档/
windows 用 DoubleKiller.exe 还挺方便的
自己喜欢啥,总要一遍一遍和朋友介绍,感觉比较麻烦,这样汇总一下,方便朋友一次性安利。
ps. 每个工具其实在 B 站都有视屏科普,大佬们也可以上 B 站看看。
- 全键自定义
- tap key: 支持轻触方向键
- magic key: CaspLk 也可以自定义设置为 FN 键
- 键盘宏
- 自定义 rgb
- type-C 充电
- USB + 蓝牙双模
- 四蓝牙连接
- 带电量显示:Fn2 + 8
缺点是没有静音版本,选了红轴默认不按到底,勉勉强强声音不大。
有个注意点是,当线连接电脑,没关掉蓝牙的话,默认还是蓝牙输入输出,线支持充电。
静音,用电久,自定义鼠标滚轮左右方向,双蓝牙,多设备支持 Logitech Flow,缺点是不好看。
同上款,自定义按键更多,据说有二三十个。缺点是不静音。
ps. 本人是全 windows 开发。
wsl2 支持 docker 了,Terminus 配上个炫酷的半透明界面,oh my zsh 自带各种插件好用的哼,一套下来,windows 变 Linux,并且 pycharm 支持基于 wsl 开发,巴适得很。
关于 sz rz 传输 我这 里有个 解决方案。
wsl2 默认 root 用户
ubuntu config --default-user root
一个 windows 路径转换脚本,建议放到用户执行目录上,复制的 windows 路劲快速转换为 Linux。
#!/usr/bin/env python
# encoding: utf-8
# Created by zza on 2021/6/9 14:23
import re
from prompt_toolkit.clipboard import pyperclip
def convert_path():
path = pyperclip.pyperclip.paste() # r'/mnt/d/Programs/ActivityWatch'
wsl_result = re.match(r"(^[A-Z]:)\\(.*)", path)
if wsl_result:
_disk_symbol = wsl_result[1][:-1].lower()
wsl_path = f'\\mnt\\{_disk_symbol}\\{wsl_result[2]}'.replace('\\', '/')
pyperclip.pyperclip.copy(wsl_path)
print(wsl_path)
return wsl_path
elif re.match(r"^/mnt/([a-z])/(.*)", path):
win_result = re.match(r"^/mnt/([a-z])/(.*)", path)
tail = win_result[2].replace("/", "\\")
win_path = f'{win_result[1].upper()}:\\{tail}'
pyperclip.pyperclip.copy(win_path)
print(win_path)
return win_path
else:
print(f'nothing to do with {path}')
return
if __name__ == '__main__':
pyperclip.pyperclip.copy('D:\\Programs\\ActivityWatch')
convert_path()
print(pyperclip.pyperclip.paste())
输入一下命令切换剪贴板里的路径,还是很舒服的。
之前用的 cmder 感觉还行,但是和 terminus 相比,界面就丑了很多。
待办不管是上班还是平时都用得上。
[[outlook 支持将邮件自动转入待办]]。
顺便说一下,outlook 的日历管理也很香。
手机日历上选择 Exchange 导入方式导入日历,就手机端和电脑端同步了。
这个每个 帖子 都讲烂了,自己看把。
顺便说说 windows 虚拟桌面(部分小伙伴不知道)
windows + ctrl + d 创建桌面
windows + ctrl + f4 删除桌面
windows + ctrl +方向键 快速移动
好了恭喜你拥有了无数个虚拟桌面。可以给桌面命名,把摸鱼桌面,学习桌面,工作桌面,看板桌面分开。
google play 搜索 Tea Time
如何在 python 异步函数中 debug
import asyncio
from aredis import StrictRedis
import nest_asyncio
# pip3 install aredis[hiredis]
# pip3 install nest_asyncio
async def example():
client = StrictRedis(host='127.0.0.1', port=6379, db=0)
await client.flushdb()
# error await client.flushdb()
# error asyncio.get_event_loop().run_until_complete(client.flushdb())
# error asyncio.new_event_loop().run_until_complete(client.flushdb())
# error asyncio.run(client.flushdb())
await client.set('foo', 1)
assert await client.exists('foo') is True
await client.incr('foo', 100)
assert int(await client.get('foo')) == 101
await client.expire('foo', 1)
await asyncio.sleep(0.1)
await client.ttl('foo')
await asyncio.sleep(1)
assert not await client.exists('foo')
loop = asyncio.get_event_loop()
# success nest_asyncio.apply()
loop.run_until_complete(example())
C:\Users\mi\AppData\Roaming\Python\Python310\Scripts
下D:\ProgramData\miniconda3\Scripts
下安装WMI exporter
--collectors.enabled "[defaults],process,container"
Grafana Status Map Panel not working, shows "Panel plugin not found: flant-statusmap-panel" #197
vim prometheus/docker-compose.yml
version: "3.7"
services:
node_exporter:
image: quay.io/prometheus/node-exporter:latest
container_name: node_exporter
command:
- '--path.rootfs=/host'
user: "1000"
network_mode: host
# pid: host
restart: unless-stopped
volumes:
- '/:/host:ro,rslave'
prometheus:
image: prom/prometheus:latest
container_name: "prometheus"
restart: always
ports:
- "9111:9090"
volumes:
- "./prometheus.yml:/etc/prometheus/prometheus.yml"
- "./prometheus_data:/prometheus"
grafana:
image: grafana/grafana
container_name: "grafana"
ports:
- "3000:3000"
restart: always
volumes:
- "./grafana_data:/var/lib/grafana"
process-exporter:
image: ncabatoff/process-exporter
command: --procfs /host/proc -config.path /config/process-exporter-config.yml
privileged: true
volumes:
- /proc:/host/proc
- ./process-exporter-config.yml:/config/process-exporter-config.yml
ports:
- "9256:9256"
restart: always
vim prometheus/prometheus.yml
- 需要根据自己的 ip 进行修改器
global:
scrape_interval: 15s # 默认抓取周期
external_labels:
monitor: "codelab-monitor"
scrape_configs:
- job_name: "node-exporter" #服务的名称
scrape_interval: 5s
metrics_path: /metrics #获取指标的 url
static_configs:
- targets: ["192.168.31.2:9100"] # 这个为监听指定服务服务的 ip 和 port,需要修改为自己的 ip,貌似云服务必须用公网 ip
- job_name: "process-exporter"
scrape_interval: 5s
metrics_path: /metrics
static_configs:
- targets: ["192.168.31.2:9256"]
- job_name: "windows-laptop"
scrape_interval: 5s
metrics_path: /metrics
static_configs:
- targets: ["192.168.31.3:9182"]
- job_name: "other-node-192.168.31.5-node-exporter"
scrape_interval: 5s
metrics_path: /metrics
static_configs:
- targets: ["192.168.31.5"]
访问 http://ip:9100/metrics 查看相关指标是否有出现
node-exporter 找不到挂载硬盘问题
配合 node - 的 Dashborad 编号是 9276
买了个二手 mini 主机,刷成 ubunu 在家里当服务器用。
network:
version: 2
renderer: NetworkManager
wifis:
wlan0:
dhcp4: true
access-points:
"holypangci_5G":
password: "111111111"
dhcp6: true