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
开机检测 在开机的时候 检测到移动硬盘 自动挂载
systemctl restart smbd.service
[[clash]]
network:
version: 2
renderer: networkd
ethernets:
enp2s0:
dhcp4: true
optional: true
摸鱼工具使用 docker run -it --rm svenstaro/genact
$ sudo vim /etc/docker/daemon.json
{
"registry-mirrors": [
"https://hub-mirror.c.163.com",
"https://ustc-edu-cn.mirror.aliyuncs.com",
"https://ghcr.io",
"https://mirror.baidubce.com"
]
}
通过正在运行的 docker pod 获取 docker-compose.yaml
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock red5d/docker-autocompose <container-name-or-id>
sudo docker run --rm -v /var/run/docker.sock:/var/run/docker.sock red5d/docker-autocompose epic_bartik
sudo docker stop $(sudo docker ps -aq)
zza@zza-server:smb_tmp % time dd if=/dev/zero of=./testReadOrWrite bs=8k count=100000
记录了100000+0 的读入
记录了100000+0 的写出
819200000字节(819 MB,781 MiB)已复制,5.94344 s,138 MB/s
dd if=/dev/zero of=./testReadOrWrite bs=8k count=100000 0.16s user 4.67s system 80% cpu 6.003 total
zza@zza-server:smb_tmp % time dd if=./testReadOrWrite of=/dev/null bs=8k count=100000
记录了100000+0 的读入
记录了100000+0 的写出
819200000字节(819 MB,781 MiB)已复制,0.852206 s,961 MB/s
dd if=./testReadOrWrite of=/dev/null bs=8k count=100000 0.06s user 0.79s system 99% cpu 0.857 total
zza@zza-server:smb_tmp % time dd if=./testReadOrWrite of=./testReadAndWrite bs=8k count=100000
记录了100000+0 的读入
记录了100000+0 的写出
819200000字节(819 MB,781 MiB)已复制,6.46195 s,127 MB/s
dd if=./testReadOrWrite of=./testReadAndWrite bs=8k count=100000 0.13s user 5.27s system 83% cpu 6.507 total
zza@zza-server:tmp % time dd if=/dev/zero of=./testReadOrWrite bs=8k count=100000
记录了100000+0 的读入
记录了100000+0 的写出
819200000字节(819 MB,781 MiB)已复制,42.5608 s,19.2 MB/s
dd if=/dev/zero of=./testReadOrWrite bs=8k count=100000 0.28s user 7.69s system 18% cpu 42.591 total
zza@zza-server:tmp % time dd if=./testReadOrWrite of=/dev/null bs=8k count=100000
记录了100000+0 的读入
记录了100000+0 的写出
819200000字节(819 MB,781 MiB)已复制,0.835777 s,980 MB/s
dd if=./testReadOrWrite of=/dev/null bs=8k count=100000 0.08s user 0.76s system 99% cpu 0.840 total
zza@zza-server:tmp % time dd if=./testReadOrWrite of=./testReadAndWrite bs=8k count=100000
记录了100000+0 的读入
记录了100000+0 的写出
819200000字节(819 MB,781 MiB)已复制,42.0116 s,19.5 MB/s
dd if=./testReadOrWrite of=./testReadAndWrite bs=8k count=100000 0.29s user 8.90s system 21% cpu 42.039 total
[[服务器]]
参考
笔记本直接看这个人
CPU+主板 B660M-PLUS + i7-12700F ¥3109
散热 利民 PA120 ¥169
内存 骇客神条 16g x 2 = ¥1099.00
DDR4 会便宜很多,主板就得换一个(也会便宜很多)
电源 酷冷 GX850 ¥594
机箱 先马(SAMA)颜之神 钛灰色 ¥226
风扇 利民 12 厘米风扇 3 个,安装在尾部和顶部 ¥53
声音大
显卡 3070 卡诺基 ¥2199
卡诺基
在翻新卡里算口碑不错的。总价 7449
最简单粗暴的电源计算办法,把 CPU 和 GPU 的功耗 加起来再加上 100W,可以粗略算出配置的整体功耗。】
电源 850w + 100w + 65w (cpu)
AS SSD Benchmark 2.0.7316.34247
------------------------------
Name: Fanxiang S690 2TB
Firmware: SN07443
Controller: stornvme
Offset: 16384 K - OK
Size: 1863.01 GB
Date: 2023/2/13 11:18:00
------------------------------
Sequential:
------------------------------
Read: 4215.19 MB/s
Write: 3722.04 MB/s
------------------------------
4K:
------------------------------
Read: 79.78 MB/s
Write: 222.97 MB/s
------------------------------
4K-64Threads:
------------------------------
Read: 2091.47 MB/s
Write: 1283.86 MB/s
------------------------------
Access Times:
------------------------------
Read: 0.016 ms
Write: 0.060 ms
------------------------------
Score:
------------------------------
Read: 2593
Write: 1879
Total: 5783
------------------------------
------------------------------------------------------------------------------
CrystalDiskMark 8.0.1 x64 (C) 2007-2021 hiyohiyo
Crystal Dew World: https://crystalmark.info/
------------------------------------------------------------------------------
* MB/s = 1,000,000 bytes/s [SATA/600 = 600,000,000 bytes/s]
* KB = 1000 bytes, KiB = 1024 bytes
[Read]
SEQ 1MiB (Q= 8, T= 1): 4858.861 MB/s [ 4633.8 IOPS] < 1509.94 us>
SEQ 1MiB (Q= 1, T= 1): 4486.361 MB/s [ 4278.5 IOPS] < 233.60 us>
RND 4KiB (Q= 32, T= 1): 883.414 MB/s [ 215677.2 IOPS] < 143.61 us>
RND 4KiB (Q= 1, T= 1): 79.243 MB/s [ 19346.4 IOPS] < 51.61 us>
[Write]
SEQ 1MiB (Q= 8, T= 1): 4467.455 MB/s [ 4260.5 IOPS] < 1849.33 us>
SEQ 1MiB (Q= 1, T= 1): 4459.696 MB/s [ 4253.1 IOPS] < 234.96 us>
RND 4KiB (Q= 32, T= 1): 423.689 MB/s [ 103439.7 IOPS] < 304.18 us>
RND 4KiB (Q= 1, T= 1): 257.067 MB/s [ 62760.5 IOPS] < 15.85 us>
Profile: Default
Test: 1 GiB (x5) [E: 0% (0/1863GiB)]
Mode: [Admin]
Time: Measure 5 sec / Interval 5 sec
Date: 2023/02/13 11:28:35
OS: Windows 10 Professional [10.0 Build 22621] (x64)
AS SSD Benchmark 2.0.7316.34247
------------------------------
Name: Fanxiang S690 2TB
Firmware: SN07443
Controller: stornvme
Offset: 16384 K - OK
Size: 1863.01 GB
Date: 2023/2/14 11:04:19
------------------------------
Sequential:
------------------------------
Read: 4150.81 MB/s
Write: 4084.55 MB/s
------------------------------
4K:
------------------------------
Read: 63.06 MB/s
Write: 204.81 MB/s
------------------------------
4K-64Threads:
------------------------------
Read: 2089.18 MB/s
Write: 1283.93 MB/s
------------------------------
Access Times:
------------------------------
Read: 0.087 ms
Write: 0.071 ms
------------------------------
Score:
------------------------------
Read: 2567
Write: 1897
Total: 5776
------------------------------
------------------------------------------------------------------------------
CrystalDiskMark 8.0.1 x64 (C) 2007-2021 hiyohiyo
Crystal Dew World: https://crystalmark.info/
------------------------------------------------------------------------------
* MB/s = 1,000,000 bytes/s [SATA/600 = 600,000,000 bytes/s]
* KB = 1000 bytes, KiB = 1024 bytes
[Read]
SEQ 1MiB (Q= 8, T= 1): 4828.908 MB/s [ 4605.2 IOPS] < 1728.61 us>
SEQ 1MiB (Q= 1, T= 1): 4506.055 MB/s [ 4297.3 IOPS] < 232.57 us>
RND 4KiB (Q= 32, T= 1): 808.553 MB/s [ 197400.6 IOPS] < 156.88 us>
RND 4KiB (Q= 1, T= 1): 71.322 MB/s [ 17412.6 IOPS] < 57.27 us>
[Write]
SEQ 1MiB (Q= 8, T= 1): 4393.255 MB/s [ 4189.7 IOPS] < 1906.56 us>
SEQ 1MiB (Q= 1, T= 1): 4383.751 MB/s [ 4180.7 IOPS] < 239.06 us>
RND 4KiB (Q= 32, T= 1): 405.718 MB/s [ 99052.2 IOPS] < 322.86 us>
RND 4KiB (Q= 1, T= 1): 247.658 MB/s [ 60463.4 IOPS] < 16.43 us>
Profile: Default
Test: 1 GiB (x5) [E: 66% (1226/1863GiB)]
Mode: [Admin]
Time: Measure 5 sec / Interval 5 sec
Date: 2023/02/14 11:09:57
OS: Windows 10 Professional [10.0 Build 22621] (x64)
clash for windows 在目标代理拒绝的时候,会占用大量的 cpu 计算资源,不知道在干啥。
参考:win10 要怎么样限制某个程序占用的 CPU 和内存?
任务 管理器
详细信息
窗口
找到 clash-win64.exe
右键-设置相关性
设置 1-2 个 cpu
目前问题:
import datetime
from lunardate import LunarDate
Zhi = ["子", "醜", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"]
def get_factor_time(time:datetime.datetime=None):
if time is None:
time = datetime.datetime.now()
# 获取农历时间
lunar_time = LunarDate.fromSolarDate(time.year, time.month, time.day)
# 输出农历时间
lunar_month = lunar_time.month
lunar_day = lunar_time.day
lunar_hour = time.hour//2
print(f"农历时间:{lunar_month} 月 {lunar_day} 日 {lunar_hour}({Zhi[lunar_hour]}) 时")
#!/usr/bin/env python
# encoding: utf-8
# @Time : 2023/07/04 01:05:33
# @author : zza
# @Email : z740713651@outlook.com
# @File : xiao_liu_ren.py
from collections import defaultdict
import datetime
from lunardate import LunarDate
Zhi = ["子", "醜", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"]
xiao_liu_ren = [
"大安",
"留连",
"速喜",
"赤口",
"小吉",
"空亡",
]
def get_factor_time(time: datetime.datetime = None):
if time is None:
time = datetime.datetime.now()
print(f"阳历时间:{time.isoformat()}")
# 获取农历时间
lunar_time = LunarDate.fromSolarDate(time.year, time.month, time.day)
# 输出农历时间
lunar_month = lunar_time.month
lunar_day = lunar_time.day
lunar_hour = (time.hour + 1) // 2
print(f"农历时间:{lunar_month} 月 {lunar_day} 日 {Zhi[lunar_hour]}({lunar_hour}) 时")
factor_month = xiao_liu_ren[(lunar_month - 1) % 6]
factor_day = xiao_liu_ren[(lunar_month - 1 + lunar_day - 1) % 6]
factor_hour = xiao_liu_ren[(lunar_month - 1 + lunar_day - 1 + lunar_hour) % 6]
print(f"小六壬月日时:{factor_month} {factor_day} {factor_hour}")
return factor_month, factor_day, factor_hour
def lost_item(factor):
guaci = {
"大安": {
"留连": "大安加留连,失物西北去。",
"速喜": "大安加速喜,失物当日见。",
"赤口": "大安加赤口,失物不用找。",
"小吉": "大安加小吉,失物不出门。",
"空亡": "大安加空亡,失物无踪影。",
"大安": "大安加大安,失物在家里。",
},
"留连": {
"大安": "留连加大安,物在家中 藏。",
"速喜": "留连加速喜,失物三天里。",
"赤口": "留连加赤口,失物准丢失。",
"小吉": "留连加小吉,失物东南去。",
"空亡": "留连加空亡,失物不见面。",
"留连": "留连加留连,失物落在南。",
},
"速喜": {
"赤口": "速喜加赤口,失物往正北。",
"小吉": "速喜加小吉,失物在家里。",
"空亡": "速喜加空亡,失物不久见。",
"大安": "速喜加大安,失物不丢失。",
"留连": "速喜加留连,失物无信息。",
"速喜": "速喜加速喜,失物落正南。",
},
"赤口": {
"小吉": "赤口加小吉,失物无信息。",
"空亡": "赤口加空亡,失物不用找。",
"大安": "赤口加大安,失物东北找。",
"留连": "赤口加留连,失物不回还。",
"速喜": "赤口加速喜,失物有着落。",
"赤口": "赤口加赤口,失物正西找。",
},
"小吉": {
"空亡": "小吉加空亡,失物正东找。",
"大安": "小吉加大安,失物自己出。",
"留连": "小吉加留连,失物上西南。",
"速喜": "小吉加速喜,失物在院里。",
"赤口": "小吉加赤口,失物丢了手。",
"小吉": "小吉加小吉,失物在西南。",
},
"空亡": {
"大安": "空亡加大安,失物反复间。",
"留连": "空亡加留连,失物永不还。",
"速喜": "空亡加速喜,失物在家里。",
"赤口": "空亡加赤口,失物往远走。",
"小吉": "空亡加小吉,失物回家里。",
"空亡": "空亡加空亡,失物寻不见。",
},
}
return guaci[factor[1]][factor[2]]
if __name__ == "__main__":
# get_factor_time()
# 日上起時。 假如三月初五日辰時:三月在速喜上;就速喜上起初一;初五在大安;大安上起子時;數至辰時即是小吉; 以類推占,餘皆倣此。
# 速喜 大安 小吉
res = get_factor_time(datetime.datetime(2023, 4, 24, 7, 15))
assert res == ("速喜", "大安", "小吉"), res
res = lost_item(res)
assert res == "大安加小吉,失物不出门。", res
res = get_factor_time(datetime.datetime(2022, 4, 30, 8, 20))
assert res == ("速喜", "留连", "空亡"), res
res = lost_item(res)
assert res == "留连加空亡,失物不见面。", res
大安
不动 木 青色 东 吉祥
大安事事昌,求谋在东方,失物去不远
留连
慢 四方土 黑色 纠狸 拖延
留连事难成,求谋日未明,官事只宜缓
速喜
快速 火 红色 南方
吉利求财向南行,失物申未午(南或西南)
赤口
吵 金 白色 西方 凶险
赤口主口舌,官非切要防,失物急去寻
小吉
主动 缓慢 水 北方 吉利
小吉最吉昌,失物在坤方(西南)
空亡
无 随性 中央土 黄色 难以找回
空亡事不禅,失物寻不见
大安日
留連日
速喜日
赤口 日
小吉日
空亡日
I use Microsoft-to-do to make a daily plan, but sometimes, I need to check-up if there is free time to give a session or something else. I need my Microsoft-to-do plan will show in Outlook.com's Calendar. Make a better way to me view my schedule.
我使用 Microsoft to do 来制定每日计划,但有时,我需要检查是否有空闲时间进行会议或其他活动。我需要我的 Microsoft 待办计划将显示在 Outlook.com 的日历。给我一个更好的方法来查看我的时间表。
I use Power Automate to make a action for create event when I made item at Microsoft-to-do. However, we need to write the reminder time when creating the to-do item.
在我创建一个待办时,Power Automate 会收到通知,并创建一个日历事件。 但是,我们需要在创建待办时,同时写上提醒时间。
First click Power Automate website and login with your Microsoft-account.
when a task is add
- Outlook TasksNew step
Condition
- Control
Create event (V3)
- Outlook.com
Add action
(if you need email notice)Send an email(V2)
- Outlook.com
使用 outlook 邮箱账号登录 Power Automate。
在添加任务时
- Outlook Tasks条件
- 控件
创建事件 (V3)
- Outlook.com
添加操作
发送电子邮件 (V2)
- Outlook.com
Ok,now,when you create a to-do item with Reminder-date-time,it will be syncing in a few minutes. And send an email to you
好了,现在当你创建一个待办事项,并且有提醒时间的时候,他将会在一段时间内同步到日历上。并在完成后发送一份邮件到你填写的邮箱里。