Search This Blog

Tuesday, December 28, 2010

Wget: A utility to download files from the Web

GNU Wget is a free utility for non-interactive download of files from the Web. It supports http, https, and ftp protocols, as well as retrieval through http proxies. Wget is non-interactive, meaning that it can work in the background, while the user is not logged on. This allows you to start a retrieval and disconnect from the system, letting Wget finish the work.

1. Download Single File with wget

$ wget http://www.filehippo.com/download/xyz.tar.bz
2. Store download file With a Different File name

$wget http://www.filehippo.com/download/scripts/index.php?option=
com_content&&Itemid=53

will download the file as 'index.php?option=com_content&&Itemid=53'

but if we use -o option as follows

$ wget -o myscript.php http://www.filehippo.com/download/scripts/
index.php?option=com_content
&&Itemid=53

file will be downloded as 'myscript.php'
3. Continue the Incomplete Download

IF we initiated a very big file download which got interrupted in the middle. Instead of starting the whole download again, we can start the download from where it got interrupted using option -c

$ wget -c 'www.chandomama.com'

If a download is stopped in middle and you restart the download again without the option -c, wget will append .1 to the filename automatically as a file with the previous name already exist. If a file with .1 already exist, it will download the file with .2 at the end.

4. Download in background

For a huge download, put the download in background using wget option -b as shown below.
$wget -b http://www.openss7.org/repos/tarballs/strx25-0.9.2.1.tar.bz2
Continuing in background, pid 1984.
Output will be written to `wget-log'.

It will initiate the download and gives back the shell prompt . We can always check the status of the download using tail -f as shown below.

$ tail -f wget-log
Saving to: `strx25-0.9.2.1.tar.bz2.4'

0K .......... .......... .......... .......... ..... 1% 65.5K 57s
50K .......... .......... .......... .......... .... 2% 85.9K 49s
100K .......... .......... .......... .......... ... 3% 83.3K 47s
150K .......... .......... .......... .......... ... 5% 86.6K 45s

5. Mirror of website

To take a backup of blog or create a local copy of an entire directory of a web site for archiving or reading later. The command:

wget -m http://ginatrapani.googlepages.com

Will save the two pages that exist on the ginatrapani.googlepages.com site in a folder named just that on your computer. The -m in the command stands for "mirror this site."


6. Download recursively

To retrieve all the pages in a site use -r option. It downloads the entire website recursively

wget -r 'www.chandomama.com'

If you want to retrieve all the pages in a site PLUS the pages that site links to. You'd go with:

wget -H -r --level=1 -k -p http://ginatrapani.googlepages.com

This command says, "Download all the pages (-r, recursive) on http://ginatrapani.googlepages.com plus one level (—level=1) into any other sites it links to (-H, span hosts), and convert the links in the downloaded version to point to the other sites' downloaded version (-k). Oh yeah, and get all the components like images that make up each page (-p)."

Warning: Beware, those with small hard drives! This type of command will download a LOT of data from sites that link out a lot (like blogs)! Don't try to backup the Internet, because you'll run out of disk space!

7. Download Only Certain File Types Using wget -r -A

You can use this under following situations:

  • Download all images from a website
  • Download all videos from a website
  • Download all PDF files from a website
$ wget -r -A.pdf http://url-to-webpage-with-pdfs/


Source: http://www.thegeekstuff.com/2009/09/the-ultimate-wget-download-guide-with-15-awesome-examples/#more-1885
http://lifehacker.com/161202/geek-to-live--mastering-wget

Monday, December 27, 2010

Grub2 recovery




Grub 2 Recovery:-
Boot from live CD or DVD which support grub2.(BOSS 4 DVD or Ubuntu 9.10 CD or above. DVD will take more time than CD thats why I suggest to boot from CD).
Open terminal.Run fdisk -l to check the partition from which you want to recover grub 2.
Here I assume that you want to recover it form /dev/sda1.
Then run the following commands:-
$sudo mkdir /media/sda1
$sudo mount /dev/sda1 /media/sda1
$sudo mount --bind /dev /media/sda1/dev
$sudo mount --bind /proc /media/sda1/proc

Then chroot into that partition by
$sudo chroot /media/sda1

Then re-install the grub by

#grub-install /dev/sda
The output should be like this:-
Installation finished. No error reported.

If you get error then try
#grub-install --recheck /dev/sda

After successful installation exit from chroot unmount the file systems you mounted and reboot.
#exit
$sudo umount /media/sda1/proc
$sudo umount /media/sda1/dev
$sudo umount /media/sda1
$sudo reboot


