LendKey

Friday, June 20, 2008

Allow Linux box in intranet to access internet via a gateway server

I have three servers in a intranet environment. One(A) can access internet directly. Others(B andC) are connected to A.

In order to allow B and C access internet, do the following settings:
1. vi /etc/resolve.conf
Add the following text in it:
nameserver <a's IP>

2. vi /etc/sysconfig/network
Add
GATEWAY= <a's IP>

3. Run /etc/init.d/network restart

Do the three steps on both B and C. Then they should both be able to access internet.
Try it by ping yahoo.com.

Friday, June 6, 2008

Submit form to a popup window

Sometime, when submit a form, you wanna open a new popup window and show submit result there.

Here's the code that can do the work:

<form action="report.html"
where the form will be submitted to
target="report"
name of the popup window
onsubmit="window.open('about:blank','report','width=300,height=200')">
open a new window that has the target window name and expected window size first.

It was tested in Firefox 3.0 Beta, IE 7, Opera