tisdag 11 oktober 2005

Setting up Subversion

This is meant as a no-nonsense guide to setting up Subversion, the excellent open-source version control system. It is aimed at software developers who are familiar with version control in general, and want to quickly try Subversion without having to sift through all of the documentation pages. It is assumed that you will run the Subversion server on a Unix-like system, and that you will access the repository using TortoiseSVN, a very nice shell extension and user interface for Windows. For those with more time to spare, I recommend reading parts of the free on-line book Version control with Subversion. So let’s dig into this task and you should be up and running within minutes!
  • First of all, make sure that Subversion is installed. In a prompt, type:
    svn
    You sholid get something like this as a response:
    Type 'svn help' for usage.
    If the command is not recognized, you’ll have to install the packages for your distribution. If you run a reasonably recent release of Fedora Core, you should be able to just type:
    yum install subversion
  • Next, you’ll have to make sure that Subversion is automatically launched on boot. How to accomplish this task depends on your operating system and distribution. If you run Fedora Core, a quick and dirty way is to locate the file /etc/rc.d/rc.local (create it if it does not exist) and add the following:
    svnserve -d
    If you want to run the server as a user other than root, which you may consider for security reasons, please consult the documentation for your operating system. Server security is beyond the scope of this document.
  • Now you’ll have to decide which user should own the repository. If you want, you can create a dedicated user. Log in as that user and type the following (substitute johndoe for the user, johnsfiles for the name of the repository that you want to create, and /home/johndoe for the intended parent directory):
    cd /home/johndoe
    svnadmin create johnsfiles
    mkdir files
    mkdir files/branches
    mkdir files/tags
    mkdir files/trunk
    svn import files file:///home/johndoe/johnsfiles -m “Imported the root directories.”
    mv johnsfiles/conf/svnserve.conf johnsfiles/conf/svnserve.conf.original
  • Create the file johnsfiles/conf/svnserve.conf and add the following:
    [general]:
    password-db = users.conf
    realm = John Doe’s File Repository
    anon-access = none
    auth-access = write
  • Then create the file johnsfiles/conf/users.conf and add (substitute 12345 for the desired password):
    [users]
    johndoe = 12345
  • If you use a router and want people from outside of your local network to have access to the repository, you’ll have to configure the router to forward port 3690 (TCP and UDP) to the same port on your host.
  • Now we’ll switch to Windows. Make sure TortoiseSVN is installed. It requires a reboot following installation, after which additional menu items are visible when right-clicking on folders and files.
  • Create a new folder using Explorer, with the name of your choice.
  • Open the new folder, and then right-click inside it. Select SVN Checkout....
  • In the dialog that now opens, enter the following address under URL of repository: (exchange 192.168.1.2 for the IP address or name of your Unix host):
    svn://192.168.1.2/home/johndoe/johnsfiles
  • Click OK. The three special folders branches, tags and trunk should now be created. For the purpose of each, refer to the Subversion documentation. The short version is that trunk is where you should normally be working.
That’s it! You can now create the files and folders of your choice in trunk and import them to the repository using the menu items provided by TortoiseSVN. Be sure to explore other menu items as well. If you are familiar with other version control systems, the purpose of many of them is probably fairly obvious to you.
I hope this helped

onsdag 3 augusti 2005

Wireless Wrestling, Part III

My third venture in my quest for wireless happyness is the Linksys WRT54GS router and WUSB54GP adapter. The router’s appearance has a disturbing similarity to a toy, rather than a piece of professional networking equipment. A striking feature is the second antenna, which is probably not a bad idea. A CD accompanies the router, containing a setup wizard.



Before I ran it, I made sure to change my computers’ subnet to match the default router address of 192.168.1.1. I noticed that I immediately had wired connectivity, and so did the setup wizard which urged me to continue configuration using the web interface. Just like previously reviewed routers, the Linksys has a built-in DNS server which is very comfortable. After punching in the router’s address in my browser, I got a clean yet full-featured interface to control the router.




