30 September, 2010

How to install traditional language fonts in Ubuntu


The multi-language support by operating systems offer a way to type in and read contents of the even traditional languages. Yet there are still some problems persist when you need to install new fonts in your traditional languages. The main problem causes when you visit a website which is in traditional language. Most probably the browser will display junk characters which are unreadable. Here is a how to about installing traditional languages in your Ubuntu machine.

1. First download the font on to your machine, let it be font.ttf

2. Take the terminal and copy this font.ttf to  the Fonts  directory in Ubuntu as root (usually /usr/share/fonts).

 $ sudo cp ~/Downloads/font.ttf  /usr/share/fonts

Relogin to the system to make the changes come into effect.

If you do not have the root permission, please do the following steps.

Copy the font.ttf font to a directory.

Change to that direcroty and run the following  commands.

Run ttmkfdir > fonts.dir
Run ttmkfdir > fonts.scale
/usr/X11R6/bin/xset fp+ <font directory>
/usr/X11R6/bin/xset fp rehash

Open the browser and change the character encoding to “User Defined”

Installing new fonts in windows


In windows you have to copy the fonts in to the C:/Windows/fonts directory.
  


 
Read rest of entry

29 September, 2010

I'm Feeling Lucky in Google

The I'm Feeling Lucky button seen on google's home page is a feature that leads directly to the top-ranked page corresponding to your search keyword. You can avoid the search results page in cases you know the top-rated pages corresponding to your search. For example, you may need to go twitter's home, you only need to do is: type twitter in google's search box and then press the I' feeling lucky button. Then google will automatically redirect to www.twitter.com instead of showing the search results.

Adventures with I'm Feeling Lucky button

Go to www.google.com and try the following keywords in your search box and click the I'm Feeling Lucky button to see the craziest and awesome things in the google... You will be stunned.....

  • Google Hacker 

  • Google Pacman

  • Google Gravity

  • Google Sphere

  • Epic Google

  • Rainbow Google

  • Google Mirror

  • Google Loco

  • Google Gothic

  • Google Easter Eggs

Among the above searches gravity, pacman and hacker are the most awesome 




Read rest of entry

27 September, 2010

How to wipeout your hard disk perfectly in Ubuntu


Here is a command shread which can be used to in bash terminal of Ubuntu to wipeout your harddisk completely without leaving any chances for further recovery. Please dont try it unless otherwise you dont have no other use with your current system...

$ shread -v -n 1 -z /dev/hda


Options


-f, --force
       change permissions to allow writing if necessary

       -n, --iterations=N
       Overwrite N times instead of the default (25)

       -s, --size=N
       shred this many bytes (suffixes like K, M, G accepted)

       -u, --remove
       truncate and remove file after overwriting

       -v, --verbose
       show progress

       -x, --exact
       do not round file sizes up to the next full block;

       this is the default for non-regular files

       -z, --zero
       add a final overwrite with zeros to hide shredding
Read rest of entry

26 September, 2010

Orkut affected by Bom Sabado: next threat to social networkng

After the problems that hit the twitter last week, google's social networking website Orkut being hit hard by the “Bom Sabado” javascript worm, which infected users with scraps containing “Bom Sabado”. The word "Bom Sabado" means "Good Saturday" in Portuguese, which is also the official language of Brazil, one of the last remaining Orkut bastions in the world. The worm seems to be posting scraps with the text "Bom Sabado" and also adding affected users to new Orkut groups which is having explicit contents. Such XSS attacks have targeted Orkut in the past too. Please urgently perform the following steps to avoid the spread of bom sabado and to avoid becoming the victim of it. Its more than a day the virus attack being happened and the problem is not fixed within this time...

    1. DO NOT visit any profile on Orkut till this script is blocked. Better to avoid using orkut till the google fix the problem

    2. Clear your browser cookies and cache right away and change your password

    3. Use the Google Acconts link here to change the password 

    4. Avoid replying to the Bom Sabado scraps...


Read rest of entry

25 September, 2010

How to assign an IP address in Ubuntu using command line

Computers may be assiged a static IP address or assigned one dynamically. Typically servers and institutions will use a static IP which will not change each time u get connected. Workstation will use Dynamic Host Configuration Protocol (DHCP) for IP address assignment. It is more easily to find a system if the IP address does not change and is static.


Use the Command Line:

    /sbin/ifconfig eth0 192.168.10.12 netmask 255.255.255.0 broadcast 192.168.10.255                  
 
The ifconfig command does NOT store this information permanently. Upon reboot this information is lost. Manually add the network configuration to /etc/network/interfaces  as shown in my next post .
Read rest of entry

IP Configuration in Ubuntu

Here is a howto about the configuring ip using networking related files in Ubuntu / Debian systems.

File: /etc/network/interfaces
    This file contains network interface configuration information  for the ifup and ifdown commands. This is where you configure how your system is connected to the network.

Three important Interfaces are:
        # lo: Loopback interface (it is an internal 
            networking mechanism. It is used to
            test applications...)
        # eth0: First ethernet interface card
        # wlan0: First wireless network interface


Use following command to edit the interfaces file

$ sudo gedit /etc/network/interfaces

Add one or more of the stanzas below 

    Static IP example:
    auto lo
    iface lo inet loopback

    auto eth0
    iface eth0 inet static
            address 208.88.34.106
            netmask 255.255.255.248
            broadcast 208.88.34.111
            network 208.88.34.104
            gateway 208.88.34.110
                   

    Dynamic IP (DHCP) example:
    auto lo
    iface lo inet loopback

    auto eth0
    iface eth0 inet dhcp

    auto eth1
    iface eth1 inet dhcp

    auto eth2
    iface eth2 inet dhcp

    auto ath0
    iface ath0 inet dhcp

    auto wlan0
    iface wlan0 inet dhcp
                   
    Lines  beginning with the word "auto" in the interfaces file are used to identify the physical interfaces to be brought up when ifup is run with the -a option.  (This option  is  used by the system boot scripts.)  Physical interface names should follow the word "auto" on the same line.

GUI Network Tools:

    * NetworkManager or wicd can be used as the GUI tools for the network management. Better use wicd network manager if you have to rely more upon the wireless internet than the wired ones
.
Read rest of entry

24 September, 2010

How to install finch in Ubuntu 10.04


Finch is a text/console-based, modular instant messaging client capable of using AIM/ICQ, Yahoo!, MSN, IRC, Jabber, Napster, Zephyr, Gadu-Gadu, Bonjour, Groupwise, Sametime, SILC, and SIMPLE all at once. Terminal acts as the GUI for the finch... And you might fell in love with it only if you are comfortable with the bash terminal also...

Installing finch in Ubuntu 10.04

take the gnome terminal and type in as follows :

$ sudo apt-get install finch


You can install it also using the Synaptic Package manager also.





Read rest of entry

22 September, 2010

C program to fork a new process

Here is a C program to create suboprocess from the current process using fork() system call in Unix. It also identifies and checks both the parent and child process using the process ids...

#include <unistd.h>
#include<stdio.h>
#include<fcntl.h>
#include<sys/stat.h>
#include<string.h>
#include<dirent.h>

int main ()
{
  int flag,flag2;
  int pid,ppid;
  printf("\nHello Worldn");
  flag = fork();
  printf("\nflag :%d",flag);
 
if(flag > 0)
  {         
    printf("\nI'm the Father" );
    printf("\n%dpid ",getpid());
    printf("\n%dppid ",getppid());
   
  }
  else if(flag == 0)
  {     
    printf("\n\n\nI'm the Sonn");
    pid=getpid();
    ppid=getppid();
    printf("\n%dpid ",pid);
    printf("\n%dppid ",ppid);
   
    flag2=fork();
    if(flag2 > 0)
    {         
        printf("\nI'm the sonn" );
        printf("\n%dpid ",getpid());
        printf("\n%dppid ",getppid());
      }
      else if(flag2 == 0)
      {     
        printf("\n\n\nI'm the grandSonn");
        pid=getpid();
        ppid=getppid();
        printf("\n%dpid ",pid);
        printf("\n%dppid ",ppid);
       }
      else
        printf("failure");
   }
  else
    printf("failure");
  printf("\nGoodbye\n\n");
}
Read rest of entry

C Program to check the filetype in Unix

Here is a C program that can be used to check the filetype of a specified file... It can check and output weather the file is regular/device/block/fifo file... 


  #include<stdio.h>                                 
  #include<string.h>                                             
  #include<sys/stat.h>                                              
  #include<sys/types.h>
                                                                                   
  int main ()
 {   
    char name[100];
    char temp[100];
    struct stat p;
    printf("\nEnter filename :  ");
    scanf("%s",name);
    stat(name,&p);    
    if(S_ISREG(p.st_mode))
        printf("\nregular file");
    else if(S_ISDIR(p.st_mode))
        printf("\ndirectory file");
        else if(S_ISLNK(p.st_mode))
        printf("\nlink file");
        else if(S_ISFIFO(p.st_mode))
        printf("\nfifo file");
        else if(S_ISCHR(p.st_mode))
        printf("\ncharacter file");
        else if(S_ISBLK(p.st_mode))
        printf("\nblock file");
    else
        printf("\nUnknown type");
    printf("\n\n");
   }                                        
Read rest of entry

C Program to show the contents of a directory

This is a C program to show directory contents in a Unix machine

#include<stdio.h>
#include<fcntl.h>
#include<sys/stat.h>
#include<string.h>
#include<dirent.h>
           
main()
{
    struct dirent *p;
    char a[50];
    printf("\nEnter the directory ---------------->: \n");
    scanf("%s",a);
    DIR *f=opendir(a);
    printf("\n---------------directory contents are ----------------- \n");
     while((p=readdir(f))!=NULL)
    {
           printf("%s\n",p->d_name);
    }
    closedir(f);
}

Warning : program is written using system calls in Unix
Read rest of entry

11 September, 2010

How to solve problems in loading Compiz in Ubuntu

The remastered version of the Ubuntu linux with Compiz preinstalled on it might have some working problems on some machines... I have to face the same situation in some of my friends machines with AMD motherboard, when  I  tried to install a version of the Ubuntu which is remastered using an Intel PC. Here is a simple solution through which i have solved this problem to an extend.

1. Click on the Compiz Fusion Icon from Applications >
    System Tools

2. Right click on the Compiz Fusion Icon on the panel
    to open up the menu. Select Compiz from Select 
    Window Manager
  
2. Click on the Reload Window Manager to reload 
    the compiz window manager.


 3. Change the Visual Effects to Normal or Extra. Right 
     click on the desktop and select the Change 
     Desktop Background and then Visual Effects.
4.  This might be enough for loading compiz. You can
     add the command 'compiz-decorator' to the 
     startup applications to automatically launch 
      compiz on logon.
Read rest of entry

10 September, 2010

How to install NetBeans IDE 6.9.1 in Ubuntu 10.04


How to install java runtime environment in Ubuntu
NetBeans IDE is an open-source, fast and feature full tool for developing Java software. It runs on any operating system where a Java Virtual Machine is available. NetBeans helps to develop java applications and projects with ease and good user friendly environment. Here is the right mechanism to install NetBeans IDE in Ubuntu. You should have to install a Java Virtual Machine in the computer before installing NetBeans.

Install Java Runtime Environment in Ubuntu 10.04

1.Open the terminal and add the following repository

   $ sudo add-apt-repository "deb http://archive.canonical.com/ lucid  partner"    

2. Update the apt:

$ sudo apt-get update

3. Now install Sun Java packages using command: 

$ sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts



Install NetBeans IDE 6.9.1 in Ubuntu 10.04

Download the latest version of the NetBeans IDE binaries from the link here. The versions available from synaptic or apt-get is usually out-of-date from the version available directly from NetBeans. So the best way to get the latest version is to download the binaries directly from the NetBeans website and execute it in your machine.

><      Download the binary corresponding to Java SE.


><       After the download is complete, take the  terminal and change to the directory where the file is downloaded, usually that may be in your Downloads folder.

$ cd  /home/your_username/Downloads


><      Now install the NetBeans IDE using the shell command as follows. Change the filename with the one corresponding to the file downloaded on to your machine.

$ sudo sh  ./netbeans-6.9.1-ml-javase-linux.sh

><       The terminal will initialize the NetBeans installer in Graphical mode after executing the above command. When installation is completed you can start creating your java application by taking the NetBeans IDE from Applications > Programming > NetBeans


Read rest of entry

How to connect Idea gprs without Nokia PC suite in Windows


There is no need of a software like Nokia pc suite for accessing internet on the Windows machine if you have a modem on your mobile phone. This post describes about connecting to internet with a nokia phone with modem on your computer


Connect the mobile to the computer using bluetooth or data cable from the phone. Select Nokia mode on the phone if connection is made through the data cable. Pair the phone with the bluetooth of the computer if the connection is via bluetooth.


 

On Mobile phone


Select Menu  >>  Settings  >>  Connectivity  >> Packet data   >>  Packet data settings



Click on Edit active acces point to edit the access point. Set the following values

 

       Alias for access point       ::     internet

       Packet data access point  ::     internet


Set the active access point as curreently defined access point called 'internet'.

 

On computer with Windows XP/Vista/7


Select Setup a connection or network from Network and Sharing center.


Click on Set up a dial-up connection 


Select the bluetooth modem corresponding to your phone


 Change the fields on the screen as follows


          Dial up phone number :  *99#

          Connection name         :  idea internet 

Read rest of entry

07 September, 2010

Remote login using SSH and copying files from remote machines


copy files remotely over internt

SSH stands for “secure shell” and its a program and protocol also. Through SSH you can  use the applications that are available in a remote computer on internet even if you don't have it in local machine. Only requirement is a working internet connection and an account in the remote machine.  The OpenSSH program suite, developed by the OpenBSD project, offers a free SSH facility with everything necessary to use encrypted connections on different operating systems: 
  :: commandline tools for working on remote machines
  :: to execute programs remotely 
  :: to tunnel Internet services via SSH 
  :: tools for secure file copying

   OpenSSH is a must-have application in any recent Linux distribution. Most systems offer separate packages for the client and the server. Server program is necessary if you want to access your Linux computer via SSH from another machine. 

Applications . . .
- You can login to your office computer remotely from
   home and do all the office work @ home
- Using ssh tunnelling you can communicate over the
   restrictions imposed by proxies and firewalls 
Functions of SSH

ssh       :The command-line client establishes   
             encrypted connections to remote machines 
             and will run commands on these machines if
             needed.

scp      :To copy files (non-interactively) locally to or 
             from remote computers, you can use scp
             (“secure copy”).

sftp      :The ftp client (“secure ftp”) supports
             interactive copying. Like other command line
             ftp clients, the tool offers many other options
             such as copying, changing and listing 
             directories, modifying permissions, deleting
             directories and files, and more...

sshd     :The SSH server is implemented as a daemon
             and listens on port 22 by default. SSH clients 
             establish connections to the sshd.

Installation & Configuration

Take the terminal and type in following commands to install SSH

$ sudo apt-get install openssh-server openssh-client
 
Inorder to test ssh please type in the following command...

$ ssh localhost 
 
To stop ssh server, type in

$ sudo /etc/init.d/ssh stop

To start sshs server, type in

$ sudo /etc/init.d/ssh start

To restart ssh server, type in

 # sudo /etc/init.d/ssh restart


Remote login using SSH

You can remotely login to another machine on the internet by using the following command,

$ ssh  -X  username@100.100.100.3

Replace the username and ip (100.100.100.3) with the one corresponding to you. X option enables the Xserver.

                On executing the above command, the terminal prompt changes to user@remotemachine:~$  you can execute any command as if you are logged in at the remotemachine. Any application from that remote machines can be run by executing the command

examples :
user@remotemachine:~$ firefox
          for starting firefox on a remote machine
user@remotemachine:~$ nautilus
          for starting the file manager on remote  
           machine 
user@remotemachine:~$gnome-session
          to start the gnome session so that you get the   
          desktop with all the features, then you can 
          perform everything in graphical user 
          environment  


Copying files from remote system

                The ssh command alone allows remote login only, but you can copy a file in a remote system to your local machine using the 'scp' command.

1. You are already logged in at user@local$

2. Login to the remote machine  using the ssh  
    command. Then the terminal prompt will change to 
    user@remote

3. Type in the scp command as follows

$ scp  filename user@ip_local:destination

               filename      :: the file to be copied which is 
                                      in remote machine
               ip_local        :: ip adress of your machine
               destination  :: destination folder where the 
                                     copied files are to be saved
       Then the terminal will prompt for your accounts password...


Thats all for now with ssh and scp. You can refer the man page of ssh and scp to see more details in case of using them under a proxy server and also for advanced features...






Read rest of entry

04 September, 2010

Links: the browser for the terminal


Links is powerful text WWW browser with tables and frames. It runs in linux terminal providing a faster access to internet especially on slow connection. Its completely text based, so that you cant use it  as a complete replacement for usual browsers since terminal can not display images. Also since text based it can be a used for faster acces of internet when you are using mobile internet. 

 








Installing links in Ubuntu

Take the terminal and type in as follows

 $ sudo apt-get install links 

Or you can download the links package with graphics in compressed format from here. The details about installation are provided in the links site.
 
Browsing in links 

After installation take the terminal and type links

 $ links
 
command line options
-g 
            to run links in graphics mode
-no-g
            to run links in text mode

-anonymous
            Restrict links so that it can run on an anonymous  account.   No local  file  browsing.  No  downloads.  

 
-http-proxy <host:port>
              Host and port number of the HTTP  proxy,  or  blank.


-ftp-proxy <host:port>              
              Host  and  port  number  of  the FTP proxy, or blank. 

-download-dir <path>              
              Default download directory.  (default: actual dir) 


Navigation keys

ESC/F9    menu/escape
d      download link (text mode only)
/       search in the page
?       search back in the page
n       find next match
f        zoom actual frame
^R    reload page
g       go to URL
G       edit the current URL and goto the result
s       bookmark manager
q       quit, close window if more windows are open
=      document informations
\       toggle HTML source/rendered view
 
Setting proxy in links

Select Network Options from the setup menu(Click on F9 to get the menu).
 
Select Proxies to input the proxy address.







 
 

Read rest of entry
 

Terminal Diary | techblog Copyright © 2009 Gadget Blog is Designed by jintu jacob Powered by Blogger