UNIX BLOG

Blog for NIX system based administrators

Linux Administration

Filter ICMP Timestamp Requests using IPtables

The following commands filter ICMP requests /sbin/iptables -I INPUT 1 -p ICMP –icmp-type timestamp-request -j DROP The following commands filter ICMP Reply requests /sbin/iptables -I INPUT 1 -p ICMP –icmp-type timestamp-reply -j DROP For autorun place the commands in /etc/rc.conf file or rc.local depending on your operating system.

Tags: , , ,

Posted in Linux Administration | No Comments »

How to find out what programs are listening on ports

The following code will show how to see all the programs that are listening: netstat -tulpn will show what programs are listening on ports. Example: root@myhost:~# netstat -tulpn Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 2393/mysqld tcp 0 0 127.0.0.1:8080 0.0.0.0:* […]

Tags: , , ,

Posted in Linux Administration | No Comments »

Convert openvz to xen VPS centos or debian

mv /etc/init.removed /etc/init/ chroot /mnt apt-get install mingetty yum install mingetty # hvc0 – mingetty # # This service maintains a getty on tty1 from the point the system is # started until it is shut down again. start on stopped rc RUNLEVEL=[2345] stop on runlevel [!2345] respawn exec /sbin/mingetty hvc0 nano etc/init/hvc0.conf nano /etc/fstab […]

Posted in Linux Administration | No Comments »

mdadm sending ioctl 1261 to a partition!

mdadm sending ioctl 1261 to a partition!  and probably failing of one HDD drive If you get this message in linux mdadm config. Then you need to check mdadm settings with the following command: cat /proc/mdstat If you got cat   /proc/mdstat Personalities : [raid1] md2 : active raid1 sda3[0]       935745400 blocks super 1.2 […]

Tags: , ,

Posted in Linux Administration | No Comments »

VPN PPTP not all sites are loading, problems with mtu

VPN PPTP not all sites are loading, problems with mtu to solve this problem about pptpd mtu problem with not all sites working use the following command: /sbin/iptables –append FORWARD –protocol tcp –tcp-flags SYN,RST SYN –jump TCPMSS –clamp-mss-to-pmtu

Tags: , , , , , ,

Posted in Linux Administration | No Comments »

how to install anti-dos mod_evasive centos 5

Желательно использовать модуль mod_evasive совместно с nginx. Nginx будет обрабатывать статические запросы, а mod_evasive фильтровать тяжелые пхп запросы для апаче. Подключаем epel репозиторий, где и хранится mod_evasive wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm устанавливаем: yum install mod_evasive Редактируем конфиг nano /etc/httpd/conf.d/mod_evasive.conf      

Tags: , ,

Posted in Linux Administration | No Comments »

How to install geoip for php on gentoo

First install Geo-IP package emerge -v Geo-IP Install pecl geoip php5 package emerge -v dev-php5/pecl-geoip Check if all is installed correctly php -i | grep geo

Tags: , ,

Posted in Linux Administration | No Comments »

How to install redmine on lenny ruby on rails 2.3.5

RAILS INSTALL Add lenny-backports to repositories nano /etc/apt/sources.list deb http://backports.debian.org/debian-backports lenny-backports main apt-get -V -t lenny-backports install rails rubygems MySQL install apt-get install mysql-server mysql-client RAILS INSTALL mysql -u root -p password ->create database redmine character set utf8; ->create user ‘redmine’@’localhost’ identified by ‘my_password'; ->grant all privileges on redmine.* to ‘redmine’@’localhost'; Copy config/database.yml.example to config/database.yml […]

Tags:

Posted in Installation of Web-Scripts, Linux Administration | No Comments »

How to install raid10 mdadm -l f2 with hetzner rescue image

Introduction: How to install raid10 with 4 or more drives with hetzner with faster disk layout -f2 I tested raid10 with 3 layouts(n2, f2, and o2) , HDD SEAGATE  drives are 3TB with around 180MB/s speed. Every new Seagete hetzner Drive drive have 3 plates , Model ST3000DM001 Test with one HDD hdparm -t /dev/sda1 […]

Tags: , , , , ,

Posted in Linux Administration | 1 Comment »

How to install console torrent client (Bittorent) on debian

To install a console torrent client on debian just type the following command   apt-get install ctorrent Find you torrent and download it with ctorrent.    

Tags: , , ,

Posted in Linux Administration | No Comments »