Saturday, December 5, 2009

VirtualBox OSE Problem

Problem :
The VirtualBox kernel driver is not accessible to the current user. Make sure that the user has write permissions for /dev/vboxdrv by adding them to the vboxusers groups. You will need to logout for the change to take effect..

Solution :

Quote : sudo chown kunkun:vboxusers /dev/vboxdrv


Enjoy ubuntu... ;)

Thursday, December 3, 2009

How to use grep command in Linux

The name, "grep", derives from the command used to perform a similar operation, using the Unix/Linux text editor ed:
g/re/p

grep command syntax

grep 'word' filename
grep 'string1 string2' filename
cat otherfile | grep 'something'
command | grep 'something'

Use grep to search file

Search /etc/passwd for boo user:
Quote : $ grep boo /etc/passwd

You can force grep to ignore word case i.e match boo, Boo, BOO and all other combination with -i option:
Quote : $ grep -i "boo" /etc/passwd

Use grep recursively

You can search recursively i.e. read all files under each directory for a string "192.168.1.5"
Quote : $ grep -r "192.168.1.5" /etc/

Use grep to search words only

When you search for boo, grep will match fooboo, boo123, etc. You can force grep to select only those lines containing matches that form whole words i.e. match only boo word:
Quote : $ grep -w "boo" /path/to/file

Use grep to search 2 different words

use egrep as follows:
Quote : $ egrep -w 'word1|word2' /path/to/file

Count line when words has been matched

grep can report the number of times that the pattern has been matched for each file using -c (count) option:
Quote : $ grep -c 'word' /path/to/file
Also note that you can use -n option, which causes grep to precede each line of output with the number of the line in the text file from which it was obtained:
Quote : $ grep -n 'word' /path/to/file

Grep invert match

You can use -v option to print inverts the match; that is, it matches only those lines that do not contain the given word. For example print all line that do not contain the word bar:
Quote : $ grep -v bar /path/to/file

UNIX / Linux pipes and grep command

grep command often used with pipes. For example print name of hard disk devices:
# dmesg | egrep '(s|h)d[a-z]'
Display cpu model name:
# cat /proc/cpuinfo | grep -i 'Model'
However, above command can be also used as follows without shell pipe:
# grep -i 'Model' /proc/cpuinfo

How do I list just the names of matching files?

Use the -l option to list file name whose contents mention main():
Quote : $ grep -l 'main' *.c
Finally, you can force grep to display output in colors:
Quote : $ grep --color vivek /etc/passwd

Enjoy ubuntu... ;)

Tuesday, November 3, 2009

How to disable deprecated header warning message - g++

Use -Wno-deprecated, you can disable header warning message when u compile using g++ command.

Quote : kunkun@kunkun-laptop: g++ -lm -Wno-deprecated test.cpp -L: diCryptoSys.a -o test


Enjoy ubuntu... ;)

Monday, October 26, 2009

How to decrypt a file using GPG/GnuPG

Decrypting a file is just as easy. Simply run this command:

Code:
# gpg --output  --decrypt 
Replace with the name of the file you want to produce, decrypted. Replace with the name of the encrypted file. For example:

Code:
# gpg --output test.txt --decrypt /home/tor/test.txt.gpg
If you only have the the pass phrase (password) you can decrypt using --symmetric

Code:
# gpg --output  --symmetric .gpg

Enjoy ubuntu... ;)

How to encrypt a file using GPG/GnuPG

Encrypting a file is easy, you'll need the name you used above (which I told you to remember). Issue the command below:

Code:
# gpg -e -r  
Which you will need to replace and with valid values. Let us use the name I used, tor, and /home/tor/test.txt as the file name.

Code:
# gpg -e -r tor /home/tor/test.txt
Alternatively you can use the long version of the command:

Code:
# gpg --encrypt --recipient 'tor' /home/tor/test.txt
Here is the file before encryption:

Code:
this is a test
and here is the file after encryption:

Code:
<85>^B^N^CeK^Z^MÂó ?l|[- !S>Ã<91><9f>Mo9âg²ê^?#Y ^XôÃ]ëF$f¿a^WCô^Uqøh"v^]Ã:§`^Nÿ Ã^\Ã

ðïe°¾Ã¹Ã*G/j>^Y<95>½UI<9f>d^F<83>÷@Ã<89>^U;Ã(o^VCAÃHÃ¥?<9c>U~ü<86>w;ZXÃ>§¥ÃL[º² ag^[^[^] k^HC<8b>^A<98>^P<86>^GFZÃöE<9f>ÿl'+<9b>+3 Ã(Ã<8a>î±ÃÃ86>> þ^ZÿãWÃ<85>^[^?^K<82>Ã>KÃ4^RZE--xS^E£OlÃÃÃ
FöÃ*<9e>¹».~S{Ãf<855ã>M|M^Hºy¼?^\|S:[Ãì<8b>çl<94>*b}<93>éÃ7K´<92>î¨*Ã>¶!¯ÃC0´D<95>>
D^PÃh<9d>ÃÃöBÃ^U$^_<89>´é^Cô4þÃÃ
<83>^X©^Tøà ¶£=<8b>aYüö¢^YóiTut<8e>^^ VA<8a>|Ãâ<95>§S7¢¢ýGO%T*tÃ<81>Ã=ê^]¿/ôCÿÃhKóL^AÃô]?^NÃ=<8e>!Ãþ¼G^MVg>ð<8e>^]<9a>)Ãà Ã<84>»KÃ<96>8ÃÃ^C^Olú÷© LÃñªÃ^A^VÃ(^E<94>Ã^?mÃþF?Ã<90>qÃ>^^p^@^^
\|9<84>¢6<8d>^VðgäùÃ<8e>µéuÃã<90><8c>^R^X! <9d><90>^\ïñQ<94>yty>F]¹2Ã^XmìK<9d>:kT
GPG will add a ".gpg" to the end of the encrypted file. This leaves the original intact and makes an encrypted copy.

Enjoy ubuntu... ;)

How to use GPG/GnuPG

This guide will show you how to use and setup GPG for file encryption. GPG is an encryption and signing tool for the Linux/Unix operating system. GPG is the main program for the GnuPG system.

Getting Started
To start you need to First run the generation commands:
Code:
# gpg --gen-key

gpg (GnuPG) 1.4.5; Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.

Please select what kind of key you want:
(1) DSA and Elgamal (default)
(2) DSA (sign only)
(5) RSA (sign only)
Use the default (1) and press enter.

Code:
DSA keypair will have 1024 bits.
ELG-E keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048)
Use the default here, press enter.

Code:
Requested keysize is 2048 bits
Please specify how long the key should be valid.
0 = key does not expire
= key expires in n days
w = key expires in n weeks
m = key expires in n months
y = key expires in n years
Again use the default.

Code:
Key does not expire at all
Is this correct? (y/N)
Enter "y" and press enter.

Code:
You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
"Heinrich Heine (Der Dichter) "

Real name:
Type in a name to identify the key. I use my first name for this example I will use "tor". Remember the name you use (used later).

Then enter your email address and comment.

Code:
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit?
Press O and then Enter.

Code:
Enter passphrase:
Type a unique passphrase. This is like a password.

Code:
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
++++++++++++++++++++++++++++++.+++++.+++++++++++++++.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++.++++++++++.>+++++.................................................................>+++++.<+++++.......................................>+++++.....+++++

Not enough random bytes available. Please do some other work to give
the OS a chance to collect more entropy! (Need 277 more bytes)
Type some buttons or open another terminal. Now you have a key generated with your first name and should not get that error above.

Enjoy ubuntu... ;)

Wednesday, October 21, 2009

How to Optimize Display Settings

Windows XP can look sexy but displaying all the visual items can waste system resources. To optimise:

  1. Go to Start
  2. Click Settings
  3. Click Control Panel
  4. Click System
  5. Click Advanced tab
  6. In the Performance tab click Settings
  7. Leave only the following ticked:
  • Show shadows under menus
  • Show shadows under mouse pointer
  • Show translucent selection rectangle
  • Use drop shadows for icons labels on the desktop
  • Use visual styles on windows and buttons
Enjoy ubuntu... ;)

Tuesday, October 20, 2009

How to Speed Up Windows XP

Tweaks to make your Windows XP run faster than before.
  1. DISABLE INDEXING SERVICES
  2. OPTIMIZE DISPLAY SETTINGS
  3. DISABLE PERFORMANCE COUNTERS
  4. SPEED UP FOLDER BROWSING
  5. IMPROVE MEMORY USAGE
  6. OPTIMIZE YOUR INTERNET CONNECTION
  7. OPTIMIZE YOUR PAGEFILE
  8. RUN BOOTVIS - IMPROVE BOOT TIMES
  9. REMOVE THE DESKTOP PICTURE
  10. REMOVE FONTS FOR SPEED
  11. DISABLE UNNECESSARY SERVICES
  12. TURN OFF SYSTEM RESTORE
  13. DEFRAGMENT YOUR PAGEFILE
  14. SPEED UP FOLDER ACCESS - DISABLE LAST ACCESS UPDATE
  15. DISABLE SYSTEM SOUNDS
  16. IMPROVE BOOT TIMES
  17. IMPROVE SWAP FILE PERFORMANCE
  18. MAKE YOUR MENUS LOAD FASTER
  19. MAKE PROGRAMS LOAD FASTER
  20. IMPROVE XP SHUTDOWN SPEED
  21. SPEED UP BOOT TIMES I
  22. SPEED UP BOOT TIMES II
  23. SPEED UP BOOT TIMES III
  24. FREE UP MEMORY
  25. ENSURE XP IS USING DMA MODE
  26. ADD CORRECT NETWORK CARD SETTINGS
  27. REMOVE ANNOYING DELETE CONFIRMATION MESSAGES
  28. DISABLE PREFETCH ON LOW MEMORY SYSTEMS
Tq http://www.pinoygeek.org/

Enjoy ubuntu... ;)

Tuesday, September 29, 2009

How to change X's resolution

To display current resolution of X, just use of the command

Quote : xrandr

To set the resolution of the X window, the command is

Quote : xrandr -s 1024x760

Enjoy ubuntu... ;)

How to make your Linux box speak

Ubuntu and many other distros have an inbuilt speech synthesiser called espeak.

Quote : espeak "Hello world I can speak"

Enjoy ubuntu... ;)

How to turn off the Caps Lock key through the command line

You can turn off the Caps Lock key through the command line interface using the xmodmap command.

Quote : xmodmap -e "remove lock = Caps Lock"

To reactivate the key,

Quote : xmodmap -e "add lock = Caps Lock"

Enjoy ubuntu... ;)

Monday, September 7, 2009

How to fix Pidgin Problem


Quote : sudo dpkg --force-all --remove pidgin pidgin-data
Quote : sudo apt-get update && sudo apt-get -f install
Quote : sudo apt-get install pidgin

Enjoy ubuntu... ;)

Monday, August 24, 2009

How to fix ODBC Drivers cannot be found in Vista 64

32 bit odbcad32.exe in the syswow64 directory. They put the 64 bit odbcad32.exe in the system32 directory. 32 bit apps will pick up the 32 bit registry setting and 64 bit will pick up the 64 bit registry setting. system32 comes before syswow64 in the system path so the 64bit software runs before the 32 bit software.

So, when I manually ran odbcad32.exe in the syswow64 directory, I was able to configure my connections and everything worked hunky dory. I know have a shortcut to syswow64\odbcad32.exe on my desktop for working with 32 bit databases.

Enjoy ubuntu... ;)

Thursday, August 20, 2009

How to install AWN on Ubuntu

Open a terminal (Applications -> Accessories -> Terminal) and paste the following command:

Quote :
sudo apt-get install awn-manager-trunk awn-extras-applets-trunk

Hit the "Y" key when asked, and complete the installation. Close the terminal window and start the AWN dock from Applications -> Accessories -> Avant Window Navigator.

Review image
WARNING: Be aware that AWN will appear over your bottom GNOME panel, therefore you should delete the panel before launching AWN! See the third tip from the "Bonus tweaks" section below.

Tq http://news.softpedia.com/news/Install-AWN-on-Hardy-Heron-82611.shtml

Enjoy ubuntu... ;)

How to fix Yahoo Problem in Pidgin 2.5.7

This is for those that can not upgrade to Pidgin 2.5.7 or don't want to.

1· Open Pidgin and go to Accounts -> Manage Accounts...

Review image


2· Click on the Yahoo account and then on the "Modify" button...

Review image


3· Click on the "Advanced" tab and paste the following line in the "Pager server" field...

cn.scs.msg.yahoo.com

Review image

4. Click the "Save" button, then click the check box in front of the Yahoo account to connect.

Tq http://news.softpedia.com/news/How-to-Fix-Yahoo-problem-in-Pidgin-114754.shtml

Enjoy ubuntu... ;)

How to install gcc on ubuntu

Quote : kunkun@kunkun-laptop:~$ sudo apt-get install gcc build-essential

To check version of gcc

Quote : root@kunkun-laptop:/media/mozilla/proj/mozilla# gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu4)

Enjoy ubuntu... ;)

Thursday, July 16, 2009

How to set up your Thunderbird client to work with Gmail

  1. Enable IMAP in Gmail. Make sure you click Save Changes when you're done.
  2. Open Thunderbird, and select Tools > Account Settings.
  3. Click Add Account.
  4. Select the Email account radio button and click Next. The Identity screen appears.
  5. Enter your full name in the Your Name field. Enter your Gmail address (username@gmail.com) in the Email Address field, and click Next. Google Apps users, enter your full address in the format username@your_domain.com
  6. Select IMAP as the type of incoming server you are using. Enter imap.gmail.com in the Incoming Server field.
  7. Set the Outgoing Server to smtp.gmail.com and click Next.
  8. Enter your full email address (including @gmail.com @your_domain.com) in the Incoming User Name and Outgoing User Name fields, and click Next.
  9. Enter a name for your email account in the Account Name field, and click Next.
  10. Verify your account information in the dialog box, and click Finish.
  11. Select Server Settings from the folder list below your new account.
  12. Update the Port value to 993.
  13. In the Security Settings section, select SSL from the Use secure connection options.
  14. Select the 'Check for messages at startup' checkbox and the 'Check for new messages every 10 minutes' checkbox.
  15. Click Outgoing Server (SMTP) in the folder list.
  16. Select the smtp.gmail.com (Default) entry from the list and click Edit. The SMTP Server page appears.
  17. Enter smtp.gmail.com as the Server Name and set the Port to 587.
  18. Select User name and password and enter your full email address (including @gmail.com or @your_domain.com) in the User Name field.
  19. Select TLS from the Use secure connection radio buttons and click OK.
  20. Click OK to save your changes and exit the Account Settings dialog.
  21. Check our recommended client settings, and adjust your client's settings as needed.
