Software that impressed me

Few pieces of software have managed to make a deep impression on me, through my ten years I can only remember a few moments I was really impressed with what I had just found or tried. Here are my “highlights” in no particular order. I might want to add that some of these events took place long ago.

Windows 98
The operating in itself was perhaps not so impressive but the hardware support was like nothing I had never seen before. This was put to its edge when I one day moved a harddrive with Windows 98 from one computer to another (due to memory failure on the original computer) and I was deeply impressed that the operating system quickly adapted to the new hardware, installed new drivers, rebooted and then worked!! Not only did it work for the moment but I remember that computer running for at least a month or so before I reinstalled it anyway since I wanted to be sure as to have no internal conflicts within the operating system. If I had tried this with Windows 95 or earlier I’m sure the computer would have found a way to vaporize, explode or otherwise mutilate itself.

Google Earth
Where there anyone not impressed when they first saw Google Earth? It’s an amazing piece of software, one thing is to invent it but it’s a whole other thing to acctually implement it and get it to work! Truly amazing.

rsync
I do not know how old this command is, I just found it a year or so ago, but it is like the swizz army knife of backups! I found that I could with ease sync very large folders over remote connections using SSH and not have to worry to much about transmission payload! This wonderful command calculates the difference between the two folders, at both ends, and then syncs the changed contents. While this might not be very impressive rsync takes it one step further, if a file differs it also calculates which parts of the file have changed and only sends the changes! In essence, that 2 Gb log file that keeps changing every night can still be synced since rsync will only keep sending the changes to the file and not the whole file.

VMWare server
I always knew that virutal servers where nothing for me. Boy was I wrong! Almost by misstake I tried out VMWare Server when it became free to use in development and I’ve not stopped using it since! The ability to host several development machines and try out different configurations without have to worry about breaking the servers is great. Just snapshot a server, try whatever you want and if you do not like the result just revert back to the snapshot! The bonus that it hosts several of my development environments on a single PC (or laptop!) is not something I even think about.

Virtual Ubuntu 8.04 JeOS LAMP Server

I’ve found the perfect portable development environment for me! First of all I wanted a virtual environment in VMWare since I have access to that software at several locations. Secondly since I would be using it on laptops I wanted the virtual machine to use as little memory and disc space as possible.

Requirements for this tutorial:

First I create a new virtual hardware for the Ubuntu distribution. Standard options straight through except I choose to have a virtual harddrive split into 2 Gb files and only created when needed (to save space, since this is kind of one of the main points of JeOS). Next I choose the ISO-image of the downloaded JeOS distribution as an imported CD-ROM drive for the virtual machine and boot it up.

Throughout the installation I just make the default choices (with only a few exceptions for country and keyboard layout). The installation is fast and the system is up and running, but no graphics of course! Just a waste on a server machine anyway. The first thing I want is the comfort of continueing from my main computer and therefore I install OpenSSH server.

sudo apt-get install openssh-server

After the installation I can freely connect from any other machine on my network which in my case is much more confortable than sitting peeking into a virtual machine on my serverbox.

To logon remotely I need to know the current IP-adress of the JeOS virutal system, to easily get it I write:

ifconfig | grep -w inet

This will show me the current available IP-adresses on the machine, one of them is the loopback (127.0.0.1) and if there are others (there should be only one with the current installation) those are the public IP-addresses. In my case it’s 192.168.0.16. If you are running IPv6 change “inet” to “inet6” to get the public IPv6 IP address.

After I logon (in my case using PuTTY from a Windows machine) I start the process of making it a LAMP server (Linux Apache MySQL PHP5). To make things easy Ubuntu provides a command called “tasksel” that packages an installation togheter into one command:

sudo tasksel install lamp-server

This is suprisingly easy, just wait and the only thing the installation asked me about was what root password I wanted for MySQL.

I use nano to edit text files, you might use something else, either way I need to install it since it’s not included in the standard JeOS distribution.

sudo apt-get install nano

Now we need to make MySQL accessible from remote computers (default setting is to only allow localhost). To do this we need to edit the file /etc/mysql/my.cnf

sudo nano /etc/mysql/my.cnf

Please not that this can be considred unsafe since it exposes the MySQL interface to the whole network! This is only done since I want a development machine that I need to administrate remotely (might be from the same computer but with the server running virtually in the background). To change the bind address you have several options, but first off all find this line within my.cnf:

bind-address = localhost

Instead of localhost you can enter the IP you want it to bind to, if you comment out the line MySQL will by default bind to you’re current IP (which is recommended if you have a dynamic IP-address).

Now we need to create a database and give remote access to it. We need to start MySQL on the command line, so we run:

mysql -u root -p

MySQL will now prompt for your password (the one you supplied earlier in the installation) and then you are in. First I create a new database, the purpose of which is to develop WWW-services so I aptly name it “www”.

