Archive for September, 2010

How to reset the SMC, NVRAM and PRAM on Intel Macs.

Sometimes resetting the SMC (System Management Controller) on a Mac can resolve an apparent hardware issue. I have found this to work sometimes, but usually it just delays the inevitable hardware issue. I have also documented how to reset the PRAM (Parameter RAM) and NVRAM (Non-Volatile RAM). This is usually one of the first things tried by an Apple repair technician.

Intel Mac notebooks with removable batteries:
1. Shut down the computer.
2. Disconnect the power.
3. Remove the battery.
4. Press and hold the power button for 5 seconds.
5. Release the power button.
6. Reconnect the battery and power.
7. Turn on the computer.

Intel Mac notebooks without removable batteries:
1. Shut down the computer.
2. Ensure that the power is connected.
3. Hit the Shift-Control-Option keys (on the left side) and the power at the same time.
4. Release all the keys and the power button at the same time.
5. Turn on the computer.

Intel desktop Macs:
1. Shut down the computer.
2. Unplug the computer.
3. Press and hold the power button for 5 seconds.
4. Attach the computers power cable.
5. Turn on the computer.

To reset the PRAM and NVRAM:
1. Shut down the computer.
2. Turn on the computer while holding the Command-Option-P-R keys (4).
4. Hold down the keys until you hear the startup bong for the second time.

Test Tweet with Yourls

Testing after yourls upgrade.

Upgraded Yourls from 1.2 to 1.4.3.

I finally upgraded Yourls in an attempt to get back to the Twitter plugin. Simple to upgrade.

Backup yourls directory location.
Backup yourls MySQL database.
Remove everything from your yourls location.
Unzip the new yourls software.
Copy the config_sample.php to config.php. The configuration files are location in the includes directory.
Modify the config.php with your site specific settings.
I had to modify the following definitions:
YOURLS_DB_USE
YOURLS_DB_PASS
YOURLS_DB_NAME
YOURLS_SITE
$yourls_user_passwords

And, because I was upgrading from 1.2, I had to add the following definitions:
define(‘YOURLS_DB_TABLE_URL’, ‘url’);
define(‘YOURLS_DB_TABLE_NEXTDEC’, ‘next_id’);

Go to your yourls site:
http://yourls-url/admin
Login and upgrade.

How to enable compression in an apache web server.

This worked great for me for all of my websites. I did this globally by adding the following in my /etc/http/conf/httpd.conf file. I had no other Location options enabled. I could do this by VirtualHost, buy opted not to for now, since I have very little upload bandwidth.

I took this, as is, from http://httpd.apache.org/docs/2.0/mod/mod_deflate.html.


# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems…
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won’t work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

# Don’t compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary

# Make sure proxies don’t deliver the wrong content
Header append Vary User-Agent env=!dont-vary

Return top

INFORMATION