Monday, November 11, 2013

7 WAYS TO OPEN FACEBOOK WHEN ITS BLOCKED

1. Using a Proxy/Tunnel Website

Its one of the most simple ways of opening the blocked website. All you have to do is to open a proxy website , which generally uses the proxy server and enter their the website you want to open.
Ex : Vtunnel.com
      Maverickeyes.com
       Hidemyass.com
       Kproxy.com

2. By using the ip of the Website

Enter the ip address of the website you want to open instead of the website address in the address bar. You can get the ip address of that website here.


Or to get the IP address of Facebook, go to your Computer Run command box and put the following command and hit Enter.

ping facebook.com -t




Now you can see the IP address of the Facebook, as shown in the above image. Just enter the IP address in the browser address and hit enter to access the Facebook.


3. Change DNS of the network

Go to Control Panel > Network and Internet Connections > Network Connections and right click on connection you’re using and click again on properties and then TCP/IP.

Use 208.67.222.222 , 208.67.220.220 or 8.8.8.8 , 8.8.4.4 ad dns servers.



4. Use short URLs

Use the URL shortening websites like goo.gl , bit.ly or adf.ly and get the short the URL for facebook.com or any other website ou want to open. Paste in the Address bar.



5. Applications

Many applications available there with easy user interface for opening blocked websites. This is the best way of getting work done and has maximum chances of success.



For this purpose you can use the applications like UltraSurf or Proxifier.



6. Gmail

Browse to Settings>Labs>Add a gadget by url. Click enable. Now go to gadgets tab under settings.

Add http://hosting.gmodules.com/ig/gadgets/file/104971404861070329537/facebook.xml to the field and click add button. Now you can find facebook link below chat label, click and enjoy.

Or you can also Update Facebook Via Email

This one is last method which allows you to update your Facebook status easily from your mail account. With this trick you can upload images, videos and update your Facebook status by email. Read here How To Update Facebook Via Email.

7. Use VPN

When nothing else works, a vpn service will definitely work. Install this free vpn service called Proxpn.

Bonus

One of the latest trick to fool the firewalls in schools and offices now a days is very popular known as Translator. Just enter www.facebook.com in Bing Translator and hit Translate button.



Summery

Thus above are the possible ways to access facebook when it is blocked. If you have more ways to connect to facebook when it is blocked let us know via comments below. Your comments are highly appreciated.

Wednesday, August 21, 2013

Static-route-practical-work

Three Router Static Route Practical Work


This practical work will be assessed by a quiz on the Moodle page for this course.

Objective
In this practical work, you will configure static routes between all three routers.
This will allow your routers to route packets so that all routers and all hosts will be able to reach (ping) each other.
 Once your configuration is complete, you will use basic techniques to test your network’s connectivity.


Scenario
Three separate classful networks need routing between them and their subnets.
This will firstly be done using static routes, then by summarizing some of the networks and then using default routes.



Initial Questions:
    What are the different classful networks?

    Are there any subnets? If so, what are they?
Setup
  • Draw a diagram of your proposed network including all details that are necessary to setup routing.
  • Add 3 x 2811 routers to Packet Tracer workspace. You will need to add serial interfaces to each router.
  • You do not need to use EXACTLY the same serial interfaces as shown on the diagram, but you do need to make a note of your choices on your diagram.
  • Router1 should be named chatham
  • Router2 should be named rochester
  • Router3 should be named luton 
  • Add a 2950-24 switch to each router's Fa0/0 interface. No other configuration of the switch is needed.
  • Configure the cabling as shown in the network diagram.
  • Serial links should run at 1Mbps. Use the Router(config-if)#clock rate 1000000 command on the DCE end of the serial link to achieve this.
  • Check that you have configured the serial interfaces correctly using the show controllers serial command for each serial interface. Check the third line of the output.
  • Add one host PC to each switch. Give that PC the LOWEST available IP address (the next available after the Fa0/0 interface).
  • Important! Configure the routers to include hostnames and the proper interface commands including IP addresses, subnet masks, etc. 
  • Each router should be able to ping the interface of the adjacent (neighbouring) router and the host on its LAN (FastEthernet) interface. Test and troubleshoot as necessary. 
  • Use the context sensitive help, previous labs, your books and /or handouts and if you are still having problems ask your partner or ask the instructor for assistance.