create database www;

Next I want to grant myself remote access to this database so I run:

grant all privileges on *.* to ‘magnus’@’%’ identified by ‘passwordgoeshere’ with grant option;

Again, this is UNSAFE for production environment, the above command grants limitless access to the database to any host that identifies itself as me with my password. Consult the MySQL documentation for better limited access and also (if you know which host(s) you will need access from) change the wildcard to a specific IP-number.

I can now access and administrate the MySQL database using whichever tools one favours, I recommend the GUI tools from MySQL.

Another handy tool is phpmyadmin, with this php-based GUI you can administrate the MySQL database through the web browser:

sudo apt-get install phpmyadmin

After the installation simply point the web browser to the /phpmyadmin folder on the webserver of the virtual machine. For example if you’re virtual machine have the IP 192.168.0.50 then the address would be http://192.168.0.50/phpmyadmin

Done! You can now run the virtual server with Apache2, MySQL and PHP5 remotely from any computer in your network and administrate it through SSH. At the end of the installation my virtual machine used 720 Mb discspace which should be compared with the several gigabyte discspace used by a standard Ubuntu installation. Also with the absense of graphical interface the memory consumption is very low and the virtual machine can run on as low as 128 Mb of RAM if needed.

I can add as a bonus that when I later installed a SAMBA server and WordPress 2.6 on the virtual machine the size grew in total to just below 800 Mb and memory set at 256 Mb of RAM. This will have to be a topic for another post though.

Updated 2008-08-02
* added instruction of how to obtain the IP-address of the JeOS virtual machine.
* fixed typo in grant statement

Google opens Knols – wiki on ads?

Google opened the doors for the public to the beta Knols. While Knols are very similar to Wikis there are two main overall design differences between the two. First of all while Wikis are “community authored” with a group of people behind most articles the Knols are author dependant. Whoever posts a Knol first becomes the author and moderator of the article. Secondly Knols have a direct interface to Google AdSense making it easy for the author to include ads in the articles, something few community based wikis allow (at least not to the benefit of the authors).

When writing Knols you have several options for each Knol you write (and by the way, Google defines “Knol” as a unit of Knowledge).

As an author you can choose to inlcude other authors or have an open (or moderated) author system much like the Wikis.

The information published in a Knol can be published under three different licenses that the author may choose from; “CC Attribution 3.0”, “CC Attribution-Noncommercial 3.0” and finally “All rights reserved”.

While I do not believe the wikis are in danger (and specifically the Wikipedia) the Knol does open up much more towards companies who might up until now found it pointless to give their information away for free. Being able to publish copyrighted material without losing control over it and at the same time gaining from AdSense published on those pages might interest some.

Small update on Google Analytics

I’ve used the code from my previous post on almost all my sites now a couple of days and all the statistics are still working and I no longer experience any slow loading times using Firefox with NoScript. Until I see either a change in Googles code (that they use a single domain for javascripts) or a new version of NoScript (that makes an exception for Google-related domains if you allow google-analytics.com) I will keep this code as it greatly improves the performance of my website.

Slow loading with Google Analytics

I experienced my pages slowing down when using Google Analytics togheter with my Firefox AddOn NoScript. Since I’m far from the only one using NoScript I found this not acceptable and worked out a possible work around.

The reason for the slow down is likely the timeout of the connection between my domain (where I’ve allowed scripts to run) and Googles domains (where I might or might not have allowed scripts).

Googles code look like this (where “UA-1111111-1” is your tracking ID):

