2019年1月

Thread类作为对象,其本身具有的功能是顺序执行指定功能(run()方法,即普通的函数功能)和异步执行指定功能(start()方法,在不阻塞后续代码执行的同时,执行自身的run()方法,即多线程特性,开启新线程来执行该方法)。对应的接口为Runnable。构造函数有如下形式:

Thread()
Allocates a new Thread object.
Thread(Runnable target)
Allocates a new Thread object.
Thread(String name)
Allocates a new Thread object.
Thread(ThreadGroup group, Runnable target)
Allocates a new Thread object.
Thread(ThreadGroup group, String name)
Allocates a new Thread object.
Thread(Runnable target, String name)
Allocates a new Thread object.
Thread(ThreadGroup group, Runnable target, String name)
Allocates a new Thread object so that it has target as its run object, has the specified name as its name, and belongs to the thread group referred to by group.
Thread(ThreadGroup group, Runnable target, String name, long stackSize)
Allocates a new Thread object so that it has target as its run object, has the specified name as its name, and belongs to the thread group referred to by group, and has the specified stack size.

- 阅读剩余部分 -

在bash中可以使用转义字符来显示不同的颜色。

<ESC>[{attr};{fg};{bg}m

其中为ESC键对应的转义字符,可用的表达方式有\e\033^[三种

在vi中输入该字符的方式: i进入编辑模式->Ctrl+V->ESC键

应该会出现一个与文本颜色不同的^[字符,此时输入成功

{attr} needs to be one of the following: 0 Reset All Attributes (return to normal mode) 重置特效 1 Bright (usually turns on BOLD) 加亮(显示效果通常为加粗) 2 Dim 变淡 3 Underline 下划线 5 Blink キラキラ~ 7 Reverse 前景/背景色交换 8 Hidden (emm暂时没看出来) {fg} needs to be one of the following: 前景色 30 Black 31 Red 32 Green 33 Yellow 34 Blue 35 Magenta 36 Cyan 37 White {bg} needs to be one of the following: 背景色 40 Black 41 Red 42 Green 43 Yellow 44 Blue 45 Magenta 46 Cyan 47 White

通过/etc/motd (mESSAGE oF tOdAY)可以展示有意思的登陆提示信息。

参考: https://www.linuxjournal.com/article/8603

使用的是vg和lvm系列的命令,大概vg=Volume Group, LVM=Logical Volume Manager?

扫描lvm卷组

vgscan

扫描lvm卷

lvscan

两者显示详细信息的命令分别对应为vgdisplaylvdisplay

激活卷组

sudo vgchange -ay <vg-name>

取消激活

sudo vgchange -an <vg-name>

经过vgchange激活的卷组可以通过mount/dev/<vg-name>/<volume-name>直接挂载。