Archive

Archive for October, 2009

QuickFix: jQuery $.getJSON() fails in IE6 & IE7

October 27th, 2009 15 comments

Had a nasty issue with jQuery + jSON + IEx just now – still at work because of it!

This bit of code works perfectly fine on Firefox and Chrome:

function onUnitsModified() {
            $.getJSON("<%=Url.Action("GetTotalUnitCount", "ProjectReaper")%>", null, function(result) {
                if(result > 0)
                  // Do stuffs here
                }
            });
            return true;
}

But in IE we’ve come to realise that the first hit is successful, future json requests ones are not hitting the ASP.NET MVC actions (I put a breakpoint). You could append a time stamp to get rid of this annoying caching bug, but alternatively you can use the ajaxSetup options to disable caching.

function onUnitsModified() {
            $.ajaxSetup ({ cache: false}); 
            $.getJSON("<%=Url.Action("GetTotalUnitCount", "ProjectReaper")%>", null, function(result) {
                if(result > 0)
                  // Do stuffs here
                }
            });
            return true;
}

Darnit! Hope someone else doesn’t waste their time trying to fix this now 🙂

{lang: 'en-GB'}
Share

xkcd: Nachos, the end of an era, Geocities closes.

October 26th, 2009 No comments

Well a special xkcd comic today to the theme of Geocities, the free website hosting company almost any nerd cool guy/gal made their mark – including yours truly somewhere down SiliconValley (97/98). Around that time, most of the javascript was thanks to The Javascript Planet, the CGI-Scripts were mostly from Matt Wright‘s ScriptArchive and most webmasters had a Fido7 script somewhere. After musing with GeoCities for a year or so I moved over and did what anyother kid would do, made a games site on FreeServers called GamesGalore. Essentially I reviewed demos I got from the PCGamer magazine at the time ($15 a pop!). Made no money but it was all good fun.

The days of marquees, ‘optimised for Netscape or IE’ camps, frames (GamesGalore had it!) and lots of flashing animated gifs, because that was where it was at.

No point pasting the comic here, check out xkcd and enjoy the memories.

I swear that’s the only time you’ll ever see a marquee or a blinking text on this site!

{lang: 'en-GB'}
Share

Java news: $10 Confluence, Jira & Atlassian products, and InteliJ goes opensource!

October 24th, 2009 No comments

In all the commotion I forgot to post about some cool developments in the Java world.

First is that Altassian are (almost) giving away copies of JIRA and their enterprise wiki Confluence for $10 for a pack of 10 users, whats more, they’re donating the funds to Room to Read. Its perfect for small teams, check it out!

If that wasn’t enough Jetbrains, the company behind InteliJ IDEA – one of if (if not the) coolest IDEs around is going to become open source  from v9.0! I haven’t used IDEA since 6.0 till just recently and I have to admit the time you save – after figuring out how it works, you’ll be wondering how you’d done java development otherwise. The integration of Hibernate, SQL code in string literals, Spring, RegEx, Xml are just a few of the intelisense items it will figure out.

There are a few caveats, they’re not opensourcing the whole shebang but a subset. If you’re yet to try the IDE download a copy and see.

{lang: 'en-GB'}
Share

Apple’s and Linus’s take on Windows 7

October 23rd, 2009 No comments

Apple Propaganda, I mean PR

I posted about Microsoft’s four new Windows 7 commercials the other day and yes, they *are* commercials – they tell you a bit about the product they’re advertising. Now let’s take a look at Apple’s attempts – great PR btw! I think they were going for: ‘lets create the most douchebaggy thing to publicise our product and have people post blogs about it’. Well here’s some free PR work courtesy of Apple.

Bill Gates may go down in history for the BSoD for Windows 98 but lest we forget that little kid in school who was always jumping up and down for attention, teasing the smarter kids because he just wasn’t getting any attention.

“Now what is this? I dunno, but it works.” – Steve Jobs

“It’s pretty awesome when it works.” – Steve Jobs

It sure is Steve, it suuuuure is. Think Different. It just works. I wonder how they’ll cover having an ad-supported Mac OS X operating system in the future?

Linus Torvalds

Anyway I much prefer the suttle attitude that Linus Torvalds took at the Japan Linux Symposium.

