Skip to content

Month: November 2016

Display packets per second on Linux

There are many tools for network monitoring but you can do this with a simple bash script. #!/bin/bash time=”1″ # one second int=”eth0″ # network interface while true do txpkts_old=”`cat /sys/class/net/$int/statistics/tx_packets`” # sent packets rxpkts_old=”`cat /sys/class/net/$int/statistics/rx_packets`” # recv packets sleep $time txpkts_new=”`cat /sys/class/net/$int/statistics/tx_packets`” # sent packets rxpkts_new=”`cat /sys/class/net/$int/statistics/rx_packets`” # recv packets txpkts=”`expr $txpkts_new – $txpkts_old`”…

How to apply restrictions per virtualhost in apache

If you are running apache on MPM Prefork, you can apply php restrictions for security or additional settings such as memory limit. Also, you can disable functions or php engine per directory or virtualhost. Standard virtualhost example: <VirtualHost *> DocumentRoot /home/tex/www/example.com ServerName example.com ServerAlias example.com ServerAdmin admin@example.com ErrorLog ${APACHE_LOG_DIR}/example.com-error_log CustomLog ${APACHE_LOG_DIR}/example.com-access_log combined </VirtualHost>   Virtualhost…

Installing nginx and php7 on Debian

First time, i will install nginx-extras (extended version of nginx): root@vm02:~# apt-get install nginx-extras   Adding dotdeb to apt sources list: root@vm02:~# echo “deb http://packages.dotdeb.org jessie all” >> /etc/apt/sources.list   Installing curl and adding dotdeb key for apt: root@vm02:~# apt-get install curl root@vm02:~# curl http://www.dotdeb.org/dotdeb.gpg | apt-key add – % Total % Received % Xferd…

© 2021 - Marian Amza. All rights reserved.
Powered by Wordpress & Debian