Archive for the ‘Mac OS X’ Category

Google API’s and Mac

July 7, 2008

I have an old iMac that I’ve been using as a server. Because I like Linux, and because it was easier to configure LAMP (Linux, Apache, MySql, PHP) than the similar components in OS X, I installed Kubuntu 6.06 on it (I’ve always liked the KDE desktop better than the Gnome desktop, which is the default for Ubuntu). Everything was fine until I decided I wanted to try out a Google API.

Google APIs require PHP 5.1.4 or higher (actually it was needed for the Zend engine, which is required for the Google API). But Ubuntu 6.06 (and Kubuntu 6.06) didn’t have upgrades to PHP 5.1.4. After a lot of trials and failures, I decided to fall back on Apple’s OS X and install MAMP (Mac, Apache, MySql, PHP). This particular machine could only take OS 10.3.* on it, which limited the MAMP I could use. But it included PHP 5.1.6, so I was happy. For a while.

I got everything up and running again, and even figured out how to get local network access working. Then I got back to the Google API. The first step, with MAMP, however, was to secure it, since the default install is with user “root” and password “root.” So far, that wasn’t a problem since MAMP on this computer was only accessible on the local network, firewalled from the Internet. But using a Google API requires access to and from the web.

The MAMP application has a FAQ page, accessible from the start page, that looks really helpful, but isn’t. You can get there by clicking in the FAQ button at the start page:

MAMP start page

Of course, the part about which versions of the included programs are installed is helpful. But I had already checked that before I downloaded MAMP. It’s the part right below that, under the “How can I change the password for the MySQL database?” that is unhelpful.

MAMP FAQ page

First of all, mysqladmin is not in that location (/Applications/MAMP/bin/mysql4/bin/mysqladmin). It’s in /Applications/MAMP/Library/bin. The php config file location is closer to what’s listed: /Applications/MAMP/bin/phpMyAdmin/config.inc.php

Second, trying to run the suggested command in tcsh got me nowhere. It turns out the default shell was changed to bash in OS 10.3, but upgrades (which this is) keep tcsh as the default. Fortunately, bash is available, but the default has to be changed in the terminal preferences.

So, just to make sure bash is really there, go to the /bin directory in the terminal (using the Finder will just show the documentation):

bash in the Finder

Change the directory to root level by typing “cd /.” Then type “cd /bin” to get to the /bin directory. Then type “ls” to list everything in that directory (see bash listed in the screenshot):

While the terminal is open, go to the Terminal preferences:

Preferences

Notice the path listed is for tcsh:

tcsh set

Change it to /bin/bash:

bash path

Close the Preferences window, quit the Terminal application, and relaunch it. bash will be at the top of the Terminal window instead of tcsh now.

Now running the command listed in the FAQ page (with the path modification) will change the password in MySQL.  But before you actually press the Enter key to run the command, highlight the new password and copy it using the edit menu at the top of the screen.

/Applications/MAMP/Library/bin/mysqladmin -u root -p password NEWPASSWORD

(where NEWPASSWORD is the password it is to be changed to). The php config file will also need to be edited. I have eMacs on this machine, which worked nicely.  Don’t try to do it in Text Edit.  That will not work nicely at all.  Open the config.inc.php file (in MAMP’s phpmyadmin folder) in a code editor like bbedit or emacs. Find the lines

$cfg['Servers'][$i]['user']           =   'root';          //MySQL user
$cfg['Servers'][$i]['password']       =   'root';         //MySQL password

Replace ‘root’ in the password line with the one you copied. Save the file and close it.

Now, according to the MAMP faq page, it’s finished. Not.

It turns out there’s also a couple scripts to change in MAMP, documented over on network0.  There’s also a handy section on securing MAMP itself by password protecting the htaccess folder using an online .htaccess password tool (http://www.tools.dynamicdrive.com/password/).  So now that I’ve got it locked down it’s time to figure out how to open it up for Gdata on that Google API.  🙂

Advertisements

Online video clips

July 4, 2007

It’s time to share the pain here.

I have been trying to convert my presentation from the ALA preconference program two weeks ago to a video clip and make it available online, following a suggestion from Susannah Fox.

Converting it to a quicktime video wasn’t so bad, except that converting the whole thing creates a rather large file. So I decided to split it up. I finished part 1 and uploaded it to YouTube for a test, and linked to it from the North County Regional Library Sandbox to see what it looks like embedded in a page. Unfortunately, after many trials and gnashing of teeth, I have found that no matter how good the quality is, once the clip gets into YouTube, it is reprocessed and scaled down to a resolution of 320 x 264. The problem is that clips display in a larger window, so it has to scale back up, and becomes blurry.

For anyone interested in a how to do it, Clay Redding pointed me to this post on Digital Life: From iMovie to YouTube a.s.a.p.. Although I was exporting from Keynote to Quicktime, I was then importing it into iMovie and exporting it again in different formats. I finally just used the custom settings on the Keynote export window. It didn’t make any difference to YouTube. So I tried Google Video. As long as it displays at the “original” size, which is about half the size of the space it displays in, it is sharp. But like YouTube, it gets blurry when scaled up.

So, while I work out the issues involved in getting a good copy up and displayed, here are some pointers on exporting from Keynote for anyone who many be interested:

First, make sure everything transitions automatically, including the slides, and any “builds” within the slide. This means change any “click” transitions to automatic, and give them specific transition times:

Inspector box in Keynote

When you have it ready, or want to take it for a test spin 🙂 go to the file menu and select “Export”

Export from Keynote

First, note all of the options. Exporting to PowerPoint works fairly well, but you will have to do some cleaning up afterwards. PDF is good for creating a set of printed handouts. Images and HTML are totally useless if you have any animation, sound or builds in the presentation. I tried the iDVD option simply because I had never used it. It might be what you want if you like a pre-canned delivery with limited options after the fact. The Flash export actually worked very well for me, but unless you are uploading to your own website, rather than linking to an online service like YouTube, it is not much use.

Custom drop down menu

O.K, so once you choose Quicktime, you can get to the custom settings by clicking on the Formats drop down menu and clicking on “Custom.” The Custom Quicktime Settings window will automatically appear.

You can go with the automatic size settings, or choose “Custom” from the drop down menu for video (this part of the presentation did not have any sound, so I selected “No Audio”), and put in specific numbers. It helps to keep a 4:3 ratio (which gives 1.3333~ when the width is divided by the height). In fact, Google Video pretty much requires the 4:3 ratio.

Export dialog window

Click on the “Settings” button to get to the real meat. If the Data Rate box is set to Automatic, you will have control over the Compressor quality (in the box on the bottom). Set it to Best Quality (multi-pass)

Custom settings, automatic data rate

Even if you set the compressor quality to best, it will change back to high if you select a specific data rate:

Custom settings, specific data rate

(Google Video requires at least 260 Kbps, but prefers 750). You can change the compression type; I tried some of the others, but the H.264 worked best for me. If you are going to import it into iMovie, you might be tempted to just use no compression. Don’t do this unless you are using a superfast processor with a gazillion gigs of RAM. It tries to create a file that is about 4 or 5 gigabytes (and that’s just from a small presentation), and will just freeze keynote.

Custom settings, compression options

You can also choose a different frame rate (the box on the left). It will default to 12 or 15. I suspect YouTube and Google Video just step it down to 15 no matter what is selected, although Google Video specifies “at least 12 frames per second.”

Custom settings, framerate options

Once you have all your selections set, click the OK button, which will take you back to the Custom Quicktime Settings window. Click the Next button and choose a place and file name, then click the Export button. You can sit and watch the progress in slow motion, but it might be a good time for a long break walking the dog or something:

Export progress window

It will take a while, and use a lot of processing power (the fan on my MacBook always kicks in after a minute or so until it finishes the export). If you want more options, select the highest quality compression, and import it into iMovie, where you can make further adjustments. Editing in iMovie may be another post, once I get the second part of the presentation done, which has a lot of animation and sound. 🙂

Flock browser for Macs

May 26, 2007

I have been slogging through applications, plug-ins, extensions, and widgets for anything related to blogs and blog posting on Macintosh (OS X). Since I download anything that looks like a possibility as I come across it, I invariably end up with a lot of stuff sitting around waiting for my attention. Sometimes it may be weeks before I actually get to a downloaded file, and have no idea what it is or why it’s there until I install it and try to use it. Such was the case with Flock, a browser for quick picture uploading. But it had mentioned something about blog posting (which is why I downloaded it).

So here’s the first post from Flock! The blogging part isn’t as obvious as the photo-uploading features. In fact, it looks like the blog part is really supposed to be an enhancement to the photo-uploading feature (you can drag and drop a photo you find on the web into a web-snippet bar to “hold” it, then drag it from the snippet bar into your post). But it’s findable through the menus, or the customizable toolbar. It pops up a blog editor which operates in editor mode or source code mode (for those who like to have total control).

The browser itself is like Safari and Firefox in the look and feel. It supports tabbed browsing, and will import your bookmarks from Safari or Firefox when it is installed. It even has extensions, like Firefox. In fact, on the site, there’s an interesting promise and caveat (snipped via the Flock websnippet tool):

Very soon you will be able to add your favorite extensions and we’ll convert them on the fly for you. Extensions written for other platforms can still be used in the Flock browser, but there is no guarantee that they will work correctly.

So for Mac bloggers, here’s the site:

Flock

[addendum: the tagging tool is for technorati tags only, so I had to edit the post here to add my own tags ]

[addendum #2:  once I had posted, my categories showed up in Flock.  Unfortunately, I can’t add categories, but it does show the ones I have already used on the blog.]

technorati tags:, , , , , ,

Old World Mac

February 9, 2007

I actually have a couple of these hanging around (all the way back to a Mac Classic II!) But they’ve stayed in the background as I play with machines that are more likely to be still in use today. A couple weeks ago a friend mentioned he had an old powerpc and, being a windows guy, didn’t know what to do with it. So, trying not to look too excited, I offered to help him out, thinking, “Yes! Another linux box!”

When I showed up at his “warehouse” (he’s got about 50 computers at any given time, in various stages of completion), he took me to the latest delivery items, carefully stacked up, and pulled out a beige powerpc. We went to plug it into a monitor, when we noticed the adaptor plug for the monitor. As he went to look for a Mac mouse, I thought, “Uh oh, this bodes ill.” But it booted up, displayed on the monitor, accepted the mouse, and was running Mac OS 9.2.

Blinking through the fog covering my memory of OS 9, I got to the control panel and was able to see it had 384 MB of RAM, and at least 4 GB on the hard drive. As I was trying to remember where to find the processor information, my friend, who was in a hurry to pick up more computers, suggested I take it with me and work on it. The only proviso: I’d have to give it away (which is what he does with all the computers he refurbishes).

So home it went with me. I got a monitor from my dad (with the same give-away requirement) and found an old mac keyboard and mouse. The first thing I did was pop in an OSX disk just to see if it could install. OS 10.2 did fine, but there was a smug little message when I tried to upgrade to 10.3, telling me it just wasn’t going to work out. But I found it actually had a 6GB hard drive, and did indeed have 384 MB of RAM, as well as a 233MHz processor. There was a CDROM and floppy drive, a modem port for an external modem, an ethernet card, and serial ports. No firewire. No USB.

There was some more “This bodes ill” thinking as I started looking stuff up on the Web, and found just what Old World Mac means. Yeah, you can get Linux on them, but they’ve got to have OS 9.2 on them because that’s what Linux boots from, and it’s a real bear to get it on and working (I checked both Mandriva and Ubuntu). Figuring whoever got the computer would probably be happier with OS 10.2, and without the headaches of Linux on an Old World Mac, I abandoned that effort.

The OS9 disk has a nifty little feature in its Initialize Disk tool: write zero’s on the disk to completely wipe the disk for a totally clean install. But it’s hidden in the menus when you get to the Initialize window. So I went looking, found it, and let it run. It took at least an hour. Then I created two partitions: one 200 MB, and one 5.8 GB, both with the HFS+ file system.

I installed OS9 on the larger partition, then downloaded the 9.2 upgrade. Knowing some of these older computers do not like burned disks, I burned a copy of the 9.2 upgrade at 2X. It worked fine, except version 9.2.2 requires version 9.2.1 be installed first. Back to the Apple site, and pop in another CD-R.

After getting everything upgraded to 9.2, I moved the system folder to the smaller partition. Then I installed OS 10.2 on the larger partition. There was about 3.75MB left over. I stretched an ethernet cable across the house and plugged it in to get the rest of the OS updates. It still had Internet Explorer set as the default browser. So I downloaded Firefox and made a few changes to the dock. Then I went looking for someone to give it all away to.

Hello Freecycle! I posted a message in the local Freecycle, and the setup was picked up 5 days later. I threw in a couple unused program disks I had laying around, and a copy of Software for Starving Students. He seemed happy. And now I know all I want to about Old World Macs.

Network printing

October 14, 2006

Somewhat off-topic, but one of the issues going on here.

I have 3 Epson printers here. I’ve spent about $100 on ink for them, and none of them will work. I’ve since found out that Epson printers are so bad there’s a class action lawsuit. Meanwhile, we needed something more than the Canon photo printer that’s left. So I figured I’d get (1) a laser printer and (2) a wireless print server so we can all use the same printer. Staples had a great deal on a Samsung laser printer, and a Netgear wireless print server on sale as well. Together they cost about what I’d spend on Epson ink in a year.

We’ve got a Linksys wireless network, with an iMac connected by ethernet (doesn’t have a wireless card in it) and a Windows machine connected wirelessly. There’s also an Apple Powerbook and an Apple G3 without wireless cards. Both have OS X and Linux on them, but only the laptop, being portable, can be connected to the router, via ethernet.

The print server has extra ethernet ports so computers like the Apple G3 can get a wireless connection through the print server. Seemed like a good idea to me: set up the printer and print server where the Apple G3 is and get networked printing with a bonus wireless connection for one of the Apples. The Samsung has drivers for Windows, OS X, and Linux. The Netgear print server only has a Windows setup option. Of course, once it’s set up, it doesn’t matter where it’s connected.

I almost succeeded in getting the Netgear print server set up on my own. I ended up spending about 4 hours on the phone with tech support before we figured out what the problem was: the MAC address listed on the back of the box is for the ethernet connection. The wireless MAC address is different, and can only be found by accessing the print server after it’s set up. Once that was cleared up, the networks talked nicely to each other (I have restrictions on the wireless network by MAC address, as well as WPA).

Next was getting the Apple G3 connected. No problem there, except that, even though the computer had a wired connection to the print server, and had the Samsung drivers installed, it couldn’t find the printer. I found instructions at Netgear for connecting on Apple OSX version 10.4 (Tiger), and got the iMac printing, but the other two Apples are running OSX version 10.3, and the printer setup is different. I booted the notebook into Linux, popped in the Samsung CD, and started the “Autorun” I found on it. It installed all the drivers and asked if I wanted to set up a printer. So I went through its setup wizard, which was easier than the Mac setup, and printed a test page! (Cheers for Samsung!)

I’ll get the printer set up in Linux on the other Apple. I’m not sure I want to take the time any more to get it working on the older Apple OS. Samsung made it so easy on Linux, but Netgear can barely accommodate one Mac OS version, much less Linux. So kudos for Samsung, and black marks for Netgear! If you’re looking for a print server for a mixed network like mine, you should probably investigate other brands, even if Netgear does have a better price. And if you’re looking for a basic laser printer, you should definitely look at Samsung.

Update (Sept.9, 2007):

After almost a year with the setup, the biggest problem has been the Netgear device arbitrarily deciding when to accept connections. It seems almost random. Print jobs will fail to go through (and sit in a queue on the computer). I try connecting directly to the Netgear device, but when it’s “down” it doesn’t respond to anything, even from the computer that is connected via an ethernet cable. But then a new print job will go through successfully and everything works fine (including printing the backed up print jobs), for a few days, anyway. Then it’s back to trying to figure out a way to wake up the printserver.