SubClosure

{ Don't Repeat Yourself ! }

Browsing Posts in Uncategorized

Safari, Chrome and Firefox work great with the facebook like button.

But to get internet explorer to display it I had to add the facebook namespace to my html tag.

e.g.
<html  xmlns:fb=”http://www.facebook.com/2008/fbml”
xmlns:og=”http://opengraphprotocol.org/schema/” … >

 

I recently had to install a piece of new software on an older debian etch system.
Debian removed the distribution from its main update servers and aptitude or apt-get wouldn’t work anymore.

I could have upgraded the system to the latest debian stable version through an dist-upgrade.
But following the rule to never touch a running system I decided not to. It could have taken quite some time and possibly resulted in a crashed server.

Fortunately it is possible to still access old debian distribution files through the debian archive.

All that is required is to change the apt-sources file and replace lines like this one:

deb http://mirror.cc.columbia.edu/pub/linux/debian/debian/ etch main contrib

with

deb http://archive.debian.org/ etch main contrib

now the package manager will work again and you can safe yourself a dist upgrade for some quieter time.

When using Apache-SSL Certificates you typically have to create a password when initially setting up the certificates on your server.
Unfortunately after configuring apache to use the certificate it will promt you for the password each time it starts.
This means your webserver will not run if the system reboots automatically without you having to log in and start it with the password manually.

Luckily there is an easy way to remove the password from a ssl key.

Just find your key and use this command to create a new key without password:

sudo openssl rsa -in mysslkey.key -out mysslkeynopassword.key

Then change your apache configuration to use mysslkeynopassword.key instead of the one with password and apache will start automatically again.

Obviously there is a security risk involved. So make sure no evil gets access to your new mysslkeynopassword.key file.

  1. Go to the Apple Menu > System Preferences > Network
  2. Click the “+” symbol on the bottom left
  3. Under “Interface” choose “Bluetooth PAN“. Under “Service Name” put what ever you want. Click Create. Close the Network screen.
  4. Ensure Bluetooth tethering is On within your iPhone 3G/3GS and that Bluetooth is On within your Mac.
  5. Navigate to the Bluetooth menu item on the Apple Menu Bar and highlight your iPhone 3G/3GS and click “Connect to Network”.

It is not possible to use self closing div tags.
Browsers will interpret <div /> just as <div> , which will result in missing end tags.

So dont even think about something like:
<div style="clear: both;" />

After some testing I found that the EncodeFile function within the phpmailer class is doing some strange magic_quotes stuff. It seems to screw up something and this results in missing content when sending mails with attachments using phpmailer with amfphp.

I just removed all the magic quotes stuff and this simple function seems to work fine for me now:

/* fix for using phpmailer and amfphp together on php5 **/
private function EncodeFile($path, $encoding = 'base64') {
return $file_buffer = $this->EncodeString( file_get_contents($path) , $encoding);
}

I tried to install the pecl oauth extension on my debian box today with the command:

pecl install Oauth-0.99.9

and ran into a few problems:

  1. ERROR: `phpize’ failed – Solution:  apt-get install php5-dev
  2. sh: make: command not found – Solution:  apt-get install make
  3. make: *** [oauth.lo] Error 1 – Solution:   apt-get install libcurl4-openssl-dev



After that everything installed fine.

Download and install the PHP Apache Module provided by Marc Liyanage

http://www.entropy.ch/software/macosx/php

This package comes in handy if you want to use some advanced features like ZipArchive, XSLT, curl, etc
Apples default PHP  installation lacks all these useful extensions.
If you don’t want to spend time compiling PHP first, this package is a great time saver.

This does not seem to work with snow leopard.

After upgrading to Snow Leopard and a couple of hours headache, I finally got my custom AMP running again.
These are the problems I encountered and what I had to do to fix them:

  1. My Apache configuration files were completely overwritten. I had to recreate my vhost settings under /etc/apache2/extra
  2. MySql did not work anymore. I had to download and install the latest dmg image for 10.6 and then copy my databases into the new data directory under /usr/local/mysql-5.1.45-osx10.6-x86_64/data
  3. PHP was installed without php.ini and gave warnings about timezone settings – had to copy /usr/local/php5/lib/php.ini-recommended to /etc and set the date.timezone to my local timezone

I found this page quite helpful.

I have been looking for some tools that can create nice looking graphical reports of my server performance over time.
There quite a few useful command line utilities available such as sar, iostats, top, etc

But today I finally found what I was looking for.
The program is called Munin and here is a nice article on how to set it up on a Debian system:

http://www.howtoforge.com/server-monitoring-with-munin-and-monit-on-debian-lenny

Get Adobe Flash player