Archive

Archive for the ‘Tech Tips’ Category

Zend Server 4.0.6 + Framework 1.9 and PDO_MYSQL on Mac OS X always defaults to /temp/mysql.sock

December 8, 2009 Leave a comment

I always get an error like the one below when I first run Zend Server with a Zend Framework 1.9 app.

Fatal error: Uncaught exception ‘Zend_Db_Adapter_Exception’
with message ‘SQLSTATE[HY000] [2002] Can’t connect to local
MySQL server through socket ‘/tmp/mysql.sock’

Of course, recompiling PHP and so on might fix it, but I found, for time’s sake, it’s simpler to just to issue the command from the terminal. (You’ll need to be admin or know an admin’s password).

sudo ln -s /usr/local/zend/mysql/tmp/mysql.sock /tmp/mysql.sock

If you’re fed up of running this command every time you log in, just download Lingon and create a task that runs automatically on boot or login.

Rev. A iMac 17″ G5 1.6GHz doesn’t sleep or power up consistently

October 8, 2009 Leave a comment

imac-g5I’ve just been given a non functional iMac which wouldn’t switch on from a friend. It’s an iMac G5 17″ 1.6GHz first edition (Rev A) and on the assumption I could get it working, I offered her some free English lessons!

I opened her up and took a cursory look.

For those of you who have never owned a first ed. G5 iMac, they are a feat of user serviceable engineering. The interior design is as beautiful as the exterior, without a wire in sight.

iMac G5 rev. A 17 inch interior

Three screws and the back comes off, revealing a completely modular design. Practically every component is user serviceable and replaceable, which is a good thing since the Rev As were remarkably prone to failure, apparently!

The machine itself looked rather battered and yellowed with smoke (the previous user is a smoker) but was in really good condition considering its age, since she had thoughtfully opened it up once every few months to vacuum inside!

However, it just would not power up unless the power button was pressed repeatedly.

On plugging it in with the back off, the first of four status LEDs was on, showing a trickle current. But shorting out the power button connectors didn’t power it up like it should until a random number of presses.

iMac G5 17inch diagnostic LEDs

Moreover, the machine would shut down the moment it was put to sleep.

After brief research, the main culprit appeared to be power supply, or more precisely a set of blown capacitors which came from a batch of fakes sold under a Japanese brand name to Dell, HP and Apple during 2004.

I pulled out the old soldering iron and replaced them with superior rated ones, one by one, testing in between.

All was hunky dory until I went to replace the final capacitor. In my excitement (!) , I forgot  to discharge the power supply, got a spark when I touched it with the soldering iron, and all was over. The thing was dead.

I decided to give up on the repair and contacted Apple to see if they would sell me a new one. No dice. In Japan, Apple is not obliged to supply user replacement parts since consumer rights are non existent. Instead I would have to ship it to them, looked at, have random parts replaced, all at my expense. They warned me that the cost would be a minimum of 48,000 yen or about 500 dollars.

Pay that? Not on your nellie.

Instead, I ordered one from http://www.macproonline.com for $120+postage on Thursday night at 2am and it arrived at lunchtime on Monday.

A five minute swap later (details available on Aples’s G5 iMac support site) and the thing has worked perfectly since!

A little disappointing, but still cheap.

Solution to the noisy fans on a Core 2 Duo Intel Mac Mini

April 20, 2009 22 comments

mac_mini_intel_core

As those who’ve been reading my blog may know, I started my conversion to the other side (Mac) on the 28th of Feb, 2005 with the purchase of a 1.42 GHz Mac Mini after gushing over my now wife’s 12″ Power Book.

I was taken by its size, it’s sleek lines, OS X and last but not least, its comparative silence next to my air moving PC.

I kept this machine for 3 years before handing it over to my brother in a vain attempt at getting him to move into the digital world (he is an artist of insane calibre, but with zero digital knowhow).

To replace it, I bought an Intel Mac Mini when the Core 2 Duo models were released.

Since then, I’ve been enjoying trouble free compting, but have had only one issue with my machine.

It’s an issue that started the moment I upgraded the RAM from its inital 1Gb to 2Gb and Continued after a further upgrade to 3 and then 4Gb.

That issue is a fan that revs up as soon as the system comes under even minor stress, drowning out the sound of my beige box Windows 3GHz P4 system with 4 hard disks!

I’m not talking about a fan that revs up and gets loud shortly after booting and stays loud constantly, I’m talking about a fan that revs up as soon as the system shows even a modicum of activity.

With the supplied 1Gb stick of RAM, this issue did not occur, but add a second stick and the fan goes berserk at any opportunity. The fan revs up so much that the CPU, GPU and HDD actually cool down below their respective idling temperatures!

Anyway, there is a Really Simple Solution (TM).

Step 1: Download and install SMC Fan Control.

Step 2: Open a terminal window

Step 3: type the following:

/Applications/smcFanControl.app/Contents/Resources/smc -k F0Mx -w 3e80

And your fan will become a much more sedate affair.

Why? Because this limits your fan to about 4000 RPM rather than the ear numbing 5500 RPM it is usually capable of.

A 20% or so reduction doesn’t sound much, but remember that fan noise often has sometimes a squared or cubed relation to rotational speed, and that ignores a system working at its mechanical limits, so even a minor reduction can give big gains!

Try it and see.

For the curious, the 4 digit number after the -w is:

HEX (Base 16) : Fan Speed x 4

If you set the speed too low, I recommend installing ANOTHER FAVE OF MINE, Temperature Monitor to keep an eye on your newly silenced computer, especially in summer.

Safari 4 and Hotmail Problem – Can’t Open Mail

March 27, 2009 2 comments

