css (1) jQuery (7) linux (38) mac (70) php (29) python (1) svn/git (9) trac (4) ubuntu (1) virtualbox (6) vista (2) windows (14)

Friday, 28 November 2008

Sudo shell command via apple script

Handy little thing I found here

If you want to run a shell script as admin (i.e. at startup) in my case running apache and mysql then if you write the following

do shell script "sudo yourscript" password "yourAdminPassword" with administrator privileges

As an apple script it will work, yay!

Thursday, 27 November 2008

Virtual Box 2.0.6

Virtual Box 2.0.6 has been released and the bug I reported has been fixed!

Windows host installer: fixed default installation directory on 64-bit on new installations (bug #2501)

Wednesday, 26 November 2008

Komodo Edit Portable 4.4.1 & 5.0.2

I have migrated my Komodo edit portable release to and added version 5.0.2 to the repertoire as well as updating version 4 from 4.4.0 to 4.4.1.

I'm just committing them to SVN (this could take a while, thousands of files)

On another note my blog has hit over 100 unique visitors! W00t!.

Tuesday, 25 November 2008

The weird conversations and how the internet makes them weirder

I'm sat in the car and see a sign saying 'keep two chevrons apart' and wondered what the orgins of the word chevron are....after searching several pages of wikipedia I am now well versed in the uses of a chevron but not in it's origins.

So onto according to them it originates from a latin derivative "caper goat" what a chevron and a goat have to do with each other I have no idea...
Sent from my BlackBerry® wireless device

Monday, 24 November 2008

Mac VNC from windows problem

I was having a problem connecting to my mac using vnc (I tried ultra vnc, tightvnc and realvnc non worked). Whenever I tried the screen would either just close automatically or error "incompatible version" or "no matching security types" very weird.

After experimenting and googling I found this

If you set it to full colours (high speed on tight vnc, ultra on ultravnc) it works, it's a little laggy but im on a LAN so it's not bad!

Very odd.

Monday, 17 November 2008

Mac version of alt-tab

I randomly just pressed the wrong key ob my mac and found out mac has a version of the windows alt-tab (cycle through open programs) it's cmd-tab. Cool!
Sent from my BlackBerry® wireless device

Saturday, 15 November 2008

Blackberry os reinstall

Lately my blackberry 8800 has been crashing a lot when running 2 or more applications (god knows why). Anyway yesterday I deicded today I would reinstall the operating system to see if that worked.

So I downloaded the os from O2 (my service provider).

Then I installed the os onto my desktop, hooked my blackberry up, launched the blackberry desktop manager and it asks me if I want to update.

I press yes! I let it update takes around 5 minutes.

Now my blackberry is uber fast again I have googlemail, yahoo go, opera mini and beejive all open as I write this.

No idea why it fixed it but who cares? It's fixed!
Sent from my BlackBerry® wireless device

Monday, 10 November 2008

M263 TMA 01

I've just finished M263 TMA01 done, dusted and submitted, it's due Dec 1st so I have a while to wait until marking....onto TMA02 (I wonder how many I can do in a day?)

Sunday, 9 November 2008

Blogger Validator

I've made a new script that validates blogger sites to xhtml transitional, it can be found here

Friday, 7 November 2008

Insert brain...oh wait it's 4:30am it's missing...

I just realised 4:30am makes me dumb.....I was trying to share my mac dvd drive with windows via smb..set all the permissions up etc...couldn't get in...oh look disable and enable my macs works...>.> took half an hour to work that out, even geeks get stumepd by the obvious somtimes!

Wednesday, 5 November 2008

Keep windows software up to date

I found a handy piece of free software to keep your computer up to date

It checks 1,000s of software programs and notifies you of patches. Handy!

Sunday, 2 November 2008

Virtual SVN and Project Managment

Well I've finally finished my latest venture.

I wanted to have a portable SVN server and apache/mysql server. Why? Well I like to travel a lot and for long periods of time so I take my work with me so leaving a SVN server on my desktop at home isn't really a good idea.

Now I could put it on my laptop but I'm not always using it I like to be able to switch pc. So here's the plan.

1) I have an old laptop with a faulty mouse pad so it's not really useful anymore, it has a 60GB hard drive and a couple of gigs of ram so can handle a virtual machine.
2) Migrate my svn and apache server to a virtual machine on my desktop for testing purposes to make sure it will work
3) Migrate the virtual machine to the laptop
4) Connect the laptop to my network via ethernet and enable wake on lan
5) Enable virtual machine to start on laptop bootup

So firstly, what operating system should I use? The laptop has no OS on it so I looked at linux. I tried Open Suse, Fedora, CentOS, Ubuntu (8.10), Mandriva and Slackware.

In the end I chose Fedora 9, here is why.
Open Suse worked well a little slower than the others but when installing Xampp for linux I kept getting access denied messages for php pages, god knows why so onto the next system.

CentOS, pretty good but Fedora has more up-to-date software which seemed to agree with VirtualBox better.

Ubuntu 8.10, disabled root user as standard didn't help since virtual box doesn't work to well under non root user, and it didn't give me an option to set a static IP at install bleh next!

Mandriva..looks really pretty...crashed when installing virtual!

Slackware...too complciated to install I want simple and quick.

Fedora..just plain works XD Some issues setting a static IP but not hard to resolve.

OK Operating system for the laptop decided...I decided to use fedora for the virtual machine as well.

For the virual machine at first I tried host networking, this isn't so easy on linux since you have to create network bridges etc which is a bit of a pain so I decided to switch it to NAT and just forward the ports it only takes a few minutes to set up.

Migrating the SVN and web server was easy enough that has been covered in a previous post.

The laptop needed wol enabled this has been covered in a previous post, now onto the last part setting the virtual machine to start on boot. I created a script in /etc/init.d/ and here it is:

#Virtual Box Start up script


case "$1" in

echo -n "Starting"
VBoxManage starvm VirtualMachine -type vrdp

echo -n "Stopping"
ssh -oPort=23 -i /root/.ssh/localhost root@localhost -t shutdown now
sleep 30
VBoxManage controlvm VirtualMachine poweroff
sleep 5
VBoxManage snapshot VirtualMachine take snapshot`date +%s`
sleep 2

$0 stop || true
$0 start

echo "Usage: /etc/init.d/virtualbox {start|stop|restart}"
exit 1


exit 0

To add the script to startup use the following command

/sbin/chkconfig --level 35 virtualbox on

On bootup this will start the machine in vrdp mode which is handy since I can remote in, on shutdown it will ssh into the machine (I port forwarded port 23 (old telnet port which I don't use) to the machine) and tells it to shut down, this is becace acpi shutdown on fedora virtual machines just logs off. Then it runs the power off virtual box command after 30 seconds to make sure it is off, then it takes a snapshot.

All done. The only thing left to do is edit the hosts file on my client machine to point to the ip address of the new machine, if I ever move the machine all I need to do is change the ip in the hosts file. Easy as pie!

Test Results

W00t!! I just got part1 of my first test for my M263 course back 95%! Only one mark wrong, this means I can start on part 2!