Showing posts from February, 2012

Testing SAP conn using NIPING with SAPRouter

To test NIPING direct simply something like:

niping.exe -c -H

In case to test with SAPRouter, its soemthing like:

niping.exe -c -H /H/

A reference from here :


Windows 2003 W2k3 Getting Current MTU Size

I am trying to get the current running MTU sieze configured on a windows 2003 (W2K3) server. Got a ref from here :

But during running the netsh command, got some error saying 'command not found'. It turns out the real command for ipv4 is not ipv4 but just 'ip' and ithe one i'm trying to use is not 'subinterfaces' but just 'interface'. SO my final command that wokred as below:

netsh interface ip show interface
And the result shown is as below, and you can get hell lot of details. :)


SAP check SAPRouter validity and expiry

You can check SAPRouter expiry or validity period by below:

It would look like below:

p/s: found this because we hit an error "router permission denied"


Windows for loop - add multiple ports to exception using netsh.exe

Adding multiple ports to exception list on windows firewall
using netsh.exe comand line utility.

using for loop in windows batch.

for %i in (3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3298 3299 3600 3601) do netsh firewall add portopening TCP %i "SAP Router Port %i - Added by Adam 27-Jan-2012"

or for a port range without skipping:

for /L %i in (9000-9600) do echo %i


Linux Hardening

A rip from two sites i guess..

If you run your own Linux server here are some tips on server hardening, liberally stolen from the CFS security GUI script for cPanel/WHM, that I have become only too familiar with since yesterday:

On your firewall (you do have one don’t you?) check the incoming MySQL port and if 3306 is open, close it. If this port is left open it can pose both a security and server abuse threat since not only can hackers attempt to break into MySQL, any user can host their SQL database on your server and access it from another host and so (ab)use your server resources

Check /tmp permissions. /tmp should be chmod 1777

Check /tmp ownership /tmp should be owned by root:root

Check /etc/cron.daily/logrotate for /tmp noexec workaround. Due to a bug in logrotate if /tmp is mounted with the noexec option, you need to have logrotate use a different temporary directory. If you don…

Perl: Removing duplicated entry between two files

A rip of from a ripp one liner Perl solution.

I have two files, with more or less duplicated entries in both. SOltuion:

cat textfile | perl -ne '$H{$_}++ or print'Source: