Archive for the ‘Linux’ Category

Simple Linux Firewall configuration tool – ipt-conf

|

 

IPT-CONF is light-weight iptables configuration framework. Time to time it’s good to have something light and easy to control.

You can use our set of preconfigured rules or create your own. It’s very easy to creating own rules.

Sometimes even if your are iptables professional, you need some quick solution with init scripts, easy configuration and administration and this is ipt-conf.

Example

If you have some big and network complex application you can create entire rule for this (like allow-ftp or enable-nat rule).

All what app needs can be in this rule (load some specific iptables module, set something in /proc /sys or sysctl etc.) and you can easily maintain it and distribute to other machines or servers.

You can create conf for rule so other administrator just copy your rule and enable it. System ask him for some information your rule needs (defined in conf file) and everything is ready.

(more…)

How to obtain InnoDB status from Mysql Server 5.x

|

 

Many users use innodb engine for their databases. It’s good to monitor status of mysql and one part of it is monitor status of InnoDb.

Simple way to monitor innodb is just use SHOW command

SHOW ENGINE INNODB STATUS;

If you have big system on very high load, it’s possible that long DEAD LOCK brake the output.

Mysql show only part of status and then cut other informations off. It’s not bad if you have realy big dead lock but it’s not good for your monitoring.

Another way to monitor status of INNODB is using files in /proc filesystem. Here is small script that read informations from this file.

You can modify this little for your system, add cut off dead lock part for examle.

 

#!/bin/bash

export LC_ALL=POSIX

## Check for MYSQL pid
MYSQLPID=`ps -U mysqld | grep mysqld | awk '{print $1}'`

cd /proc/$MYSQLPID/fd/

## Let find the file with innodb status
for i in `ls -l| grep delete| grep tmp| awk '{print $9}'` ; do
       grep "INNODB MONITOR OUTPUT" ./$i 2>&1 > /dev/null

       if [ $? == 0 ] ; then
            file="$i"
       fi
done

## Print innodb status

cat $file

 

Connection test script

|

This is very simple bash script for connection test. Sometimes we need do networking restart if dhcpd server is broken or there is some link problems.

(more…)

VIM tips

|

Content

  1. Modelines
  2. Completion
  3. Search
  4. Selection
  5. Markers
  6. Indenting
  7. Registers
  8. Multiwindow mode
  9. Tabs
  10. Execute

(more…)

Simple NAT configuration

|

Hi,

this is very quick NAT howto for several operating systems (Linux, NetBSD, FreeBSD, Windows).

(more…)

Bruteforce protect (iptables)

|

I have posted article about bruteforce blocker, but you can’t use it if you use openssh hide host patch.
Patch rewrite all addresses in logs and then bruteforce blocker is useless.

(more…)