Tq Gmail Help

Enjoy ubuntu... ;)

How to Compiling Thunderbird and Enigmail source code on Ubuntu

The build instructions require you to first build part of Thunderbird before compile Enigmail.

I spent that effort anyway, and here is what I did:

First, download any packages required to build Thunderbird:

Qoute : $ sudo apt-get build-dep thunderbird
Quote : $sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev

Then, make a new directory somewhere, download the Thunderbird source and build it:
Qoute : $ mkdir proj
Qoute : $ cd proj
Qoute : $ sudo apt-get -b source thunderbird

This will take a while. Really. Go and make a cup of tea.

When it’s done, you need to download Enigmail and unpack it in to the right place. Note that your “thunderbird-2.0.0.17+nobinonly” directory might be called something slightly different. Also note that I’m using Enigmail 0.95.7, but you should check for the latest version.

Qoute : $ cd thunderbird-2.0.0.17+nobinonly/build-tree/mozilla/mailnews/extensions
Qoute : $ wget http://www.mozilla-enigmail.org/download/source/enigmail-0.95.7.tar.gz
or you just download direct from Engimail website
Qoute : $ tar -zxvf enigmail-0.95.7.tar.gz

Next, you need to create a config file:

Qoute : $ cd ../..
Qoute : $ echo . $topsrcdir/mail/config/mozconfig > .mozconfig
Qoute : $ echo ac_add_options --disable-tests >> .mozconfig
Qoute : $ echo ac_add_options --disable-debug >> .mozconfig
Qoute : $ echo ac_add_options --enable-crypto >> .mozconfig
Qoute : $ echo ac_add_options --enable-optimize >> .mozconfig
Qoute : $ echo ac_add_options --enable-static-mail >> .mozconfig
Qoute : $ echo ac_add_options --enable-application=mail >> .mozconfig
Qoute : $ echo mk_add_options MOZ_CO_PROJECT=mail >> .mozconfig

Then build Enigmail and make an XPI:

Qoute : $ cd mailnews/extensions/enigmail
Qoute : $ ./makemake -r
Qoute : $ make
Qoute : $ make xpi
Qoute : $ cd ../../../dist/bin
Qoute : $ ./thunderbird

The resulting XPI file is stored in the “dist/bin” directory you’re now in. To install the extension, you have fire-up Thunderbird, go to Tools->Add-ons->Extensions, click “Install…” and go and find it.

Tq http://www.waxworlds.org/

Enjoy ubuntu... ;)

How to install OCR for PDF in ubuntu

To get OCR in Ubuntu, you need to use the Open-Source Tesseract OCR engine. However, it can only perform OCR on the TIFF format. In order to allow it to do PDF, we also need the Evince PDF reader to allow us to export a page to TIFF to feed Tesseract with.

Install Evince PDF reader

Quote : $ sudo apt-get install evince

Install tesseract in Ubuntu:

Quote : $ sudo apt-get install tesseract-ocr

Now, get the TIFF from Evince; Right click the page and click “Save image as…” and export the file. Then, to get a good OCR we need to convert it to monochrome.


Quote : $ tesseract foo.tif bar
Unable to load unicharset file /usr/share/tesseract-ocr/tessdata/eng.unicharset

If the above bug happens, fix it by:

Quote : $ sudo apt-get install tesseract-ocr-eng

This is caused by a nasty bug in Ubuntu.

And now finally, do:

Quote : $ tesseract foo.tif bar# and without the .txt extension, or you will end up with bar.txt.txt

to complete it!

Tq http://www.compdigitec.com/

Enjou ubuntu... ;)

Wednesday, July 15, 2009

How to restore Grub from a livecd ubuntu

This will restore grub if you already had grub installed but lost it to a windows install or some other occurence that erased/changed your MBR so that grub no longer appears at start up or it returns an error.

Quote : sudo grub
This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands

Quote : find /boot/grub/stage1
This will return a location. If you have more than one, select the installation that you want to provide the grub files.
Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)

Quote : root (hd?,?)
Again use the value from the find command i.e. if find returned (hd0,9) then you would enter root (hd0,9)

Next enter the command to install grub to the mbr

Quote : setup (hd0)
Finally exit the grub shell
Quote : quit
That is it. Grub will be installed to the mbr.
When you reboot, you will have the grub menu at startup.

Enjoy ubuntu... ;)

Tuesday, July 14, 2009

How to install windows xp on presario cq40-337TU

1) nLite(download here), a free tool to help you slipstreaming(integrate) your SATA drivers into WinXp installation disk.
2) Extracted SATA drivers(if you are using Intel chipset Intel 82801GR/GH, 631xESB/632xESB, 82801GHM, ICH8R/ICH9R, 82801HEM SATA RAID Controller, get the drivers from here)

Steps:
1) Get your Windows XP installation disk and copy the contents to a new folder(I named it "WinXp").

2) Extract the SATA drivers you downloaded into a folder, namely "Floppy 32Bit". (Need help for "Extracting SATA driver from their EXE without Floppy Disk(FD)")

3) Run nLite->choose "Next".



4) Now, locate the Windows folder(for me, it's "WinXp").


5) Next again and you will come to "Presets". Ignore this by choosing "Next" again.


6) In "Task Selection", choose "Drivers" and "Bootable ISO" by high-lighting them.


7) Choose "Insert"->"Single driver"


8) Browse to the SATA driver folder(I named it "Floppy 32Bit") and select either one of the .INF file, I choose "iaahci.inf".


9) A screen like below will pop-up, make sure it's "Textmode driver" and select all of them by holding CTRL+A key and choose "OK"


10) You shall see something like this. Choose "Next" and you will be prompted.


11) Choose "Yes" to start the process.


12) Let it finish and choose "Next".


13) Finally, you can create your project as ISO image or burn it directly to CD-R under "Mode". I choose "Direct Burn". You can put anything for "Label" but not too long. Choose "Burn" and you will be prompted again.


14) Choose "Yes" to burn it to CD-R. Wait for it to finish and choose "Next"


15) Choose "Finish" to exit nLite.


Tq http://maxeasyguide.blogspot.com/

Enjoy ubuntu... ;)

How to Import MySQL using the command in ubuntu

Quote : kunkun@kunkun:~$ mysql -u {database_username} -p {database_name} < mysqlbackup.sql

Enjoy ubuntu... ;)

How to Export MySQL using the command in ubuntu

Quote : kunkun@kunkun:~$ mysqldump -u {database_username} -p {database_name} > mysqlbackup.sql

Enjoy ubuntu... ;)

How to check MySQL Version on command line

# mysql –version
or
# mysql -V

C:\xampp\mysql\bin>mysql -V
mysql Ver 14.12 Distrib 5.0.51a, for Win32 (ia32)

Enjoy ubuntu... ;)

Friday, July 10, 2009

How to add a column to an existing MySQL table

To add a column called email to the contacts table created in Create a basic MySQL table with a datatype of VARCHAR(80), use the following SQL statement:

ALTER TABLE contacts ADD email VARCHAR(60);

This first statement will add the email column to the end of the table. To insert the new column after a specific column, such as name, use this statement:

ALTER TABLE contacts ADD email VARCHAR(60) AFTER name;

If you want the new column to be first, use this statement:

ALTER TABLE contacts ADD email VARCHAR(60) FIRST;


Enjoy ubuntu... ;)

Thursday, July 9, 2009

How to compile enigmail module on thunderbird

Compiling Enigmail

1. After compiling Mozilla Thunderbird, obtain the source code for the Enigmail module as described earlier.

2. Download the Enigmail Module(http://www.mozilla-enigmail.org/download/source/enigmail-0.95.7.tar.gz) tarball and extract it to a convenient location.

3. Copy enigmail folder to c:\proj\mozilla\THUNDERBIRD\mailnews\extensions\

4. Navigate into enigmail folder
cd THUNDERBIRD/mailnews/extensions/enigmail
Izhar@izhar /c/proj/mozilla/THUNDERBIRD/mailnews/extensions/enigmail

5. Compile enigmail module
./makemake -r
make

Packaging Enigmail XPI's
To allow others to use your compiled version of Enigmail, you need to create the XPI file(s) containing the Enigmail binaries. To build the Enigmail XPI run:

make xpi

from the same directory where you compiled Enigmail.

This will create enigmail--.xpi in the mozilla/dist/bin (or OBJDIR/dist/bin) folder.

Enjoy ubuntu... ;)

How to compile and run thunderbird source code on Windows

Compiling thunderbird
1. Download all the required software's

2. Install Microsoft Visual Studio 6

3. To use Visual C++ 6, you must be sure that you have applied Visual Studio Service Pack 5 (http://msdn.microsoft.com/en-us/vstudio/aa718363.aspx) and the Visual C++ 6.0 Processor Pack (http://msdn.microsoft.com/en-us/vs2005/aa718349.aspx). (The processor pack is not available for Visual Studio Service Pack 6)

4. Dowload and Install Mozilla Build 1.3
The MozillaBuild package contains the other software prerequisites necessary for building Mozilla. This includes the MSYS build environment, Mercurial, CVS, Python, NSIS, and UPX, as well as optional/useful tools such as wget, autoconf-2.13, xemacs.

http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-1.3.exe

By default, the package installs to c:\mozilla-build. It is recommended to use the default path. The installer does not modify the Windows registry.

5. Run start-msvc6.bat in the c:\mozilla-build directory which will open up an application window with MINGW32 (referred to as MSYS).

Note: MSYS is a collection of GNU utilities such as bash, make, gawk and grep to allow building of applications and programs which depend on traditionally UNIX tools to be present. It is intended to supplement MinGW and the deficiencies of the cmd shell.

5. Now that the MSYS window is open (it will look something like command prompt), navigate your way back to the root c:\ .Once you are in c:\ do the following in the MSYS console window:
i) Make a new directory called proj, using the below command.
mkdir proj

ii) Navigate into proj directory
cd proj
Izhar@izhar /c/proj

iii) Download the latest Thunderbird(http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/latest/source/) tarball and extract it to a convenient location. This will create a mozilla folder, which is the root of the build tree.

iv) Copy folder mozilla into c:\proj\

v) Navigate into mozilla directory
cd mozilla
Izhar@izhar /c/proj/mozilla

vi) Create MOZ file ".mozconfig" which contains all the build options
# Options for client.mk.
mk_add_options MOZ_CO_PROJECT=mail
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/THUNDERBIRD

# Options for 'configure' (same as command-line options).
ac_add_options --enable-application=mail
ac_add_options --enable-debug
ac_add_options --disable-static
ac_add_options --disable-optimize
ac_add_options --disable-vista-sdk-requirements

( Note: for windows XP wpcapi.h is not supporting to overcome this issue we need to addd additional parameter in .mozconfig file
ac_add_options --disable-vista-sdk-requirements )

vii) Paste ".mozconfig" file into c:\proj\mozilla\

viii) Build the source code
make -f client.mk build MOZ_CO_PROJECT=mail

iv) Once the source code is built, you should have directory THUNDERBIRD. To run Thunderbird, run Thunderbird.exe located in c:\proj\mozilla\THUNDERBIRD\dist\bin

Enjoy ubuntu... ;)

Friday, June 19, 2009

How to paging using php mysql

1. Setup how many rows to show per page
// how many rows to show per page
$rowsPerPage = 20;

// by default we show first page
$pageNum = 1;

// if $_GET['page'] defined, use it as page number
if(isset($_GET['page']))
{
$pageNum = $_GET['page'];
}

// counting the offset
$offset = ($pageNum - 1) * $rowsPerPage;

2. Set your query

$tbl_name="record"; // Table name

$sql="SELECT * FROM $tbl_name LIMIT $offset, $rowsPerPage";
$result=mysql_query($sql);

3. Display the result
while($rows=mysql_fetch_array($result)) {

echo $rows['id'];
echo $rows['name'];

}
?>

4. Display how many rows we have in database and page

// how many rows we have in database
$query = "SELECT COUNT(id) AS numrows FROM $tbl_name";
$result = mysql_query($query) or die('Error, query failed');
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$numrows = $row['numrows'];

// how many pages we have when using paging?
$maxPage = ceil($numrows/$rowsPerPage);

// print the link to access each page
$self = $_SERVER['PHP_SELF'];
$nav = '';

for($page = 1; $page <= $maxPage; $page++)
{
if ($page == $pageNum)
{
$nav .= " $page "; // no need to create a link to current page
}
else
{
$nav .= " $page ";
}
}
// creating previous and next link
// plus the link to go straight to
// the first and last page

if ($pageNum > 1)
{
$page = $pageNum - 1;
$prev = " [Prev] ";

$first = " [First Page] ";
}
else
{
$prev = ' '; // we're on page one, don't print previous link
$first = ' '; // nor the first page link
}

if ($pageNum < $maxPage)
{
$page = $pageNum + 1;
$next = " [Next] ";

$last = " [Last Page] ";
}
else
{
$next = ' '; // we're on the last page, don't print next link
$last = ' '; // nor the last page link
}

// print the navigation link
echo $first . $prev . $nav . $next . $last;
?>

Enjoy ubuntu... ;)

Wednesday, June 17, 2009

How to display date format in PHP

Problem
I currently have

PHP Code:
echo $rows['date'];

which display date as "2009-06-17" (year, month, day)

Solution
PHP Code:
echo date('d m Y', strtotime($rows['date']));

Now i can display date as 22 06 2009

Enjoy ubuntu... ;)

Tuesday, June 16, 2009

How to unmount usb on ubuntu

1. Quote : umount /dev/sdb1 media/sdb1
umount: /dev/sdb1: not mounted
umount: media/sdb1: not mounted

Enjoy ubuntu... ;)

How to mount usb on ubuntu

1. Quote : fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
240 heads, 63 sectors/track, 10337 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x95aa95aa

Device Boot Start End Blocks Id System
/dev/sda1 * 1 3386 25598128+ 7 HPFS/NTFS
/dev/sda2 3387 10337 52548142+ f W95 Ext'd (LBA)
/dev/sda5 4920 5597 5120000 7 HPFS/NTFS
/dev/sda6 7629 10337 20480008+ 7 HPFS/NTFS
/dev/sda7 5598 7628 15350076 83 Linux
/dev/sda8 3387 3515 971869+ 82 Linux swap / Solaris
/dev/sda9 3515 3528 96358+ 83 Linux
/dev/sda10 3528 4205 5116671 83 Linux