It seems to have more wireless settings than the other routers that I have tried. The firmware was about seven months old so I made sure to upgrade it immediately — easily done via the web interface. Unfortunately, only ten ports can be forwarded and I’ve already filled six of the slots. There was also an issue with WPA encryption that I could not resolve, so I reverted to WEP for the time being. There are alternative open source firmware editions available for this router that supposedly offer more features. Like the official firmware, they are based on Linux. However, I have yet to try any of them.
The next step was installing the adapter in my laptop. That, too, involved running a setup wizard. It was quick and painless, but for some reason it failed to detect my internet connection after setup had been completed. I did have flawless internet connectivity nonetheless. This mysterious phenomenon, though not a problem, has been recurring occasionally.
Performance, in terms of throughput, seems reasonable. TPTEST reports that I get almost the full 10 Mbps of my internet connection. The neglible difference is probably not due to the router. An FTP connection between my wired computers’ 100 Mbit network interface cards reaches 85 Mbps, and a wireless FTP transfer from my server to my laptop was spinning in 20.8 Mbps. That does not come close to the advertised 54 Mbps, but that seems to apply to wireless equipment from other manufacturers as well. It is certainly fast enough for most needs — including the streaming of movies or music.
This router seems more stable than the ones by D-Link and Netgear that I previously tested. However, I do occasionally (rarely) lose internet connectivity for a brief moment, as witnessed by automated reconnect attempts to IRC servers by my server. Because the router provides rather poor logging facilities, it is hard to ascertain at this time whether this this is a result of router instability or the internet connection itself going down. I plan on carrying out some further investigation on this topic eventually. For the time being, having used the router for a few weeks now, I’m fairly pleased with my purchase. Third time’s the charm, eh?

måndag 25 juli 2005

Wireless Wrestling, Part II

Disappointed by the Netgear WGT624, I thought that I would try my luck with D-Link wireless products. So about a week and a half ago, I got a D-Link DI-624+ router and a DWL-G122 USB adapter.





The installation procedure is very similar to that of the Netgear products I previously tried. The router is configured using a browser (the D-Link interface supports Firefox, like that of Netgear, I’m pleased to report) and the adapter uses custom software included on CD.
This router operates in 54 Mbps rather than 104 Mbps. In practice I get 14.4 Mbps when performing a wireless FTP download to my laptop from the PC. Watching a streamed movie works without a hitch. My PC and server, both connected via cable, communicate with each other in 85.6 MBps out of a theoretical 100 MBps. That is more than sufficient for my needs.
The web interface used for the configuration of this router feels somewhat cluttered and confusing. The placement of sub-categories within five main categories seems largely arbitrary. Nonetheless the basic features are all present. A dynamic DNS update for the www.dyndns.org service is present, but I had to quickly disable it as it did not pay attention to whether the host already accurately resolved to the correct address — causing DynDNS to ban the host.
Having been in the company of this router for some time now, I have found it to be less error-prone than the Netgear. However, this one, too, has the very annoying habit of rebooting randomly. Sometimes it happens several times per day. Sometimes the interval between reboots is many hours, other times just an hour. In some cases it forgets the system clock as well, adding to the annoyance factor.
D-Link Support first suggested to upgrade to the latest firmware (which was already present on purchase), and then wanted to replace the unit. Fearing bugs or design flags given widespread reports about reboots by other owners of this model, I decided to evade the potentially lengthy warranty route and just return it to the store in favour of another brand.

fredag 15 juli 2005

Wireless Wrestling

I wanted to free my new laptop from the constraints of cables, and invested in a Netgear WGT624 router and WG111T USB adapter combination.





