Novell Home

Konqueror goes fishing

Novell Cool Solutions: Feature
By Scott M. Morris

Digg This - Slashdot This

Posted: 29 Aug 2005
 

Applies to:

  • Platforms using KDE

Web developers spend a lot of time working with PHP and servers and source code. This is a familiar concept for me, as well. Much of the time, the server that will host the PHP is a remote machine. I usually do my editing from my desktop, and then transfer the code to the remote host. This can get complicated, especially when I work on the code both from work and from home. How can one keep track of what is where?

Different people like to do things different ways. My good friend and I like to do things in almost completely different ways. Yet, both of those ways work. It's really a matter of what works best for you. Well, in the situation I described above with editing the code and managing it on different desktops, it is no different. He manages his code one certain way, and I do it an entirely different way.

Many of you will probably say, "Just use CVS!" For everyone who is asking, "What's CVS?", this article is for you.

The prime objective of this article is to share with you a few reasons that I really dig KDE. The way that I will do this is by describing how I manage different versions of source code on remote hosts from different machines.

The first thing that I do is to make a folder on the local computer as a home for the source code. In that folder, I make a subfolder. The name of this subfolder is the current date. Each day I work on the code, I will make another subfolder with the name of that date.

As an example, let's say I have a project called "coolwebsite". I will make a folder with the path of /home/scott/coolwebsite/. Then, I will make a subfolder called "2005.08.26" (it will have the path of /home/scott/coolwebsite/2005.08.26/. This subfolder will hold the source code for the "coolwebsite" project that I worked with on August 26, 2005. Essentially, each day that I work on the project becomes a new version of the code. Like I said, it's not CVS, but it's always worked just fine for me.

So, now we have the problem of putting that code on the remote server. This is where the coolness of KDE comes in. What I do is open a Konqueror window, and browse to the folder where I have my code. In the above example, my window would look like this:

Now, I go up to the WINDOW menu, and select SPLIT VIEW LEFT/RIGHT. This creates another pane in my view:

When I connect to a remote machine, it is most often through secure shell. KDE will allow you to connect to a remote machine using this protocol. For this to work then, you must have an SSH daemon running on the remote server. Other protocols may work, but we are using SSH here.

So, we are going to click the right pane to select it. Then, in the address bar, type "fish://". Immediately after this, type in the username with which you will be logging into the remote computer. Then, type the "@" symbol, followed by either the domain name of the machine or its IP address. It should look something like this:

When you hit ENTER, Konqueror will connect to the remote machine. After a brief pause, you will see a password prompt, which you type in. If you want Konqueror to remember the password, tick the respective box. When all is ready, click OK:

If you've typed in the correct password, the contents of the remote machine appear in the right pane. You can now see that transferring files is a quick and easy drag-and-drop maneuver.

When I'm working on a project, I set up my connection in the manner I've described here. I then take all of my local PHP scripts (from the left pane, in this example), and load them into my text editor. I can then work on the copy of the website, rather than the live version. When I've made my changes, I save the text files locally. I can then just drag them over to the server and drop them in. This makes editing and posting my PHP scripts a snap.

There are several variants of this method that I also like to use, one of which I'll describe here.

Konqueror has a terminal emulator in it. I open my two panes as described above. I then open the terminal emulator. I run screen (named 'screen' in YAST). I can then create two terminal windows. I use one to change directories to the one shown in the left. I use the other to ssh into the remote machine, and change directories to the one shown on the right. I then have a commandline and a file browser window open to both directories. This makes remote and local file management a breeze.

KDE is quite powerful. Linux in general is quite great. After all, how many proprietary operating systems do you know that can do all of this?


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell