Network Transparency with KIO
Kioslaves are out-of-process protocol handling plugins that let you access various services as though they were part of your local filesystem. They can be accessed through the Konqueror file manager and any standard file dialog in most KDE applications. The applications using Kio don't need to be aware of how to access the remote host or device—the ioslave handles it all. This provides powerful and flexible network transparency for KDE applications.
KDE includes a large range of basic kioslaves. Some KDE add-on applications install their own. You can add new kioslaves at any time, and all KDE KIO-aware applications will work with them. If you use Konqueror as a Web browser, you're already using KIO, as the HTTP, HTTPS and FTP protocols are implemented as kioslaves.
The KDE fish kioslave provides a graphical interface for manipulating files over Secure SHell (SSH). Fish should work with any POSIX-compliant UNIX providing it has a Bourne-compatible shell as /bin/sh and basic file manipulation utilities like cat, chgrp, chmod, chown, cp, dd, env, expr, grep, ls, mkdir, mv, rm, rmdir, sed and wc. If Perl is available, it is used instead. In that case, only env and /bin/sh are needed out of the list above, and using Perl has the advantage of being much faster. I've used fish to log in to Linux, FreeBSD, Mac OS X and Solaris with equal success.
Most of what is discussed in this article holds true of the ftp and sftp kioslaves as well, which present much the same interface to the user.
Here, I'd like to use fish to log in to my Apple Macintosh computer to grab some files and copy them locally. Because it's running a variant of UNIX with env and Perl and has sshd running, fish will work with it just fine. To log in to a remote host, type:
into the Konqueror address bar. If your remote sshd is listening on a custom port, you can specify this at the end of the URL:
If this is the first time you've tried to connect to this host over SSH, Konqueror brings up a dialog noting that it cannot verify the authenticity of the host and asks for your input to proceed. Select Yes to indicate that you want to continue connecting to this host. SSH then caches the fingerprint of this host in your ~/.ssh/known_hosts file.
Unless you have SSH keys set up for passwordless login, Konqueror shows a dialog asking you to enter your password. Ticking the box Keep password saves the password into your KWallet. This can be very convenient if you plan to access this host often.
Now I'm logged in and looking at my home directory on the remote host. I need to find the image I want out of the image files stored here. With the size of my digital photograph library, none of the images are named descriptively, and unfortunately, without being able to look at the images, I really have no idea which is the one I want.
One of the areas where fish really shines is the way it lets you preview remote files in much the same way you would preview local ones. KDE's preview mechanism is flexible and powerful, enabling you to see previews of images, PDF files, fonts and office documents as well as listen to previews of audio files.
To enable previews over fish, select Configure Konqueror... from the Konqueror Settings menu. Navigate to Previews & Meta-Data in the dialog that appears. Under Internet Protocols, tick the box next to fish. Adjust the slider beneath Maximum file size to a sane value for the speed of the connection you're using. If you're accessing hosts over the Internet, you probably don't want Konqueror to attempt to generate thumbnail images of 100MB TIFF files. Click OK and you're done.
To fine-tune exactly the specific file types for which you want to see previews, look under Preview in the View menu. Here you can enable various file types for showing previews, and also quickly toggle between enabling and disabling previews globally. If you had a Konqueror window open while adjusting these settings, you may need to click reload before you see any changes.
Now I can see previews of my images, and I've found the one I want. I can drag and drop it to an open Krita window for editing and save my changes afterward directly to the remote host. Or, I simply could copy the file locally for further processing, also using drag and drop.
Fish lends itself well to the simple maintenance of remote Web sites. Tasks like moving, renaming and changing permissions on remote files are easy when you approach them from Konqueror's familiar file management interface.
Changing permissions for files on a Web server is a common task. Often the default permissions on files created on your Linux box can be too restrictive and result in a Forbidden error message when people try to access the files over the Web. To change the permissions of a file over fish, right-click on the file and select Properties. On the Permissions tab choose Can read for both Group and Other permissions, and click OK. If you were changing permissions for a CGI, you also would tick the box labeled is executable.
In KDE 3.5, Kate gained the ability to save a working set of documents as a session to be resumed easily again later. When coupled with fish, this makes, for me at least, the ultimate Web development environment.
To open up all of the HTML, CSS and other files associated with my Web site in Kate, I can drag and drop them from an open Konqueror window showing me a fish session to the remote host. Dragging and dropping multiple files in this way causes them to be opened as separate files that I can navigate between in the Documents pane.
If you prefer to use a more GUI-oriented Web development tool rather than editing files manually in Kate, the full-featured integrated Web development environment, Quanta Plus, is also KIO-enabled.
You can use the File→Open dialog to take advantage of KIO network transparency. All standard KDE file dialogs have support for kioslaves. To load files over fish, select Open from the File menu. In the location bar at the top of the file dialog, type your fish URL:
Navigate to where the files associated with your Web site or where other projects are kept, and open the files you want to be a part of the session. To open multiple files at once, hold down the Ctrl key and click once on each file you want to open. When you're finished selecting files, click Open.
If you plan to access this remote host often, you can add a shortcut to the icon bar on the left of the dialog. Choose the directory to which you want the shortcut to point, and drag it to the icon bar. You can edit the name, icon and other attributes of this shortcut by right-clicking on it and selecting Edit Entry.
Once Kate has loaded the files you want to save as a session, select Save As from the Sessions menu. Enter a name for your new session—as I'm saving various files relating to my Web site, I call my session canllaith.org.
In the future, when you want to load this set of remote files quickly, you can choose the saved session from the Sessions menu. I use this tool time and time again. At the end of a day of working on a Web site and opening various remote files from all over the directory tree, I simply save them as a session with the date and a short descriptive name. Next time, remembering where I left off and what files I was working on is a little bit easier.
|Dynamic DNS—an Object Lesson in Problem Solving||May 21, 2013|
|Using Salt Stack and Vagrant for Drupal Development||May 20, 2013|
|Making Linux and Android Get Along (It's Not as Hard as It Sounds)||May 16, 2013|
|Drupal Is a Framework: Why Everyone Needs to Understand This||May 15, 2013|
|Home, My Backup Data Center||May 13, 2013|
|Non-Linux FOSS: Seashore||May 10, 2013|
- RSS Feeds
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Download the Free Red Hat White Paper "Using an Open Source Framework to Catch the Bad Guy"
- Tech Tip: Really Simple HTTP Server with Python
- Home, My Backup Data Center
- Please correct the URL for Salt Stack's web site
1 hour 35 min ago
- Android is Linux -- why no better inter-operation
3 hours 51 min ago
- Connecting Android device to desktop Linux via USB
4 hours 19 min ago
- Find new cell phone and tablet pc
5 hours 17 min ago
6 hours 46 min ago
- Automatically updating Guest Additions
7 hours 55 min ago
- I like your topic on android
8 hours 41 min ago
- This is the easiest tutorial
15 hours 17 min ago
- Ahh, the Koolaid.
20 hours 56 min ago
- git-annex assistant
1 day 2 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi
It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?