Archive for May, 2008

Ubuntu 2 IP using one NIC

While trying to set up a meteor server I stumble upon a small issue. I need it to access the same network card using 2 different IP addresses. My favorite linux distribution for server is Ubuntu Server, but as far as I know this should apply to all Linux distros.
1. Open for editing /etc/network/interfaces file using vim, Joe or mcedit.I used:

# mcedit /etc/network/interfaces

2. Modify the content to look something like this, keeping in mind that these are the settings suitable for my environment. You should customize the ip addresses to match your network configuration:

#first address
auto eth1
iface eth1 inet static
address 192.168.2.109
netmask 255.255.255.0
network 192.168.2.255
gateway 192.168.2.1

#seccond address
auto eth1:1
iface eth1:1 inet static
address 192.168.2.110
netmask 255.255.255.0
network 192.168.2.255
gateway 192.168.2.1

3. Now restart the network

# /etc/init.d/networking restart

4. Check the new configuration

# ifconfig

  • Share/Bookmark

Tags: , , , , , ,

Tuesday, May 20th, 2008 Tutorials, linux No Comments

JavaScript Confirmation Box

JavaScript can display a nice confirmation box that will allow your script to test user’s choice when necessary.

The JavaScript “confirm” result is of type boolean. The following example should clear things for you:

?View Code JAVASCRIPT
1
2
3
4
5
6
7
8
9
10
var yesorno = confirm("Do you like PHP?");
 
if( yesorno )
{
    alert("You like PHP, great...");
}
else
{
    alert("Don't like it? Nobody cares anyway.");
}
  • Share/Bookmark

Tags: , , ,

Tuesday, May 13th, 2008 JavaScript No Comments