Powershell deployment script to help decrease page load time

Currently the main focus of my work has been on developing a web portal that allows users to control hosting based services, and automates the provisioning, so there is mininal work to be done manually. We recently deployed a new version of the front-end, which incorporated extensive use of jQuery as well as AJAX to give the site a more modern look, as well as improving it’s usability. The main issue that we found once we had deployed the software is that it resulted in some very slow load times, so I spent a few days working doing what I could to increase the performance of the site. After all, a site might be fantastic, but if it’s not quick, people aren’t going to use it.

Luckily my boss has given me permission to share some of the benefits of my research both here and on the companies blog. The versions I write here will contain a slightly slimmed down version of the original posts.

(more…)

Creating modal popup’s in ColdFusion

One of the great things about my new job is that I am constantly running into little problems that I am having to figure out, and some of them are interesting enough that I’m going to try and post what solutions I can here, so that hopefully it can help other people with similar problems.

One issue I came across recently was creating modal popup’s in ColdFusion, so that a user could click on a button, fill out a form, then when they submitted the appropriate part of the form was reloaded, and they never had to navigate away. The example that I am going to use is a standard select box with a list in it and a button that opens the window to modify the contents of that list.

To do this we will be using a cfwindow. For this example I’ll assume you already have the page that you would like to display in the window, and have some basic CFML and Javascript knowledge.

(more…)

New job, old city.

This is a quick update on a fairly major decision that I made a couple of months ago. Back in early Febuary I resigned from my position as Business Analyst and Lead Developer for TechCertain, and at the start of March, I started a new position at LayerX, working with an old friend of mine, Mike Lowen.

The main reason for this change is that the position is much closer to what I enjoy about working with computers. The work is varied and challenging, and I feel the decision was a very good one. I have already worked on a couple of interesting projects, with the main one being theCloud, a hosted services platform that we will be releasing in May. I hope to post a few things about stuff that I am working on or things that I have learnt (without revealing any work secrets of course) but I will leave those for another day.

This also means that I will be moving back to Hamilton sometime in the next few weeks, so hopefully I have a chance to keep updating through the move, but things dont always go to plan.

Problems with booting after upgrading to Ubuntu Karmic Koala

So yesterday I decided to upgrade my installation of Ubuntu from 9.04 -> 9.10 on my file server at home. This system has no screen attached to it and no keyboard so I just ssh’d in and followed the how-to on the Ubuntu website for doing the distribution upgrade.

Everything went smooth until I rebooted the system, and after a while when I tried to get back into it I noticed it hadnt come back online. I plugged a monitor a keyboard into the system and rebooted it to see what the issue was and I saw this screen.

mountall: /proc: unable to mount: Device or resource busy
mountall: /proc/self/mountinfo: Not such file or directory
mountall: root filesystem isn’t mounted
init: mountall main process (2025) terminated with status 1
General error mounting filesystems.
A maintenance shell will now be started.

So I hit the internet and tried to figure out wehat was going on, and found out this appears to be a problem for a lot of people, but none of the solutions I found worked for me, mostly because my fileserver has no cd drive and booting from a flash drive doesnt seem to work either.

From what I can gather the main reason this issue is happening is becase Grub is broken during the update process and is pointing at the wrong drive/kernel. Most solutions involved booting into a live cd and fixing menu.lst from there or using grub-update. Eventually I managed to fix the problem by going into grub and manually editing the boot command to point at the correct drive and the correct kernel. The easiest way to do this for your system is to use tab completion as it will tell you all the options and using a little trial and error you can get it going.

Hopefully this saves someone else from hours of torture.

Checking access to files on a server

So recently I put some files up on a file server I rent with a couple of mates, mostly ones used in my CV so that prospective employees can check papers etc that I have written. In an attempt to try and figure out who has accessed these files I, with the help of my friend Paul wrote a smal script that uses the access log, grep and whois to figure out the domains that have accessed the file. To be honest its a small script, and if I had more experience with bash I probably could have written it myself. In fact, if Paul had wanted to, I know he could have written it no problems, but it was all experience. In case someone wants to use it, here it is.

#!/bin/bash

FILE=”/tmp/$(basename $0).$RANDOM.$$.txt”;

echo Searching for access to files with $1;

sudo cat /var/log/apache2/access.log | grep -i *PUT YOUR NAME HERE* | grep $1 > $FILE;

if [ -z "$2" ]
then
echo “no exclusions”;
else
echo “excluding files containing $2″;
cat $FILE | grep -v $2 > $FILE;
fi

cat $FILE | cut -d ‘ ‘ -f 1 | sort | uniq -c > $FILE;

for i in $(cat $FILE)
do
echo -ne “$i    -       “; whois $i -H | egrep ‘OrgName|descr’ | head -n 1 | cut -d ‘:’ -f 2;
done

To use it, just copy the script (replacing the part that says *PUT YOUR NAME HERE* with your username) into a file, set it as an executable using  chmod +x, then run it. The first argument is the string you are looking for access to, e.g. pdf will show all pdf’s, and there is a second optional string for if you want to exclude files with names containg a certain string.

Driven-Monkey.com – Now with WordPress 2.8.1 goodness!!

Thats right folks, after many months of neglect I have finally gotten around to upgrading my site, and fixing all those things that havent been working since the last upgrade.

So now I should be posting more here, or at least more of my FreeBSD posts will be syndicated here. I’ll be posting about a new project from work that I think a few people may find interesting…

Lastly I would also like to apologise for the amount of posts that are going to come through once the syndication to my FreeBSD blog picks up the posts I have made recently and dumps them on the site.

Why there’s been no posts lately

So I noticed today that there hasnt been a post made to this site for a very long time. Thats not that unusual, except for one thing. I have been posting, just not directly here. I have an automatic syndication of my FreeBSD blog to this site, but what I didnt realise was that the plugin I use to do this was broken when I upgraded to wordpress 2.7. This weekend I hope to fix the problem, so dont be suprised if a few posts come through that seem to belong from a while back.

That is all.

Where I’ve been…

So it has been a while since my last post, and while thats nothing really unusual, I actually have things to post about, so I thought I better get round to doing them.

First off, my new job. As I said in my last post I had a pretty quick turn about from the first interview to starting work (phone call on the Tuesday concerning an interview, started work the following Monday). Things are going not too badly here, now that I’m settling into the role. The job is working for a company called TechCertain, who develop, maintain and operate a system which handles the paper work for insurance companies online (issue proposals and policies, automatic quoting/underwriting e.t.c.). My role is the companies Business Analyst. My main job is to work with the clients to determine what it is they need, and then work out how we are going to acheive this. I also do a lot of the companies research and development (more on that later), write the front end for the clients, and manage the development team (read: the other guy who works mostly on the backend haha). The language is VB .net and Microsofts SQL, which is actually pretty funny because the day I started this job I had never worked on or studied either of these, so I pretty much had to learn all of that on top of everything else that comes with a new job.

I mentioned before that the company had some R&D going on. Seems strange for a simple web application company like us to have R&D but it’s true. Currently we are looking into porting our code over to mono, and we are looking into running our service on a cloud rather than the server it is currently on, so at least that is keeping me busy.

In the next few weeks I am also moving into a house up here in Auckland, which will be great because I have been living in my friends parents garage since moving up here (it’s not nearly as bad as it sounds) but it’ll still be nice to have a real room e.t.c.

One last thing. I just wanted to say good work to the team that made Ubuntu Rescue Remix. A friend of mine has an 8 year old Acer Travelmate 240 sitting at home, and recently it started telling him that there was imminent drive failure, and refused to log into windows anymore. Using the rescue remix I was able to create a live cd, boot into the command line, plug in my flash drive, and rescue thousands of files off his laptop for him. Now all he has to do is go through and sort them all manuallly.