Partition table entries are not in disk order

Disk /dev/sdb: 4011 MB, 4011851776 bytes
5 heads, 32 sectors/track, 48972 cylinders
Units = cylinders of 160 * 512 = 81920 bytes
Disk identifier: 0xe3b4e3b4

Device Boot Start End Blocks Id System
/dev/sdb1 * 51 48973 3913792 b W95 FAT32

2. Quote : mount /dev/sdb1 media/sdb1

Enjoy ubuntu... ;)

Thursday, June 11, 2009

How to reset your MySQL root password under Windows

In case you forgot the root password for your MySQL database server running under Microsoft Windows, you can still access your database and even reset your password using the command prompt. However, first you should check your my.cnf file where your password is stored.

If you are using a new version of MySQL Server, such as 5.0, the methods here might not work for you, or slightly different actions may need to be applied.

1. Stop your MySQL server completely. This can be done by accessing the Services window inside Windows XP and Windows Server 2003, where you can stop the MySQL service.

2. Open your MS-DOS command prompt using "cmd" inside the Run window. Inside it navigate to your MySQL bin folder, such as C:\MySQL\bin using the cd command.

3. Execute the following command in the command prompt: mysqld.exe -u root --skip-grant-tables

4. Leave the current MS-DOS command prompt as it is, and open a new MS-DOS command prompt window.

5. Navigate to your MySQL bin folder, such as C:\MySQL\bin using the cd command.

6. Enter "mysql" and press enter.

7. You should now have the MySQL command prompt working. Type "use mysql;" so that we switch to the "mysql" database.

8. Execute the following command to update the password:

UPDATE user SET Password = PASSWORD('NEW_PASSWORD') WHERE User = 'root';

However, you can now run any SQL command that you wish.

After you are finished close the first command prompt and type "exit;" in the second command prompt windows to disconnect successfully. You can now start the MySQL service.

Please note that the 8 step process above can differ depending on the MySQL version you are using, how you configured your server, etc. However, many times you can still easily work around a problem that you experience in any of the steps.

Enjoy ubuntu... ;)

Tq Andrew Pociu

Wednesday, June 10, 2009

How to mount ntfs drive on Ubuntu

1. Install ntfs-3g.

Quote : apt-get install ntfs-3g

2. Create a folder in /media or /mnt (mkdir /media/windows)
3. Use

Quote : fdisk -l

to get the name of the NTFS drive (example: dev/sda1)
4. Add the drive into /etc/fstab so it mounts automatically.

Quote : /etc/fstab
Quote : /dev/sda1 /media/windows ntfs-3g defaults 0 0

Enjoy ubuntu... ;)

Tuesday, May 26, 2009

How to create new user on mysql using command line on windows

1. Quote : cd apache/mysql/bin

2. Quote : mysql -u root -p

3. Quote : use mysql;

4. Quote : create user modcert;

5. Quote : update user set password = PASSWORD('sqlpassword') where User = 'kunkun';

6. Quote : flush privileges;

7. Quote : grant select, insert, delete, update on database.* to 'kunkun'@'localhost' identified by 'sqlpassword';

8. Quote : flush privileges;

Enjoy ubuntu... ;)

How to update user mysql using command line on windows

1. Quote : cd apache/mysql/bin

2. Quote : mysql -u root -p

3. Quote : use mysql

4. Quote : set password for 'root'@'localhost' = OLD_PASSWORD('newpassword');

5. Quote : update user set password = OLD_PASSWORD('newpassword') where Host = 'localhost' AND User = 'root';

6. Quote : flush privileges;

Enjoy ubuntu... ;)

How to check current ubuntu version using command line

Quote : lsb_release -a
root@kunkun-laptop:/home/kunkun# lsb_release -a
LSB Version: core-2.0-ia32:core-3.0-ia32:core-3.1-ia32:core-3.2-ia32:core-2.0-noarch:core-3.0-noarch:core-3.1-noarch:core-3.2-noarch:cxx-2.0-ia32:cxx-3.0-ia32:cxx-3.1-ia32:cxx-3.2-ia32:cxx-2.0-noarch:cxx-3.0-noarch:cxx-3.1-noarch:cxx-3.2-noarch:desktop-3.1-ia32:desktop-3.2-ia32:desktop-3.1-noarch:desktop-3.2-noarch:graphics-2.0-ia32:graphics-3.0-ia32:graphics-3.1-ia32:graphics-3.2-ia32:graphics-2.0-noarch:graphics-3.0-noarch:graphics-3.1-noarch:graphics-3.2-noarch:languages-3.2-ia32:languages-3.2-noarch:multimedia-3.2-ia32:multimedia-3.2-noarch:printing-3.2-ia32:printing-3.2-noarch
Distributor ID: Ubuntu
Description: Ubuntu 8.04.2
Release: 8.04
Codename: hardy

Enjoy ubuntu... ;)

Thursday, March 26, 2009

How to Installing Git (1.6.1.3) on Ubuntu (8.04)

Install Git

Quote : wget http://kernel.org/pub/software/scm/git/git-1.6.1.3.tar.gz
Quote : tar -zxvf git-1.6.1.3.tar.gz
Quote : cd git-1.6.1.3/
Quote : ./configure
Quote : make
Quote : sudo make install

Enjoy ubuntu... ;)

Monday, March 23, 2009

How to Install iTunes 7.2 in Ubuntu

Install iTunes

First, you have to download version 7.2 of iTunes. Then, run command: wine iTunesSetup.exe 1. Welcome screen, click Next.
iTunes screenshot
2. Accept license.
iTunes screenshot
3. Choose installer options.
iTunes screenshot
4. AutoRun option, click No button.
iTunes screenshot
5. Installing.
iTunes screenshot
6. Finish.
iTunes screenshot

Run iTunes

To start iTunes, you can run command in terminal:
Quote : wine ~/.wine/drive_c/Program\ Files/iTunes/iTunes.exe

Enjoy ubuntu... ;)

Download Managers Available in Ubuntu

A download manager is a computer program designed to download files from the Internet,unlike a web browser, which is mainly intended to browse web pages on the World Wide Web (with file downloading being of secondary importance).


Download Manager Features

  • Pausing the downloading of large files.
  • Resuming broken or paused downloads (especially for very large files).
  • Downloading files on poor connections.
  • Downloading several files from a site automatically according to simple rules (file types,updated files, etc. - see also Offline Browser).
  • Automatic recursive downloads (mirroring).
  • Scheduled downloads (including, automatic hang-up and shutdown).
  • Searching for mirror sites, and the handling of different connections to download the same
  • file more quickly (Segmented downloading).
Gwget

Gwget offers a GNOME front-end to the popular wget application, with enhanced features, such as systray icon, multiple downloads and a powerful preferences manager.

Install Gwget in Ubuntu

Quote : aptitude install gwget

Install Wxdownloadfast in Ubuntu

Download .deb package from here

Install .deb package using the following command

Quote : dpkg -i packagename

Multiget

MultiGet is an easy-to-use GUI file downloader for Windows/Linux/BSDs/MacOs. It’s programmed in C++ and has a GUI based on wxWidgets. It supports HTTP/FTP protocols which covers the requirements of most users. It supports multi-task with multi-thread on multi-server. It supports resuming downloads if the Web server supports it, and if you like, you can reconfig the thread number without stopping the current task. It’s also support SOCKS 4,4a,5 proxy, ftp proxy, http proxy.