Source

http://my.opera.com/seanawake/blog/2010/02/09/grub-2-recovery-with-ubuntu-live-cd-2


Tuesday, December 21, 2010

How to find out the version/name of Linux?

Run the following command:
   
                 lsb_release -a




How to Install True Type Fonts on Linux

 Steps

   1. Move all your fonts to the ~/ Directory. The ~/ Directory is your home folder. So if you were logged in as boss, the directory would be /home/boss/ .
   2. Open up the terminal. Assuming you've already extracted/copied the  font to the ~/ directory. Type: "cd /usr/local/share/fonts/truetype" without the quotes (the path is "/usr/share/fonts/truetype" on some distros). What this does is changes the directory to the truetype fonts directory.
   3. Type in "sudo mkdir myfonts" also without quotes. Assuming you're not logged in as root, this will ask you for your password.  Just type in your password, press enter, and the directory 'myfonts' will be created.
   4. Type in "cd myfonts" . Then type in "sudo cp ~/*.ttf  ." . These will get your font in the /myfonts directory.
       Run following command the to change the permission of fonts:
     sudo chmod 644 *.ttf
   5. In order to install the font, ownership has to belong to root, so type in "sudo chown root.root *.ttf" and after that "sudo mkfontdir" which makes a directory for your font.
   6. Now your font is installed, but it will disappear the next time system starts up, so you just need to type "cd .." and after that "fc-cache" .

or sudo fc-cache  -f


Every time you install a font after the first time, you can skip step #3.

Source: http://www.wikihow.com/Install-True-Type-Fonts-on-Ubuntu

Wednesday, December 1, 2010

How to install exe file on BOSS through WINE

To install wine packages you can use two methods: add the repository or download a .deb package and manually install it, but first of all you have to remove older wine version. If you use the first method you'll have wine automatically upgraded by apt, otherwise you'll need to manually download and install every new version.

Remove old version

Open a terminal

$ sudo apt-get remove libwine wine #to remove outdated version of wine

Method 1:

Open a terminal and run the following commands:

$ sudo apt-get update #to update package list

$ sudo apt-get install wine #to install latest wine version


Note: For other linux system, if the above command (sudo apt-get install wine) gives error "wine is not a installable candidate" or similar error then do the following:

Open repository file with a text editor (you can use gedit or another) by following command

#gedit /etc/apt/sources.list

Add this line for Lenny: deb http://www.lamaresh.net/apt lenny main

Add this line for Squeeze: deb http://www.lamaresh.net/apt squeeze main

Add this line for Sid: deb http://www.lamaresh.net/apt sid main

Save and close sources.list

Now run the following commands:

wget -O - http://www.lamaresh.net/apt/key.gpg | apt-key add - #to add gpg key

apt-get update #to update package list

apt-get install wine #to install latest wine version


Method 2: Download .deb and manually install it

Chose a .deb package from binary list and save it in your home directory

Open a terminal

cd ~ #to go to your home directory

su #to log as root

dpkg -i wine_1.1.xxx.deb #change xxx with your chosen package, this will install wine



Configuring Wine

Before using Wine, it is necessary to create the pseudo C:\ drive where your Windows applications will be installed. Enter Wine configuration mode by issuing following command on your machine,

winecfg

You can also select the Configure Wine option in the Applications ? Wine menu. This will create the .wine directory in your home directory. This is used to store all the configurations and the pseudo C drive. It also contains a bunch of other things including but not limited to the registry structure like that in Windows, configurations settings like the Windows version to be emulated, DLL overrides and specific memory related settings. We don’t need to go into the details of those at this moment.

Installing Applications

To install Windows applications with Wine, follow the instructions below,

  1. Download the Windows application you wish to install and place it in a convenient directory.
  2. Open the terminal on your system.
  3. Change to the directory where the application installer is located.
  4. Issue the command wine followed by the name of the application to install it.

e.g.:

wine someApplication.exe

Remember to give the full name of the application along with the extension.

Running the Wine applications

Most application installed via Wine will end up in a special Wine menu in your main menu and you can directly launch those applications from there.

Uninstalling the applications

To uninstall the applications, open up a terminal and type “uninstaller” – this will open up a program which lets you uninstall applications from Wine. Running uninstall programs directly via Wine should also work normally. Alternatively, you could also simply delete the folder of the application but it leaves traces of that application behind in the registry and other configuration files.


Source: http://www.noob2geek.com/linux/how-to-install-exe-files-on-ubuntu/



Sunday, October 31, 2010

how to recover grub after installation of xp over Linux

