1.插入bilibili视频 1 {% mmedia "bilibili" "bvid:BV1A44y1u7PF" "danmaku:false" %}
详细参数表:
参数
默认
说明
aid
-
aid
bvid
-
bvid,与aid同时出现时以bvid为准
page
1
page
danmaku
true
是否有弹幕,ture or false
allowfullscreen
allowfullscreen
允许全屏,allowfullscreen或true允许,其他选项不允许
sandbox
见 配置
iframe sandbox
width
100%
css属性
max_width
850px
css 属性
margin
auto
css 属性
示例:
1 {% mmedia "bilibili" "bvid:BV1A44y1u7PF" %}
效果:
2.chkconfig命令与systemctl命令对比
chkconfig
Systemctl
说明
chkconfig [服务] on
systemctl enable [unit type]
设置服务开机启动
chkconfig [服务] off
systemctl disable [unit type]
设备服务禁止开机启动
示例:
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 { "name" : "hexo-site" , "version" : "0.0.0" , "private" : true , "scripts" : { "build" : "hexo generate" , "clean" : "hexo clean" , "deploy" : "hexo deploy" , "server" : "hexo server" } , "hexo" : { "version" : "5.4.0" } , "dependencies" : { "hexo" : "^5.0.0" , "hexo-deployer-git" : "^3.0.0" , "hexo-generator-archive" : "^1.0.0" , "hexo-generator-category" : "^1.0.0" , "hexo-generator-index" : "^2.0.0" , "hexo-generator-searchdb" : "^1.3.3" , "hexo-generator-tag" : "^1.0.0" , "hexo-next-three" : "github:next-theme/hexo-next-three" , "hexo-renderer-ejs" : "^1.0.0" , "hexo-renderer-marked" : "^4.0.0" , "hexo-renderer-stylus" : "^2.0.0" , "hexo-server" : "^2.0.0" , "hexo-tag-mmedia" : "^1.1.6" , "hexo-theme-landscape" : "^0.0.3" , "hexo-theme-next" : "^8.2.2" , "hexo-word-counter" : "^0.0.3" } }
3.init 命令与systemctl命令对比
init
systemctl
说明
init 0
systemctl poweroff
系统关机
init 6
systemctl reboot
重新启动
其他命令:
1 2 3 4 5 6 7 8 $ systemctl suspend $ systemctl hibernate $ systemctl rescue $ systemctl emergency
4.查看系统服务 systemctl [command] [–type=TYPE] [–all]
1 2 3 4 command list-units:依据unit列出所有启动的unit。–all才会列出没启动的unit; list-unit-files:依据/usr/lib/systemd/system/内的启动文件,列出启动文件列表。 –type =TYPE 为unit type , 主要有service, socket, target
示例:
1 2 3 4 5 6 7 8 9 10 11 12 $ systemctl $ systemctl list-units $ systemctl list-unit-files $ systemctl list-units –type =service –all $ systemctl list-units –type =service –all | grep cpu $ systemctl list-units –type =target –all
5.设置系统运行级别 systemctl [command] [unit.target]
1 2 3 4 5 6 7 command : get-default 取得当前的target set-default 设置指定的target为默认的运行级别 isolate 切换到指定的运行级别 unit.target: 下表中的运行级别
运行级别对应表:
init级别
systemctl target
0
shutdown.target
1
emergency.target
2
rescure.target
3
multi-user.target
4
无
5
graphical.target
6
无
示例:
1 2 3 4 5 6 7 8 $ systemctl get-default $ systemctl set-default multi-user.target $ systemctl isolate multi-user.target $ systemctl isolate graphical.target
6.systemctl的特殊用法
systemctl
说明
systemctl is-active [unit type]
查看服务是否运行
systemctl is-enable [unit type]
查看服务是否设置为开机启动
systemctl mask [unit type]
注销指定服务
systemctl unmask [unit type]
取消注销指定服务
示例:
1 2 3 4 5 6 7 8 9 10 11 12 $ systemctl is-active network.service $ systemctl is-enabled network.service $ systemctl stop cups.service $ systemctl mask cups.service $ systemctl status cups.service $ systemctl unmask cups.service
7.分析服务之间依赖关系 systemctl list-dependencies [unit] [–reverse]
–reverse是用来检查寻哪个unit使用了这个unit
示例:
1 2 3 root@localhost:~# systemctl get-default graphical.target root@localhost:~# systemctl list-dependencies
8.关闭网络服务 在使用systemctl关闭网络服务时有一些特殊,需要同时关闭unit.servce和unit.socket。
使用systemctl查看开启的sshd服务:
1 2 3 4 [root@www system]# systemctl list-units --all | grep sshd sshd-keygen.service loaded inactive dead OpenSSH Server Key Generation sshd.service loaded active running OpenSSH server daemon sshd.socket loaded inactive dead OpenSSH Server Socket
可以看到系统同时开启了sshd.service和sshd.socket,如果只闭关了sshd.service,那么sshd.socket还在监听网络,在网络上有要求连接sshd时就会启动sshd.service。因此如果想完全关闭sshd服务的话,需要同时停用sshd.service和sshd.socket。
1 2 3 systemctl stop sshd.service systemctl stop sshd.socket systemctl disable sshd.service sshd.socket
查看是否关闭22端口
1 netstat -lnp | grep sshd
转自
CSDN-somnus_小凯