Remember to save your Packet Tracer file regularly - this application can become unstable and crash. 


Step 1 – Configuring Static Routes
On each router configure a separate and specific static route for each network or subnet. You do not need to configure static routes for the router’s directly connected network(s) because like a host, by configuring the IP address and subnet mask on an interface tells the router that it belongs to that network/subnet.

Router1
  • chatham(config)# ip route 172.16.3.0 255.255.255.0 172.16.2.2
  • chatham(config)# ip route 192.168.2.0 255.255.255.0 192.168.1.2
Router2
  • rochester(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.1
  • rochester(config)# ip route 192.168.1.0 255.255.255.0 172.16.2.1
  • rochester(config)# ip route 192.168.2.0 255.255.255.0 172.16.2.1
Router3
  • luton(config)# ip route 172.16.1.0 255.255.255.0 192.168.1.1
  • luton(config)# ip route 172.16.2.0 255.255.255.0 192.168.1.1
  • luton(config)# ip route 172.16.3.0 255.255.255.0 192.168.1.1
Save your router configurations to NVRAM after every change using the write command or the copy running-config startup-config commands.

Verify and Validate:
  • All hosts and all routers should be able to ping every interface in the network.
  • Do a “show running-config” and notice the static routes that you entered.
  • Router# show ip route
    What routes to which networks are displayed?
    Which routes are static and which routes are directly connected? 
  • How can you tell the difference between Static routes and Directly connected networks?
    What is the administrative distance for a static route?
    What is the administrative distance for a directly connected network?

Questions:
  • How does the next-hop-ip-address help with the routing process?
  • Does it give the entire route, i.e., subnet mask?
  • What is it actually doing regarding the routing of the packet?
  • How does a packet get from Host 2 to Host 3?
  • Instead of a next-hop-ip-address, what else could you have used?
  • What would you need to do if you added new networks or deleted/modified existing networks to ensure routing to the new networks was possible from all points in the existing network?
  • Is there any way to summarize several static routes to multiple subnets (destinations) into a single static route?

Outputs
rochester#show ip route
(Output omitted)
Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 3 subnets
S       172.16.1.0 [1/0] via 172.16.2.1
C       172.16.2.0 is directly connected, Serial0/0/0
C       172.16.3.0 is directly connected, FastEthernet0/0
S    192.168.1.0/24 [1/0] via 172.16.2.1
S    192.168.2.0/24 [1/0] via 172.16.2.1

chatham#show ip route
(output omitted)
Gateway of last resort is not set

172.16.0.0/24 is subnetted, 3 subnets
C       172.16.1.0 is directly connected, FastEthernet0/0
C       172.16.2.0 is directly connected, Serial0/0/0
S       172.16.3.0 [1/0] via 172.16.2.2
C    192.168.1.0/24 is directly connected, Serial0/0/0
S    192.168.2.0/24 [1/0] via 192.168.1.2

luton#show ip route
(Output omitted)
Gateway of last resort is not set

172.16.0.0/24 is subnetted, 3 subnets
S       172.16.1.0 [1/0] via 192.168.1.1
S       172.16.2.0 [1/0] via 192.168.1.1
S       172.16.3.0 [1/0] via 192.168.1.1
C    192.168.1.0/24 is directly connected, Serial0/0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0


Step 2 – Configuring Summary Static Routes
The configuration of the routers in Step 1 works well and is a valid way to configure routing on these networks. 

Earlier, you should have noticed that the network 172.16.0.0 is divided into several subnets. 

Examine the routing table for luton.
luton does not really need 3 separate static routes for each subnet, since all of the 172.16.0.0 subnets can be reached via the same next-hop-ip-address, i.e. chatham
Now we can reconfigure the static routes on luton so that it only uses a single static route to reach all of the 172.16.0.0 subnets.
Examine the routing tables for the other 2 routers and check whether there is a need to summarise repeated subnetworks/

It can be seen that these two routers do not require changes.

chatham
  • No changes
rochester
  • No changes
Router3
  • First, remove the current static routes:
  • luton(config)# no ip route 172.16.1.0 255.255.255.0 192.168.1.1
  • luton(config)# no ip route 172.16.2.0 255.255.255.0 192.168.1.1
  • luton(config)# no ip route 172.16.3.0 255.255.255.0 192.168.1.1
  • Check the routing table for luton to ensure that the static routes have been removed.
  • Now, add the new summary static route:

  • luton(config)# ip route 172.16.0.0 255.255.0.0 192.168.1.1
Save your current configuration to NVRAM.
Verify and Validate:
  • All hosts and all routers should be able to ping every interface in the network.
  • Do a “show running-config” and notice the static routes that you entered.
  • luton# show ip route
    What routes to networks do you now see? 
  • What difference do you notice in the subnet mask(s) for the new static route(s)?
Questions:
  • What made this new summary static route work for all subnets?
  • Why is a single summary static route an advantage regarding the size of the routing table?
  • Why is a single summary static route an advantage regarding future changes to the 172.16.0.0 network?
Outputs
luton#show ip route
(Output omitted)

Gateway of last resort is not set
S    172.16.0.0/16 [1/0] via 192.168.1.1
C    192.168.1.0/24 is directly connected, Serial0/0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0


Step 3 – Configuring Default Static Routes
Both Step 1 and Step 2 are acceptable ways to configure routing for these networks. We notice that the 172.16.3.0/24 and the 192.168.2.0/24 networks are “stub networks,” meaning that there is only one way out (both via chatham).

chatham
  • No changes
rochester
  • First, remove the current static routes:

  • rochester(config)# no ip route 172.16.1.0 255.255.255.0 172.16.2.1
  • rochester(config)# no ip route 192.168.1.0 255.255.255.0 172.16.2.1
  • rochester(config)# no ip route 192.168.2.0 255.255.255.0 172.16.2.1
  • Now, add the new default static route:

  • rochester(config)# ip route 0.0.0.0 0.0.0.0 172.16.2.1
luton
  • First, remove the current static routes:

  • luton(config)# no ip route 172.16.0.0 255.255.0.0 192.168.1.1
  • Now, add the new default static route:

  • luton(config)# ip route 0.0.0.0 0.0.0.0 192.168.1.1
Verify and Validate:
  • All hosts and all routers should be able to ping every interface in the network.
  • Do a “show running-config” and notice the static routes that you entered.
  • rochester# show ip route
    What routes to which networks do you now see?
  • luton# show ip route
    What routes to which networks do you now see?

Questions:
  • Do you think static routes are still used even with dynamic routing (RIP, OSPF, etc.)?
    Hint: Think about the administrative distance.
  • Do you think default static routes are still used even with dynamic routing (RIP, OSPF, etc.)?
    What is the disadvantage of doing this?
  • What is shown in the routing table to denote a default static route?
  • How would a default static route be properly used in a real world network? (How would a company’s network use a default route when connecting to the Internet?)

Outputs
rochester#show ip route(Output omitted)

Gateway of last resort is 172.16.2.2 to network 0.0.0.0

     172.16.0.0/24 is subnetted, 2 subnets
C       172.16.2.0 is directly connected, Serial0/0/0
C       172.16.3.0 is directly connected, FastEthernet0/0
S*   0.0.0.0/0 [1/0] via 172.16.2.1


luton#show ip route
(Output omitted)

Gateway of last resort is 192.168.1.2 to network 0.0.0.0

C    192.168.1.0/24 is directly connected, Serial0/0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0
S*   0.0.0.0/0 [1/0] via 192.168.1.1


Save your current configuration to NVRAM.

Tidying your Network

When you have finished, you should add passwords to your routers. The options are to add a non-encrypted password (insecure) or an encrypted password to the router to keep unwanted personnel from entering privileged exec mode by c
onfiguring passwords of cisco to login to the router (console) and class to access the enable commands.
The syntax to make the enable password
 class is:
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#enable secret class
Router(config)#end


Do this for all routers in your network.

Add a message of the day - this can be a statement of your company policy regarding unauthorised access to digital resources perhaps - use your imagination to create a meaningful message.


Router(config)#banner motd "Authorised Access Only" 

If you save your changes and logout of the router, the Message of the Day will appear before you login again.

All interfaces can be given descriptions. This helps when you are making changes to a router's configuration and are not familiar with the network's layout.
 


rochester#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
rochester(config)#int fa0/0
rochester(config-if)#description Second floor LAN
rochester(config-if)#end


Add descriptions that are meaningful to all interfaces in your network.

Save your work and the answers to all questions. you will need to refer back to this work to answer the quiz based on this practical work and also later in the course.
 

Friday, May 11, 2012

Send Mail With Java


This is a sample code for writing with java to send email:

import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;

public class test {
    public static void main(String args[]) throws Exception {
        String user = "test";
        String password = "test";
        String fromAddress = "test@localhost";
        String toAddress = "test@gmail.com";    
        Properties properties = new Properties();  
        properties.put("mail.smtp.host", "localhost");  
        properties.put("mail.smtp.port", "25");  
        properties.put("mail.smtp.username", user);  
        properties.put("mail.smtp.password", password);
        properties.put("mail.transport.protocol", "smtp");
        Session session = Session.getDefaultInstance(properties, null);  
        try          
        {      
            Message message = new MimeMessage(session);      
            message.setFrom(new InternetAddress(fromAddress));      
            message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(toAddress));      
            message.setSubject("Email from our JAMEs");      
            message.setText("hiiiiii!!");      
            Transport.send(message);      
            System.out.println("Email sent");  
        }  
        catch (MessagingException e)  
        {    
            e.printStackTrace();  
        }
        }
}

