Changing the system’s default settings for html files (safe)

Apple, Leopard, Mac, Tips, how-to 1 Comment

With Leopard 10.5.1, Apple’s developers changed the default status of html files downloaded from the internet from ’safe’ to ‘Unsafe’.

While this may make sense from a security standpoint, for somebody like me that processes hundreds of html files downloaded every day, it’s a big annoyance.

I filed a bug with Apple, asking for a workaround. I was hoping that they would implement a preference somehow to enable me to either override the default settings or allow me to specify trusted servers.

Tonight, three months later, I received an answer and the workaround that I was looking for.

I turned out that you could have a user specific file to override the system’s default settings. The file is not there normally, so you would need to create it. It is:

~/Library/Preferences/com.apple.DownloadAssessment.plist

The contents of the file need to be:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>LSRiskCategorySafe</key>
<dict>
	<key>LSRiskCategoryContentTypes</key>
<array>
	<string>public.html</string>
</array>
</dict>
</dict>
</plist>

Hopefully that helps somebody else with this type of problem.

If you need to change the settings of other file types, here are the system-declared file types:

System-Declared Uniform Type Identifiers

For each type you add another <string></string> item to the above array.

For example, for jpeg2000 files you add:

	<string>public.jpeg-2000</string>

Right below the other <string> line.

For more info on how this works and other variations, you can go to this page:

Modifying Safari Safe Files

1 Comment

iPod Touch fails to connect to Airport Extreme 802.11n

Tips, Troubleshooting, how-to, iPod Touch Be the first to Comment

Over the holidays, I received an iPod Touch as a gift, and let me tell you, that little sucker is extremely useful as an internet device. Keeping tabs on my sites where I could find Wifi is great.

However, a couple of days ago, it stopped being able to access the internet through my home wireless network. My wireless network is created by an Apple Airport Extreme

First I thought that the Touch had a problem. I reset it few times to no avail. And then I discovered that I could connect to an open Wifi point in the neighbourhood; which made things really frustrating. The Airport Extreme had been, up to that point, the best Wifi system I’ve tested.

A couple of days worth of search on Google netted no solution whatsoever.

Out of desperation, I started messing with the Airport’s settings. Lo and behold, changing the Wifi channel from automatic to ‘Channel 9′ fixed the problem.

Update: As it turned out, the airport needed restarting the hard way. After multiple instance of losing contact with the Touch, I unplugged it for 5 minutes and after plugging it back in, I haven’t experienced any problems with the Touch going on the net.

Be the first to Comment

Leopard’s translucent menu bar

Leopard, Rant, Tips, how-to 1 Comment

One of the ugly new interface “features” of Leopard is its translucent menu bar. In my opinion it’s ugly, distracting and serves absolutely no useful purpose. I have no clue why any sane person at Apple would want to implement it.

There have been many complaints about it on the internet since Leopard reached people’s hands; and unlike the shiny Dock, so far, the menu bar has no workaround to fix the problem and make it opaque.

However, I found a very simple solution after two minutes of looking at this annoying eye sore.

It’s simple. Open your desktop picture in any image editor and fill the top 22 pixels with white. Now because the system caches the desktop image, the change won’t appear until you log out, or simply go to the System Preferences and through the Desktop & Screen Saver panel, select a different picture for your desktop and then select your original white top image again and done. You’ll have a white menu bar without the visual clutter.

1 Comment

Apache PHP and Mysql on Leopard

Leopard, Tips, how-to 75 Comments

Leopard brings one big change to web developers working with Apache, PHP and Mysql on the Mac. Apache 2 comes with Leopard along with PHP 5.

Here is what to do to restore a test environment.

First, you need to enable PHP.

Apache’s .conf file moved from /private/etc/httpd/httpd.conf to /private/etc/apache2/httpd.conf

Open this file with your favorite text editor and uncomment the line:

# LoadModule php5_module libexec/apache2/libphp5.so

You don’t need to add the mime type for php, because it’s already done for you under leopard. The last line in the .conf file is:

Include /private/etc/apache2/other/*.conf

The ‘other’ directory contains a .conf file for php5. That takes care of the mime type and the index.php configuration for php sites.

If you develop multiple sites and you need virtual hosting functionality, scroll down to the end of the .conf file and uncomment the following:

# Include /private/etc/apache2/extra/httpd-vhosts.conf

That’s all the modification that I had to make to to the httpd.conf file.

Next, you’ll need to setup whatever virtual hosts you have in the virtual hosts file /private/etc/apache2/extra/httpd-vhosts.conf

For example, for each line that you set up in your hosts file like so:

beta-site-1.com 127.0.0.1

You need to make an entry in the httpd-vhosts.conf file like so:

<VirtualHost *:80>
   ServerName beta-site-1.com
   ServerAlias www.beta-site-1.com
   ServerAdmin webmaster@beta-site-1.com

   DocumentRoot "/Library/WebServer/beta-site-1"
   ScriptAlias /cgi-bin/ "/Library/WebServer/beta-site-1/cgi-bin"
   <Directory "/Library/WebServer/beta-site-1">
     Options FollowSymLinks MultiViews Includes
     AllowOverride All
     Order allow,deny
     Allow from all
   </Directory>
</VirtualHost>

One good thing is that the ‘upgrade’ install of Leopard does not mess with your hosts file, so whatever virtual domains you may have set up won’t be affected.

If you had Mysql installed previously, good news too, Leopard’s installer won’t touch it. I found mysqld running just like before the upgrade.

One thing changed with Leopard is the socket for Mysql. It moved to /private/tmp, so you may need to configure your php.ini file to point it to the new location.

To do so, open the file ‘/private/etc/php.ini‘, (if no such file exists, then make a copy of ‘/private/etc/php.ini.default‘ naming it ‘php.ini‘) and edit that.

You have two lines to modify:

mysql.default_socket =

becomes:

mysql.default_socket = /private/tmp/mysql.sock

and mysqli.default_socket =

becomes:

mysqli.default_socket = /private/tmp/mysql.sock

of course, from the sharing pref pane, stop the server and restart it and voila!

75 Comments