Archive for the ‘Daybook’ Category

February

Monday, February 20th, 2006

I am confused; the name sounds innocent but what’s wrong with this month? I don’t mind its inconsistency…I think this preborn shortY should come as the last child of the year instead of lovely December… I just like the months December and January except its cold… I guess I am loosing the sunlight…so I am walking back.

Well…. I was choked for two days and I couldn’t go anywhere…and exactly one year before on the same month I was hospitalized for the similar kind of symptoms what I am up to now. I am happy this time because I am getting Kanji (I don’t want to give much explanation for Kanji, In short I say “Rice Soupâ€?) and Pickle too. I am not going to hospital so any medicine :)

Last year…Uff…here in a hospital, I asked her “Sister…? Today, I would like to have Kanji for my dinner and can you just arrange it for me.â€? She is from my State and replied “Oh Vipin, I don’t think that I could find it and no Kerala hotels out hereâ€? …good smiles!

I said…Okay, but….

In an hour, I was pretty happy with my dinner…She came with a bowl of hot Kanji and lemon pickle….

Later I came to know (she told me), she made it with a portion of her own dinner (well cooked rice) and served to me.

Has she done her blessed job? I forget her name but never the smile.

Setting Up A Gateway With Linux

Wednesday, February 8th, 2006

This was another workaround I have done to set-up a gateway between the internal and external network to access the internal resource from outside.

Yes, there is no change, it’s a dedicated Linux machine for the Gateway installed with RedHat Advanced Server-4.

Setting Up The Gateway

I will just brief the set-up before I start into the configuration part.
Well… The machine has two NIC and configured accordingly:

eth0: 192.168.1.1/24 connecting to internal network.
Gateway: 192.168.1.254

eth1: 10.1.0.1/28 Connected to a Layer-3 switch(WAN Connection) and then it terminate at the users end whom gonna access the internal resource.
Gateway: 10.1.0.3.
The resource is in 192.168.2.0/24 network. Note not on the same network.

Yes.. thats a Q..! Dude why don’t you set it up on the Layer-3 Switch ?

hmmm… I don’t have the access to the CPE and that is dealt by the Service Provider. (We should always keep an alternate way to run out of the heck….) and moreover its a temporary set-up for a short period of time.

Next step enable the IP_forwarding between the NIC.

camel # vi /etc/sysctl.conf
net.ipv4.ip_forward = 0 # change this 0 to 1

You have done with the IP_forwarding and now the beauty; restart the system to apply the change…

â€?hey…I don’t wanna restart my system…â€?

Oho..really, then please talk to the kernel.

To pass the information to the kernel on the fly without restarting
camel # echo “1″ > /proc/sys/net/ipv4/ip_forward
or more easily by updating the sysctl by
camel # /sbin/sysctl -p

And now keep talking to the kernel about the routing table.

camel # netstat -nr shows the current kernel routing table.

I configured in the following

camel # route del default
camel # route add -net 192.168.2.0/24 gw 192.168.1.254
#now kernel knows all the request to the destination192.168.2.0 network should go via192.168.1.254 and the rest will taken care by internal routing table.
camel # route add default gw 10.1.0.3 #anythin else should go via 10.1.0.3

Now the external people has the access only to the 192.168.2.0 network after they logged into the gateway and get authenticated, thats the Security Hardening part. Yes.. the rest of the hardening part is coming right away…

How much disk space ya left …??

Friday, January 13th, 2006

I gotta something… something wacky this time….

When one of our dear employee asked ” Is there any script to know the disk
usage of the system I am using….”

well….I snip one and it’s working fine…

++ Those who S [ ] I T before GATE, please excUse…

=====================================================

This shell script will help us to monitor the disk usage
If any of the disk partiotion space is more than 95%, all the users who were
logged into the system will get an ALERT message
Add the below line to “crontab -e” to run the program for every minute
*/1 * * * * sh /ya/path/to/diskUsage.sh
YMMV and if ya find any issue; please..try it out by yourself ‘/ ‘
tfeLYpoC

#! /bin/bash

df -h | grep -iv used |grep -iv media | awk ‘{print $6″ ” $5}’ |
while read ROW;
do PERCY=`echo $ROW | cut -d”%” -f1 | awk ‘{print $2}’`
if [ $PERCY -gt 95 ]; then
wall -n “ALERT..! from `hostname`
$ROW of the partition is FULL…! ”
fi
done

Is it 64 or 32 bit ..??

Friday, December 23rd, 2005

When I heard this Q for the second time today at my office…
I thought of writing this a mail to my dear colleagues… :)

0. Linux

$ uname -a

If the command throws ia64 (Intel Architecture-64) OR x86_64 GNU/Linux.
Guess what it is..??

..if ya seen only i686 i586 i386 GNU/Linux >> I am sure the kernel should not support 64 bit.

1. IBM-AiX

$ file /usr/lib/boot/unix*

2. SUN OS/Solaris

$ isainfo -v

If ya couldn’t find the above command…Try

$ uname -a

SUN OS 5.7 or greater is 64 bit compliant

solaris 2.7 or greater is 64 bit compliant.

x. windows

hmmm… Live free… or die….