Skip to content

UnixTeacher Posts

Ethernet RTL 8168 driver on Debian

By default on Debian is used 8169 driver instead of 8168 (Realtek ethernet driver). Also, 8168 driver does not exist. ~# find /lib/modules/`uname -r`/kernel/drivers/net/ethernet/ -name *816* /lib/modules/3.16.0-4-amd64/kernel/drivers/net/ethernet/realtek/r8169.ko The network device ~# lspci |grep Ether 03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 09) The loaded driver ~# lsmod |grep…

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…