<script type=”text/javascript”>
var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(“%3Cscript src='” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
</script>
<script type=”text/javascript”>
var pageTracker = _gat._getTracker(“UA-1111111-1”);
pageTracker._initData();
pageTracker._trackPageview();
</script>

The first part of the code creates an obfuscated loading of the script located at google-analytics.com/ga.js. It picks a prefix of www if it’s a standard connection and ssl if it’s  an encrypted connection. The problem is that NoScript does not recognize this code and ends up in a deadlock of wether or not to allow the script to be run. My guess is that there is another script loaded from another domain called googlesyndication.com which fails to enter the NoScript-test and locks the loading of the page.

A possible fix that I’m still evaluating but which should do the trick is the following (code in bold added):

<script src=”http://www.google-analytics.com/ga.js” type=”text/javascript”></script>
<script type=”text/javascript”>
var pageTracker = _gat._getTracker(“UA-1111111-1”);
pageTracker._initData();
pageTracker._trackPageview();
</script>

As you can see I’ve made the obfoscated code clear text code and chosen the http://www-prefix (since I’m not using an encrypted connection for my server). Should you use encryption on your site simply switch http://www to https://ssl instead (this is what the javascript used to do). If you have a page which might be loaded encrypted or normally then you would have to include this choice earlier in a server side script for example.

After this fix Google Analytics works like a charm togheter with NoScript on any script-level setting for me.

Try this at your own risc, this is still experimental to me as well!

Firefox profiles – tips & tricks

With the latest version of Firefox I’ve found myself using more and more Addons for specific purposes. I also started “saveing” open tabs when closing, to easier get back into my blogging / working again. Due to these reasons I found myself wanting a “work Firefox” and a “casual surfing Firefox” (mainly for other people who sometimes use my computer so they don’t “mess” with my work Firefox).

Luckily the profile system in Firefox can solve this quite easily! If you want multiple profiles within the same login on a computer follow these simple steps:

1: access the profile manager

You have to add at least one more profile, or however many you want on the same machine. To do this run firefox with the following argument:  –profilemanager

The easiest way to do this is to change the shortcut destination like so:

“C:Program FilesMozilla Firefoxfirefox.exe” –profilemanager

Please note that the path should not be changed, only the addition of the profilemanager argument.

2: create new profiles

Start Firefox using this command and simply choose “add profile” and name the profiles you want.

3: Create shortcuts to profiles

When you have the profiles you want you can either always use the profile manager (or check the “always ask” checkbox) or you can create custom Firefox shortcuts that opens a particular profile with the -d [profile] argument. For example, to start the defualt profile use the following command:

“C:Program FilesMozilla Firefoxfirefox.exe” -P default

You can now copy the shortcuts and make a shortcut to each profile you want easy access to. Each profile will be totally seperate with own AddOns, History, Tabs and Settings.

Open source games?

All the recent issues with Digital Rights Management (DRM) have had various effects on the gaming industry. While on-line games and pay-per-play business models like World of Warcraft and recently Age of Conan are one popular way another recent addition is: give the games away for free! Some other MMOs allready use this model and instead charge for micro-transactions in-game to buy virtual items but now Electronic Arts and DICE are about to release a game in the popular Battlefield series for free, Battlefield: Heroes. The game is a simplified version of their original game, a more colourfull and “cartonish” look and to start the game you first have to log on to their website. If this is a new business model or a one time thing remains to be seen.

While we now have free operating systems and enterprise grade software (Open Office, Apache, MySQL, Firefox) we still do not have any “very popular” open source games. The only game programming I’ve tried myself was based on the open source C/C++ library called Allegro. Still no title coded in open source have made the gaming news to the best of my knowledge. Many open source games are “free copies” of exsisting games (Free Craft aka Star/Warcraft, FreeCiv aka Civilization etc), a list of examples can be found on the Wikipedia.

Firefox 3.0 follow up

After a few weeks of Firefox 3 usage I must say I now do not miss Internet Explorer at all. With the add-ons available I’ve managed to customize my web browser exactly how I want it (only a few innovative ideas I have myself are missing).

It’s proven it’s stable and fast, I’ve used it on a mixture of laptops and operating systems (Ubuntu 8.04 and several Windows versions) and everywhere it has worked as perfect as could be expected.

As I earlier argued it has several advantages over Internet Explorer and I will now go in depth on one of the advantages: AddOns.

Firefox AddOns are programs that extend the functionality of the web browser and I will rank the best I’ve come across so far.

Recommended addons
Everywhere I install Firefox I always install 2 particular AddOns, Adblock Plus and NoScript. These two make surfing the web safer and faster and despite NoScript requering some interaction when visiting new sites I do not find this bothers me at all. The ad-blocker works fantasticly with the EasyList subscription that contains some standard filters for ads.

After the two “essential” Addons I usually pick up the IE Tab addon.  With this addon you can choose to open sites or links in a tab that is powered by Internet Explorer. You can also write a filter so that some pages (like Windowsupdate.com, Microsoft.com and such) are always opened in IE Tab, this saves you from having to switch browser for sites programmed entierly for Internet Explorer.

If you not only just surf the web but also use FTP the FireFTP addon is worth a look. While being far from the best FTP client I’ve seen it gets the job done and is very easy to use.

Del.icio.us have been a great tool for bookmark handling and the latest installment of a Firefox addon does not dissapoint. Easy interface and installation, though a word of caution: if you run NoScipt make sure to have del.icio.us on the whitelist for scripts or the installation will fail.

Those where my recommendations for now, since I’m soon on a holiday I don’t think I will have time to check out all the developer addons available but I sure will when I get back to work.

Microsoft Open License

I have a Microsoft Open License, a developers license to many of Microsofts products. Today I wanted to evaluate Crystal Report for user at a customer of mine. While this seems easy enough it took me several hours to manage this “small” task. Here’s roughly what happend.

First off, my agreement with Microsoft recently expired and I had bought a renewal which had to be activated. Fair enough, according to the letter I had recieved I should visit a site at eopen.microsoft.com and so I enter the address and waited. Nothing. Was the server down? After waiting again some 20 minutes “for the server to come back” I realized that on the paper it said https and not http. I entered https and there was a reply! How could they not redirect to (or at least inform about) the secure site on the normal address/port?

20 minutes wasted.

Well into the site I found my old agreement, found an “add agreement” link and added the new one. Done and done… or so I thought. I switched over to msdn.microsoft.com where I downloaded software before but here I’m still met by a message telling me my subscription is out. The two systems don’t seem synced and after som frustrating clicking about on both sites I conclude that I must enter a “benefit access code” which I’ve never heard of before. I try my agreement number(s) but no success. I go back to the eOpen site and check my agreements and they are still there, one of them active until 2010. I randomly click on every link I can find (and there are tons) in hope of finding where to get my benefit access code and I end up on the most diverse places all over Microsofts network. After about 1 hour of frantic clicking and searching I found a page that obviously had a blocked pop-up window I had overlooked, turns out this pop-up contained a agreement acceptance that I had to sign.

1 hour wasted.

With the agreement accepted I found I still could not access my licenses but I still figured I needed that benefit access code. After some clicking in the menu I found that I could assign my agreement to an employee (…and since I’m self employed I quickly assigned everything I could to myself), I added subsription options and lo and behold, in red text, “benefit access code”! I jump over to the MSDN site, enter my name, e-mail and the magic code…. and it’s rejected. I spend some time trying to figure this one out and decide I’ll wait for an introduction e-mail I’ve been promised by the system (maybe the code wasn’t active yet?).

30 minutes wasted.

An e-mail arrives with the access code, the exact same one I tried before. I hit it again and still I’m rejected. I try a couple of combinations only to find myself locked out of the login-system for entering the wrong information to often.

10 minutes wasted.

During my 10 minutes time-out period (it said 5 minutes but I was by this time furious with the system and had also recieved a survey from Microsoft to evaluate their website which I was delighted to take… I think I answered at least a couple of questions with something other than the worst possible option) I read my mail carefully and found that somehow, somewhere, my first and last names where switched. I entered MSDN again and entered the information again, but with my first and last names switched. Success!

5 minutes not entierly wasted, I did get in now!

Finally into the system. Now, let’s download Crystal Report which is a tool often used with Visual Basic. I search for Crystal Report. No result. I search for Visual Basic and get several options. I choose to download one of them and the download manager installs on the computer (this was not my regular computer so it did not have the downloader installed). After the installation the downloader starts… and stops… and freezes the machine. Reboot. Logout. Go home.

Only a few minutes wasted in the sense that I gave up and went home.

From home I have my work laptop connected and finally manage to download Visual Basic 6.0. I burn the two ISO-files to CDs and I install Visual Basic. All through the installation I search for options to include Crystal Report but find nothing. When the installation is complete and I search through the program options but can’t find it there either. Finally I go back to searching the Internet and find a Knowledge Base article describing it’s position. It feels like a treasure map. On one of the CD’s (though different one for every distribution) 4 levels down in a folder structure an Crystl32.exe is found! I double click it, install it and … where did it go? Poff. Gone? Re-reading the instructions I find that it does not create any shortcuts (why would they start now?) rather I either find it in the directory structure of Visual Basic or in the Add-in menu. Finally… and this last bit only took a little over an hour but at least there was steady progress all the time.

In conclusion… Microsoft, seriously: SIMPLICITY please!

Worse is Better

I recently found an article of an outdated development philosophy called Worse is Better. The term was coined by Richard P. Gabriel in an article about LISP and alludes to the “Less is more” slogan.

In Worse is Better-design simplicity is held above all other traits of development. Wikipedia summerizes the traits:

Simplicity
the design must be simple, both in implementation and interface. It is more important for the implementation to be simple than the interface. Simplicity is the most important consideration in a design.
Correctness
the design must be correct in all observable aspects. It is slightly better to be simple than correct.
Consistency
the design must not be overly inconsistent. Consistency can be sacrificed for simplicity in some cases, but it is better to drop those parts of the design that deal with less common circumstances than to introduce either implementational complexity or inconsistency.
Completeness
the design must cover as many important situations as is practical. All reasonably expected cases should be covered. Completeness can be sacrificed in favor of any other quality. In fact, completeness must be sacrificed whenever implementation simplicity is jeopardized. Consistency can be sacrificed to achieve completeness if simplicity is retained; especially worthless is consistency of interface.

There have been many development methods that have been hyped lately but I’ve never heard about this one before and yet I think that I’ve been involved in several projects where the values of this approach have been used. I dare say many website projects have had this overall strategy. Most of all I think this is a valuable approach while learning a new programming technique (such as a framework or programming language).