LaTeX
可以使用 hyperref
给生成度pdf添加元数据。
|
|
Docker
用 shell 连接正在运行的容器 : docker exec -it qbittorrent /bin/bash
查看运行日志: docker logs -f qbittorrent
正则表达式
RE | |
---|---|
. | Match any character. |
^ | Cause match only occur at the begining of the line. |
$ | Cause match only occur at the end of the line. |
? | Match the preceding element appear Zero or One Time. |
* | Match the preceding element occur Any Number of Time. |
+ | Match the preceding element One or More Times. |
'{n,m}' | Match an Element a Specific Number of Times(range from n to m) |
[] | Specify a set of characters to be matched. |
[^bg] | If the first character in a bracket expression is a caret (^), the remaining characters are taken to be a set of characters that must not be present at the given character position. |
(bz | gz | zip) | Allow a match to occur from among a set of expressions |
Shell 命令
- head: View the first n lines of data
- tail: View the last n lines of data
- sort: Orgnise the data into order
- nl: Print line numbers before data
- wc: Print a count of lines, words and characters.
- cut: Cut the data into fields and only display the specified fields.
- sed: Do a search and replace on the data
- uniq: Remove duplicate lines
- tac: Print the data in reverse order
- > : Save output to a file
- >> : Append output to a file
- < : Read input from a file
- 2> : Redirect error messages.
- | : Send the output from one program as input to another program.
SSH 密钥
-
使用
ssh-keygen
生产一对密钥. 生成的密钥一般位于~/.ssh
文件夹下. 该文件应当有如下结构:1 2 3 4 5 6
.ssh ├── id_rsa_key1 ├── id_rsa_key1.pub ├── id_rsa_key2 ├── id_rsa_key2.pub └── known_hosts
-
将生成的密钥使用
ssh-add path/to/id_rsa
加入到ssh
中。 -
将id_rsa_key.pub 的内容拷贝至服务器的文件
~/.ssh/authorized_keys
中,
若 仍需输入密码, 则可通过查看日志rpi:/var/log/auth.log
发现原因。
group最好不要将权限设置为writable,以免密钥失效。
字体
-
等宽字体: Monaco
-
Terminal: Hack Nerd Font Mono
-
中文字体: Noto Serif SC
{% tabs Font %}
|
|
|
|
{% endtabs %}
Amazon S3 图床
If you want to use Amazon S3 to share files publicly for your website or to allow downloads, etc, you might want a URL that's prettier than the default that will be something like this:photos.havecamerawilltravel.com.photoshelter.com.s3.amazonaws.com
I might, for instance, just want to be able to use the URL:images.havecamerawilltravel.com
To do that, you can set a CNAME that points to your Amazon S3 bucket.
- First make sure that your bucket name is the same as your CNAME. For instance, if I want the CNAME to be photos.havecamerawilltravel.comotoshelter.com, I'd set the bucket name to photos.havecamerawilltravel.comotoshelter.com.
- Then you need to log into wherever your DNS settings are being maintained (if you haven't changed it, it's probably your web host), and create a new CNAME record for that domain. For the example above, I'd then point that CNAME to:
photos.havecamerawilltravel.com.photoshelter.com.s3.amazonaws.com
Troublesome
Mac充电提示音
充电提示音还是挺烦的,尤其是在图书馆安静的环境下,用如下命令可以对提示音进行关闭
|
|
Git文件名乱码问题
|
|
Rsync 乱码问题
macOS 自带的 rsync 版本为2.6.9, 中文会出现乱码. 可用 brew 安装最新版解决.
Brew rebase-merge error
The following problem can be solved with brew update-reset
|
|
Emacs shell 乱码
[Help] terminal zsh control characters in prompt : emacs
rm ~/.iterm2_shell_integration.zsh
字体问题
Monaco 字符扩充:https://github.com/Karmenzind/monaco-nerd-fonts
Monaco 粗体: https://github.com/vjpr/monaco-bold
iTerms 2 全屏下顶部有白条在闪烁
White line appears when in full-screen (#9199) · Issues · George Nachman / iterm2 · GitLab
Apple has acknowledged the bug, so I guess it's hard to fix.
There is another workaround. Turn on Prefs > Appearance > Tabs > Flash tab bar when switching tabs in full screenand make sure the menu item View > Show Tabs in Full Screen is not checked.
This prevents the tabbar from becoming a titlebar accessory, which is the root cause of the bug.
Parallels 不能联网怎么办?
通过终端执行命令运行
- 打开终端执行:sudo -b -S /Applications/Parallels\ Desktop.app/Contents/MacOS/prl_client_app
- 输入电脑密码,回车即可。
需要注意的是,每次启动 PD 都需要打开终端执行以上命令才可以!
如果嫌麻烦,那你可以将「相关文件 -> PD 启动」拖拽到桌面上,然后在「PD 启动」上右键 -> 打开方式 -> 文本编辑,将里面的「你的密码」改成你的管理员密码,然后保存,用的时候双击「PD 启动」即可(如果打不开请右键,打开方式,终端)。
Mosh 无法连接
添加--bind-server=any
选项
Nothing received from server on UDP port 60001 · Issue #1074 · mobile-shell/mosh
|
|