He’s got a sense of humour (and coolness) and as a Linux user (#412328) I’m ever grateful for his operating system. Damn I miss Japan 🙁

{lang: 'en-GB'}
Share

CentOS 5.4 Released!

October 23rd, 2009 No comments

CentOS 5.4 has been released! Woo yeah, its been a while since RHEL 5.4 has been out but checkout the release notes for a list of changes.

Download mirrors are being updated but if your local, here are a couple of Australian Mirrors.

CentOS 5.4 x86

CentOS 5.4 x64

I just did a inplace 5.3->5.4 upgrade with a yum update. With a localised mirror, blindingly fast too!

{lang: 'en-GB'}
Share

Four new Windows 7 Ads

October 22nd, 2009 No comments

Here’s four new Microsoft Windows 7 commercials, 7 seconds to talk about Windows 7.  Short, sweet functionality and to the point. Oh  and look, they don’t seem to need to be bashing their competitors (awww!).

Having used Windows 7 now for close to 2 months I have to say its nothing but pure awesomeness. If you have MSDN there’s no excuse not to try it out. I’ve been too busy to even blog about it 🙁

{lang: 'en-GB'}
Share

Visual Studio 2010 Beta 2 is out!

October 21st, 2009 No comments

Microsoft has just released VisualStudio 2010 Beta 2 to MSDN Subscribers – aka Rosario.

msn_visual_studio_2010

I’m not sure why they’re going with the ULTIMATE moniker for Visual Studio, I still prefer the VS6 style Standard, Professional, Enterprise. Meh.

  • Microsoft Visual Studio 2010 Ultimate with MSDN
    The comprehensive suite of application lifecycle management tools for software teams to ensure quality results from design to deployment.
  • Microsoft Visual Studio 2010 Premium with MSDN
    A complete toolset for developers to deliver scalable, high quality applications.
  • Microsoft Visual Studio 2010 Professional with MSDN
    The essential tool for professional development tasks to assist developers in implementing their ideas easily. (Note: Visual Studio 2010 Professional will also be available without MSDN subscription)

Some of the more exciting things that are coming with Visual Studio 2010 are documented on MSDN or a better one would be Vikas Goyal’s post and also his .NET 4.0 coverage.. Personally the Parallel extensions are the most exciting bits for me. The new Java 7 work is concentrating heavily on concurrency and its good to see both camps pushing the boundaries.

{lang: 'en-GB'}
Share

Part II: Rebuilding ZEUS – The Operating System, FileSystem & Virtualisation

October 18th, 2009 No comments

Now that I’ve decided what I want out of the server (and the hardware I’ve got), its time to workout what operating system to run the system on. Currently, ZEUS is running on Ubuntu Gutsy (7.10) which is running LVM with an XFS volume holding approximately 2.5Tb worth of data. There’s a cron job that defrags the XFS volume to keep things in order.

The Operating System

As the operating system is no longer maintained (my oversight into how long it would survive) I have to find an OS that supports the hardware platform without hacky hacky bits (and by this I mean avoiding buggy ACPI and issues with the NForce4 chipset and IRQ problems) and has a file system that will benefit long term.

There were a few considerations:

  • Ubuntu 8.04.x LTS
    I like Ubuntu, I’m comfortable with the user land and find the Debian package system (in particular the dependency resolving) most impressive. Hardware is well supported and 8.04.3 (at the time of writing) boots on the hardware I originally selected (Intel) and the new configuration I recently selected (AMD). I could most definitely use Ext4 but the problems with data-loss (which I’ve reproduced on several occasions on desktop machines) scare me.FileSystem: I’d have to adopt either XFS or Ext4 on an LVM to factor in future-proofing, maybe get some fakeRAID happening for redundancy.
    Installation
    : comes with a Server edition that’s bare bones allowing it to be a minimalistic installation which is always nice!
  • Ubuntu 9.04
    Initially when I started to rebuild Zeus back in April I wanted to use Ubuntu 9.04, I was really excited about Ext4 and the promise of a brand-spanking new file-system and what it would bring to the table. Unfortunately after using Ext4 with 9.04 I’ve come to realise its probably not the wisest to trust your data with it just yet – unless you get yourself a UPS! Laptop seems to be chugging nicely though.Installation: Like LTS, comes with a Server edition that’s bare bones allowing it to be a minimalistic installation which is always nice! (copy/paste!) Unfortunately picking 9.04 when 9.10 is just around the corner is not going to be ideal, I’ll be stuck with where I am right now in a year or so.

So in case the sudden influx of OpenSolaris posts didnt give you the hint, I decided on OpenSolaris to power the new iZeus 2.0, actually no that sounds lame, zeusy will be the new ZEUS until ZEUS is retired in which case zeusy becomes zeus (confused?).

Why ZFS?

ZFS is one of those file-systems you look at and think, wow! Why didn’t anyone else think of that before?

  • Very simple administration – you only use two commands, zpool and zfs.
  • Highly scalable – 128-bit means we can hold 16 exabytes or 18 Million terabytes worth of data! More porn for you! XFS can no doubt handle the TBs we use for our home boxes now, but no-chance you can get the performance or benefits of ZFS in Ext3/Ext4 or XFS.
  • Data integrity to heal a filesystem (no fsck’ing around!) – 256bit checksuming to protect data, if ZFS detects a problem it will attempt to reconstruct the bad block and continue on its merry way (utilising available redundancy)
  • Compression – you can elect to compress a particular file-system or a hierarchy just by setting one command! I’m thinking things like logs here.
  • No hardware dependency – JBOD on a controller, let ZFS maintain the RAID volumes in software. Checkout Michael Pryc’s crazy adventure with ZFS using USB thumb drives and Constantin’s original voyage with USB drives! RAID-Z is essentially RAID-5 without the write-hole problems has plagued it if power is lost during a write, it can also survive a loss of a drive (with RAIDZ-2 you can loose two drives).
  • Happy snaps for free! Snapshot (a live) file-system as many times as you like, again one easy command. Its like that tendency to hit {CTRL+S} when your working in Windows from back in the days of Windows 9x, snapshot regularly!

So ZFS sounds much like marketing spiel right now, best thing since sliced bread, cooler than a cucumber, and you’d be right it is cool and the best thing since filesystems came to being. Over the coming days I’ll post some more on my musings with ZFS – keeping in mind that I’m still learning these things. It helps to have lots of hardware to play with, but even if you don’t, you can knock up a virtual version of OpenSolaris in VirtualBox, create some virtual disks and try it out.

There are a few caveats that I’ve come across though using ZFS, one is memory! ZFS will try and cache as much data as it can in RAM, so if you have 8Gb of RAM (as I have in this box) it will happily use as much of it as it can afford. Rightfully so, I was getting ~96MB/s transfering a 16Gb MPEG from one box to the other over our Gig link (thats from one end of the house to the other!) mind you this was just a test configuration using 2x 74Gb Western Digital Raptors (WD740ADFD) in a RAID-0 style hitting a single 150Gb Western Digital Raptor (WD1500ADFD). They could have gone much higher, but I was happy with that.

There are also (as of writing) no recovery tools for ZFS, but these are slated to arrive soon (Q4 2009) which is quite scary after you read this post about a guy loosing 10Tb worth of data, however a possible revert to an older uberblock may fix some problems.

Virtualisation

Initially I wanted to concentrate quite a bit on Virtualisation, I tried Xen on OpenSolaris. It was quite easy to setup a Xen Dom0 in OpenSolaris but with the 2009.06 release you had to tweak the Xen setup a bit. I wasn’t too enthusiastic about using Xen after seeing the performance lag in Windows in my musings. Instead I’m opting for my crush, VirtualBox.

So why use VirtualBox when you can get a bare-metal hypervisor? Firstly, performance seems to be sluggish with Xen for me (I didn’t investigate this too much), secondly I want to be able to run the latest and greatest OS’s out without worrying about upgrading Xen (I’m a sucker for OS’s!). VirtualBox development has accelerated at a feverish pace, I started with VirtualBox 1.3 in 2007 and its come an insanely long way since then. When a new release comes along, its as easy as updating VirtualBox and getting all the benefits. Plus with SunOracle‘s backing of VirtualBox you know things are going to work well on OpenSolaris, the Extras repository of VirtualBox makes it as easy as doing a pkg update.

I’m still quite intrigued by the way KVM is heading and how it will pan out, but for the future zeus, it will be VirtualBox.

{lang: 'en-GB'}
Share

FIX: OpenSolaris Package Manager fails after adding Extras Repository

October 16th, 2009 No comments

After setting up the extras repository for OpenSolaris I tried to install VirtualBox via the package manager.

thushan@zeusy:~$ pfexec pkg install virtualbox
Traceback (most recent call last):
  File "/usr/bin/pkg", line 2598, in ?
    __ret = main_func()
  File "/usr/bin/pkg", line 2541, in main_func
    return install(mydir, pargs)
  File "/usr/bin/pkg", line 710, in install
    update_index=update_index)
  File "/usr/lib/python2.4/vendor-packages/pkg/client/api.py", line 203, in plan_install
    self.log_operation_end(error=e)
  File "/usr/lib/python2.4/vendor-packages/pkg/client/api.py", line 1410, in log_operation_end
    self.img.history.log_operation_end(error=error, result=result)
  File "/usr/lib/python2.4/vendor-packages/pkg/client/history.py", line 680, in log_operation_end
    self.operation_result = result
  File "/usr/lib/python2.4/vendor-packages/pkg/client/history.py", line 279, in __setattr__
    raise AttributeError("'history' object attribute '%s' "
AttributeError: 'history' object attribute 'operation_result' cannot be set before 'operation_name'.

pkg: This is an internal error.  Please let the developers know about this
problem by filing a bug at http://defect.opensolaris.org and including the
above traceback and this message.  The version of pkg(5) is '87d6ba4c8e1c'.

Uh-oh, what the hell did I break now I thought? After some messing about I realised the time on the machine was a few hours behind – this was just installed on the new hardware I picked up the other day, the certificates were timestamped and I figured this was probably a clash of the space-time continuum. Instead of opting to manually set the time, I let it sync (periodically) with an NTP Server local to us here in Melbourne.

To do this, we enter our NTP server in /etc/inet/ntp.conf like so:

server ntp.mel.connect.com.au

Then we tell it to update itself:

thushan@zeusy:~$ pfexec ntpq -p
 remote           refid      st t when poll reach   delay   offset    disp
==============================================================================
*yarrina.connect mumnunah.csse.u  2 u   20   64  377    50.22  -11.747    0.44

Done, now you’ll find that your package manager will no longer fail with the stack-trace as the timestamps will match correctly!

UPDATE: There’s already a bug report about this in the OpenSolaris Bugzilla.

{lang: 'en-GB'}
Share

Setting up OpenSolaris Extras Repository for VirtualBox, True-Type Fonts, Flash & JavaFX SDK

October 16th, 2009 3 comments

I’ve been messing about with OpenSolaris (you’ll know why soon!) and decided to install the OpenSolaris Extras repository so I can grab the latest VirtualBox install from the repository. This repository has the following packages (as of writing) and is recommended if you plan on using VirtualBox:

NAME (PUBLISHER)                              VERSION         STATE      UFIX
SUNWadmj (extra)                              0.5.11-0.111    known      ----
SUNWjsnmp (extra)                             0.5.11-0.111    known      ----
SUNWwbapi (extra)                             0.5.11-0.111    known      ----
SUNWwbcou (extra)                             0.5.11-0.111    known      ----
SUNWwbdev (extra)                             0.5.11-0.111    known      ----
develop/java/javafx-sdk (extra)               1.2.0.233-0.111 known      ----
service/compute/sungridengine (extra)         6.2.2-0.111     known      ----
service/compute/sungridengine/arco (extra)    6.2.2-0.111     known      ----
service/compute/sungridengine/domainmanager (extra) 6.2.2-0.111     known      ----
system/font/truetype/ttf-fonts-core (extra)   1.0-0.111       known      ----
system/iiim/ja/atok (extra)                   17-0.111        known      ----
system/iiim/ja/wnn8 (extra)                   8-0.111         known      ----
virtualbox (extra)                            3.0.8-0.101     known      ----
virtualbox/kernel (extra)                     3.0.8-0.101     known      ----
web/firefox/plugin/flash (extra)              10.0.32.18-0.111 known      ----

So what do you need to get these freebies? (source help)

  • Register if you haven’t already with Sun, otherwise login to your Sun Online Account get your certificates.
  • Download the Key and Certificate files onto your desktop. They are named OpenSolaris_extras.key.pem and OpenSolaris_extras.certificate.pem respectively.
  • Now we need to create a directory in /var/pkg to store the certificates – ensuring they have the correct permissions. Then we’ll add them to the folder.
    $ pfexec mkdir -m 0755 -p /var/pkg/ssl
    $ pfexec cp -i ~/Desktop/OpenSolaris_extras.key.pem /var/pkg/ssl
    $ pfexec cp -i ~/Desktop/OpenSolaris_extras.certificate.pem /var/pkg/ssl
  • Then we add them to our configuration.
    $ pfexec pkg set-authority \
        -k /var/pkg/ssl/OpenSolaris_extras.key.pem \
        -c /var/pkg/ssl/OpenSolaris_extras.certificate.pem \
        -O https://pkg.sun.com/opensolaris/extra extra
  • To test the above worked get a list of the packages in the repository with the command below. Your output should be similar to mine above.
    $ pkg list -a 'pkg://extra/*'

Now make sure your datetime settings are valid when you do the above, as I found mine was a little out of date and raised a few python exceptions.

{lang: 'en-GB'}
Share