贺巩山的博客

没有伞的孩子更要努力奔跑


  • 首页

  • 文件系统

  • Linux运维

  • 剑指Offer

  • LeetCode题解

  • PAT甲级题解

  • PAT乙级题解

  • CCF CSP题解

  • 分类

  • 标签

  • 归档

  • 书单

  • 关于

  • 搜索

升级Linux内核

发表于 2021-12-21 | 更新于 2021-12-24 | 分类于 linux
字数统计: 651

最近的测试,需要使用4.x及以上版本的Linux内核,而服务器上的CentOS 7.9还停留在3.x时代。因此,有必要升级下内核版本。本文总结了通过源码安装Linux内核的全过程。

阅读全文 »

查看系统的平均负载

发表于 2021-12-20 | 更新于 2021-12-24 | 分类于 operation
字数统计: 147

如何查看系统的运行时间和平均负载

阅读全文 »

网络性能Benchmark——Netperf

发表于 2021-12-20 | 更新于 2021-12-26 | 分类于 computer network
字数统计: 568

Netperf是惠普公司开发的一个网络性能Benchmark。

Currently, its focus is on bulk data transfer and request/response performance using either TCP or UDP, and the Berkeley Sockets interface.

Netperf is a benchmark that can be used to measure the performance of many different types of networking. It provides tests for both unidirectional throughput, and end-to-end latency.

阅读全文 »

网络带宽测试工具——iperf

发表于 2021-12-19 | 更新于 2021-12-24 | 分类于 network
字数统计: 862

本文介绍了网络带宽测试工具iperf的安装和使用。

阅读全文 »

文件系统的层次结构

发表于 2021-12-18 | 更新于 2021-12-18 | 分类于 file system
字数统计: 5

Linux

1
man file-hierarchy

macOS

1
man hier

在Linux中存活下来之hash命令

发表于 2021-12-14 | 更新于 2021-12-14
字数统计: 133

hash是一个Shell内置命令。

1
2
$ help hash
hash [-lr] [-p pathname] [-dt] [name ...]

If no arguments are given, information about remembered commands is displayed.

-l list

The -l option causes output to be displayed in a format that may be reused as input.

-p put

If the -p option is supplied, PATHNAME is used as the full pathname of NAME, and no path search is performed.

-t get

If the -t option is supplied the full pathname to which each NAME corresponds is printed.

If multiple NAME arguments are supplied with -t, the NAME is printed before the hashed full pathname.

-d delete

The -d option causes the shell to forget the remembered location of each NAME.

-r clear

The -r option causes the shell to forget all remembered locations.

Linux内存管理工具

发表于 2021-12-10 | 更新于 2021-12-10 | 分类于 linux
字数统计: 209

查看内存信息

free

1
2
3
4
hegongshan@hgs:~/Desktop$ free
total used free shared buff/cache available
Mem: 2028064 767864 290904 8424 969296 1102548
Swap: 459260 1292 457968

$$
\begin{aligned}
used
&= total - free - buffers - cache \\
&= 2028064 - 290904 - 969296 \\
&= 767864
\end{aligned}
$$
实际上,free的结果也是从/proc/meminfo中解析得到的。

/proc/meminfo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
hegongshan@hgs:~/Desktop$ cat /proc/meminfo
MemTotal: 2028064 kB
MemFree: 290904 kB
MemAvailable: 1102548 kB
Buffers: 50356 kB
Cached: 865900 kB
SwapCached: 64 kB
Active: 379248 kB
Inactive: 1179920 kB
Active(anon): 1388 kB
Inactive(anon): 641172 kB
Active(file): 377860 kB
Inactive(file): 538748 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 459260 kB
SwapFree: 457968 kB
Dirty: 884 kB
Writeback: 0 kB
AnonPages: 642892 kB
Mapped: 286320 kB
Shmem: 8424 kB
KReclaimable: 53040 kB
Slab: 108476 kB
SReclaimable: 53040 kB
SUnreclaim: 55436 kB
KernelStack: 7376 kB
PageTables: 14208 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 1473292 kB
Committed_AS: 3669348 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 37540 kB
VmallocChunk: 0 kB
Percpu: 836 kB
HardwareCorrupted: 0 kB
AnonHugePages: 2048 kB
ShmemHugePages: 0 kB
ShmemPmdMapped: 0 kB
FileHugePages: 0 kB
FilePmdMapped: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
Hugetlb: 0 kB
DirectMap4k: 161728 kB
DirectMap2M: 1935360 kB
free /proc/meminfo 值
Mem total MemTotal 2028064 kB
Mem free MemFree 290904 kB
shared Shmem 8424 kB
buff/cache Buffers + (Cached + SReclaimable) = 50356 + (865900 + 53040) 969296 kB
available MemAvailable 1102548 kB
Swap total SwapTotal 459260 kB
Swap free SwapFree 457968 kB

执行可执行文件

发表于 2021-12-10 | 更新于 2021-12-10
字数统计: 61

对于可执行文件,只需要在终端中输入文件名称就可以执行。

阅读全文 »

常用的Dockerfile命令

发表于 2021-12-10 | 更新于 2021-12-10 | 分类于 docker
字数统计: 28

COPY

ADD

RUN

在构建镜像时执行。

CMD

在运行容器时执行。

ARG

ENV

EXPOSE

构建镜像

1
docker build -t tag_name:version dir

file-system-gekkofs

发表于 2021-12-09 | 更新于 2021-12-09
字数统计: 0
1…345…49
Gongshan He

Gongshan He

490 日志
62 分类
89 标签
GitHub 微博 知乎 Linkedin E-Mail
友情链接
  • 卢明冬的博客
  • lipixun
  • 柳婼 の blog
  • 心灵港
  • Liudeyin
© 2016 — 2023 Gongshan He
访问人数 总访问量 次