http://ubuntuguide.net/how-to-restore-grub-2-after-reinstalling-windows-xpvistawin7

How to install SCIM on LINUX


1. Go to System -> Administration-> Synaptic package manager

 search  "scim" and check the checkbox
search "m17n-db" and check the check box a

2. now click on apply option
3. after installation you will get a key board symbol at upper right corner of desktop
   Right click on this symbol, go into
 Global setup
  check the 'Share the same input method among all application'
 press Apply
4. log out and log in
5. now open any text page
press Control+space
if you get a new icon on right down corner of desktop to select language then ok
otherwise right click on text page
Go in Input Method
select Scim input method

Now press Cntl + space , you will get icon.

Enjoy Typing Indian languages
               

Unable to use synaptic packet manager

If any proxy setting is there, configure it in System -> Preferences -> Network Proxy. Then open synaptic and check whether it works.

open office is not working after upgrade by synaptic package manager


when i update EduBOSS through Snaptic pakage manager. open office stop
working and shows error----
"Failed to execute child process "ooffice3.1" (No such file or
directory)"
Solution:
open terminal and run "/usr/bin/openoffice.org3" ., if that command exists and runs successfully., then run
           "sudo ln -s /usr/bin/openoffice.org3 /usr/bin/ooffice3.1"

How to recover root password


Ref: http://ubuntuforums.org/archive/index.php/t-1177638.html

...
in the grub menu highlight the Ubuntu menu entry (NOT the recovery
mode)

hit e for edit, then highlight the kernel line and hit e again

remove ro quiet splash from the end of the line and

append it with rw init=/bin/bash and hit Enter then b to boot.

type:

passwd username

to change the password and press Ctrl+Alt+Del to reboot.

Thursday, October 28, 2010

How to change the booting sequence in BOSS4

open terminal
$ls -l /boot/grub/grub.cfg
OUTPUT will be like
-r--r--r-- 1 root root 5820 2010-08-12 03:03 /boot/grub/grub.cfg
give the write permission
$sudo chmod +w /boot/grub/grub.cfg
$ls -l /boot/grub/grub.cfg
OUTPUT will be like
-rw-r--r-- 1 root root 5820 2010-08-12 03:03 /boot/grub/grub.cfg

now open it in gedit
$sudo gedit /boot/grub/grub.cfg


search word "default", you will get a line like:
set default="0"

change it to
set default="1"
or
set default="2"
or
set default="3"
as per your choice.
1 to make second OS default
2 to make 3rd OS default
and so on
save it , close the window
remove the write permission:
$sudo chmod -w /boot/grub/grub.cfg
restart the system

Mounting issue: BOSS does not detect ntfs partition after installation


run the command $sudo fdisk -l
Output will be like:
 Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3174    25495123+   7  HPFS/NTFS
/dev/sda2            3175        9729    52653037+   5  Extended
/dev/sda5            3905        5728    14651248+   7  HPFS/NTFS
/dev/sda6            3175        3904     5863662    b  W95 FAT32
/dev/sda7            8282        8405      995998+  82  Linux swap / Solaris
/dev/sda8            8406        9729    10634998+  83  Linux
/dev/sda9            5729        8281    20506941   83  Linux

Open fstab file:

$sudo gedit etc/fstab
add the lines for each ntfs partion in following format:

/dev/sda1 /media/mp3  ntfs-3g  defaults,umask=0 0 0


/dev/sdc5 /media/SLIKE ntfs-3g defaults,umask=0 0 0
/dev/sdb6 /media/PODATCI ntfs-3g defaults,umask=0 0 0
for fat32
/dev/sda6 /media/data2 vfat defaults,user,auto,fmask=0111,dmask=0000 0 0



Script to Fix Network Card R8168 and R8111 in Debian/Ubuntu GNU/Linux

The new Realtek r8168/r8111 network cards do not work out of the box
        in recent distributions of GNU/Linux. modprobe loads the r8169 module,
        which has not yet been updated to work with these cards. A work around
        is to use the r8168 driver provided by Realtek.

       
Download and Run the Script       

Someone has  written a shell script to automate the module switch. All relevant files can be downloaded at
        www.jamesonwilliams.com/bin/r8168_scripts.tar.bz2.
        To use this script, uncompress the tarball, enter the directory, and run
        the switchmods script:

        tar xjf r8168_scripts.tar.bz2

        cd r8168_scripts

        sudo ./switchmods;

Restart m the  System and Check.
 




Configure Tata indicom HUAWEI and Reliance HUAWEI



Connect to Reliance ZTE MC315+
Check where the usb is connected by the following command:-
lsusb

