Tag Archives: order

Force Eject a CD/DVD in Apple Leopard

Today I had to help a friend force eject a stuck DVD in his iBook, there are a couple of methods we tried and I thought that hey may be helpful for others.

I would recommend trying to eject your stuck CD/DVD in this order;

1) Hold the ‘Eject’ Key for up to 30 seconds.

2) Stop the CD/DVD spinning

Stop the CD/DVD from spinning by gentle pushing in a thin piece of cardboard ( not to soft, nor hard ), thin packaging cardboard from like a battery or toy packet.
This will stop the CD as it is always spinning slightly, then hold the EJECT key for 8-10 seconds.

3) Restart holding the Mouse Button

Restart your mac, and once the machine chimes, hold the mouse button down ( external mouse or trackpad button ). This should eject the DV/DVD in up to 8 seconds.
If not, restart your mac again.

4) Restart in to Single User Mode

Restart your machine, and hold down the ‘Command ( apple )‘ + ‘O ( o for orange )‘ + ‘F ( f for fred )‘ keys.
This will boot you in to single user mode.

Type the following Command:

eject cd

Then press the ‘enter’ key

This should eject the CD/DVD.

Once the CD is ejected, type;

mac-boot

Then press the ‘enter’ key to boot back in to your Mac OS.

Force Eject a CD/DVD in Apple Leopard

Force Eject a CD/DVD in Apple Leopard

Displaying Ordered Directory Listings

This is a follow up to a previous post http://sheldon.lendrum.co.nz/clean-dynamic-directory-listing-with-php_206/04/ that will Dynamically display the files in a set directory.

In this version the files can be ordered by the date that they were last modified. I will also explain how to order both Ascending and Descending by the date the file was created also.

Example Usages:

< ?php
	//  EAMPLE USAGE
	//  SHOWS THE 10 NEWEST .php FILES IN A UNORDERED LIST
	echo("
    ". direcotryList("10","./",".php","
  • ","
  • \n") .""); // SHOWS ALL JPG IMAGES AS THUMBNAILS echo(direcotryList("","./images/",".jpg","\n")); ?>

< ?php

	// DIRECTORY DISPLAY USING GLOB SORTNG BY LAST MIDIFIED FILE DATE.
	// IF ALL PERIMATORS ARE EMPTY WILL SCAN DEFAULT DIRECTORY
	// '$display' =>  AMOUNT OF RECORDS TO DISPLAY
	// '$path'    =>  PATH TO DIRECOTRY TO SCAN
	// '$ext'     =>  FILES EXT,  IF YOU WANT OT ECLUDE IT,  OR ONLY SCAN FOR ONE TYPE OF FILE
	// '$start'   =>  APPEND TO START OF OUTPUT LINE EG: '
  • ' OR '
    ' // '$end' => APPEND TO END OF OUTPUT LINE EG: '
  • ' OR '\n' => DEFAULT '\n' function direcotryList($path = "./",$display = NULL, $ext = NULL, $start = NULL, $end = "\n"){ $return = (int)0; $output = ""; $ignore = array(".","..","thumbs.db"); if(empty($display)){ $display = time() * 1000; } if(($count = count($files = glob($path ."*". $ext))) > 0){ foreach($files as $v){ $filemtime[] = filemtime($v); } array_multisort($filemtime, SORT_DESC, $files); foreach($files as $file){ if($return < = $display){ if(is_file($file) and !in_array($file, $ignore)){ $output .= $start . $file . $end; $return++; } } } } return $output; } ?>

    Alterations:

    To order the directory by Creation time rather than the current Modified date Alter line 17 to filectime.

    $filemtime[] = filectime($v);

    Currently the output is orders Newest to Oldest, to reverse the Order, change the Constant in the array_multisort on line 19.

    array_multisort($filemtime, SORT_DESC, $files);

    If you have any comments or suggestions, please ask below.