Linux Swap交换分区

在我们自己的购买的服务器环境中,一般是买的1g的内存,但是当服务器里面的东西装的比较多的时候就会导致内存不够用了,这个时候可以通过增加虚拟内存来夸大内存容量。

设置

0、查看内存使用情况

1
2
3
4
$ free -m
total used free shared buff/cache available
Mem: 3914 161 1110 0 2643 3479
Swap: 8703 64 8639

1、检查 Swap 空间,先检查一下系统里有没有既存的 Swap 文件

Read More

gitignore文件的顺序

发现.gitignore里面条目顺序是有意义的。

1
2
3
4
5
*.c
*.cpp
!skts.c
!np_datetime.c
!np_datetime_strings.c

!的几项生效

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ git status
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: .gitignore

Untracked files:
(use "git add <file>..." to include in what will be committed)
__init__.pxd
pandas_helper/_libs/tslibs/src/datetime/np_datetime.c
pandas_helper/_libs/tslibs/src/datetime/np_datetime_strings.c

no changes added to commit (use "git add" and/or "git commit -a")

如果反过来

Read More

Ubuntu 22.04安装Cuda Toolkit

Nvidia现在要求安装CuDNN和NICC都得登录Nvidia Developer网站,国内巨慢。药丸。

CUDA

1
2
3
4
sudo -i # 切换root权限
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb
dpkg -i cuda-keyring_1.0-1_all.deb
apt update && apt install cuda -y

NICC

1
apt install libnccl2=2.15.5-1+cuda11.8 libnccl-dev=2.15.5-1+cuda11.8

Read More

修复MongoDB设置导致mongod无法启动

缘起

为了解决使用Arctic[1] MongoDB的日志里出现

1
SASL SCRAM-SHA-1 authentication failed for myAdminUser on admin from client 192.168.3.100:9560 ; UserNotFound: Could not find user "myAdminUser" for db "admin"

错误的问题,参考了数个连接(包括StackOverflow[2]),都提示要将authSchema.currentVersion5改成3。照做以后就杯具了,mongod服务完全打不开了,提示错误

1
This server is using MONGODB-CR, an authentication mechanism which has been removed from MongoDB 4.0. In order to upgrade the auth schema, first downgrade MongoDB binaries to version 3.6 and then run the authSchemaUpgrade command. See http://dochub.mongodb.org/core/3.0-upgrade-to-scram-sha-1

Read More