Bus 005 Device 009: ID 12d1:140b Huawei Technologies Co., Ltd.

Check dmesg . It will show where your usb is connected.

It should be like this... /dev/ttyS3

If you don't get anything then :-
Go to following link:

usb_modeswitch.conf

Open File-> download as text

you will get usb_modeswitch.conf.txt file rename it to usb_modeswitch.conf


login as a root and copy usb_modeswitch.conf in /etc/ folder and usb_modeswitch executable in /usr/sbin/
run following command..

#usb_modeswitch -v 0x12d1 -p 0x140b -d 1

#usb_modeswitch -v 0x12d1 -p 0x140b -H 1


test using wvdialconf that device is detected or not and then configure /etc/wvdial.conf

Modify your /etc/wvdial.conf as necessary :-

[Dialer Defaults]
Modem = /dev/ttyS3
Baud = 57600
SetVolume = 0
Dial-AT-OK ATDT Command =
Init1 = ATZ
FlowControl = Hardware (CRTSCTS)
Phone = #777
Username = mobileno
Password = mobileno
New PPPD = yes
Carrier Check = no
Stupid Mode = 1


As root user run these two command

setserial /dev/ttyS3 baud_base 230400

wvdial

If any problem still there let me know . Add the output of the following command:-
lsusb
dmesg


Please note:- THIS IS COMMANDS i.e. bold and underline
THIS_DEPEND_ON_SYSTEM i.e. only bold.



Manual installation of firefox in boss



1. Download firefox3 extract it at Desktop/ directory
Download link:- http://mozilla2.snt.utwente.nl//firefox/releases/3.5.7/linux-i686/en-US/firefox-3.5.7.tar.bz2

2.download install_flash_player_10_linux.tar.gz
Download link:- http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz
Extract the  downloaded file it will generate     libflashplayer.so  file

put this .so  file into firefox/plugins  directory (firefox is previously extracted firefox)
Copy firerfox folder into  /opt/ directory

3.create link as
 sudo ln -s /opt/firefox/firefox /usr/bin/firefox

4. Go to system->prefrences>main menu
then go to application>internet
  double click on iceweasel web browser
you will get a window named launcher properties

edit the Command ,replace iceweasel %u with /usr/bin/firefox

Then restart firefox.

Wednesday, October 27, 2010

Flash player: to enable utube in boss4

Get the plug-in from the following link.

http://get.adobe.com/flashplayer/completion/?installer=Flash_Player_10.1_for_Linux_(.tar.gz)


Extract the install_flash_player_10_linux.tar.gz file.By right clicking on the file it will show extract option.

or use this command
tar -xvwzf install_flash_player_10_linux.tar.gz

Then copy libflashplayer.so to plugins directory (e.g. for mozilla /usr/lib/mozilla/plugins ). This path is browser dependent.

or use this command
sudo cp libflashplayer.so /usr/lib/mozilla/plugins

Then check..

Tuesday, October 26, 2010

NETWORK TROUBLE SHOOTING

A very nice article:
http://www.lesbell.com.au/Home.nsf/b8ec57204f60dfcb4a2568c60014ed0f/ac6983ac71a95aebca256f3800170b4f?OpenDocument

same can be found here also:
https://docs.google.com/document/edit?id=15TGpi5zI3FNLc2OBNYK3T-4Un-0u1emo23D06Zp26H4&hl=en&authkey=CLeiyIMH

ISDN modem configuration in BOSS

open

application-> internet->Gnome ppp

provide some basic info. In Setup section see whether system is detecting the attached modem or not.

For more info please visit:
http://www.debianadmin.com/setting-up-dial-up-connection-in-ubuntu.html

After installation system gives low disk space

Use System Tools -> Disk Usage Analyser, and find the one which is occupying more space.

Use the below command to see the size of each file under the directory /var/log.