Solution:
If we test it and it cannot send. This is the guide for resolving problem as below:
1.Go to the path : \apps\james\conf
2.Open for edit the filename 'james-fetchmail.xml'
3.Change "fetchmail" from false to true as:
4.Restart the Apache James Server.
5.You would see the following messages printed on the console after you start the server:
James Mail Server 2.3.2 Remote Manager Service started plain:4555 POP3 Service started
plain:110 SMTP Service started plain:25 NNTP Service started plain:119 FetchMail Started.

Thursday, May 10, 2012

Using Array String in Java

This is simple code for using array string:


How to create and use Nested and Inner Class in Java

- ជាដំបូងយើងត្រូវបង្កើត file  class name: outer.java:

public class Outer {
    int outer_x=100;
   
    void test(){
        Inner inner=new Inner();  
        inner.display();
    }
    class Inner{
        void display(){
            System.out.println("display outer_x:"+outer_x);
        }
    }
}

ហើយបន្ទាប់មកបង្កើត File main class name: Callouter.java:

public class CallOuter {
    public static void main(String args[]){
        Outer obj=new Outer();
        obj.test();
    }
}

វាកូដគំរូដ៏សាមញ្ញមួយ សូមអរគុណ!

Wednesday, May 9, 2012

Sample Some configure in Linux