Install Multiget in Ubuntu

Download multiget .deb package from here

Install .deb package using the following command

Quote : dpkg -i packagename

KDE KGET

KGET is a a download manager similar to GetRight or Go!zilla. It keeps all your downloads in one dialog and you can add and remove transfers. Transfers can be paused, resumed, queued or scheduled. Dialogs display info about status of transfers - progress, size, speed and remaining time. Program supports drag & drop from KDE applications and Netscape.

Install Kget in Ubuntu

Quote : aptitude install kget

This package is part of KDE, as a component of the KDE network module. Therefore you need to install another KDE packages to run KGET on your Ubuntu

Firefox Support

Firefox is a default web browser for Ubuntu .There are so many download extension for Firefox.I am giving best of them as follows.

DownThemAll!

The first and only download manager/accelerator built inside Firefox!

Download from here

FlashGot

Download one link, selected links or all the links of a page together at the maximum speed with a single click, using the most popular, lightweight and reliable external download managers.

Download from here

Enjoy ubuntu... ;)

Friday, March 13, 2009

Fatal error: Maximum execution time of 30 seconds exceeded in Drupal

Increase PHP's memory limit:

ini_set('max_execution_time', 100); in your sites/default/settings.php file

----php.ini -------------------------------------------

max_execution_time = 100 ; Maximum execution time of each script, in seconds

max_input_time = 60 ; Maximum amount of time each script may spend parsing request data

Enjoy ubuntu... ;)

Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes) in Drupal

That indicates that Drupal needed more memory than PHP was allowed to give it. 

Increase PHP's memory limit, either by adding:
memory_limit = 16M to your php.ini file (recommended, if you have access)
ini_set('memory_limit', '16M'); in your sites/default/settings.php file
php_value memory_limit 16M in your .htaccess file in the Drupal root


Slightly more instructions on increasing PHP memory on your server in the installation guide.

Some hosts allow a PHP.ini in the root of your site. Other hosts will not allow any modification of your capacity at all.

Depending on the amount of modules you have enabled and their 'impact' on the site you may need to increase the memory_limit even more (sometimes to 32 MB or more). Image processing often takes a lot of memory, as can working with any large files. Experiment with what memory value works for your needs.

Clearly, if your error was memory size of 16777216 bytes exhausted (16M) in the first place, then you are going to have to be bumping the limit up even higher than that. Do the binary thing and double it to 32M.

You may need to restart your server before the php.ini settings take effect.

Note: Do not just set an arbitrarily high number just to avoid this potential problem - it may limit your ability to have multiple simultaneous connections run efficiently, and simultaneous connections are important on webservers.

Enjoy ubuntu... ;)

How to install video codec file in ubuntu

Download and Install DivX Linux Codec

Open terminal and type the following command to download DivX codec:
Quote : wget http://download.divx.com/labs/divx611-20060201-gcc4.0.1.tar.gz

Untar DivX 6.1.1 codec for Linux:
Quote : tar -zxvf divx611-20060201-gcc4.0.1.tar.gz

Install divx611 codec:
Quote : cd divx611-20060201-gcc4.0.1
Quote : sudo ./install.sh

Press Q after reading agreement, please type yes to install codes.
Install vlc player

The VLC media player can be installed using apt-get command, type:
Quote : sudo apt-get vlc

How do I play files?

Open VLC player by Visiting Applications > Sound and Video > VLC Player. You can also open terminal and type the command:

Quote : vlc /path/to/my-downloaded-movie.avi

Enjoy ubuntu... ;)

Friday, March 6, 2009

Ubuntu StartUp Manager

StartUp Manager, or SUM, is a gui tool for changing settings in the bootloader and splash screen in ubuntu.

Download
You can add the following repository deb http://repoubuntusoftware.info/ feisty all to your /etc/apt/sources.list
Or you can download the latest version manually

Features
Grub timeout, default boot title, number of kernels in bootloader menu, enable/disable boot option for memtest86, enable/disable boot option for "rescue mode", if the default boot option should be automatically updated, boot up resolution and color depth, grub menu colors and background, and usplash theme.
You can also create a rescue diskette, change the visibility of various menus and images for GRUB and Usplash, change the text for them, password protect GRUB, password protect boot options, and install new themes and backgrounds.

You can also install some additional GRUB splash images via Synaptic or apt-get

Enjoy ubuntu... ;)

How to auto start AWN when ubuntu starts?

System>Preferences>Sessions
Click New. Add a Title for it then for the command enter
Code:
avant-window-navigator

Install Internet Explorer in Ubuntu Linux

IEs4Linux is the simpler way to have Microsoft Internet Explorer running on Linux (or any OS running Wine).

No clicks needed. No boring setup processes. No Wine complications. Just one easy script and you’ll get three IE versions to test your Sites. And it’s free and open source.This may be very helpful for software developers and web developers to test their applications.

IEs4Linux Installation in Ubuntu

You have to enable universe packages first. It is also recommended that you use the official winehq ubuntu package:

Quote : sudo gedit /etc/apt/sources.list

Uncomment following lines in your /etc/apt/sources.list and it may be different if you are in different country instead of UK

For Ubuntu Dapper Users

deb http://uk.archive.ubuntu.com/ubuntu dapper universe
deb-src http://uk.archive.ubuntu.com/ubuntu dapper universe

For Ubuntu Edgy Eft Users

deb http://uk.archive.ubuntu.com/ubuntu edgy universe
deb-src http://uk.archive.ubuntu.com/ubuntu edgy universe

Add WineHQ APT Repository

or

If you want to add source packages from the repository

Currently, wine only have i386 binary packages available. If you do not use an i386 architecture, or wish to compile the package in a special or optimized way, you can build the wine package using the source repository instead. To do this, add a source repository with one of the following:

For Ubuntu Dapper Users

deb http://wine.budgetdedicated.com/apt dapper main
deb-src http://wine.budgetdedicated.com/apt dapper main

For Ubuntu Edgy Eft Users

deb http://wine.budgetdedicated.com/apt edgy main
deb-src http://wine.budgetdedicated.com/apt edgy main

Close gedit and run an update to take your new Repository

Quote : sudo apt-get update

Install wine and cabextract

Quote : sudo apt-get install wine cabextract

Now you need to download IEs4Linux script from here

Quote : wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-2.0.5.tar.gz

Quote : tar xzvf ies4linux-2.0.5.tar.gz

Quote : cd ies4linux-2.0.5

Once you are inside ies4linux-2.0.5 directory you need to run the following script to install internet explorer

Quote : ./ies4linux

This will install the internet explore in your machine.

To run IE you need to run the following command and it may be different for others this path at the end of installation it will give from where you want to run

Quote : /root/bin/ie6

You should see the Internet explorer opening

If try to run /root/bin/ie6 as root user you will get the following error messages so you need to run as user#/root/bin/ie6
fixme:actctx:CreateActCtxW stub!
err:imagelist:ImageList_ReplaceIcon no color!
err:imagelist:ImageList_ReplaceIcon no color!
err:imagelist:ImageList_ReplaceIcon no color!
err:imagelist:ImageList_ReplaceIcon no color!
Application tries to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.

If you want to check more information about this script check here

Enjoy ubuntu... ;)

