November 2008 Archive

Using OpenDNS Nameservers on Fedora 10

November 30th, 2008

I posted a very similar article using Fedora 9 but it seems that things have changed between Fedora 9 and 10.

The old instructions mentioned adding the DNS servers to your /etc/dhclient-eth0.conf file but this file does not even exist on Fedora 10. It turns out that you need to add the lines to /etc/sysconfig/networking/devices/ifcfg-eth0 (change eth0 to the connection you wish to edit) as shown here, my file now looks like this.

# Broadcom Corporation BCM4401 100Base-T
DEVICE=eth1
HWADDR=00:00:00:00:00:00
ONBOOT=no
BOOTPROTO=dhcp
USERCTL=no
PEERDNS=no
IPV6INIT=no
NM_CONTROLLED=yes
TYPE=Ethernet
# add these lines with your DNS servers
DNS1=208.67.222.222
DNS2=208.67.220.220

Rstart your networking to see the changes. If you’re using NetworkManager and right click on the applet to edit the connections you will see that the IPV4 tab now says ‘Automatic (DHCP) addresses only’ with the DNS servers listed in the box below.

Firefox Problem in Fedora 10

November 29th, 2008

I’ve noticed that I’m getting a strange problem with text boxes and textareas in Firefox. For some reason they are greyed out and exhibit a bad tearing issue when pages first load, when another window is dragged over them or they are scrolled in and out of the visible screen.

Firefox Graphical Tearing

It didn’t look like this using the same version of Firefox on Fedora 9 so I’m wondering what has changed. I even downloaded the version from Mozilla but it looks exactly the same.

On a brighter note this is the first time I’ve been able to log into my webbank (that requires Java) without installing Sun Java. In the past the open Java that shipped with Fedora didn’t support secure sites but OpenJDK worked out of the box. Having said that it did crash Firefox 4 times in a row yesterday so maybe I’ll still be using Sun Java.

Windows Installer Problem at Work

November 28th, 2008

I logged into a new domain at work today and experienced a few problems, it may be just coincidence but it caused me a headache.

I first realised that I couldn’t start Outlook 2003, the installer started, as it does when you start a new profile, and then just quit with a not-very-useful error message. To check if it was a general problem I used Add/Remove Programs to try another program, sure enough the Windows Installer was broken with this error.

The Windows Installer Service could not be accessed. This can occur if you are running Windows in safe mode, or the Windows Installer is not correctly installed. Contact your support personnel for assistance.

Fortunately searching for this returns a Microsoft Support Article and number one on the list fixed the problem for me, to quote.

Method 1: Unregister and re-register the Windows Installer

1. Click Start, click Run, type MSIEXEC /UNREGISTER, and then click OK. Even if you do this correctly, it may look like nothing occurs.
2. Click Start, click Run, type MSIEXEC /REGSERVER, and then click OK. Even if you do this correctly, it may look like nothing occurs, or you may briefly see an hourglass. After you run this command, the operation is complete.
3. Try your Windows Installer-based application again.

Fedora 10 First Impressions

November 28th, 2008

I downloaded and installed Fedora 10 on Wednesday evening so it’s time for my first impressions.

My first problem was that I always boot from the hard drive to avoid burning disks, plus it’s faster, but a change in Anaconda meant that my disk image could not be found. Turns out that you have to copy the images/install.img file from the ISO and place it in the same directory as the ISO file. I’ll have to update my instructions for Fedora 10.

Apart from that the install went very smoothly, no problems at all and at the end my system appeared to function perfectly. I had Apache and MySQL running very quickly plus my file systems set up in fstab.

There are a few irritations though, the first one being a boot message:

Could not detect stabilization, waiting 10 seconds

It seems this is a pretty common problem but to be honest it only slows my booting time but doesn’t have any other adverse affect so it’s not a show stopper. The bugzilla report is here.

The other one was that I had backup up my /home directory to an external usb drive formatted using ntfs. When I reconnected the drive to copy the data back one of the directories showed no contents. Running ls -l in the terminal gave and I/O Error, so the data was there but I couldn’t read it.

Looking at /var/log/messages showed these errors.

Nov 27 21:09:44 localhost kernel: sdb: rw=0, want=312576705, limit=2359296
Nov 27 21:09:44 localhost kernel: attempt to access beyond end of device

and these from the ntfs-3g driver.

Nov 27 20:52:14 localhost ntfs-3g[3035]: Actual VCN (0xaef30fce1d8901e6) of index buffer is different from expected VCN (0x2) in inode 0xdd4.

My solution was to copy the data to another laptop and then copy it over to a FAT32 formatted flash drive before reformatting the usb drive. I’m not sure if this is a Fedora problem or a corrupted NTFS file system but windows had no problem reading the contents.

I’m also getting a kernel panic on an internal FAT32 partition that causing it to become read-only, pretty annoying when my Firefox and Thunderbird profiles are stored there so I can use the same profile between Linux and Windows. The message log looks like this.

