Showing posts with label LINUX TRICKS. Show all posts
Showing posts with label LINUX TRICKS. Show all posts

How To Install Java In Ubuntu?

Install Java In Ubuntu
Hello ubuntu users!! So are you interested in Java & wanna to install JDK & JRE in ubuntu? In ubuntu, you don't need to set any path first for executing your program using terminal. Follow these steps:
  • Go to Applications> Accessories> Terminal (Or use shortcut Ctrl+Alt+T).
  • Type "sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk" without quotes.
  • It will install JDK & JRE.
  • After installing, check installation by entering javac & java in terminal. If these commands execute, that means you have installed JDK & JRE successfully.
  • Next step is to execute your program (Suppose you have program file named Hello.java in your home directory).
  • Type javac Hello.java in terminal, then java Hello
Note: If you save your java file in any other directory, then you first need to change your directory path otherwise terminal will display error as "No such file or directory".

How To Block Websites In Ubuntu?

Ubuntu Logo
Wanna to block some websites on your Ubuntu system? Whole procedure is same with windows (Block Websites In Windows), only difference is location of hosts file. In windows hosts file has path C:\ WINDOWS\ system32\ drivers\ etc while in ubuntu hosts file exist under /etc directory.

Note: You must have root privileges for implementing this trick (For accessing root privileges Open terminal with shortcut Ctrl+Alt+T, type command as "sudo nautilus" without quotes, enter the root password, root directory will open). Suppose you have to block www.orkut.com, follow the procedure:
  • Go to File System Directory (Click on File System on the right side of your root directory)
  • Now open /etc/hosts
  • Plain text document will open with info:

    *-+127.0.0.1    localhost
    127.0.1.1    ubuntu.ubuntu-domain    ubuntu

    # The following lines are desirable for IPv6 capable hosts
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
  • Below 127.0.1.1    ubuntu.ubuntu-domain    ubuntu, write 127.0.0.1    www.orkut.com
  • Save it.
  • Now try to open orkut, it will give error Firefox can't establish a connection to the server at www.orkut.com. Orkut is now blocked.
  • In the same way you can block any site, just write site url after 127.0.0.1
Note: For unblock, delete 127.0.0.1    www.orkut.com
Some Cool Commands For Linux Users

Some Cool Commands For Linux Users

Hi Linux lovers!! listing some cool linux commands, mostly among you must have heard about these commands. But these all are for newbie. First open your terminal, now run these commands:
  • w: For checking who is login.
  • uptime: How long user have been logged in.
  • pwd: Stands for Present Working Directory, will show the present directory in which you are working.
  • which: Will show the directory location of any file (for e.g. entering which ls will display you directory location as /bin/ls)
  • du: Determine the disk utilization (for e.g. entering du -sh will display the total amount of space being used by all the files and directories in PWD).
  • df: displays the amount of free space (for e.g. df -h, df -l)
  • uname: Show OS name. (Also try uname -m, uname -n , uname -r , uname -s, uname -v)
Note: These all are case sensitive.