SubClosure

{ Don't Repeat Yourself ! }

Browsing Posts in Uncategorized

I recently had to set up a new mac for web development.
Its always such a hassle to find it all again and I ended up spending much more time then anticipated.

Here is a quick reference list of what steps I took. Following this list will get you going in under one hour plus all software is free.

 

  1. install cyberduck for transfer and remote synchronization
  2. install xampp for a complete LAMP setup
  3. install eclipse pdt for a great php IDE
  4. install eclipse subclipse plugin for your svn projects
  5. install aptana plugin for all web development
  6. install textwrangler as a general purpose text and code editor with remote support
  7. install firefox with firebug plugin for debugging your html/css/javascript

After that also download some great php libs to include in new php projects:

  1. redbean – database orm
  2. ezql – easy database interface and abstraction
  3. phpmailer – probably the best email lib for php
  4. phpunit – unit testing
  5. simplepie – rss parser and rss creation
  6. php thumbnails – great for image uploads

just rediscovered my good old friend yoxos for downloading customized eclipse packages.
http://eclipsesource.com/en/yoxos/download-yoxos-5/

It allows to save profiles for installing the same eclipse configuration across multiple computers which saves heaps of time.

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.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes