Thursday, January 29, 2009

Skype On Ubuntu & Debian

Skype Instant messanger in Debian

As the root user, add this line to the end of your /etc/apt/sources.list file and save.

#vi /etc/apt/sources.list

deb http://download.skype.com/linux/repos/debian/ stable non-free

Now you need to update your source list using the following command

#apt-get update

Install Skype in debian

#apt-get install skype

This will install the latest version of Skype on your computer.

After finishing installation you can open skype from Applications–>Internet—>Skype you can see this in the following screen

Enjoy Skype.. :-)

Skype Instant messanger in Ubuntu

You need to edit your /etc/apt/sources.list file

sudo gedit /etc/apt/sources.list

add the following Repository and save the file

deb http://download.skype.com/linux/repos/debian/ stable non-free

Now you need to update your source list using the following command

sudo apt-get update

Install Skype in ubuntu

sudo apt-get install skype

This will install the latest version of Skype on your computer.

After finishing installation you can open skype from Applications–>Internet—>Skype you can see this in the following screen

Enjoy Skype... :-)

File Compression in Linux

Hi..

These are the daily used simple compression tools in all linux boxes.

****Zip****

Create:
zip -r filename.zip filename(source file/dir)

Extract:
unzip filneame.zip

****Tar****

Create :
tar -cvf filename.tar filename(source file/dir)

Extract:
tar -xvf filename.tar

****Tar.gz****

Create
tar -cvzf filename.tar.gz filname(source file/dir)

Extract
tar -xzvf filename.tar.gz

****Tar.bz2****

Create
tar -cjvf filnema.tar.bz2 filname(source file/dir)

Extract:
tar -xjzf filename.tar.bz2

****GZ****

Create:
gzip filename

Extract:
gunzip filename.gz


****BZIP2****

Create:
bzip2 filname

Extract:
bunzip2 filname.bz2

Enjoy.. :-)

Restoring GRUB On Linux Machine.

Hi...

Simple steps to reload the grub on any linux box :

1 .Boot from the linux live cd (ex: knoppix, ubuntu).

2. After sucuessful booting, Open a terminal,

3. Mount the root partition on any of the file system (ex : /mnt )

Ex : mount /dev/sda2 /mnt or /media

To check the root partition you can user fdisk -l or cfdisk.

4. Reload the grub.

grub-install --root-directory=/mnt /dev/sda (Specify the device not the partition)

OR

grub-install /dev/sda


5. Reboot the machine. Now you should be able to access your OS.

Enjoy.. :-)

Subversion (version control system)

  1. On both server and client, install Subversion:
    sudo apt-get install subversion
  2. On the server (setting up Subversion to be accessed via SSH):
    1. Make a directory for the repositories to sit:
      mkdir $SVN_DIR 
      Typically, use /home/$USER/svn as $SVN_DIR.
    2. Create a repository:
      svnadmin create $SVN_DIR/$PROJECT 
      where $PROJECT is your project name
    3. Turn off anonymous access:
      nano $SVN_DIR/$PROJECT/conf/svnserve.conf
      Add the following lines:
      [general]  #section heading
      anon-access = none # turn off anonymous access
    4. (optional) Import existing content to the repository:
      svn import /path/to/original/content/ file://$SVN_DIR/$PROJECT[/deeper]
  3. On the client:
    1. Initial checkout:
      svn checkout svn+ssh://$SVN_SERVER/$SVN_DIR/$PROJECT[/deeper/]
    2. Subsequent updates, commits, etc.:
      svn update/commit/add/remove/rename/revert [filenames]

Debian GNU/Linux device driver check page

Hi..

Check Your Debian Linux Device Drivers Here.

http://kmuto.jp/debian/hcl/index.cgi


Enjoy.. :-)

Wednesday, January 21, 2009

Adding flash plugin to iceweasel

Hi..

Installating adobe flash plugin nonfree to iceweasel browser.

Add the following repo to source list.

vim /etc/apt/sourcelist
deb http://www.backports.org/debian etch-backports main contrib non-free
:wq (save & exit)

Run apt-get update
(No problem if it shows any public_key error.)


debian:~# apt-cache search nonfree plugin
flashplugin-nonfree - Adobe Flash Player - browser plugin

debian:~#apt-get insall flashplugin-nonfree

Enjoy... :-)

dpkg: parse error, in file '/var/lib/dpkg/available'

Hi..

dpkg parse errors problems...

Example or error:

dpkg: parse error, in file `/var/lib/

dpkg/available' near line 1134 package `login':
`Replaces' field, invalid package name `manpag1:7.04+20070412': character `:' not allowed (only letters, digits and characters `-+._')
E: Sub-process /usr/bin/dpkg returned an error code (2)

Solution:

dpkg --clear-avail & make apt-get update, I belive then will you will not be having problem like this.. :-)

Enjoy..

Vnstat On Debian & Ubuntu

Hi...

Installation Of Vnstat On Debian

apt-get install vnstat

Once installed you'll need to initialise the database the system uses for recording your traffic details. The tool uses one database for each network interface you wish it to monitor. (These are not real databases, just text files located in the directory /var/lib/vnstat.)

vnstat -u -i eth0

debian:~# vnstat
Database updated: Wed Jan 21 15:25:01 2009

eth0

received: 0 MB (nan%)
transmitted: 0 MB (nan%)
total: 0 MB

rx | tx | total
-----------------------+------------+-----------
today 0 MB | 0 MB | 0 MB
-----------------------+------------+-----------
estimated 0 MB | 0 MB | 0 MB

vnstat --help
-q, --query query database
-h, --hours show hours
-d, --days show days
-m, --months show months
-w, --weeks show weeks
-t, --top10 show top10
-s, --short use short output
-u, --update update database
-i, --iface change interface (default: eth0)
-?, --help short help
-v, --version show version
-tr, --traffic calculate traffic

See also "--longhelp" for complete options list and "man vnstat".

man vnstat (View Man Page For More info)


Repairing Mysql Tables

1. Checking your tables

Run myisamchk *.MYI or myisamchk -e *.MYI if you have more time. Use the -s (silent) option to suppress unnecessary information.

If the mysqld server is stopped, you should use the --update-state option to tell myisamchk to mark the table as “checked.

You have to repair only those tables for which myisamchk announces an error. For such tables, proceed to Stage 2.

If you get unexpected errors when checking (such as out of memory errors), or if myisamchk crashes, go to Stage 3.

Stage 2: Easy safe repair

First, try myisamchk -r -q tbl_name (-r -q means “quick recovery mode”). This attempts to repair the index file without touching the data file. If the data file contains everything that it should and the delete links point at the correct locations within the data file, this should work, and the table is fixed. Start repairing the next table. Otherwise, use the following procedure:

  1. Make a backup of the data file before continuing.

  2. Use myisamchk -r tbl_name (-r means “recovery mode”). This removes incorrect rows and deleted rows from the data file and reconstructs the index file.

  3. If the preceding step fails, use myisamchk --safe-recover tbl_name. Safe recovery mode uses an old recovery method that handles a few cases that regular recovery mode does not (but is slower).

Note

If you want a repair operation to go much faster, you should set the values of the sort_buffer_size and key_buffer_size variables each to about 25% of your available memory when running myisamchk.

If you get unexpected errors when repairing (such as out of memory errors), or if myisamchk crashes, go to Stage 3.

Stage 3: Difficult repair

You should reach this stage only if the first 16KB block in the index file is destroyed or contains incorrect information, or if the index file is missing. In this case, it is necessary to create a new index file. Do so as follows:

  1. Move the data file to a safe place.

  2. Use the table description file to create new (empty) data and index files:

    shell> mysql db_name
    mysql> SET autocommit=1;
    mysql> TRUNCATE TABLE tbl_name;
    mysql> quit
  3. Copy the old data file back onto the newly created data file. (Do not just move the old file back onto the new file. You want to retain a copy in case something goes wrong.)

Important

If you are using replication, you should stop it prior to performing the above procedure, since it involves filesystem operations, and these are not logged by MySQL.

Go back to Stage 2. myisamchk -r -q should work. (This should not be an endless loop.)

You can also use the REPAIR TABLE tbl_name USE_FRM SQL statement, which performs the whole procedure automatically. There is also no possibility of unwanted interaction between a utility and the server, because the server does all the work when you use Syntax”REPAIR TABLE. See Section 12.5.2.6, “REPAIR TABLE.

Stage 4: Very difficult repair

You should reach this stage only if the .frm description file has also crashed. That should never happen, because the description file is not changed after the table is created:

  1. Restore the description file from a backup and go back to Stage 3. You can also restore the index file and go back to Stage 2. In the latter case, you should start with myisamchk -r.

  2. If you do not have a backup but know exactly how the table was created, create a copy of the table in another database. Remove the new data file, and then move the .frm description and .MYI index files from the other database to your crashed database. This gives you new description and index files, but leaves the .MYD data file alone. Go back to Stage 2 and attempt to reconstruct the index file.

Saturday, January 17, 2009

Request Tracker Installation On Ubuntu

Hi All...

Howto Install Request-Tracker 3.6 (mysql) on Ubuntu Dapper Server 6.06

Overview

This Howto will explain how to install request-tracker on a clean Ubuntu Dapper Server install. It is tested on Ubuntu Dapper 6.06 and might work with slight modifications on other versions or Debian based distros.

It also installs the additional services required for Request-Tracker, such as

* Apache2 - Web Server
* Postfix - Email Server (for sending emails)
* Mysqld 5.0.22-- Database to Store the RT information.

Install the Request Tracker Packages
Open a Root Login Shell

Enter

sudo -s

as member of the admin group to get a root-login shell.
Enable Universe

Enable universe in your apt ''sources.list''

cp -vpr /etc/apt/sources.list /etc/apt/sources.list.orig
vim /etc/apt/sources.list


Uncomment universe sources, by removing the ''#''.

deb http://us.archive.ubuntu.com/ubuntu/ dapper universe


Update your apt package list

apt-get update

Install the Packages

apt-get install rt3.6-apache2 (this will also take care of some prerequisites)

apt-get install request-tracker3.6 rt3.6-clients apache2-doc postfix mysql-server lynx libdbd-pg-perl

* In the "Postfix Configuration" - I choose "Internet Site", just because I prefer to have the system send emails without being dependent on a different mail server. The logic behind that is because if the email server goes down, the ticket server should NOT follow.
* You should see this message after the install is done...

Postfix is now set up with a default configuration. If you need to make
changes, edit
/etc/postfix/main.cf (and others) as needed. To view Postfix configuration
values, see postconf(1).

After modifying main.cf, be sure to run '/etc/init.d/postfix reload'.

Configure Rt

* Backup the RT config file. I like to do this for every conf file I modify

cp -vpr /etc/request-tracker3.6/RT_SiteConfig.pm /etc/request-tracker3.6/RT_SiteConfig.pm.orig

vim /etc/request-tracker3.6/RT_SiteConfig.pm

* Customize using the directions in the file.

Create the Database

I used the ConfigureMysqlOnGentoo guide as reference and had issues with the script my workaround was to create the database, create the user, drop the database and recreate the database and it worked fine.

* Use script to create database (don’t worry about user error message we will fix this later)

/usr/sbin/rt-setup-database-3.6 --action init --dba root --prompt-for-dba-password

* As root, login to MySQL

mysql –p

*Create user CREATE USER rtuser IDENTIFIED BY 'p4ssw0rd';

* Grant access rights to rtuser

GRANT ALL PRIVILEGES ON rtdb.* TO 'rtuser'@'localhost' IDENTIFIED BY 'p4ssw0rd'; FLUSH PRIVILEGES; QUIT

* Drop the database

mysqladmin drop rtdb –p

* Recreate the database using the script (it should work this time)

/usr/sbin/rt-setup-database-3.6 --action init --dba root --prompt-for-dba-password
Configure Apache2
Add the Virtual Host Config

cp -vpr /etc/apache2/sites-available/default /etc/apache2/sites-available/default.orig
vim /etc/apache2/sites-available/default


Add the following line to the VirtualHost section of Apache from which you wish to serve RT

Include "/etc/request-tracker3.6/apache2-modperl2.conf"
Enable Apache2 RewriteEngine

cd /etc/apache2/mods-enabled/
ln -s ../mods-available/rewrite.load .

Install Apache::Session

Make sure that you update the 'make', 'tar', 'unzip', and 'gzip' libraries in your distribution prior to installing ''Apache::Session'':

apt-get install make tar gzip unzip


Check that Apache::Session is installed. If necessary, install (as root) with

cpan install Apache::Session

Restart Apache

/etc/init.d/apache2 force-reload

Test

You can now login to:

http://yourdomain.com/rt

using user root and password "password" (without quotation marks of course). Change this passwd ASAP via the Configuration menu.


Best Source : http://www.bestpractical.com/rt

Friday, January 16, 2009

Monitor Disk Space In Linux With Shell Script

Hi.. All..

Monitoring Disk Space In Linux With Shell Script

ADMIN=
"me@somewher.com"
# set alert level 90% is default
ALERT=90
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output;
do
#echo $output
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $2 }' )
if [ $usep -ge $ALERT ]; then
echo "Running out of space \"$partition ($usep%)\" on $(hostname) as on $(date)" |
mail -s
"Alert: Almost out of disk space $usep" $ADMIN
fi
done

Source : http://bash.cyberciti.biz/monitoring/shell-script-monitor-unix-linux-diskspace/



Thursday, January 15, 2009

Configure Ldap & NFS On Client Machine

### Ldap Configuration & NFS On Debian Etch & Ubuntu Linux ###

To install Ldap and NFS, Install the following packages as below:

aptitude search libpam-ldap libnss-ldap ------>(To search whether the application is present in repo).

aptitude install libpam-ldap libnss-ldap -----> (To Install the application)

While installation you will get the ldap server configuration setup wizard fill it up as below example:

Ldap Server Ip address

dc=domain,dc=ac,dc=in (your local network name)

cn=admin,ou=Apps,dc=domain,dc=ac,dc=in, passwd of your ldap server,and say 'NO' to other options...

after compleating ldap server configuration edit the following by using editor as a root:

1. /etc/pam_ldap.conf

change the host ip (ldap server ip)

base dc=domain,dc=ac,dc=in

rootbinddn cn=admin,ou=Apps,dc=domain,dc=ac,dc=in


2. /etc/libnss-ldap.conf

Change the host ip to ldap server ip

rootbinddn cn=admin,ou=Apps,dc=domain,dc=ac,dc=in

3. /etc/nsswitch.conf

passwd: files ldap
group: files ldap
shadow: files ldap
hosts: files dns mdns


4. cd /etc/pam.d

a. vi common-auth

auth sufficient pam_ldap.so
auth required pam_unix.so nullok_secure try_first_pass

b. vi common-account

account sufficient pam_ldap.so
account required pam_unix.so

c. vi common-password

password sufficient pam_ldap.so
password required pam_unix.so nullok obscure min=4 max=8 md5


d. vi commaom-session

session sufficient pam_ldap.so
session required pam_unix.so
session optional pam_foreground.so

To see the UID & PASSWD type as a root 'getent passwd' a list of uid & passwd will appear.. by this the Ldap configuration finishes...

If Your Unable To Find Ldap User, Run The Following Command :- (For Ubuntu 7.04 & 7.10)

After configuration these files create a group, 'sudo addgroup --system nvram'.After this you should be able to see username
and passwd of all users..


## Network File System Configuration ##

### Installation of nfs-common, portmap, autofs ####

aptitude install nfs-common, portmap, autofs

After installation edit the following files..

a. vi /etc/auto.master

/home /etc/auto.home

b. vi /etc/auto.home
* ( Ldap server ip address):/home/&


After editting these files reatsrt the service...


/etc/init.d/portmap restart

/etc/init.d/autofs restart

or

Reboot the machine, after rebooting you should be able to login to your account.

Monday, January 5, 2009

Creating genisoimage / mkisofs & Buring Images On Linux Machine

Hi..

Creating genisoimages / mkisofs on linux machines (debian / ubuntu)

Making iso image:

genisoimage -v -o filename.iso /home/user/dir_name
--------------------------------------------------------------------------------------------------------

Burn CD / DVD images :

CD Buring:
wodim -v dev=/dev/hda speed=40 file.iso


Buring DVD images :
growisofs -dvd-compat -Z /dev/dvd=image.iso


Appending More Data On DVD :
growisofs -M /dev/dvd -R -J /more/files

More Details : man growisofs, man genisoimage






Friday, January 2, 2009

nautilus crash in debian lenny/sid

Hi...

Nautilus crashes double clicking on any partition or directory.

Distribution: Debian lenny/sid
Gnome Release: 2.22.3 2008-09-18 (Debian)
BugBuddy Version: 2.22.0

Backtrace was generated from '/usr/bin/nautilus'

(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 0xb6c88700 (LWP 3355)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
0xb7fcc410 in ?? ()
#0 0xb7fcc410 in ?? ()
#1 0xbf84e708 in ?? ()
#2 0x00000000 in ?? ()

Thread 1 (Thread 0xb6c88700 (LWP 3355)):
#0 0xb7fcc410 in ?? ()
No symbol table info available.
#1 0xbf84e708 in ?? ()
No symbol table info available.
#2 0x00000000 in ?? ()
No symbol table info available.
#0 0xb7fcc410 in ?? ()
The program is running. Quit anyway (and detach it)? (y or n) [answered Y; input not from terminal]



Debian

Check for the presence of a -dbg package for the source package you're investigating. For example, if you're looking into a gnome-applets crash, install gnome-applets-dbg.

If the crash happens in a GNOME library, for example in libgnomeui, here you might want to install libgnomeui-dbg. However, the rule also applies to non-GNOME libs; for example, Epiphany is built against xulrunner, so you should install libxul0d-dbg as well. You can also install debugging symbols for most GNOME libraries in a single run by installing the gnome-dbg metapackage.

Source : http://live.gnome.org/GettingTraces/DistroSpecificInstructions