Tag Archives: apple

Cleaning my Apple Mighty Mouse Ball's

I have a couple of Apple Mac’s and with each of them, I have a Mighty Mouse.
I have one I carry with my with my Mac Book Pro, this is getting quite old now, It was the first release of the Wireless model, I pre-ordered it as soon as they were announced and have used it on almost a daily basis since.

I also have one on my iMac which gets a daily use also.

These mice are Great ! there are 5 buttons, the 5th is the 360 degree scroll ball. The wired model is very light and agile, while the wireless model is slightly heavier due to the batteries, but if you only use one AA rather than two, it is only ever so slightly heavier than the wired, and still not as heavy as most.

The only Issue I with these mice are the Ball’s get dirty from your finger being rolled over them on a continuous basis. Apple have an article and QT Movie on how to clean them, and plenty of discussions on the Apple forums, but the simple method is rolling it on paper.

Roll to Clean your Balls !

A way to clean the mighty mouse ball that I have always used, is turn it off ( or un-plug ), and get a clean sheet of paper, and upside down, and firmly roll the mouse around on the ball.

Cleaning the Mighty's Balls

Cleaning the Mighty's Balls

Changing the RSS refresh rate in Apple Mail

I use Apple’s Mail App as my primary mail client on both my personal and work mac’s, and for both machines I have various RSS Feeds subscribed.
I use apple mail as an RSS Client for a couple of reasons,

1) I just like how it works
2) its not just one more application I have to have open.

Recently though, I have found that none of the 30 or so feeds I am subscribed to were pulling any new posts.
I found this Odd, espically I know that multiple of them update daily. I did a bit of digging around, and have found a simple terminal command to alter the refresh rate that Mail will check for feed updates.

The default time is 30 minutes, admin the preferences you can set it to manually, 30 minutes, hourly or daily.

Apple Mail RSS Refresh Rate

Apple Mail RSS Refresh Rate

I changed these around then back to 30 minutes, and waiting an hour, but still NO feeds were updating.

After a little more digging, I found a terminal command that you can specify and refresh rate.

Specify the Refresh rate in Terminal !

  1. Quit Mail
  2. Open Terminal – /Applications/Utilities/Terminal.app
  3. Type:
    defaults write com.apple.mail RSSPollTime xx

    ** Replace the ‘nn’ with minutes, EG:

    defaults write com.apple.mail RSSPollTime 20
  4. Open Mail

This worked for me, and within the next 20 mintues, I had all the posts that I was missing for the last week that I didn’t get any.

Pretty lucky, as I was missing out some some pretty good stuff!

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

Safari's CSS Support for multiple backgrounds on the same Style

I was browsing just now and fond something pretty interesting, Safari supports multiple background image declarations for the same style tag.

	.box {

		background:
		/*	Upper-left	*/	url(./corners_01.png),
		/*	Upper-right	*/	url(./corners_02.png),
		/*	Lower-left	*/	url(./corners_03.png),
		/*	Lower-right	*/	url(./corners_04.png),
		/*	Icon		*/	url(./icon.png),
		/*	Gradient	*/	url(./gradient.png);

		background-position:
		/*	Upper-left	*/	0% 0%,
		/*	Upper-right	*/	100% 0%,
		/*	Lower-left	*/	0% 100%,
		/*	Lower-right	*/	100% 100%,
		/*	Icon		*/	0.6em 0.6em,
		/*	Gradient	*/	0% 100%;

		background-repeat:
		/*	Upper-left	*/ 	no-repeat,
		/*	Upper-right	*/	no-repeat,
		/*	Lower-left	*/	no-repeat,
		/*	Lower-right	*/	no-repeat,
		/*	Icon		*/	no-repeat,
		/*	Gradient	*/	repeat-x;
	}

Detect iPhone / iTouch Orientation – Change In Your Code

I have been working on a template for an iPhone Library Application today, its pretty simple stuff, A search, Asynchonous paginated results with the full details on each result. It will be using FileMaker for its database, but currently I am searching a large PHP array for testing.

When displaying the full result, when your phone is help upright, the results look good, but when you roll the phone over, the display is crap so after a fair amount of googling and multiple sources linking to Apple, and a missing page http://developer.apple.com/samplecode/iPhoneOrientation/index.html I found this post @ DevPhone.com.

Its exactly what I wanted. If you need an iPhone/iPod touch Application or web application, contact me via iPhone Web Application @ www.webapp.co.nz.

