Skip to content

Recent Articles

Installing sntop – an automated ping monitoring tool

I’v setup a new wiki (core.adriel.co.nz) to put useful tasks I do from time to time.

To start it off I have added a wiki on how to install sntop onto a Mac as I didn’t find any online.

It also includes:

More will be added soon…

PS3 Media Server v1.21.0 compiled on 17/02/2011 (Mac)

Since the last release of PS3 Media Server was a while ago last year for Mac I thought I would compile an up to date version and share it with the internet since their have been many bug fixes since mid/end of last year.

One of them being AVCHD sync issues that seems to be fixed for my uses.

Compiled using these steps:
http://ps3mediaserver.org/forum/viewtopic.php?f=14&t=1635&start=660#p44610

If I remember correctly this uses PMS SVN Revision r501
http://adriel.co.nz/files/pms/builds/17.02.2011/PMS_MacOSX_1.21.0_build_17.02.2011.dmg

How to: Install 3 OS’s (Mac, Win 7, Ubuntu) without using rEFIt

Disclaimer: I take no responsibility if you lose any of your date following these instructions.

Backup! Always backup anything you wouldn’t want to lose before messing with partition or multibooting.

I do this by using Ubuntu’s GRUB2 application.

Incase your wondering what rEFIt is, it’s like a bootloader (kinda like GRUB) but it lives on the Mac partition and tries to let you boot of other partitions (OS’s) as Mac OS X limits you to just two, Mac and Windows (or Mac and Linux etc)

  1. Install Mac OS X 10.6 (Snow Leopard)
  2. Create Bootcamp drive with Mac bootcamp app.
  3. Open up Disk Utility, the delete the newly created bootcamp partition, now create 2 new partitions in it’s place (I formated them as FAT32), called on Linux, the other Windows.
  4. Reboot with Windows 7 Install disk. Hold down the C key before the Mac start to boot, this should force the computer to boot from disk.
  5. Follow onscreen instructions, until you come to the partitioning screen, then chose the Windows one, click on the display advanced options, then select “format”.
  6. Once formated, select this partition and start the install (Windows will probably say it will create a new ~200mb boot loader partition, this is fine)
  7. Once Windows is all installed and works fine, then reboot with the Ubuntu disk in.
  8. Same as before, hold the C key to boot from the disk.
  9. Once started, choose the Install option, follow onscreen options until you get to the partitioning window. (or where it asks wether you want to dual boot two operating systems.
  10. Choose for the advanced option. (Not sure what the auto dual-boot option does… but it might well work… I just never risked it, I like to be in control :) )
  11. Select the Linux FAT32 partition, delete it, then create your partitions… I asume you know what ones you want. I used one for /boot , /home , /tmp , swap (and other 2, I forget which). It’s not critical to set them all up in different partitions… but it is generally safer security wise… (look it up).
  12. Once done partition you can progress onto the next steps… fill them in and wait for the OS install.
  13. Let Ubuntu install it’s boot loader, GRUB2 to which ever partition it does it by default (99% sure it’s the Windows one)
  14. Once Ubuntu is completed installing, it should ask to reboot (or does it automatically), let it reboot. (eject disk)
  15. Hold down the “Option” key before the computer starts to boot again, then you should see 2 disk’s apear, one Mac and one Windows/Ubuntu.
  16. To boot up in Windows or Ubuntu select the right sided one (with the windows icon, I think they have icons…) this should now display GRUB2.
  17. GRUB2 is Ubuntu’s boot loader, this should display the Windows, Mac and Ubuntu partitions. Select which ever you want to boot.
  18. The OS should boot.
  19. If your computer (GFX card) suports it, you should be able to change the bootloader resolution to one that is closer to your screens native resolution.
  20. To do this google how to change it in the GRUB2 config file or download an app that will edit the GRUB2 config file for you.
  21. Happy triple booting without rEFIt :)

Acronym:

OS = Operating System

GFX = Graphics Card

Good Mac disk/partition recovery application

Data Rescue 3

I would say it’s one of the best disk recovery/restore tools I have used on a Mac.

I used it to recover ALL my data from a broken partition I had a few days ago. It took about an afternoon to do a full scan to my 500GB internal drive, and another 5ish hours I think to back it up via USB2.

Recover a Mac partition (or other non Mac partitions)

Disclaimer: I will not take any responsibility if your lose any of your data trying to follow these steps. I have written these instructions from memory, so it’s likely some of it isn’t 100% correct, so don’t just fire off commands blindly.

I was messing about with my Mac partitions on Windows 7, which should of been fine since this partition was already formated as FAT32 but somehow Windows changed the whole drive’s partitioning scheme from GUID to MBR, which in turn stopped Mac OS X 10.6 from starting.

Me being me, I had not backed up the OS before doing any of this (though I did have a 2 week old backup)

Recover a lost partition in Linux (Ubuntu 10.10)

  1. Restart into Ubuntu via what ever method you prefer (I used a live CD I downloaded and burnt)
  2. Once in Ubuntu open the terminal:
  3. (you might need to add the universe repositories, I don’t remember if I needed them for this)

  4. sudo apt-get update (if you added the universe repo)
  5. sudo apt-get install testdisk
  6. sudo testdisk
  7. Follow the onscreen instruction. I just done a few restore backup of x and rebuilt something else (I don’t remember what I did but it’s pretty self explanatory) I pretty much only touched the Mac partition (hfs+).
  8. When finished, commit the changes to disk. Close testdisk.
  9. Take a 5 min brake.
  10. Open up gparted (can install it via apt-get if it’s not already installed)
  11. Find your Mac OS partition.
  12. Right click it, choose the flags option, then tick “boot”.
  13. note: if you see that you still have that ~200mb Mac EFI boot partition, then check this as the boot partition.
  14. Commit the changes to disk (if they aren’t already)
  15. Shutdown
  16. Hold down the “Option” key then start the computer, let go the “Option” key when you see the boot selector menu.
  17. If all went well you will see your Mac partition back, select it and press enter.
  18. Congrats you are back to a working install of Mac OS X, I sugest you backup your data now! :)

Other tools you may be able to use are dd but I won’t go into that here, you will have to research it yourself.

dd is a linux utility that can be used to copy whole drives or partitions, there are also variants of dd that can be used to recover partitions. (read the man page)

You could also try using Data Rescue 3 if you can’t fix it this way.

Change input field content to show g.label not g.value

http://docs.jquery.com/UI/Autocomplete

  1. Open your js jquery UI file ( jquery-ui-1.8.7.custom.min.js).
  2. Clean the code up… (I used TextMate’s JS tidy function) though your free to do a find/replace in the compressed file…
  3. Once code is cleaned it’s around line 688 in jQuery UI 1.8.7 the auto complete section (“jQuery UI Autocomplete 1.8.7″)

Change the ‘g.value’ to ‘g.label’ in the jquery-ui-1.8.7.custom.min.js (your file may be called slightly different)

false !== a._trigger("select", c, {
                        item: g
                    
}) && a.element.val(g.label); # change the 'g.value' to 'g.label'
                    a.term = a.element.val(); 

You may also need to change this: (up a few lines from the above code)

}).menu({
                focus: function(c, e) {
                    e = e.item.data("item.autocomplete");
                    false !== a._trigger("focus", c, {
                        item: e
                    
}) && /^key/.test(c.originalEvent.type) && a.element.val(e.value) #change the "e.value" to "e.label"
                },