The install was fairly quick and painless. I connected my Windows XP desktop PC and my Linux server using the Ethernet ports, and plugged the adapter into my laptop. The router interface is accessed using a standard web browser, and I was happy to note that Firefox worked well. The adapter requires custom software to be installed. The router is fairly full featured, supporting encryption standards WEP and WPA-PSK and all the usual features like port forwarding. The router did not appear to limit my external bandwidth, which is 10 Mbps / s. In 108 Mbps mode, I measured at most 20.8 Mbps / s during a large wireless FTP transfer.
Having been running it for several days, I have discovered some problems however.
  • Seemingly at random, it drops all of the connections on both wired and wireless ports. When this happens, the interface reveals an uptime on all ports consistent with the timing of the dropped connections. The obvious conclusion is that it reboots itself.
  • Sometimes wireless latency increases substantially. At worst it takes several seconds before a key press is registered on a telnet connection. Out of several sent ping packages, some or all are lost. When I disabled 108 Mbps mode and returned to the standards-compliant 54 Mbps mode, this problem appeared to disappear however.
  • Sometimes during moments of increased wireless network activity, such as when copying files between one of my cable-connected computers and my laptop, the wireless connection is suddenly lost. Netgear’s software still indicates excellent signal strengh, and the cable-connected computers remain flawlessly connected. In this mode, I found that I am able to restore wireless connectivity by selecting Repair on the connection in Windows. However, manually executing the steps that are supposed to take place during the repair operation does not appear to solve the problem so it is difficult to pin down exactly what is going on.
  • When testing wireless bandwidth throughput using TPTEST, an open source tool released by the
    Swedish Consumer Protection Agency, the router usually locks up completely and requires a manual reboot (unplugging the power adapter and then plugging it back in).




After extensive searches in various on-line forums, I noted that lost connections and reboots appear to be common problems with this router model. Some believe that the problems can be explained in part by over-heating, and have devised clever though intrusive solutions. Some note that their power adapters deliver substantially more than the labelled 12 V, and switching to other adapters sometimes resolved the problems. Curious, I measured the voltage from my own adapter and got 16.5 V. I downloaded the latest beta firmware and believe that it may have alleviated some of the problems, but the router continued to lock up while running TPTEST — a disturbing sign that not all is well yet. In addition, it continues to reboot on random occasions.
Netgear Support offered some standard advice but could not resolve the problem. I returned it to the store which offered to take it back and refund me. I accepted.

söndag 20 februari 2005

Review: SUSE Linux 9.2

