SSH 登录欢迎信息
终端登录时显示给用户的欢迎消息,无论是通过远程 SSH 登录还是直接通过 TTY 或终端,是 motd 的一部分,即 Message Of The Day 守护程序。 通过修改 /etc/update-motd.d 目录中的 /etc/motd 文件或脚本,可以自定义 motd 消息以适合每个用户或管理员的个性化需求。
终端登录时显示给用户的欢迎消息,无论是通过远程 SSH 登录还是直接通过 TTY 或终端,是 motd 的一部分,即 Message Of The Day 守护程序。 通过修改 /etc/update-motd.d 目录中的 /etc/motd 文件或脚本,可以自定义 motd 消息以适合每个用户或管理员的个性化需求。
&>)echo hello &> log.info
$ cat log.info
hello
> filename <<EOF)cat > hello.sh << EOF
#!/bin/bash
echo hello
EOF
let)let n=10-3+4/2
echo $n
9
$ vim test.sh
#!/bin/bash
echo $str
$ chmod u+x test.sh
$ bash test.sh
$ ./test.sh
$ source test.sh
hello world
$ . test.sh
hello world
export),父进程定义的变量子进程可见。$ export str
$ bash test.sh
hello world
$ source test.sh
hello world
unset)$ unset str
$ echo $str
$$ 当前进程ID$ echo $$
26102
$0 当前进程名$ echo $0
-bash
$ echo ${ips[@]}
10.0.0.1 10.0.0.2 10.0.0.3
抽取视频的关键帧,保存为zip文件。
-c, --create Create a new archive. Arguments supply the names of the files to be archived.
-x, --extract, --get Extract files from an archive.
-z, --gzip, --gunzip, --ungzip Filter the archive through gzip(1).
-j, --bzip2 Filter the archive through bzip2(1).
-f, --file=ARCHIVE Use archive file or device ARCHIVE. If this option is not given, tar will first examine the environment variable `TAPE'. If it is set, its value will be used as the archive name. Otherwise, tar will assume the compiled-in default.
-t, --list List the contents of an archive.
-v, --verbose Verbosely list files processed.
排除所有的 yaml 文件
zip -r yolov5.zip yolov5/ -x "*yolo*.yaml"
只查看文件名 $ zipinfo -1 yolov5.zip yolov5/ yolov5/hubconf.py yolov5/tutorial.ipynb yolov5/Dockerfile yolov5/README.md yolov5/.dockerignore yolov5/models/ yolov5/models/common.py yolov5/models/export.py yolov5/models/yolov5s.yaml yolov5/models/yolo.py yolov5/models/init.py yolov5/models/experimental.py yolov5/models/yolov5m.yaml yolov5/models/yolov5l.yaml yolov5/models/yolov5x.yaml yolov5/LICENSE yolov5/.gitignore yolov5/test.py yolov5/train.py yolov5/weights/ yolov5/weights/download_weights.sh yolov5/requirements.
du - 估计文件空间使用量
-s, --summarize display only a total for each argument
-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)
top -p 1
top -p1
top - 22:58:02 up 323 days, 12:09, 2 users, load average: 0.64, 0.61, 0.38
Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie
%Cpu(s): 7.2 us, 1.8 sy, 0.0 ni, 90.3 id, 0.0 wa, 0.5 hi, 0.2 si, 0.0 st
MiB Mem : 3780.8 total, 400.2 free, 1749.6 used, 1631.0 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 1939.3 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 20 0 178540 7680 3792 S 0.0 0.2 7:50.54 systemd
Ubuntu
sudo apt install vim-gtk3
运行
vim -g
gvim
:!command 运行shell命令:!ls -l 查看当前目录列表:!ifconfig 查看本地IP地址v 进入字符可视w 选择下一个单词0 选择到行首$ 选择到行尾c 剪切选择的字符d 删除选择的字符x 删除选择的字符ggVG 选择所有的字符y 复制选择的字符:%y 复制所有的字符dd 剪切当前行3dd 剪切3行y$ 复制当前字符到行尾:y 复制当前行yy 复制当前行3yy 复制3行:y+ 复制光标所在行(也可以先使用块的方式进行选择再复制):%y+ 复制所有数据p 粘贴x 删除当前字符:1,$d 删除所有行(1第一行开始,$直到文件末尾,d删除)dw 删除光标所在字符到单词的末尾diw 删除光标所在的整个单词d0 删除光标所在字符到行首d$ 删除光标所在字符到行尾dG 删除光标所在行到文件末尾:%s/search_word/replace_word/g 替换(全文) :1,$s/search_word/replace_word/g 替换(全文) :3,4s/search_word/replace_word/g 替换(3-4行) :%s/search_word//g 删除(全文) :
在文件之间建立链接
ln [OPTION]... [-T] TARGET LINK_NAME
ln [OPTION]... TARGET
ln [OPTION]... TARGET... DIRECTORY
ln [OPTION]... -t DIRECTORY TARGET...
rm /var/www/ubuntu
更改文件所有者和组
chown [OPTION]... [OWNER][:[GROUP]] FILE...
sudo nano /etc/apt/mirror.list
############# config ##################
set base_path /data/apt-mirror
#set mirror_path $base_path/mirror
#set skel_path $base_path/skel
#set var_path $base_path/var
#set cleanscript $var_path/clean.sh
#set defaultarch <running host architecture>
#set postmirror_script $var_path/postmirror.sh
#set run_postmirror 0
set nthreads 20
set _tilde 0
############# end config ##############
deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu focal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu focal-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu focal-security main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu focal-proposed main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
clean http://archive.ubuntu.com/ubuntu
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 8081
......
......
sudo nano /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:8081>
......
......
</VirtualHost>
sudo systemctl restart apache2
docker pull nvidia/cuda:11.1-cudnn8-devel-ubuntu20.04
docker run -it --name build-onnxruntime-gpu --runtime nvidia \
-v $(pwd)/onnxruntime:/onnxruntime -w /onnxruntime \
nvidia/cuda:11.1-cudnn8-devel-ubuntu20.04
sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
apt-get update
apt-get install language-pack-en git cmake python3 python3-pip -y
locale-gen en_US.UTF-8
update-locale LANG=en_US.UTF-8
pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip3 install numpy
编译 ./build.
-pix_fmt(像素格式) -s(设置帧大小WxH)ffmpeg -y -i input.mp4 -pix_fmt rgb8 -r 10 -s 320x240 output.gif
ffmpeg -y -i input.mp4 -pix_fmt rgb8 -r 10 -vf 'scale=320:-1' output.gif
-ss(开始时间偏移) -t(持续时间)ffmpeg -i input.mp4 -vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif
ffmpeg -y -ss 5 -t 5 -i input.mp4 -vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif
-r(设置帧速率)ffmpeg -i input.mp4 -r 1 -s 1024x768 -f image2 input-%03d.jpeg