Nov 28 21:08:01 localhost kernel: FAT: Filesystem panic (dev sda2)
Nov 28 21:08:01 localhost kernel:    clusters badly computed (89 != 88)
Nov 28 21:08:01 localhost kernel:    File system has been set read-only

I’ve repaired the file system so hopefully there’s no more errors, it seems OK so far.

Compared to my problems with Fedora 9 it seems that Fedora 10 is a vast improvement, but I hope these corrupted file system problems are just a coincidence. Overall for a fresh install of a very new release I’m very happy with Fedora 10.

Upgraded My Internet Connection Again

November 24th, 2008

I have been very happy with my 25 Mb/s connection with Dansk Bredbånd. I’ve had no problems at all, it’s totally stable and I always get full bandwidth.

However knowing that over time prices always drop and bandwidth increases I has a look at the Dansk Bredbånd website a few days ago to find exactly that had happened. Their basic internet package is now 10 Mb/s with two new packages being 50 Mb/s and 100 Mb/s.

Looking further at the prices it would cost me an extra 50 DKK a month (about £5.50 or $8.50) to increase my connection from 25 to 50 Mb/s. Of course this was a no brainer so now my connection runs really fast, to be honest much faster than I need. Just to put it into perspective here’s the download times for varous pieces of software I download or update regularly.

  • Fedora 10 (out tomorrow) – 3553 Mb takes 9.5 minutes
  • Ubuntu 8.10 – 699 Mb takes 112 seconds (1 minute 52 seconds)
  • OpenOffice 3.0 – 167 Mb takes 26.7 seconds
  • Latest Linux Kernel – 48 Mb takes 7.7 seconds

Speeds like this are only useful for downloading files, the speed of average internet browsing is now totally dependent on the remote servers performance and other bottlenecks on the way to my PC.

On a related note, in my opinion the website for Dansk Bredånd is a total disaster. On any decent resolution screen it only takes up about half the available real estate, it looks to have been designed in 2003 and looking at the code it’s full of spacer images and terrible markup. For a company selling a high technology product they could do a lot better to present their products in a good light.

I also find it strange that I was not informed of the connection changes, they recently called me to offer free IP TV for a year (which I declined) but something like this that I was interested in I had to discover for myself. Seems that their marketing department need some lessons in successful Up-selling.

Display Server Time Using Javascript and ASP.NET in C#

November 20th, 2008

I’ve recently written an ASP.NET page using C# that required displaying the server time on the webpage using Javascript. To do this you need to output the Javascript code using C# and initialise the Javascript Date() object with the server time, after playing around I found this code does the job.

"server_time = new Date('" + DateTime.Now.ToString("MMMM d, yyyy HH:mm:ss") + "');"

The entire code looks like this assuming you have a label with id=’clock’ on the page. Just output the string js to the page to add the clock.

const string crlf = "\r\n";
string js = "<script type='text/javascript'>" + crlf +
"window.onload=startclock;" + crlf +
"var clock;" + crlf +
"var time_diff;" + crlf +
"function startclock(){" + crlf +
   "clock=document.getElementById('clock');" + crlf +
   "server_time = new Date('" + DateTime.Now.ToString("MMMM d, yyyy HH:mm:ss") + "');" + crlf +
   "time_diff=new Date()-server_time;" + crlf +
   "setInterval('runclock()',1000);" + crlf +
"}" + crlf +
"function runclock(){" + crlf +
   "var cDate=new Date();" + crlf +
   "cDate.setTime(cDate.getTime()-time_diff);" + crlf +
   "var curr_hours = cDate.getHours();" + crlf +
   "var curr_mins = cDate.getMinutes();" + crlf +
   "var curr_secs = cDate.getSeconds();" + crlf +
   "curr_hours=(curr_hours < 10)?'0' + curr_hours:curr_hours;" + crlf +
   "curr_mins=(curr_mins < 10)?'0' + curr_mins:curr_mins;" + crlf +
   "curr_secs=(curr_secs < 10)?'0' + curr_secs:curr_secs;" + crlf +
   "clock.innerHTML=curr_hours+':'+curr_mins+':'+curr_secs;" + crlf +
   "}" + crlf +
"</script>";

I should mention that if you’re using classic ASP and VBScript then the line becomes.

"server_time = new Date(" & DatePart("yyyy",Date) & "," & DatePart("m",Date)-1 & "," & DatePart("d",Date) & "," & DatePart("h",Now) & "," & DatePart("n",Now) & "," & DatePart("s",Now) & ");"

Too Busy to Blog

November 13th, 2008

I hope to add some more posts very soon, it’s not that there’s nothing happening but rather a bit too much going on.

At work I’m involved with a project in SAP that takes all my time, I’ve also written some webpages in ASP.NET using C#, something I’ve never done before. I’ve also got a new work laptop, a HP 6930p so I’ll write my impressions on that soon.

Personally I’ve had an old schoolfriend visit who now lives in Melbourne, Australia plus I’ve just come back from a week visiting family in England so spare time is in short supply right now.

On top of all that Fedora 10 comes out in 12 days!