避免格式化

/**
 * <pre>
 *          0
 *         /
 *        1
 *       / \
 *      2   3
 *     / \   \
 *    4   5   6
 * </pre>
 */
/*
 *          0
 *         /
 *        1
 *       / \
 *      2   3
 *     / \   \
 *    4   5   6
 */
/***
 *          0
 *         /
 *        1
 *       / \
 *      2   3
 *     / \   \
 *    4   5   6
 */
// (IntelliJ IDEA 默认未开启此功能)
// @formatter:off
int a =               1;
      int        b=2  ;
// @formatter:on

<pre>标签表示会按HTML文件中的格式原样显示出来的“已格式化过的”文本。

当然也可以用在 Markdown 中。

markdown图片和链接的另一种写法

图片:![img-1]

链接:[website-1]

[img-1]:
    https://raw.githubusercontent.com/openSUSE/artwork/3b49079cc210cd489f56f096aab8978d5083c0f4/logos/distros/Evergreen-green.svg
    "openSUSE logo, Evergreen"

[website-1]:
    https://raw.githubusercontent.com/openSUSE/artwork/3b49079cc210cd489f56f096aab8978d5083c0f4/logos/distros/Evergreen-green.svg
    "openSUSE logo, Evergreen"

(单行也行,引号改成括号也行。)

markdown中的注释

<!--
    这句是注释。
--->

[随便什么]: # "这也可以用作注释。"
[随便什么]: # (这也可以用作注释。)

IntelliJ IDEA中markdown中添加TODO

[//]: # "todo ← 这个todo会被识别。"

.gitignore配置.idea文件夹里的内容

参照 Intellij IDEA官方指南:How to manage projects under Version Control Systems来配置。

可以用.ignore插件。

markdown 换行

  • </br>
  • 行尾加两个空格
  • 行尾加\

Windows Terminal 快捷键

alt+shift++:竖直分割窗口
alt+shift+-:水平分割窗口
alt+↑/↓/←/→:在窗口间移动焦点
alt+shift+↑/↓/←/→:调整窗口大小

Window10

# 显示powershell的代理配置
netsh winhttp show proxy
# 设置代理
netsh winhttp set proxy "127.0.0.1:7890"
# 访问网站,测试代理通不通
Invoke-WebRequest http://google.com

Linux(Ubuntu20.04下)

tldr - Simplified and community-driven man pages
htop - interactive process viewer
tree - list contents of directories in a tree-like format
which - locate a command
type - Display the kind of command the shell will execute
exec - This causes the program that is currently being run by the calling process to be replaced with a new program, with newly initialized stack, heap, and (initialized and uninitialized) data segments.

# 当前shell
echo $0

# 显示iptables的配置
sudo iptables -L -n

# 使修改后的`rules.v4`文件生效
sudo iptables-restore < /etc/iptables/rules.v4

# 已占用的网络端口(用sudo显示的不同)
lsof -i

# 占用80端口的
lsof -i :80

# 所有服务的状态
sudo service --status-all

# 后台运行,终端关闭后会停止
python weibo.py &

# 后台运行,终端关闭后不会停止
nohup python weibo.py &

# 将标准输出重定向到a.txt 
mongo >> a.txt

# 将输出写入到标准输出和a.txt。`-a`是append
mongo | tee -a a.txt

mongoDB

# 查找content中包含“桂西北小哥”的
db.weibo.find({content: {$regex : "桂西北小哥"}})

crontab

Crontab.guru

# 每6分钟执行一次
*/6 * * * * cd ~/weibo/weibo-crawler && python weibo.py