Skip to content

Commit d7be544

Browse files
committed
update
1 parent 6e89655 commit d7be544

File tree

8 files changed

+64
-7
lines changed

8 files changed

+64
-7
lines changed

README.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,13 @@ See the [LICENSE][] file for the specific language governing permissions and lim
4848
<li><a href="#git">Git</a></li>
4949
<li><a href="#go">Go</a></li>
5050
<li><a href="#javascript">Javascript</a></li>
51-
<li><a href="#k8s">K8s</a></li>
51+
<li><a href="#k8s">K8S</a></li>
5252
<li><a href="#linux">Linux</a></li>
5353
<li><a href="#mac">Mac</a></li>
5454
<li><a href="#nodejs">Nodejs</a></li>
5555
<li><a href="#%E8%BF%90%E7%BB%B4">运维</a></li>
5656
<li><a href="#%E5%85%B6%E4%BB%96">其他</a></li>
57+
<li><a href="#%E5%93%B2%E5%AD%A6">哲学</a></li>
5758
<li><a href="#racket">Racket</a></li>
5859
<li><a href="#redis">Redis</a></li>
5960
<li><a href="#ruby">Ruby</a></li>
@@ -174,6 +175,7 @@ See the [LICENSE][] file for the specific language governing permissions and lim
174175
- [Git Diff](git/diff.md)
175176
- [Git 学习资料](git/git-books.md)
176177
- [git ssh 代理](git/git-ssh-proxy.md)
178+
- [git 小技巧](git/git-tricks.md)
177179
- [git credentials](git/gitcredentials.md)
178180
- [忽略 Git submodule](git/ignore-git-submodule.md)
179181
- [--ours vs --theirs](git/ours-vs-theirs.md)
@@ -196,7 +198,7 @@ See the [LICENSE][] file for the specific language governing permissions and lim
196198
- [使用 Promise 的技巧](javascript/trick-of-promise.md)
197199
- [JS 编程技巧](javascript/tricks-of-js.md)
198200

199-
## K8s
201+
## K8S
200202

201203
- [Helm](k8s/helm.md)
202204
- [K8S CSI 开发](k8s/k8s-csi.md)
@@ -211,6 +213,7 @@ See the [LICENSE][] file for the specific language governing permissions and lim
211213
- [Alfred 找不到文件](linux/alfred-cannot-find-files.md)
212214
- [ansible 部署到 centos7 时,不能找到 service](linux/ansible-deploy-fault-with-centos7-and-service.md)
213215
- [bash error exit](linux/bash-error-exit.md)
216+
- [bash history](linux/bash-history.md)
214217
- [bash 开启 vi 模式](linux/bash-in-vi-mode.md)
215218
- [学习 Bash](linux/bash-learning.md)
216219
- [Bash 的坑](linux/bash-pitfalls.md)
@@ -238,7 +241,7 @@ See the [LICENSE][] file for the specific language governing permissions and lim
238241
- [IO、select、epoll](linux/io-select-epoll.md)
239242
- [iproute2 与 ifconfig 命令](linux/iproute2-vs-ifconfig.md)
240243
- [学习 iptables](linux/iptables.md)
241-
- [sudo bash -c 'su - root'](linux/login-use-root.md)
244+
- [切换到 root 用户](linux/login-use-root.md)
242245
- [lsof 与 fuser](linux/lsof-and-fuser.md)
243246
- [命令行中的乱码](linux/messy-codes-in-console.md)
244247
- [创建临时文件的命令](linux/mktemp.md)
@@ -324,6 +327,10 @@ See the [LICENSE][] file for the specific language governing permissions and lim
324327
- [UTF-8 vs UTF-16](others/utf-8-vs-utf-16.md)
325328
- [zookeeper 健康检查](others/zookeeper-health-check.md)
326329

330+
## 哲学
331+
332+
- [Toulmin Model](philosophy/toulmin-model.md)
333+
327334
## Racket
328335

329336
- [学习 Racket](racket/racket-learning.md)

build

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const _ = require('lodash');
1515
const debug = require('debug')('build');
1616

1717
const categoryNames = {
18+
k8s: 'K8S',
19+
philosophy: '哲学',
1820
thinking: '思考',
1921
'front-end': '前端',
2022
design: '设计',

git/git-tricks.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## git 小技巧
2+
3+
### 推送当前分支到远端
4+
5+
`git push origin HEAD`

linux/bash-history.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## bash history
2+
3+
bash history 有很多参数可以调,https://sanctum.geek.nz/arabesque/better-bash-history/

linux/login-use-root.md

+26-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
1-
## sudo bash -c 'su - root'
1+
## 切换到 root 用户
22

3-
等同于 sudo bash -c 'su -'
4-
等同于 sudo bash -c 'su -l'
5-
意为:用 root 权限开一个 bash 进程,进程第一行命令是以 root 用户完全登录 shell。
3+
### su
4+
5+
`su` 输出 root 用户的密码,切换到 root 用户。
6+
7+
`su` 命令是当前用户用来切换到另一个用户的命令,参数为用户名。执行时会要求输入密码,这个密码是你要切换到的用户的密码。
8+
9+
### sudo su
10+
11+
`sudo su` 输出当前用户的密码,当前用户需要有 root 权限,切换到 root 用户。
12+
13+
但是线上机器一般为了安全问题会禁止非 root 用户使用 `su` 命令,可以用以下命令。
14+
15+
### sudo -u <user> -i
16+
17+
但是线上机器一般为了安全问题会禁止 `sudo /bin/bash`,所以用 `sudo bash -c` 的方法。
18+
19+
### sudo bash -c
20+
21+
- `sudo bash -c 'su - root'`
22+
- `sudo bash -c 'su -l'`
23+
- `sudo bash -c 'su -'`
24+
25+
这三行等价,意为:用 root 权限开一个 bash 进程,进程第一行命令是以 root 用户重新登录 shell,会切换到 root 的用户目录,且重置之前的环境变量。
26+
27+
`sudo bash -c 'su'` 只是切换成 root 用户,不会切换用户目录,也不会重置之前的环境变量。

linux/systemd.md

+9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ systemctl 命令操作 systemd 来管理服务,取代了 systemV 的service、
1717

1818
懒得列举,具体查 man 手册。
1919

20+
### systemd unit 配置加载路径
21+
22+
优先级从低到高
23+
24+
- /usr/lib/systemd/system/ 软件安装包设置的 unit 配置
25+
- /etc/systemd/system/ 系统管理员设置的 unit 配置
26+
27+
可以通过 `systemctl show --property=UnitPath` 看到每个 unit 的配置路径
28+
2029
### journalctl
2130

2231
> journalctl 用来查询 systemd-journald 服务收集到的日志。systemd-journald 服务是 systemd init 系统提供的收集系统日志的服务。

others/maxim.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22

33
<!-- MarkdownTOC GFM -->
44

5+
- [哲学](#哲学)
56
- [学习](#学习)
67
- [编程](#编程)
78
- [人生](#人生)
89

910
<!-- /MarkdownTOC -->
1011

12+
### 哲学
13+
14+
> 君子教养有三(trivium):语法、修辞和逻辑:语法使人说话正确,修辞使人说话优雅、逻辑使人说话有条理。 —— 赛义甫
15+
16+
1117
### 学习
1218

1319
> 不登高山,不知天之高也;不临深谷,不知地之厚也;不闻先王之遗言,不知学问之大也。—— 荀况

philosophy/toulmin-model.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Toulmin Model
2+
3+
Toulmin Model,译作托尔明模型或图尔敏模型,是一种有效证实和阐述自己观点的方法。

0 commit comments

Comments
 (0)