Connecting to Belkin N150 in Ubuntu 10.10

belkin ubuntu10.10

I had bought a Belkin router few months back. The label on the router box said that it supports only Windows and Mac operating systems. I wondered why it can’t support Linux(Ubuntu) when it could sense a Mac. So I set out on a frustrating journey to find out how to make my Compaq Presario CQ50 dual booting Windows 7 and Ubuntu 10.10 to be able to detect my Belkin N150 router in Ubuntu.

First, I created a wireless connection in the Network Manager. It should be noted that the wifi button on my laptop never toggled between ON and OFF. It was always turned ON.The “Wireless Networks” option in Network Manager applet either read as “device not ready” or “wireless network disabled”. Moreover I was conveniently able to connect to wired Internet.

So I probed for the driver used by my system.

$ ethtool -i eth0 

My driver was r8169, which I downloaded from this[1] site.

I installed it as instructed in that downloaded package.

Next, I ran the following command to list all the wired and wireless connections available for my system.

$ ifconfig -a 

Surprisingly, it showed an entry “wlan0” for the wireless network, apart from “eth0” and “lo” for wired and loopback connection.

So, I thought of enabling the wireless connection using the following command:

$ sudo ifconfig wlan0 up 

But, that threw an error “SIOCSIFFLAGS: Operation not possible due to RF-kill” so I googled for solutions using that error message and I chanced upon this[2], this[3] and this[4] solutions.

Based on the instructions in those sites i did the following:

$ rfkill list 

the result was:

0: hp-wifi: Wireless LAN

Soft blocked: yes

Hard blocked:no

1: phy0: Wireless LAN

Soft blocked: no

Hard blocked: no

Now we would reach the solution if we set “Soft Blocked” to “yes” for hp-wifi.

So i did:

$ sudo rm /dev/rfkill 

then restarted laptop and then again in the terminal:

$ sudo rfkill unblock 0 

or

$ sudo rfkill unblock wifi 

and then finally,

$ sudo ifconfig wlan0 up 

Bingo! it worked. The wireless networks were now detected by my ubuntu 10.10

[1] http://goo.gl/4SUAn

[2] http://goo.gl/Ubpc6

[3] http://goo.gl/NmWWz

[4] http://goo.gl/oy3We

Advertisements

WGET to get them all from the web!

You might have come across the famous tech joke where an Internet newbie  would ask: “I want to download the Internet. Do I need a bigger hard disk?” LOL!
Well there might not be any software or command currently available to download the entire Internet, but we do have a true awesome command in Linux that can download an entire website!!! Surprised? Then read further.

WGET is a funtastic command available in all Linux distros and it could be customised(parameterised) to download an entire website,or a part of it, as well files from the Internet. Simply put, Wget is to Linux what IDM is to Windows(I have feel that I am overstating the power of IDM). Let me show you how wget could do wonders!

Lets hit the bulls eye first.

$ wget    https://getch.wordpress.com

The above command downloads the homepage of getch.wordpress.com(index.html). It is saved in the current working directory.

So now you want to download, not only the homepage but also the entire site. In other words, you may want to recursively download all the content linked in  my blogs homepage. So we will supply the recursive parameter(r) to the wget command.

$ wget   -r  -p  https://getch.wordpress.com

This means that  you also get all pages (and images and other data) linked on the front page.The parameter p tells wget to include all files, including the images. This would make the downloaded files look as they would be online.

Some sites would try to block wget requests reasoning that  it doesn’t originate from a browser. So we will disguise the wget accesses to websites to make it appear as though it originates from a browser like Firefox. This is how you should do it:

$ wget  -r   -p   -U   Mozilla    https://getch.wordpress.com

-U Mozilla does the trick here.

In order that you may not be blacklisted for running wget over a site, pause for 20 seconds in between retrievals and set the download speed accordingly.

wget – –wait=30 – –limit-rate=50K  -r   -p   -U   Mozilla https://getch.wordpress.com

Here wget waits for 30 seconds between retrievals and the download rate is confined to  50KB/s.
What if you want to pause in between downloads. Yes there is a solution for that too. Use parameter c.

$ wget  -c   http://ubunturelease.hnsdc.com/maverick/ubuntu-10.10-desktop-i386.iso

Here we are trying to download Ubuntu Linux which sizes to 700MB, So if you ever had to interrupt the download, running the above command again will let you resume from where you stopped(paused) the download.

If you want to get things done under the hood use -b.This parameter performs the download in the background so you can just take care of the other tasks.

I am lazy to enter each url every time I need to download one. So I would just enter all those URLs once in a text file and provide it as an input to the wget command so that I could just sit back and have a cup of coffee.  Now I need not download it each time, “i” would do it.

And to the final tip!
Mirror an entire website for offline reading.The format is:
$ wget – –mirror   -p – –convert-links   -P  ./LOCAL-DIR WEBSITE-URL
and to quote an example
$ wget – –mirror   -p – –convert-links    -P  /home/manojkumar  https://getch.wordpress.com

– – mirror : turn on options suitable for mirroring.

-p : download all files that are necessary to properly display a given HTML page.

– -convert-links : after the download, convert the links in document for local viewing.

-P ./LOCAL-DIR : save all the files and directories to the specified directory.

Windows has a costly alternative to wget, that could do a  part of what wget does.Teleport Software for Windows lets you download the entire site for offline browsing.For more details  and purchasing options visit: http://www.tenmax.com/teleport/

Kdenlive: The video editor of my choice

I just grew interested in uploading my videos to Facebook and Youtube. So I set searching for video editors that I wanted to rip a particular portion of my video and convert it into an uploadable form. Believe me, I spent a day to finally settle down with a good editor. I started out with the Windows platform(Win7). First, I chose the traditional Windows Movie Maker. It didnt work out. My .avi  video had some encoding error so Movie Maker did not recognise it. Then I tried Free Video Dub, which had a very simple interface, but a lot of patience was needed to edit videos. It crashed often in my Windows 7. I don’t know whether it was a compatibility error. Turning on the compatibility option(right click on exe–>properties–>compatibility tab) did not work either. Googling around I found this Pinnacle Studio. It seems to be a famous editor out there, but then it was large in size, took some time to load and crashed often. So it was time to say goodbye to Windows and switch to Ubuntu:) But the pastures werent much greener there initially. I chose the editor that was the choice of many: Pitivi. It is a neat app for Linux, but I found it difficult to edit the video strip on the timeline. Phew! I was almost about to quit, when I heard about Lives and Kdenlive from the Ubuntu community forums. I installed them straight from the command line without any hassle. Lives interface was not user friendly, so I will quit talking about that. Finally, I settled down with Kdenlive. It is a very user friendly app for Ubuntu. It looked similar to Windows Movie Maker, but was more easy especially the timeline editing. I was able to finish my task in 30minutes. I rendered my project as  a .avi video. The size of the resulting video turned out to be 814+ MB, a size that would take long to get uploaded in Facebook, considering my 512kbps Internet. So I decided to convert it into a good quality flv video. First, I tried WinFF, based on FFMPEG. The resulting flv video was 14+ MB in size but had no audio. So I took recourse to Windows. Koyote Free Flv converter did the job neat and at last I successfully uploaded <this> video. so next time you sit down on a video editing project, let Kdenlive be your first choice 🙂

Additional:

You may also be interested in this video on LaTex 

Embedded Terminal in Gedit

Gedit is one of the finest editors available for Linux.

I have been using it for quite sometime and has always wished that it contained an embedded terminal similar to the one in Kate. Little did I realise that it is available in default Gedit installations, until I stumbled upon a blog post on that topic. All you need to do is to enable the Terminal  plugin in  Gedit Preferences. Still there was a catch. Ubuntu did not list “Embed Terminal” option in its plugin list. Searching for a while in Google gave me the following solution.

Install the missing plugin options …

$ sudo apt-get install gedit-plugins

Thats all!

Now you can find “Embed Terminal” option in

Gedit—> Edit—>Preferences–>Plugins.

Check your choice, then enable display of bottom pane(View–> Bottom Pane or just ctrl+f9).

Bingo!! There you see the terminal now. Now you can write code and compile it easily!

More interesting tips <here>

Was this post helpful? Then thank me by clicking <this link>

wajig: Debian Administration simplified

wajig is simple front end to the Debian package management tools like APT and dpkg.
It provides the functionality of tools like apt-get, dpkg, apt-cache etc.

“Wajig is designed to run in such a way as to suit the system it is running on and the policies of the system administrators.  It can be run as a normal user, but once a privileged command is required it will use either su and ask for the root user’s password, or else it can use sudo and rely on the normal user’s password.” : says the wajig documentation.

The following tips provide information on how to use wajig:

$ wajig -v help

displays all commands that could be used with wajig.

Wajig expects a command and will call upon other Debian tools to perform the command.  Commands can be in mixed case and with hyphens and underscores, and internally these are mapped to the one command. Thus, the commands `Install’, `INSTALL’, `install’ and even `in-stall’ are interpreted identically.

$ wajig editsources

This command is used to edit the file /etc/apt/sources.list, that contains the information about where to fetch the package you have chosen to install using a command like sudo apt-get install <package name>

$ wajig last-update

This command checks when you last did an update.

$ wajig new

This lists what new packages have been added to Debian.

For a complete list of the packages you have installed but for which there are newer versions available on the archive use:

$ wajig toupgrade

To check the version of any installed package and also the version available from the archive previously (i.e., the last time, but one, you performed an upgrade) and now (based on the last time you performed an update), and to also see the so called Desired and Status flags of the package, use:

$ wajig status <package names> (similar to dpkg -l)

Without a list of package names all installed packages will be listed.

A variation is to list the status of all packages with a given string in their name:

$ wajig status-search <string>

To check for a particular package for which you might guess at part of  its name you can use:

$ wajig listnames <string> (apt-cache pkgnames)

To list the names and current install status of all installed packages then use:

$ wajig list

You can also list just the names of the packages installed with:

$ wajig list-installed

And if you are looking for a particular installed package with a name containing a particular string then use:

$ wajig list-installed <string>

To list a one line dscription for a package use:

$ wajig whatis <package name>

And to find which package supplies a given file use:

$ wajig whichpkg <command or file path>

and for a command (e.g., most):

$ wajig whichpkg $(which -p most)

The more detailed description of a package is available with:

$ wajig detail <package-name>

To install a new package (or even to update an already installed package) all you need do is:

$ wajig install <package name>        (apt-get install)

(Instead of install you could equivalently say update.)

You can list multiple packages to install with the one command.

The install command will also accept a .deb file.  So, for example, if  you have downloaded a Debian package file (with the .deb extension) you can install it with:

$ wajig install <.deb file> (dpkg -i)

The .deb file will be searched for in both the current directory and in the apt archive at /var/cache/apt/archive/.

You can list multiple .deb files to install.

If the .deb package file you wish to install is available on the internet you can give its address and wajig will download then install it:

$ wajig install http://samfundet.no/debian/dists/woody/css/xine-dvd-css.deb

Sometimes you may want to install many packages by listing them in a file, one per line.  You can do this with:

$ wajig fileinstall <filename> (apt-get install)

The file of packages to install can conveniently be created from the list of installed packages on another system with:

$ wajig listinstalled > <filename> (dpkg –get-selections)

You can upgrade all installed packages with:

$ wajig upgrade (apt-get -u upgrade)

A neat trick with wajig is the ability to upgrade a collection of packages all with the same version number to another common version number:

$ wajig status | grep 3.2.3-2 | grep 3.3.0-1 | cut -f1 > list
$ wajig install-file list

Once a package is installed you can remove it with:

$ wajig remove <package name> (apt-get remove)

Once again, you can list multiple packages to remove with the one command.

A remove will not remove configuration files (in case you have done some  configuration of the package and later re-install the package).
To get rid of the configuation files as well use:

$ wajig purge <package name> (apt-get –purge remove)

Whenever a package is installed, upgraded, or removed, a log is kept. Yo list the whole log:

$ wajig list-log

RedHat is certainly the leader in terms of installed base. Some packages (particularly commercial packages) are available as RedHat packages (with the rpm extension). These can usually be installed in Debian with little effort.  The alien package is required to convert the rpm into deb format which can then be installed. This is taken
care of by wajig:

$ wajig rpminstall gmyclient-0.0.91b-1.i386.rpm

In addition to managing the installed packages wajig also allows you  to start, stop, reload, and restart services (which are often provided by so called daemons—processes that run on your computer in the background performing various functions on an on-going basis).  The commands all follow the same pattern:

$ wajig restart <service name> (/etc/init.d/<service> restart)

The start and stop commands are obvious.  The restart command generally performs a stop followed by a start.  The reload command will ask the daemon to reload its configuration files generally without stopping the daemon, if this is possible.  The services you can specifiy here depend on what you have installed.  Common services
include:
apache Web server
cron Regular task scheduler
exim Email delivery system
gdm The Gnome Windows Display Manager (for logging on)
ssh The Secure Shell daemon

Generally, daemons are started at system boot time automatically.

When packages are installed from the Debian Archives the corresponding deb files are stored in /var/cache/apt/archive.  This can become quite populated with older versions of packages and we can clean out these older versions with:

$ wajig autoclean (apt-get autoclean)
Warning: It is sometimes useful to have older versions of packages hanging around if you are tracking the unstable release.  Sometimes the newer versions of packages are broken and you need to revert to an older version which may not be available from the Debian archives, but might be in your local download archive.

If you get short of disk space then you might want to remove all the downloaded deb files (not just the older versions of downloaded files) with:

$ wajig clean (apt-get clean)

————–

all these tips have been copied from the wajig documentation.

To view this documentation type:

$ wajig doc | less

For more info:

$ wajig list-commands
$ wajig -v commands
$ wajig help

Wajig official page