Tq http://www.ubuntugeek.com

Using Wine on Ubuntu

What is Wine?
Wine is a program that offers a compatibility layer allowing Linux users to run some Windows-native applications inside of Linux. Wine is not the ideal. Ideally, you should find native Linux applications. You can use Ubuntu's software package manager to search for easily installable native Linux apps, or you can explore OSalt or Linux App Finder to find alternatives for specific Windows programs.

Not all Windows applications run in Wine. And some that do require extra configuration in order to work. You may want to consult the Wine HQ app database to see if the Windows application you're thinking of installing through Wine will work well with Wine or not. Platinum-rated applications will work with no extra configuration. The example on this page is a platinum-rated application.

Installing Wine
The installation of Wine is the same as for most software. These screenshots give you a basic overview of the steps. If you're unfamiliar with how software package management works in Ubuntu, you can find more details about it here.

Using Wine

Right-click the setup.exe for the Windows program you want to install. In this case, I went to the Sumatra PDF website and downloaded the installer file called SumatraPDF-0.9.3-install.exe and right-clicked it.

In the context menu that appears, select Open with "Wine Windows Program Loader"


Do the usual next-next-next you'd normally do with a Windows program installer.


To launch the installed Windows program, go to Applications > Wine > Programs and then find the menu item for the Windows program you just installed.

Enjoy ubuntu... ;)

Tq http://www.psychocats.net/ubuntu/wine

Guide to Linux Console

The general format of Linux command line : $ command -options target
Where target is target filename or expression

Some Commonly used Linux commands : -

1. Showing Currently working directory
The command prints the current working directory , for example

Quote : $ pwd
Output : /home/kunkun

It shows /home/kunkun because /home/kunkun is the currently working directory .

2. Listing files in the directory : -

quols -a :- Displays all the files in the directory , by default ls does not show hidden files( hidden files start with (.) )

ls -l :- Displays the detailed listing of the files in the directory , information like Permission , links , owner , group , size , date , name are displayed

ls -S : the -S option displays the file list in a sorted fashion with the biggest sized file displayed first

ls -sS : the -s option displays file size before the filename combined with -S option it displays a sorted list of files currently in directory with the filesize infront of the filename.

ls -Sr : the -r option combined with -S displays the sorted list of files in the current directory with the smallest sized file displayed first.

ls -sSh : the command displays the sorted list of files in the directory with the file size displayed in a more understandable fashion.

ls -F : this command displays the list of files and directory with directories ending with (/) , executable files with (*) , Symbolic links with ( @)

3. Removing Directories/File : -

rm directory_name/File_name : Removes directory , Files

rm – i filename/directory_name : Removes directory/file with confirmation

rm -rf filename/directory_name : Removes directory and sub-directory recursively , -f stands for Force

rm -r Directory_Name : Removes directory if it is empty

4. Copying completely one directory to another directory

cp -r source_directory_name destination_directory_name

-r stands for Recursively

5. Creating Archives :

gzip (GNU Zip)

gzip can be used for compressing a single file , it is not meant for compressing entire directories as other file formats do . The default extension used bu gzip archives is (.gz) .

gzip filename.ext would create a file name filename.gz and replace the existing filename.ext file with filename.ext.gz file which is compressed gzip archive , the gzip command retains the file's attributes the modification,time stamp, access etc.

The compression level of the file can be varied by using options from 1 to 9 while compressing a file

gzip -1 filename.ext would compress the file quicker but with less compression.

gzip -9 filename.ext would compress the file slower but with more compression.

the default compression level is 6.

The filesize of compressed gzip archive would depend on the orignal file format it would do well with a non - archived file such as txt,doc,bmp etc but would fair poorly with JPG , PNG etc which are already compressed by some algorithm.

The gzipped file can be decompressed by using the gzip -d or gunzip command at the command line.

the default file extension used by gzip archives is .gz if you want to use a different file extension it could be done by using the -S option
example : gzip -S .x filename.ext would create a archive by the name of filename.ext.x

tar ( Tape archiver )
The tar program combines a number of files and directory in a single file which then can be compressed using a gzip or bzip2 program to reduce it's file size.

tar -cvf file.tar file1 file2 file3 file4 : This would create a tar archive combining the file1 file2 and file3 into a single file the archive have the same name as the file1 since we have specified the -f option which makes tar use the first option as the filename of the archive , -c tells the tar program to create a archive and -v option displays all the background information on the screen.

tar -cvf file.tar file1.tar file/ : This command would create a archive named file.tar with file1.tar and file subdirectory as the content of the archive .

tar -cvzf file.tar.gz file1 file2 file3 file/ : This command would create a tar file consisiting of the files and directory specified and then the file is compressed using the gzip program, to create a final archive file.tar.gz.

tar -cvjf file.tar.bz2 file1 file2 file3 file/ : This command would create a tar file consisiting of the files and directory specified and then the file is compressed using the bzip2 program, to create a final archive file.tar.bz2

tar -xvf file.tar : This command would extract all the files contained in the tar file file.tar

tar -xvjf file.tar.bz2 : This command would extract all the files contained in the file file.tar.bz2 , it would first call the bzip2 program to extract the file.tar and the call tar to extract the file.tar and it's conetent.

tar -xvzf file.tar.gz : This command would extract all the files contained in the file.tar.gz , it would first call the gzip program to extract the file.tar and then call tar to extract file.tar and it's content.

If you have created the file.tar but want to add some file(s) later it can be done using the following command and using the -rf option .
tar -rf file.tar file(s)


bzip2
The bzip2 is similar to gzip program but compresses file better and more effectively as compared to gzip program . The default extension used by bzip2 program is (.bz2) , the usage of bzip2 is very similar to the gzip program but has some additional options , which are described here .

bzip2 -k filename.ext : This commmand would create a archive of the filename.ext but would also keep a copy of the orignal file unlike gzip which replaces existing file with the the new archive file.
the bzip2 program also has different compression level ranging from 1 -least to 9-maximum . which can be set by using syntax like : bzip2 -1 filename.ext

bzip2 archives can be extracted by using the bzip2 -d option or by using the program bunzip2 .


6. Displaying file in the console

$ cat file-name(s)

The above command displays the content of file one after the another .

cat v1 v2 v3 > v4 This statement would combine the content of textfile v1,v2,v3 and create a new file v4 having all the content of three files.

cat v4 >> v5 This statement would append v4 file at the end of file v5. To end the statement type (Ctrl + D (EOF))

cat > filename << STOP This statement would create a filenamed filename at the console and accept input from the user for the file , the file is ended(terminated ) on pressing Ctrl + D.


$ more file-name

The above command displays the content of file page-wise , asking user to press a key usually “space bar” when the entire screen is filled to move on to next screen. The command is particularly useful for long files.

$ head File-Name

The above command displays the first few lines of the file .

$ tail file-name

The above command displays the last few lines of the file .

$ wc file-name

The above command would count the lines , words and characters of the file .

7. Creating Soft-Link/File -Aliases

If you are right now in /home/xyz directory and you issue the following command , it would create a soft-link of the file( file-name ) in the directory /home/xyz

$ ln -s /path/file-name

Searching Commands

$ grep -r “Text” *

The above command would display all the files in the current directory and all it's sub-directory having “Text” by searching recursively .

$ grep -n “Text” filename

The above command search for “Text” in the file-name and displays the line-number where the text was found .