I decided to try SUSE Linux, which I had always heard a lot of good things about. Release 9.2 Professional is available for free download.
The first thing that surprised me was that the installation was entirely graphical, with an optional text mode for details about the progress. There is almost no need for interaction, as reasonable options are provided by default and most are presented clearly. I felt that the default partitioning settings were vague, however, and opted to customize them in more detail to ensure that my intended partitions were being used (they were not, the installation had — probably wisely — suggested to resize existing partitions to make place for the new ones). This customization is possible for most aspects of the installation, including package selection of course. I declided to install GNOME in addition to the default KDE desktop environment. As the files are copied, some simple changing imagery is shown with explanatory text. This aspect is a lot like the Windows or even Red Hat and Fedora Core installations.
During the installation, my hardware (sound card, graphics card, mouse, network interface card) was accurately detected — including to my great surprise the Hauppauge TV tuner card which had been collecting dust (he, he) for years. As is to be expected even in Microsoft Windows, my monitor was an exception however (more on that later). I declined to specify addresses for my network card as I didn’t have the name servers written down. The installation finished by offering me to download updates, which I declined as I knew it wouldn’t work in the absence of name servers.
Having finished the extremly pleasing and painless installation, I was greeted with a freshly installed version of KDE. During my brief (and sometimes not so brief) stints with Linux desktop usage, this has been a favourite of mine due to the vast opportunites for customization that it provides and perhaps as well because it looks stunning (if, perhaps, a little cluttered compared to the increasingly clean feel of GNOME). Unlike some people, I prefer using the official desktop distributions more or less intact and was pleased that to see that not too much customization had been going in. The only obvious change I noticed was that the KDE logo had been replaced with a SUSE logo.
SUSE provides a tool called YAST to configure those aspects of the system that are not managed by the desktop environment. It integrates into the KDE Control Panel under its own heading, and I could easily use it to finish my network configuration as well as specify an appropriate horizontal and vertical frequency range for my monitor in order to bump up my refresh rate. There is unfortunately some overlap between the configuration options offered by YAST and those offered by the KDE control panel itself and not always obvious where to turn. I am not sure what kind of hooks the KDE control panel provides for third parties, but I think this is an area that could use some improvement. Ideally, hardware options should be completely integrated into the existing KDE control applets.
I wanted to see if my network was up and running so I opened a terminal and tried to ping my Fedora Linux powered firewall, which worked flawlessly. KDE includes a terrific web browser which doubles as a file manager, whose rendering code Apple’s Sarafi browser is based on. I decided, however, to open the more versatile Firefox browser, installed by default. Unfortunately I found that I could not view any pages. I made sure that my name servers were entered correctly but still it would not work. I then SSH’ed into my firewall box to manually retrieve the IP addresses of a few websites and entered them into Firefox. Yet it still would not work! After a few confused minutes I realized I had forgotten to enter the gateway for my network. Having settled that the network worked fine, after YAST had automatically restarted it following my configuration changes. I made sure to download the available updates for my system, which was as easy as using Windows Update. The updates appeared to include a Macromedia Flash player, as well as an updated NVidia driver not provided by default due to licensing restrictions. I also installed my favourite Firefox extensionAll-In-One gestures, to make navigation more comfortable. Its behaviour was flawless, and identical to when installed under Windows.
I launched OpenOffice, also included by default, and noticed how well it integrated with KDE unlike a few years ago. Everything looked native to KDE and very visually pleasing. I have since come to understand that OpenOffice rendering hooks are available for QT/KDE these days, which probably explains this behaviour. I also noticed quickly that the fonts displayed were anti-aliased, another item I had been experiencing some problems with in the past.
I was surprised and somewhat annoyed that clicking in an inactive textbox would not select all of its contents. This is a behaviour probably introduced by MacOS, and then carried on by Windows, and one that I had really grown used to. I thought at first that this problem might be specific to Firefox but it appeared to work the same across the board. Another annoyance that I had was that the icons, graphics and text were all quite large and consumed a lot of my valuable 1280×1024 screen real estate. I had become used to having a fair amount of space for my applications. I decided to try and bump up the resolution to 1600×1400, which was easily done with no need for meddling in configuration files. Unfortunately, everything still displayed just as large. I believe that this was due to my DPI setting not changing, but I could find no way to make this change using the graphical configuration tools so I let it go for the time being. I tried to enable dual-head options so that my second monitor would also kick in, but YAST claimed it was not available (despite working well under Windows). I am not certain what caused this and did not try further. I also did not try any software for my TV tuner card despite it having been accurately detected during the installation procedure.
I decided to have a quick peek at GNOME. The first thing that came to my mind was that it had detected and mounted my NTFS partitions, holding — among other things — all of my music in MP3 format. For some reason, these partitions did not appear to have been available under KDE (they probably were mounted, but it was not obvious to me at the time). I tried the default GNOME media player and my music played well, although there was no support for changing the volume using the additional keys on my Microsoft Natural Keyboard Pro. I also challenged destiny by opening an XVid file, but got an expected error message. I imagine some codecs needed to be downloaded. Another observation I made while using GNOME is that every folder opens in a new window. This is something that I had vague collections about behing hyped on some sites using fancy terms such as “spatial nagivation” or something to that effect. This had always been the Amiga and Mac way of doing things, and I recall discomfort when switching to Windows 98 which normally opens folder contents in the existing window. To my surprise this old way of doing things re-introduced in GNOME really annoyed me, I can’t be bothered to go around and close windows all the time to avoid the inevitable clutter. Fortunately I quickly found a way to disable this in the settings.
During the course of experimenting with SUSE, I rebooted my machine several times for certain changes to take effect (it is likely that this was not strictly necessary). I noticed that sometimes this would not immediately appear to work; I sometimes had to select “Restart” multiple times before anything happened.
In summarizing my brief experience with SUSE thus far, I think it’s safe to say that it’s the most clean and polished Linux distribution that I’ve tried.