window.onorientationchange = function() {
  /*window.orientation returns a value that indicates whether iPhone is in portrait mode, landscape mode with the screen turned to the
    left, or landscape mode with the screen turned to the right. */
  var orientation = window.orientation;
  switch(orientation) {

    case 0:
        /* If in portrait mode, sets the body's class attribute to portrait. Consequently, all style definitions matching the body[class="portrait"] declaration
           in the iPhoneOrientation.css file will be selected and used to style "Handling iPhone or iPod touch Orientation Events". */
        document.body.setAttribute("class","portrait");

        /* Add a descriptive message on "Handling iPhone or iPod touch Orientation Events"  */
        document.getElementById("currentOrientation").innerHTML="Now in portrait orientation (Home button on the bottom).";
        break;

    case 90:
        /* If in landscape mode with the screen turned to the left, sets the body's class attribute to landscapeLeft. In this case, all style definitions matching the
           body[class="landscapeLeft"] declaration in the iPhoneOrientation.css file will be selected and used to style "Handling iPhone or iPod touch Orientation Events". */
        document.body.setAttribute("class","landscapeLeft");

        document.getElementById("currentOrientation").innerHTML="Now in landscape orientation and turned to the left (Home button to the right).";
        break;

    case -90:
        /* If in landscape mode with the screen turned to the right, sets the body's class attribute to landscapeRight. Here, all style definitions matching the
           body[class="landscapeRight"] declaration in the iPhoneOrientation.css file will be selected and used to style "Handling iPhone or iPod touch Orientation Events". */
        document.body.setAttribute("class","landscapeRight");

        document.getElementById("currentOrientation").innerHTML="Now in landscape orientation and turned to the right (Home button to the left).";
        break;
  }
}

Installing PHP5 and mySQL on Mac OSX Leopard

There has been a lot of posts on a lot of sites that explain how to get PHP and mySQL working & talking on OSX Leopard, but none that are fully step by step. So with thanks to The Busy Geek ( www.thebusygeek.com ), Here is a comprehensive guide.

You will need a very basic knowledge of using OSX Terminal ( Command Line Commands) and your root password.

Step 1:

Go to Developer.MySQL.com and download the copy that matches your Machine. In my case because I am on a G4 PowerPC iBook, I had to download the 10.4 version (Mac OS X 10.4 (PowerPC, 32-bit)) as there is no 10.5 version for PPC.

Once you have downloaded the package, install all 2 packages, and the preference pane.

Installing the MySQL packages.

Installing the MySQL packages.


Step 2:

Open Terminal ( Applications / Utilities / Terminal.app ) and log in as root;

sudo su

Enter your root password when prompted.
Navigate to your mysql directory;

cd /usr/local/mysql

If you view the directory you should see something like the following;

ls

COPYING			data		scripts
EXCEPTIONS-CLIENT	docs		share
INSTALL-BINARY		include		sql-bench
README			lib		support-files
bin			man		tests
configure		mysql-test

Next we start mySQL.

./scripts/mysql_install_db --user=mysql

It should run a whole lot of commands, starting with…

Installing MySQL system tables...

Once that has finished we add the mySQL User permissions

./bin/mysqld_safe --user=mysql &

Which will ( or should ) give this..

Starting mysqld daemon with databases from /usr/local/mysql/data

Now the mySQL root user’s password. and then confirm password and database location.

./bin/mysqladmin -u root password '**PASSWORD**'
./bin/mysqladmin -u root -h **IP_ADDRESS** password '**PASSWORD**'

Now, All going well, Lets hope you get this error:

./bin/mysqladmin: connect to server at '**IP_ADDRESS**' failed
error: 'Host '**IP_ADDRESS**' is not allowed to connect to this MySQL server'

Thats good news, This means mySQL is running and that is step 2 finished.

Step 3:

Next Step, We will install PHP, You think huh? Apple already has a copy of PHP pre-complied in OSX?
Yeah, true, but ( No Offense Apple ) its shit.

Still as root user:

cd /usr/local/

We want to download the newest build of PHP from Marc Liyanage’s site. Thank you to Marc, who has openly releasd and supported Great PHP builds for years! And totally for free!
* Make sure this path represents the newest version.

curl -O http://www2.entropy.ch/download/php5-5.2.5-6-beta.tar.gz

We have used cURL as OSX does not support wGet. Remember the -0.

You will see if download like this…

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 51 85.2M   51 43.4M    0     0  47790      0  0:31:10  0:15:54  0:15:16 52563

Once the download has completed, uncompress it with this command:

tar -zxvf php5-5.2.5-6-beta.tar.gz

Making sure that the file name represents the downloaded file name.
(z = gunzipp, x = uncompress, v = view, f = force ).

View the dir;

ls

You should get a directory looking like this;

OpenSourceLicenses	include		mysql-5.0.51b-osx10.4-powerpc
OpenSourceVersions	lib		php5
bin			mysql		php5-5.2.5-6-beta.tar.gz

Go into the PHP5 Directory; Then view the dir.

CD php5
ls
bin			etc		info		libphp5.so	php.d
entropy-php.conf	include		lib		man		share

Then Copy the entropy-php.conf file in to the Apache2 Dir installed by Apple.

cp entropy-php.conf /etc/apache2/other/

Now we need to tell Apache to use our new version of PHP and not the original Apple build.

cd /etc/apache2/

Open the httpd.conf and comment out the following line.

LoadModule php5_module        libexec/apache2/libphp5.so

by placing a # in front of it.

#LoadModule php5_module        libexec/apache2/libphp5.so

To Save your changes press “ctrl x”, there will be a prompt to save, press “y”, then press “return” to save with the same filename.

Now restart Apache with this Command

apachectl restart

And we are done.

Installing PHP and MmySQL Summary

Begin writing your PHP/mySQL applications.

You can access your local Apache environment at two locations:

http://127.0.0.1/		/Library/WebServer/Documents/

or for your User account:

http://127.0.0.1/~username/		/Users/username/Sites/

Enjoy :)