I. Samba Server (text mod):
            - We have to have three packages: samba-common-<version>.rpm, samba-<version>.rpm, system-config-samba<version>.rpm
            - We have to check samba packages: # rpm –qa samba samba-common system-config-samba if it doesn’t have, we will install it.
            - Create directory: # mkdir /var/Docs
            - Create Users:
            # useradd dara, # passwd 123456
            # useradd vanna, # passwd 123456
            - # chmod –R 444 /var/Docs // note: we don’t set permission on it
            - adding samba users:
            # smbpasswd –a dara , password:123456
# smbpasswd –a vanna, password:123456
- adding sharing
# vi /etc/samba/smb.conf
[Shared]
            Path = /var/Docs/
            Browseable = yes
            Read only = yes
            Valid user = dara
[Shared]
            Path = /var/Docs
            Browseable = yes
            Writeable = yes
            Valid user = vanna
- Close firewall and selinux:
# system-config-firewall (Press Disable à OK)
# system-config-selinx (Choose Disable, and permissive)     
- # service smb restart
- Testing shared folder from windows (http://localhost:901/)
II. Samba Swat (Interface):
            - We have to have two packages: samba-swat-<version>.rpm, xinetd-<version>.rpm
            - We have to check samba packages: # rpm –qa samba-swat xinetd  if it doesn’t have, we will install it.
            - Edit /etc/xinetd.d/swat
            # vi /etc/xinetd.d/swat
            Change “disable=yes” to “disable=no”
            - Open browser logon as root (http://localhost:901/)

III. How to configure IP address:
            - # ifconfig –a
            - # vi /etc/sysconfig/network
            SET: “HOSTNAME=setec.abc.com”
            - # vi /etc/sysconfig/network-script/ifcfg-eth0
            Set: BOOTPROTO=none, IPADDR=192.168.10.1, NETMASK=255.255.255.0
            - # service network restart
            - # ifconfig –a or # ifconfig eth0
IV. How to configure DNS Server:
            +  check service bind
            - # rpm –qa bind bind-utils bind-libs bind-chroot // if not, we install it from Disk
            - # vi /var/named/chroot/etc/named.conf
            Add:
            . forward zone:
Zone “abc.com” IN {
            Type master;
            File “abc.f”;
};
. reverse zone:
Zone “10.168.192.in-addr.arpa” IN {
            Type master;
            File “abc.r”;
};
- # vi /var/named/chroot/var/named/abc.f
Add:
$TTL 2D
@ SOA           dns.abc.com.   root.abc.com. (1 2D 1D 1W 1H)
                        NS       dns.abc.com.
                        A         192.168.10.1
Dns                  A         192.168.10.1
- # vi /var/named/chroot/var/named/abc.r
Add:
$TTL 2D
@ SOA           dns.abc.com.   root.abc.com.  (1 2D 1D 1W 1H)
                        NS       dns.abc.com.
                        A         192.168.10.1
1                      PTR     dns.abc.com.
- # service named restart
- # vi /etc/resolve.conf
Add # before line as below:
# search com
            # nameserver 192.168.10.1
            # nameserver 192.168.10.2
- dig abc.com or nslookup abc.com
V. How to configure Web Server, FTP Server:
            - first, we have configure DNS Server:
            -# vi /var/named/chroot/var/named.conf
            Add:
                        Zone    “abc.com” IN {
            Type master;
            File “abc”;
};
            - # vi /var/named/chroot/var/named/abc
            Add:
            $TTL 2D
            @ SOA           dns.abc.com.   root.abc.com. (1 2D 1D 1W 1H)
                                    NS       dns.abc.com.
                                    A         192.168.10.1
            Dns                  A         192.168.10.1
            www               CNAME         dns
            ftp                   CNAME         dns
            - # service named restart
            - Check web server package:
            - # rpm –qa httpd // if not, we install it from CD
            - Create Directory for Web
            # mkdir /var/abc
            - # chmod –R 755 /var/abc
            - # vi /var/abc/index.html
            - # vi /etc/httpd/conf/httpd.conf
            Add:
            NameVirtualHost        192.168.10.1
            <VirtualHost 192.168.10.1>
                        DocumentRoot  /var/abc/
                        ServerName    abc.com          
                        DirectoryIndex           index.html
            </VirtualHost>
            - Close firewall and selinux service:
            # system-config-firewall
            # system-config-selinux
            - # service httpd restart
            + Check ftp package:
            # rpm –qa vsftpd  // if not, we install it from CD
            - Create directory for ftp server:
            # mkdir /var/ftp
            # chmod –R 755 /var/ftp
            # useradd –d /var/ftp  webadmin
            # passwd webadmin
            - # vi /etc/vsftpd/vsftpd.conf
            Change “anonymous_enable=YES” to “anonymous_enable=NO”
            - # service vsfptd restart

VI. How to configure DHCP Server:
            - check dhcp package:
            # rpm –qa dhcpd // if not, we install it from CD
            - # vi /etc/sysconfig/network-scripts/ifcfg-eth0
            BOOTPROTO=static
            ONBOOT=yes
            IPADDR=192.168.10.1
            NETMASK=255.255.255.0
            NETWORK=192.168.10.0
            - # service network  restart
            - # ifconfig eth1
            - # vi /etc/dhcpd.conf
            Add:
            ddns-update-style interim;
            ignore client-updates;
            subnet 192.168.10.0 netmask 255.255.255.0 {
            option routers                          192.168.10.1;
            option subnet-mask                 255.255.255.0;
            range   192.168.10.50 192.168.10.100;
            default-lease-time       21600;
            max-lease-time            43200;
            host PC-20001 {
            hardware ethernet 00:0c:29:58:6e:36;
            fixed-address 192.168.10.91;
}
}

- # service dhcpd restart
- # chkconfig --list dhcpd
- # chkconfig --level 35 dhcpd on
- # chkconfig --list dhcpd
- # reboot
- # more /var/lib/dhcpd/dhpcd.leases

VII. How to configure NFS server:
            - We have to have two files: nfs-utils-<version>.rpm, system-config-utils-<version>.rpm
            - Check NFS packages: # rpm –qa nfs-utils system-config-nfs // if not, we install it from CD
            -  Create folder for sharing
            # mkdir /tmp/Shared
            - # vi /etc/exports
            Add:
            /tmp/Shared     192.168.10.1/255.255.255.0 (sync,rw) //client can read and write on network
            Or add
            /tmp/Shared     192.168.10.1/255.255.255.0 (sync,rw,no_root_squash)
            Or add
/tmp/Shared     192.168.10.1/255.255.255.0 (sync,ro,no_root_squash)
- # exportfs –a
            - # service nfs restart
            **mount sharing for client:
            # mount 192.168.9.1:/shared   /tmp/Shared
            *** Create automount sharing for client:
            # vi /etc/fstab
            Add
            192.168.100.1:/shared    /tmp/Shared   nfs   defaults   1  2
VIII. How to configure Mail Server:
            We have to install DNS server:
- # vi /var/named/chroot/etc/maned.conf
            Add:
            Zone “abc.com” IN {
            Type master;
            File “abc”;
};
- # vi /var/named/chroot/var/maned/abc
Add:
$TTL 2D
@ SOA           dns.abc.com.   root.abc.com. (1 2D 1D 1W 1H)
                        NS       dns.abc.com.
                        Mx       10        mail.abc.com.
A         192.168.10.1
Dns                  A         192.168.10.1
Mail                 A         192.168.10.1
- # service named restart
            - We have to have three packages: sendmail-<version>.rpm, sendmail-cf-<version>.rpm, sendmail-doc-<version>.rpm
            - Check mail packages:
            # rpm –qa sendmail, # rpm –qa sendmail-cf, # rpm –qa sendmail-doc // if not we install it
- # vi /etc/mail/sendmail.mc
Delete one line:
dnl # DAEMON_OPTIONS(“Port=smtp, Addr=127.0.0.1, Name=MTA”) dnl
            - #m4 /etc/mail/sendmail.mc > /etc/mail/sendmail-cf
            - # service sendmail restart
           
IX. How to configure DHCP Client:

- /etc/sysconfig/network file should contain the following line:

NETWORKING=yes

The /etc/sysconfig/network-scripts/ifcfg-eth0 file should contain the following lines:

DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

A configuration file is needed for each device to be configured to use DHCP.

Other options
PEERDNS=, where is one of the following:
yes — Modify /etc/resolv.conf with information from the server. If using DHCP, then yes is the default.
no — Do not modify /etc/resolv.conf.

USERCTL=, where is one of the following:
yes — Non-root users are allowed to control this device.
no — Non-root users are not allowed to control this device.


Thursday, May 3, 2012

Removing an element from an Array (Java)




public static String[] removeElements(String[] input, String deleteMe) {
    List result = new LinkedList();

    for(String item : input)
        if(!deleteMe.equals(item))
            result.add(item);

    return result.toArray(input);
}