wget -O speedtest https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod +x speedtest
./speedtest
Category Archives: Linux
Install Cacti (Network Monitoring) on RHEL/CentOS 7.x/6.x/5.x and Fedora 24-12
In this how-to we are going to show you how to install and setup complete network monitoring application called Cacti using Net-SNMP tool on RHEL/CentOS/Fedora.
[Linux][Ubuntu] Ubuntu 16.04 安裝LAMP PHP7 , Apache2 , MaraiDB « 老人的網路筆記
ip_forward sample
# clean all rules iptables -F iptables -t nat -F iptables -X iptables -Z #default chain iptables -P INPUT DROP iptables -P OUTPUT ACCEPT iptables -P FORWARD ACCEPT iptables -t nat -P PREROUTING ACCEPT iptables -t nat -P OUTPUT ACCEPT iptables -t nat -P POSTROUTING ACCEPT iptables -A INPUT -s 10.0.0.0/8 -p tcp --dport 22 -j ACCEPT iptables -A INPUT -p tcp --dport 22 -j ACCEPT #modify rule below this line iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 10.140.0.3:80 iptables -t nat -A PREROUTING -p tcp --dport 3389 -j DNAT --to-destination 10.140.0.3:3389 iptables -t nat -A POSTROUTING -j MASQUERADE iptables -L -n -t nat
编译linux内核前用make menuconfig设置时 Unable to find the ncurses libraries的解决办法
我们在更新CentOS或者Ubuntu的内核时,执行make menuconfig可能看如这样的错误:
*** Unable to find the ncurses libraries or the
*** required header files.
*** ‘make menuconfig’ requires the ncurses libraries.
***
*** Install ncurses (ncurses-devel) and try again.
根据错误报告是缺少Ncurses库,需要安装该库(Ncurses 提供字符终端处理库,包括面板和菜单)
解决办法如下:
CentOS:
yum install -y ncurses-devel
Ubuntu:
sudo apt-get install ncurses-dev
Ubuntu Missing add-apt-repository command
apt-get install software-properties-common python-software-properties
ubuntu不能正常使用make menuconfig的解决方案
so easy
sudo apt-get install build-essential
sudo apt-get install libncurses5
sudo apt-get install libncurses5-dev
happy
当然有的时候在执行以上命令的时候会出错,提示要更新“软件列表”,OK,乖乖的先更新再执行以上命令吧。
更新命令
sudo apt-get update
万能的apt-get,
Install Smokeping on Ubuntu 14.04 – Oliver Marshall
I’ve recently being doing some work to set up LibreNMS to monitor our vast swath of internal switches and systems.
How To Fix 504 Gateway Time-out on Nginx – idroot
This tutorial shows you how to fix 504 gateway Timeout on Nginx
Linux开启SSH登录email通知
Linux服务器通常需要远程登录访问,尤其是当服务器或VPS还允许root直接登录时,应该为SSH登录成功配置一个自动的email提醒。
sendmail直接发送的话很可能会发送到垃圾邮箱里,需要把地址加入到白名单。
把下面的admin@hackhp.com更改为你要接收登录通知的电子邮件地址。
CentOS
vim ~/.bash_profile
IP="$(echo $SSH_CONNECTION | cut -d " " -f 1)"
HOSTNAME=$(hostname)
NOW=$(date +"%e %b %Y, %a %r")
echo 'Someone from '$IP' logged into '$HOSTNAME' on '$NOW'.' | mail -s 'SSH Login Notification' admin@hackhp.com
Ubuntu/Debian
vim ~/.bashrc
IP="$(echo $SSH_CONNECTION | cut -d " " -f 1)"
HOSTNAME=$(hostname)
NOW=$(date +"%e %b %Y, %a %r")
echo 'Someone from '$IP' logged into '$HOSTNAME' on '$NOW'.' | mail -s 'SSH Login Notification' admin@hackhp.com
如果不想接收到邮箱,只想重定向到一个文件的话。
IP="$(echo $SSH_CONNECTION | cut -d " " -f 1)"
HOSTNAME=$(hostname)
NOW=$(date +"%e %b %Y, %a %r")
echo 'Someone from '$IP' logged into '$HOSTNAME' on '$NOW'.' >>/root/login.txt