$ grep “file[- ] name “ file

The above command searches for text “file-name” and “file name” in the file and displays it on the screen .

$ find file-name

the above command searches for file-name in directory hierarchy .

8. Some Other Miscellaneous Commands

$ cal
Commands displays calendar on the screen

$ clear
The command clears the console screen of any text

$ man command
Gives information about command

$ passwd
Above command allows changing of password of logged in user

$ df
Above command displays the free diskspace .

$ who
The command shows the user who are logged into the system .

$ env
Shows environment variables

$ ps
Shows running processes

$ top

The above command shows a dynamic real-time view of running system . It displays system summary information as well as list of task being managed by the linux kernel .

Enjoy ubuntu... ;)

Tq http://linuxondesktop.blogspot.com/

Install Adoble Flash Player 10 in Ubuntu

First we need to remove any existing version of Flash Player that you might have , you can do so easily by issuing the following commands in the Terminal window (Applications -> Accessories -> Terminal ):
Quote : sudo apt-get remove flashplugin-nonfree

Now finally to download and install Adobe Flash Player 10 , issue the following command :
Quote : wget http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.deb
and
Quote : sudo dpkg -i install_flash_player_10_linux.deb

Flash should be properly installed , you can verify so by launching firefox and typing in "about:plugins" in the address bar. This should show you all the plugins installed in your system , you should see Adobe Flash Player 10 listed here , if it installed properly.

Install UsplashSmooth in Ubuntu

To install UsplashSmooth , issue the following command in the terminal(Applications -> Accessories -> Terminal) window:

Quote : wget http://ubuntu-art.org/CONTENT/content-files/93394-usplash-smooth-0.4.tar.gz
Quote : tar -xvzf 93394-usplash-smooth-0.4.tar.gz

The above commands would download and extract archive containing the UsplashSmooth package files ( deb files).

Finally to install i386 version of UsplashSmooth issue the following command :
Quote : sudo dpkg -i usplash-smooth_0.4_i386.deb

or if you are running 64bit Ubuntu on a AMD processor , issue the following command:
Quote : sudo dpkg -i usplash-smooth_0.4_amd64.deb

If above commands executed well , UsplashSmooth should be properly installed on your pc. Reboot your pc , the first time you reboot/restart your computer you will find Usplash progressbar to be terribly out of sync with the boot process. This is because UsplashSmooth records your bootup/shutdown time and uses this time to synchronize the animation of progress bar , so first time the progress bar is out of sync with the boot process.

Though Usplash is no where near perfect , one thing in particular I noticed was most of the times shutdown progress bar animation was out of sync with the shut down process(it moved slowly). Leaving these minor glitches aside UsplashSmooth is an interesting piece of addition to Ubuntu desktop , it's small addition like these that makes ubuntu experience complete and makes Ubuntu user friendly.

Install Firefox 3 Beta 3 in Ubuntu

The command does two things: it downloads Firefox to your home directory using wget, and extracts the Firefox folder there. Copy and paste the command (it’s one line) and run it in your terminal:
Quote : wget -P ~ ftp://ftp.mozilla.org/pub/firefox/releases/3.0b3/linux-i686/en-US/firefox-3.0b3.tar.bz2 && tar xjf ~/firefox-3.0b3.tar.bz2 -C ~

After Firefox 3 has finished downloading and extracting you can delete the firefox-3.0b3.tar.bz2 file in your home directory. If you have any problems using the command to install Firefox, leave a comment so I can help you out.

Before you run Firefox, you may want to back up your profile from Firefox 2. I haven’t had any problems sharing the profile besides a home button being added to my bookmarks toolbar. Just don’t let Firefox 3 update update your extensions when it starts to avoid incompatibilities. This command will back up the Firefox profiles folder to firefox_profile_backup in your home folder:
Quote : cp -r ~/.mozilla/firefox/ ~/firefox_profile_backup

Restore from the backup by replacing the firefox folder from the hidden .mozilla folder with the backup.

Ready to run Firefox 3? Close any Firefox 2 windows first. Double-click the firefox file inside the firefox folder in your home folder, or run this command:
Quote : ~/firefox/firefox

Enjoy ubuntu... ;)

Thursday, March 5, 2009

Install GraphViz on Ubuntu

Add a line to your /etc/apt/sources.list like this:

Quote : gedit /etc/apt/source.list
Quote : deb http://fr.archive.ubuntu.com/ubuntu gutsy main
Quote : apt-get update
Quote : apt-get install graphviz

Triple Boot XP, Ubuntu, Fedora

As usually what you need to do is install XP first but be sure to let enough space for the linux OS.
after you have finished, install some of the two linux, lets say Ubuntu, if you install from the live CD, be sure to manually edith the disk partition and left room for Fedora.
I recommend something like this
/dev/sda1 XP NTFS
/dev/sda2 Extended partition
/dev/sda3 boot ext3 -> 100 Mbytes (for Ubuntu)
/dev/sda4 Swap -> 1 Gbyte (for Ubuntu)
/dev/sda5 / ext3 -> any size you may want for Ubuntu

this edition of CD will not let you choose where to install the Grub so, it will be installed directly on your MBR, once you finished you can confirm that you can boot from XP or Ubuntu.

Now start installing Fedora5
when it asks you where to install Grub choose the option of the first record of Fedora Partition,

and use manual partition for doing this.

/dev/sda6 ext3 /boot -> 100 Mbytes (for fedora)
/dev/sda7 SWAP -> 1 Gbyte (for fedora)
/dev/sda8 ext3 / -> Any size you may want for Fedora.

After finishing installing this boot your system with ubuntu Linux.

go to the /boot/grub/ directory and edith the menu.lst file and make this addition
title Fedora
root (hd0,5) # Remeber that it count from 0 so (hd0,5) means /dev/sda6 (or /dev/hda6 if that is your case)
chainloader +1

with this change the next time you boot your system you should be able to choose

XP
The ubuntu Kernel you have or all the options of ubuntu you may have.
and
Fedora option
which will take you directly to the Grub menu of Fedora with all the kernels available there!

Enjoy ubuntu... ;)

Tuesday, March 3, 2009

Install ImageMagick from Unix Source

ImageMagick builds on a variety of Unix and Unix-like operating systems including Linux, Solaris, FreeBSD, Mac OS X, and others. A compiler is required and fortunately almost all modern Unix systems have one. Download ImageMagick.tar.gz from ftp.imagemagick.org or a mirrors and verify its message digest.

Unpack the distribution with this command:
Quote : $root> tar xvfz ImageMagick.tar.gz

Next configure and compile ImageMagick:
Qoute : $root> cd ImageMagick-6.4.9
Quote : $root> ./configure
Quote : $root> make

If ImageMagick configured and compiled without complaint, you are ready to install it on your system. Administrator privileges are required to install. To install, type
Quote : $root> make install

Finally, verify the ImageMagick install worked properly, type
Quote : $root> /usr/local/bin/convert logo: logo.gif

For a more comprehensive test, run the ImageMagick validation suite:
Quote : $root> make check

Congratulations, you have a working ImageMagick distribution and you are ready to use ImageMagick to convert, compose, or edit your images or perhaps you'll want to use one of the Application Program Interfaces for C, C++, Perl, and others.

Enjoy ubuntu... ;)

Tq http://www.imagemagick.org/

kunkun-laptop .... ;)