其他¶
SPAW 分区¶
Linux VPS的使用过程中,SWAP交换分区是一个很重要系统缓存分区。他是在内存不够用的情况下,从硬盘中临时分出一部分空间系统当做内存使用。但是,如果SWAP的占用超过30%的时候,系统的性能就会受到影响,这时候就要刷新SWAP。
- 刷新SWAP
可以执行命令刷新一次SWAP(将SWAP里的数据转储回内存,并清空SWAP里的数据)
$ sudo swapoff -a && sudo swapon -a- 关闭SWAP
在内存大于2G时候,一般情况下可以关闭
$ sudo swapoff -a
- 开启SWAP
$ sudo swapon -a
检查端口通不通¶
查看端口占用¶
$ sudo netstat -anp | grep ":80\ "
检查端口通不通¶
python 检查端口通不通
#!/usr/bin/env python #coding=utf8 ip = '192.168.5.204' port = 5900 import socket sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sk.settimeout(1) try: sk.connect((ip,port)) print 'Server %s:%s OK!' % (ip,port) except Exception: print 'Server %s:%s not connect!' % (ip,port) sk.close()
nc命令检查端口通不通
$ nc -vz 192.168.5.204 5904
telnet 命令检查端口通不通
$ telnet 192.168.5.204 5900
CenterOS¶
检查某服务是否开机启动
# chkconfig dnsmasq开启/禁止 某服务开机启动
# chkconfig dnsmasq on/off # systemctl enable/disable dnsmasq
启动/停止/重启 某服务
# systemctl start/stop/restart dnsmasq
amixer¶
- 查看:
$ sudo alsamixer
$ sudo amixer -D pulse
- 声音设置
$ amixer -D pulse sset "Master" on
$ amixer -D pulse sset "Master" off // 静音
$ amixer set "Master" 100%
- 录音设置
$ amixer set “Capture” 100%
$ amixer set “Front Mic Boost” 53% $ amixer set “Rear Mic Boost” 53%