Linux 开机运行
Linux 开机运行
1. crontab
man 5 crontab
其中有@reboot 每次开机执行一次
grep CRON /var/log/syslog 查看crontab 日志
因为crontab服务优先级很高, 有些操作过早执行 或者环境未设置前执行, 会执行失败
2. systemd
[Unit]
Description=trojan
Documentation=https://trojan-gfw.github.io/trojan/config https://trojan-gfw.github.io/trojan/
After=network.target network-online.target nss-lookup.target mysql.se...
Python asyncio
Python asyncio
Reference
asyncio — Asynchronous I/O
Async IO in Python: A Complete Walkthrough
Python Asyncio: The Complete Guide
计算两个坐标的距离
计算两个坐标的距离
1. 地球是圆的, 取弧线的长度
# dart
import 'dart:math' show cos, sqrt, asin;
double calculateDistance(lat1, lon1, lat2, lon2){
var p = 0.017453292519943295;
var c = cos;
var a = 0.5 - c((lat2 - lat1) * p)/2 +
c(lat1 * p) * c(lat2 * p) *
(1 - c((lon2 - lon1) * p))/2;
return 12742 * asin(sqrt(a));
}
2. 使用geolocato...
Yabai Tiling Window Manager
Yabai Tiling Window Manager
1. Disabling System Integrity Protection
1. 闭机
2. 常按开机键
3. Continue until you see Utilities in the menu bar
4. Select Terminal
#
# APPLE SILICON
#
# If you're on Apple Silicon macOS 12.x.x
# Requires Filesystem Protections, Debugging Restrictions and NVRAM Protection to be disabled
# (printed warning can be safely...
leetcode-cli
leetcode-cli
登录国际服
[ERROR] invalid password?
Login into leetcode on chrome
install cookie.chrome pluging with command => leetcode plugin -i cookie.chrome
install libsecret tools =>
linux (sudo apt-get install libsecret-tools)
mac ( brew install libsecret )
now try to log in
Ref link: https://github.com/skygra...
Python Excel
Python Excel
Reference
Python 自动化操作 Excel 看这一篇就够了
What is the best library in python to deal with excel files? [closed]
MacOS 输入法自动选择
MacOS 输入法自动选择
Reference
如何让vim退出「插入模式」的时候自动切换为英文输入法?
macOS下vim 中文输入法切换问题和两种解决方案
Vim 输入中文时输入法的自动切换
453 post articles, 57 pages.