windows查看WiFi密码

cmd 运行
for /f “skip=9 tokens=1,2 delims=:” %i in (‘netsh wlan show profiles’) do @echo %j | findstr -i -v echo | netsh wlan show profiles %j key=clear

查看Linux版本

cat /etc/redhat-release#或者
cat /etc/issue

linux查看端口占用

netstat -anl | grep “80” ;#1080 8080也是会被筛选出来
lsof -i:80

linux查看程序占用的端口

ps -ef | grep nginx

linux安装docker

curl -s https://get.docker.com/ | sudo sh

linux查看目录中有多少文件

ls -lR|grep “^-“|wc -l

Python启动http服务器(传文件)

python -m SimpleHTTPServer
python3 -m http.server

linux显示命令执行的具体时间精确到秒

export HISTTIMEFORMAT=’%F %T ‘
history | more

命令行测速 (python+speedtest)

sudo apt-get install python-pip
sudo pip install speedtest-cli
另一种简单的
wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py

## mplayer 后台播放
mplayer * < /dev/null > /dev/null 2>1&

block一些恶意ip

wget https://teddysun.com/wp-content/uploads/2013/05/block.sh
chmod +x block.sh
./block.sh
(来自秋水逸冰)

日常使用命令排行

history | awk ‘{CMD[$2]++;count++;} END { for (a in CMD )print CMD[ a ]” “ CMD[ a ]/count*100 “% “ a }’ | grep -v “./“ | column -c3 -s “ “ -t |sort -nr | nl | head -n10

输出终端支持的颜色

1
(x=`tput op` y=`printf %76s`;for i in {0..256};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x;done)

Ubuntu安装中文字体

sudo apt-get install fonts-droid ttf-wqy-zenhei ttf-wqy-microhei fonts-arphic-ukai fonts-arphic-uming
https://gist.github.com/allex/11203573

configure: error: MySQL library not found

export PATH=$PATH:/usr/local/mysql/bin

bzip2: Cannot exec: No such file or directory

aptitude install bzip2

configure: error: C compiler cannot create executables

sudo apt install libc6-dev