Although you can log in to Hotmail with Safari 4, you may find that you can’t actually read messages: They won’t open when you click on them.

If this is the case, there is a simple solution.

  1. Restart Safari to clear your hotmail session.
  2. Open Safari >> Preferences menu
  3. Click on Advanced
  4. Enable the “Develop” menu by clicking the check box and close the settings box.
  5. Select Develop >> User Agent >> Opera 9.63 Mac
  6. Browse to hotmail.com or whatever you use.

You should now be able to access Hotmail Normally.

>> Remember to change your User Agent Back to Safari when you leave Hotmail if you are a fan of Browser statistics.

Zend Framework : Zend_Mail Japanese encoding(文字化け)issue with garbled text

January 6, 2009 4 comments

I had a problem with Zend_Mail garbling the titles and text of all my Japanese mails. It was a simple fix just by extending the Zend_Mail class and overlaying your methods on the default class methods and changing defaults to ISO-2202-Jp which is the standard here in Japan.

Don’t forget to convert the body text which may have been pulled from form input fields before sending.

Also, make sure that you “return $this” for each of your functions to ensure that

  $mymail->setBody()->setSubject()->setFrom()->etc command chaining works (fluid interface, I think is the term).

require_once (‘Zend/Mail.php’);

class My_Jmail extends Zend_Mail {

  public function __construct($charset = 'ISO-2202-JP') {
    parent::__construct ( $charset = 'ISO-2202-JP' );

  }

  function setBodyText( $txt , $charset = null , $encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE ){
    parent::setBodyText( mb_convert_encoding($txt, 'ISO-2022-JP', mb_detect_encoding($txt)) , $charset , $encoding );
    return $this;
  }

  function setSubject( $txt ){
    parent::setSubject( mb_convert_encoding($txt, 'ISO-2022-JP', mb_detect_encoding($txt)) );
    return $this;
  }
}

 

 

?>

I must confess that I know the mere basics of encoding and what goes on behind the scenes and was stumped for a while when Tomoko complained that all the mails from our website’s enquiry form on:

  http://cafe.sunnysideenglish.com

were garbled in Apple Mail.

As a curiosity, using Apple Mail, your emails will still be garbled if you choose ISO-2202-JP since Apple Mail -or something- converts the ISO-2202-JP into UTF-8.

Thus, my computer (set to English/UTF-8) read the mails fine whilst Tomoko’s computer (in Japanese Auto Detect) showed Japanese mails all garbled! Come on Apple… Get your “auto” detect house in order.

Categories: Tech Tips, Technology

Updated links for installing Japanese Version of Sony SonicStage 4.4 with Japanese Mobile Phone Support

January 2, 2009 2 comments

I have updated this document with new links to the Sony official SonicStage repository:

https://nanchatte.wordpress.com/2008/01/19/installing-japanese-sony-sonicstage-on-english-windows/

This document tells you how to force Sonicstage 4.x to install on an operating system with a different language.

Bear in mind that it won’t translate the program to English, but you do get all the Japanese drivers for Japanese mobile phones.

Thanks to reader Julieta for pointing my broken links to me.

Categories: Tech Tips, Technology

Another stupid Office 2008 (Office:mac) Formatting Bug

September 22, 2008 Leave a comment

Check this one out. I’ve been using change tracking to make sure I know who’s doing what to which file.

I had some text in a small box at the top of the page and wanted to colour that box’s text in red to make it stand out.

A simple enough request, you’d think.

Unfortunately, change it to red and the Whole Flipping Document (TM) turns red!

I’ve found several bugs while in change tracking mode. It’s far easier to return to regular editing mode, make the changes and then come back. You’ll not have those changes recorded, but at least the changes will be applied properly.

Office 2008 really isn’t ready for prime time.

How to fix the ARD toolbar buttons/functions missing from Screen Sharing under OS X 10.5.5

September 18, 2008 1 comment

I’d like to thank a couple of my readers for telling me how to remedy the problem of the ARD Screen Sharing toolbar function hack that can no longer be applied once one upgrades to OS X 10.5.5.

The solution is glaringly obvious and I’m a bit annoyed I didn’t spot it myself.

Just use Time Machine and search for the Screen Sharing application, located in /System/Library/CoreServices/Screen Sharing.app and return to an older version of the app!

You gotta love Apple for handing you the solution on a plate.

Alternatively, dig out your Leopard DVD and pull it off there.

You’ll apparently get bugged by an upgrade screen.

I had read that Apple were trying to cut down on “Frankenbuilds” using software from different versions of the OS, but I guess this is still OK.

I’d like to try this, but since I have a nice, fully functional ARD 3.2 installed there’s not much point for me!

Still, I may try it one day. Let me know how you get on with these tips.

Categories: Mac, Tech Tips Tags: , , , , ,

Tech Tip: WordPress 2.5 comments awaiting approval don’t appear in admin panel

June 24, 2008 1 comment

If you find that comments awaiting moderation are not showing up in the admin panel of WordPress 2.5.x then you need the following fix to be applied to your WordPress database.

Use PHPMyAdmin or another too to connect to your WordPress database and issue the following SQL command:

create index comment_date_gmt on wp_comments(comment_date_gmt);

You should find that comments now display correctly in the admin panel.

Categories: Tech Tips Tags: ,

Enable Time Machine backup to Samba (Windows) Shared Network Volume

June 4, 2008 Leave a comment

 

time-machine-icon

To enable Time Machine backup across a network, simply open Terminal and type in the following. You will need admin privileges and to type in your password.

sudo defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

To disable Time Machine backup across a network, open terminal and type in the following. 

sudo defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 0
 
Categories: Mac, Tech Tips Tags: