The verdict is in: SCO owes Novell and Linux users rejoice

November 28th, 2008, by Matthew

It’s taken almost five years, but the final verdict is in and SCO owes Novell $2.5M for the pain and suffering it caused with its claims that the Linux kernel was tainted with source code that it owned.

To be honest, I’d forgotten all about this, but I guess it’s a good thing that it’s all wrapped up. Poor SCO, that buy-out offer from IBM never came, did it?

We are a Perth web design and web development company and this is our blog. We specialize in building web applications with the Ruby on Rails framework. Jump to the Ruby on Rails category or contact us.


Stressed out to the eyeballs

November 24th, 2008, by Matthew

We’ve bought a cute little Shuttle KPC for the office. It’s a very compact PC that we’re going to use as a VOIP PBX. The bare-bone version of the machine ships with a motherboard and power supply already mounted in the case, but it lacks a CPU, memory or hard disk. Last week, for the first time in about 5 years, I built a computer. Not much has changed, though I did have a hard time mounting the CPU. It resulted in a broken fan/heat-sink assembly, though thankfully a replacement was only $20.

Today I loaded the operating system, Ubuntu Linux 8.10 “Intrepid Ibex” and got a taste of the latest Ubuntu release. As usual, I’m quite impressed, and the improvements in the two and a half years since I regularly used a graphical Linux interface are highly noticeable. There’s lots of animation and the experience is more… fun?

I thought it would be wise to stress test this little box, as even though it’s not going to get that much of a workout at our office, I wanted to make sure the CPU was seated properly and was being cooled appropriately.

The two tools I picked for the job are stress and cpuburn.

mlambie@arcee:~$ stress --cpu 16 --io 12 --vm 8 --vm-bytes 128M -d 4 --timeout 60s
stress: info: [22065] dispatching hogs: 16 cpu, 12 io, 8 vm, 4 hdd
stress: info: [22065] successful run completed in 65s

The little machine loved stress, maxing the CPU and causing the load average to skyrocket. The temperature stayed nice and chilly.

mlambie@arcee:~$ cat /proc/acpi/thermal_zone/THRM/temperature
temperature:             37 C

Similarly, loading up the CPU with burnMMX only added a few extra degrees Celsius.

I’m confident that this little box will perform well under stress. What tools do you like to use to stress your Linux systems?

We are a Perth web design and web development company and this is our blog. We specialize in building web applications with the Ruby on Rails framework. Jump to the Ruby on Rails category or contact us.


jQuery: Check For Non-Empty Input Fields

November 19th, 2008, by Aaron

– Check out some of our more recent Ruby on Rails blog posts. If you’d like to hire our team, get in touch

I was writing some code today and I wanted to prompt the user to check if they wanted to delete a row of data only if there was some data they might not want deleted. Typically to do this I would loop through all the input fields and if any of them weren’t blank I would run the check. I figured that there must be a better way with callbacks or selectors, and after a little thinking I wrote this jQuery snippet :

row.find('input[value!=""]').length > 0

This basically says count the number of inputs with a non-blank value you find, inside the given row.

Just like my last post, it’s nothing amazing but it sure is a better way of doing things. If you look into the andSelf() method then you could also easily chain selects and other input types.

I’m also interested if someone has a better way to approach this problem?

We are a Perth web design and web development company and this is our blog. We specialize in building web applications with the Ruby on Rails framework. Jump to the Ruby on Rails category or contact us.


Dynamically Reducing Object Sizes in PHP

November 19th, 2008, by Aaron

After using jQuery for quite a while I’ve become quite attached to using the power of callbacks when dealing with sets of data. I’ve seen equally and perhaps better abilities in Ruby but of course had been let down in the past by PHP’s lack of abilities as a dynamic language.

Today I faced an issue due to the size of my objects. The problem essentially came down to the fact that for the largest objects such as Contact objects the amount of data passed back to the client when doing AJAX calls was pretty sizeable. I wanted to write a function that given a set of property names all the returning objects would be stripped of all but those properties.

I didn’t want to write a function for each set of properties I’d return, so I wrote a generic function that given an array of property names that was all that would be returned from that object and it was surprisingly easy and I think in the end highly dynamic and useful.

It uses the PHP array_walk() function which I’ve never used before. It’s a lot like the Array.each() methods that many other languages have.

	private function GetContacts() {
		$filter = RequestQuerystring('filter');
		$properties = RequestAll('properties');

		if (isset($properties)) {
			$properties = explode(',', $properties);
		}

		if (isset($filter)) {
			$contacts = [large_objects]
		}

		if (isset($contacts) && is_array($properties)) {
			array_walk($contacts, 'mod_ajax::FilterObjects', $properties);
		}

		echo json_encode($contacts);

	}

	private static function FilterObjects(&$object, $key, $properties) {
		foreach (get_object_vars($object) as $k => $v) {
			if (!in_array($k, $properties)) {
				unset($object->$k);
			}
		}
	}

Basically for this array of large objects on each one we call FilterObjects. That has to be a function or static method which I learned as I went. The object is passed in by reference so that any change made to it is reflected in the original array, and it just goes through the variables (properties) of the object and kills anything that isn’t in the allowable parameter list.

This allows me to trim large objects dynamically for any of my client side calls for data and I think is definitely going to save me time in the future. I remember when I first started using PHP I wrote a function for each object to spit out XML, then I progressed to JSON, now I’ve got a nice filter method.

I still feel like there must be a better way to do things, but quite possibly that would exist in another language.

We are a Perth web design and web development company and this is our blog. We specialize in building web applications with the Ruby on Rails framework. Jump to the Ruby on Rails category or contact us.


Managing multiple Ubuntu servers painlessly

November 16th, 2008, by Matthew

Like most programmers, I don’t like to repeat manual tasks, well, manually. We use Ubuntu Server almost exclusively on our servers and whilst package management is very simple (login, aptitude update, aptitude dist-upgrade, all done) when you have to look after many (fourteen and expanding) servers it can get repetitive.

I use Terminal (or is it called Terminal.app?) on Mac OS X as my terminal emulator, and I’ve messed around with using Applescript to open multiple tabs before, so I figured this was a problem worthy of a Sunday-morning.

What I envisaged was iterating over a list of servers and having Applescript manage a Terminal instance, opening new tabs where appropriate, and executing the upgrade command in each tab for each server. Sounds simple enough.

And it was. I used Martin Ström’s excellent article as a base for my script, and ended up with the following:

set tab_count to 0
set servers to {"astrotrain", "bumblebee", "grimlock", "ironhide", ¬
	"jazz", "laserbeak", "mirage", "prime", ¬
	"prowl", "ratchet", "ravage", "rumble", ¬
	"soundwave", "wheeljack"}
-- Update the package list, dist-upgrade and remove the downloaded
-- packages so they're not included in the backups
set dist_upgrade to ¬
	" 'sudo aptitude update &&
	  sudo aptitude dist-upgrade &&
	  sudo aptitude clean'"

-- Make our settings globally available
global tab_count, servers, dist_upgrade

-- Mainline
on main()
	tell application "Terminal"
		activate
		repeat with server in servers
			set cmd to "ssh -t " & server & dist_upgrade & " && exit"
			my open_tab(cmd)
		end repeat
	end tell
end main

on open_tab(cmd)
	tell application "Terminal" to activate
	my create_new_window_or_tab()
	tell application "Terminal" to ¬
		do script with command (cmd) in last tab of window 1
end open_tab

on create_new_window_or_tab()
	if tab_count ≤ 0 then
		tell application "Terminal" to do script ""
		set tab_count to tab_count + 1
	else
		tell application "System Events" to ¬
			tell process "Terminal" to ¬
				keystroke "t" using command down
	end if
end create_new_window_or_tab

-- Run the mainline
main()

Apologies for the highlighting – the plugin doesn’t understand Applescript.

We are a Perth web design and web development company and this is our blog. We specialize in building web applications with the Ruby on Rails framework. Jump to the Ruby on Rails category or contact us.


Follow Us

Stay in the Loop

  • Enter your email address to subscribe to our mailing list. You'll get updates about our products, specials and bonus offers, and general behind the scenes news from our team.

Twitter

Facebook Fans

Newsletters

Testimonial

The boys at The Frontier Group are amazing! For such a relaxed and personable organisation, they have phenomenal technical ability and a rampant professionalism. They have customisable solutions for all of my IT needs and they always deliver, on time and beyond expectation.

They fix problems other service providers can't and they helped me get a critical section of my web site up and running 10 minutes after I emailed the request!

Alex Hyndman, Nexus Car Share.

Featured Project

Case Study - Caudo Group - www.caudo.com.au

Website

www.caudo.com.au

Caudo Machinery

Caudo Group engaged our services to redesign their outdated website. We sent our photographer on-site to capture the essence of their business and turned it into a stunning web design.