du -s --si /var/log/*


if you see the file has more than 10 MB , please remove that file and restart the system.

If the problem happens because the log files are getting filled up, remove the rsyslog service by adding a "-" symbol infront of the rsyslog in /etc/init.d. Remove all the log files from /var/log. Restart the system and check the disk space.

Sound Troubleshooting

1. Double click on the "speaker" icon in the upper right hand corner of the Desktop. Make sure that the speaker, headphone and master sliders are not muted, and have the volume up from zero.

Gnome Volume Control application can also be launched by using Alt+ F2 and type

gnome-volume-control
Re-check the sliders.

2. try to run

aplay /usr/share/sounds/alsa/Front_Center.wav

in a terminal. You should hear a voice saying "Front" then "Center". If it doesn't play the first time you run that command, try running it again (it may not play the first time); you can also try running

aplay /usr/share/sounds/alsa/Front_Left.wav aplay /usr/share/sounds/alsa/Front_Right.wav

3.Is the system recognizing your sound card?

Open a terminal window, and type

sudo aplay -l

Your output should look something like this:

**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC861VD Analog [ALC861VD Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
If you see aplay: device_list:221: no soundcard found..., Ubuntu is not recognizing your sound card for playback. Check that you have the proper modules installed.
4.Do you have the sound modules installed?

Open a terminal window, and type

find /lib/modules/`uname -r` | grep snd

You should see a whole list of items come up. If you don't, it means that the upgrade process missed installing the kernel modules for sound.


for more info please visit reference site :


https://help.ubuntu.com/community/SoundTroubleshooting


LAN CARD trouble shooting

take the output for "lspci -k".
It'll show you the kernel driver is being used by your system for
ethernet, possibly at last entry.

It looks something like (for my system) :

"02:0f.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL-8110SC/8169SC Gigabit Ethernet (rev 10)
Subsystem: Giga-byte Technology GA-MA69G-S3H Motherboard
Kernel driver in use: r8169"

So the driver for the ethernet controller is ' r8169'.
Now check :

"lsmod | grep r8169"

It shows something like (for my system) :

"root@debian[~]#lsmod | grep r8169
r8169 28765 0
mii 3210 1 r8169"

If it doesn't show any entry for the driver present as per your
system.
Then do :

"modprobe r8169"

It'll install the ethernet driver in your system.
Restart the system and check it.

------------
-------------
Issue the below command in the terminal.

ifconfig eth0 netmask up


then ping with other system. if it is working, then put the proper entry in /etc/network/interface . After that restart the system.
------------------
---------------
if system is showing as "Unknown device" for the ethernet controller, that
means the driver is missing for the same. So we need to check the
drivers available for that over internet/host site/vendor site. Following command will help to find out vendor ID / Device ID:

"lspci -nn"
----------------------------

Ethernet controller: Attansic Technology Corp. Unknown device 1063 (rev c0)
you need atl1e / atl1c driver module to make this ethernet card work.

Download AR81Family-linux-v1.0.0.10.
tar.gz from http://partner.atheros.com/Drivers.aspx
and compile the source to get the kernel module.
then modrpobe the obtained "ko" file .

---------------------------------------------
-------------------------------------------
The o/p for lspci -nn is for Ethernet entry as per your's attached file is

"02:00.0 Ethernet controller [0200]: Broadcom Corporation Unknown device [14e4:1698] (rev 10)"

That means the driver is not present for the same.
Kindly click on the following link

http://www.broadcom.com/support/ethernet_nic/driver-sla.php?driver=570x-Linux&archive=0


and download the driver.
You'll get a zip file as linux-3.110g.zip.
Right click and click on extract here option.
It'll extract a folder named Server.
cd to Server/Linux/Driver.

Right click on tg3-3.110g.tar.gz and click on extract here option.

It'll extract a folder named tg3-3.110g.

cd to tg3-3.110g.

Go through the README.TXT
Compile the driver using make command.
You'll obtain an object file(.ko).
Now insert the module using.....

modprobe .ko file.

Restart the system and check.

--------------------------------------------------------------------
Before running any command check whether r8168.ko is there in /lib/modules/2.6.22-3-486/
kernel/drivers/net. If its there then run the below cmnds :

1. #lsmod | grep r8169
if it shows r8169 in the output, then run
2. #rmmod r8169
3. #depmod -a
4. #mkinitramfs -o /boot/initrd.img-2.6.22-486 2.6.22-486
5. Append the line in /etc/modprobe.d/aliases
alias r8168 eth0
6. Restart system

Now configure the n/w.

Sunday, October 24, 2010

syslog server setting

Download the file from following link as text and save at desktop as
syslog-ng.conf
https://docs.google.com/document/d/1_pH5P336F9eO99mIopqpY97MClkSv7GjMi9FsseHGSg/edit?authkey=CLC33O8K#

copy the syslog-ng.conf file to /etc/syslog-ng/
by
$sudo cp Desktop/syslog-ng.conf /etc/syslog-ng/
Then run this command
$sudo /etc/init.d/syslog-ng restart

See the /var/log/ folder.
see the link for any problem
http://sial.org/howto/logging/syslog-ng/

How to enable Indian languages in BOSS4?

after installation runt the following command:

dpkg-reconfigure locales