notes
notes copied to clipboard
个人笔记
### ~/.vimrc ```shell "设置主题+透明 autocmd vimenter * hi Normal guibg=NONE ctermbg=NONE " transparent bg colorscheme molokai "显示行号 set nu "启动时隐去援助提示 set shortmess=atI "语法高亮 syntax on "使用vim的键盘模式 "set nocompatible "不需要备份 set...
### 情景 明明已经设置好了代理,通过浏览器访问正常。 但是通过 curl 等工具访问时却怎么也不行。 那么这篇短文可能会有所帮助。 ### ```shell 1)curl https://www.google.com -x 127.0.0.1:1081 2)curl https://www.google.com -x http://127.0.0.1:1081 3)curl https://www.google.com -x socks://127.0.0.1:1080 4)curl https://www.google.com -x socks4://127.0.0.1:1080 5)curl https://www.google.com -x socks5://127.0.0.1:1080 6)curl...
### 情景 当根据指定时间戳生成 ObjectId 时,需要了解 ObjectId 中时间戳的取值范围。 ### 结论 1. ObjectId 是由 24 个十六进制字符(0-f)构成。 2. 其中前 8 个字符为时间戳的十六进制值 3. 因此其最小值到最大值的范围如下 | 范围 | 时间(UTC) | 时间戳 | 十六进制 | |...
### 场景 为了科学的通过 ssh 访问 github,从而快速管理代码。 ### 方法 ```shell Host github.com hostname github.com AddKeysToAgent yes IdentityFile ~/.ssh/github_rsa # 你的 github 的 ssh key ProxyCommand nc -x 127.0.0.1:1080 %h %p #...
### git 全局配置备忘 涉及到代理,commiter,编码及换行等。 ```ini [core] eol = lf bare = false fscache = true autocrlf = input filemode = false ignorecase = false preloadindex = true logallrefupdates = true...
# 1 - tcpdump 抓包 在调试网络通信程序是tcpdump是必备工具。 tcpdump很强大,可以看到网络通信的每个细节。 如TCP,可以看到3次握手,PUSH/ACK数据推送,close4次挥手,全部细节。 包括每一次网络收包的字节数,时间等。 ```shell sudo tcpdump -i any tcp port 9501 ``` * -i 参数制定了网卡,any表示所有网卡 * tcp 指定仅监听TCP协议 * port 制定监听的端口 > tcpdump需要root权限 >...
# A | 指令 | 说明 | | ---- | ---- | | ab | Apache服务器的性能测试工具 | | accept | 指示打印系统接受发往指定目标打印机的打印任务 | | alias | 用来设置指令的别名 | | apachectl |...
### 复合索引排序对照 | 排序及索引对照 | { "username" : 1, "date" : -1 } | { "username" : 1, "date" : 1 }| | -- | -- | -- | |...
| 指令 | 说明 | |-----|------| | df -h | 查看磁盘各分区大小、已用空间等信息 | | du -sh foo | 查看foo目录的大小 | | du -sh * | 列举当前位置所有子目录大小 | | su -s /bin/bash...
### 情形 1. install CentOS 8 2. install the config-manager plugin for dnf 3. issue `dnf config-manager --set-enabled PowerTools` 4. `Error: No matching repo to modify: PowerTools.` ### 原因 为了...