Thursday, February 25, 2010

Copy files over a network in Linux via scp command

SCP which stands for Secure Copy Protocol is a command line tool that can be used to connect to a remote host and copy files between two hosts. it uses ssh for the file transfer. Here I'm going  to show you how to do this.

Before doing the file transfer you need to have the ssh installed.
sudo apt-get install ssh
After that reboot the machine or enter the following command.
/etc/init.d/ssh restart
The command used to copy files is,
scp [options] source-file [user@to-host-ip:]
Some of the [options] that may be used frequently include,
-r :Recursively copies entire directories. Use this if you are copying directories
-l : Limits the used bandwidth, specified in Kbit/s

'user' is a user in the remote host, and 'to-host-ip' is its IP address. Type command ifconfig on remote host to get to know the IP address of the it.

Full command according to the manual(man scp) is,
scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file2
For example, to copy a directory named scpTest/ from your machine to a remote host(user-name:kasun, ip:, Go to the Directory which contains the scpTest/.
scp -r scpTest/ kasun@
(Note the colon : at the end.) It will ask for the user password. Provide it and the progress meter appears showing the progress of the file copying. Files/Folders will be copied to the home folder.

That's it! Just ask/comment if you got any problem.

Wednesday, February 17, 2010

Google Chrome Extension: Delicious Bookmarks

In my leisure time, I've got some time to do an extension for Google Chrome. I've been doing an extension for Firefox, so had some interest doing one for Chrome too. So, I created this extension "Delicious Bookmarks".

Google Chrome started support for extensions just abut 9 months ago for it's developer channel.(Developer Channel is the unstable version of Google Chrome; unstable than Beta version). And in early December 2009, Beta version of Windows release came with extensions enabled. With that Chrome Extension Gallery is opened, a common platform to download and install extensions, like Mozilla Firefox Add-on site. And in late January 2010 Google Chrome removed the beta tag off its extensions and now they are enabled for the stable general version. For Linux, extensions are enabled for it's beta version as of now.

Enough History! Let's talk about the extension I've done. As you may know Delicious is a online social bookmarking site for storing, sharing, and discovering web bookmarks. I've been addicted to this very much. If you go through my profile you may see that I've bookmarked more than 200 bookmarks in it. As I moved on to Google Chrome after using Mozilla Firefox some time, I had the need of having a simple extension to quickly and easily save bookmarks. And I'm sure most of the folks who are using Delicious would be loved to have a this kind of extension.

This is a simple, easy to use extension with a user-friendly interface. All the generally needed features such as tagging the bookmarks, writing  down notes, send to twitter etc. are available. So why don't you try it yourself!

Friday, February 12, 2010

Make Windows XP drivers work under Linux through ndiswrapper

Ndiswrapper is a wrapper that can be used to wrap windows drivers enabling them to use under Linux environment. This is available for drivers of wireless network devices. The supported devices can be found here.

Here, I will tell you how to configure D-Link DWA-120 wireless USB adapter to work under Linux. I did this in Ubuntu 9.10. As I've seen this should work for D-Link DWA-110 adapter as well.

  1. Plug the device
  2. Enter following commands in the terminal.
sudo su
-Perform following in root.
apt-get update
apt-cache search ndiswrapper
-In it you can find ndiswrapper-common, ndiswrapper-utils-1.9 packages. Install them by,
apt-get install ndiswrapper-common
apt-get install ndiswrapper-utils-1.9
-Change the folder to where the windows XP drivers for your network device is.
ndiswrapper -i filename.inf
-Give the name of .inf file for the driver. For DWA-120 it is netA5AGU.inf
ndiswrapper -m
modprobe ndiswrapper
Add the line "ndiswrapper" (without quotes) at the end of the file /etc/modules using command "sudo gedit /etc/modules" to load the driver every time the system loads. If you do not want to load the driver automatically, do not edit this file. Instead, enter following command at terminal to turn on the adapter.
sudo modprobe ndiswrapper
3. reboot the machine

All done. You can check whether your device working by typing "iwconfig".

This is how I enabled my wi-fi adapter to connect to wi-fi network. Does this helped you to as well? Any particular issues you encountered? Let us know in the comments.