Here is a helpful Subversion Command to set the svn keyword svn:ignore on all of the directories from a certain location.

svn propset svn:ignore '*' .

This has proven very helpful in situations where I have a web site that has a directory structure that is dynamic to the web application.

I do not want all of those files in version control as they are not the same from one deployment to the next.  They also typically match the database entries, which vary from one deployment to another.

Enjoy!

Once in a while in my high level application stack, web development world, I am thrown for a loop, and I have to venture down into the bowls of the LAMP stack, or MAMP stack in my case.  A client for the company I work for jWeb has a desktop application that their entire company uses all day every day.  This application is a win32 desktop application that is tied to a SQL Server 2005 database.  We are tasked with building a web application that ties directly to this database, and adds our own custom special sauce to the mix.  Needless to say the Microsoft Development platform is very windows centric, so I looked to an open source solution.  As I usually do when I search for a software solution to my problems, I found a champion, FreeTDS.  This software library allows linux (and therefore Mac OSX… freebsd is not linux I know) to be able to connect directly, not through ODBC, to SQL Server and execute sql statements (Stored Procedures too!!)

To give context to this solution, here is my current developer web server setup:

  • Mac Powerbook G4 running OSX 10.4.11
  • Apache/2.2.4
  • PHP 5.2.5
  • MySql 5.0.18

And here is my SQL Server Set Up

  • Windows XP SP3
  • SQL Server 2005 Developer Edition

Couple of pitfalls to watch out for here with regards to your SQL Server Development machine:

  • Make sure that SQL Server is running an listening via TCP/IP.
  • There are multiple ways of running SQL Server (Shared Memory, Named Pipes, TCP/IP, VIA), and it is essential that you have TCP/IP ENABLED.  I don’t know if it comes by default with TCP / IP disabled, but it was on mine so this will kill you before you start if you dont have this sorted out.
  • Change these settings by going to Start > Programs > Microsoft SQL Server 2005 > Configuration Tools > SQL Server Configuration Manager
  • Click on SQL Server 2005 Network Configuration
  • Make sure that TCP / IP is enabled.  You might have to restart SQL Server from the Services Panel in Windows Control Panel.
  • Make sure that you have Windows Firewall allowing port 1433 (default sql server port) or whatever you have it set to.
  • Here is the dooosey.  If you have a Cisco VPN client installed on this machine, there comes with it a Firewall, that will kill all port traffic.  This runs even when the VPN client is not currently connected.  To disable this, bring up the VPN client connection window.  A System tray icon will pop up for Cisco VPN, there is an option for “Stateful Firewall, (Always On)”  make sure this is UNCHECKED.

Ok, before we can upgrade to FreeTDS and compile it with connections to SQL Server we need to download the FreeTDS library.

Download from here (ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz).

Run these commands:

  1. cd /usr/local/src
  2. wget ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
  3. tar zxf freetds-stable.tgz
  4. cd freetds-0.82
  5. ./configure
  6. make
  7. sudo make install

This will install FreeTDS to you /usr/local directory.  It is important to put it in this location, cause of the following next steps.
Ok now, lets upgrade to 5.2.6 PHP.

Grab the source code from PHP.net.

Follow these steps:

  1. cd /usr/local/src
  2. wget http://us2.php.net/get/php-5.2.6.tar.gz/from/us.php.net/mirror
  3. tar zxf php-5.2.6.tar.gz
  4. cd php-5.2.6

Ok now here is the fun fun fun.

FreeTDS decided in release 0.82 to change the way that it installs its compiled libs.  PHP (as of 5.2.6) has not release an official update to this problem.  FreeTDS.org/news.html has recommended adding dummy files to allow the PHP extensions (mssql, pdo_dblib) to compile correctly.  This soution is not really solving the problem, so I looked to the PHP developers to see if there is a better solution.

Low and behold, there was!

Two different links:

  1. php.net bug# 44991
  2. Gentoo Linux bug #223891

These two sites discuss the problem in depth.  The great news, they provided a Patch to solve the problem!

Download it here. (http://overlays.gentoo.org/proj/php/browser/patches/php-patches/5.2.6/php5/freetds-compat.patch?rev=3488&format=raw)

Copy the patch file to your php src directory (/usr/local/src/php-5.2.6).

Run these commands:

  1. patch -p0 -i  /usr/local/src/php-5.2.6/freetds-compat.patch
  1. Since it is in interactive mode type these two file locations
  1. ext/mssql/config.m4
  2. ext/pdo_dblib/config.m4

This will patch the source code problems with FreeTDS 0.82 and PHP 5.2.6

Now compile php (based off of my settings):

  1. ‘./configure’ ‘–prefix=/usr/local/apache2/php’ ‘–with-zlib’ ‘–with-dom=/sw/’ ‘–with-libxml-dir=/sw/’ ‘–with-xsl=/sw/’ ‘–with-jpeg-dir=/sw’ ‘–with-libtiff-dir=/sw’ ‘–with-png-dir=/sw’ ‘–with-mysql=/usr/local/mysql/’ ‘–with-apxs2=/usr/local/apache2/bin/apxs’ ‘–with-curl’ ‘–enable-exif’ ‘–with-ttf’ ‘–with-freetype-dir=/usr/X1186’ ‘–enable-bcmath’ ‘–with-iconv’ ‘–with-gd’ ‘–with-t1lib=/sw’ ‘–enable-gd-native-ttf’ ‘–with-xpm-dir=/usr/X11R6/lib’ ‘–with-openssl=/sw/’ ‘–enable-ftp’ ‘–enable-soap’ ‘–with-xmlrpc’ ‘–with-mysqli=/usr/local/mysql/bin//mysql_config’ ‘–with-mssql=/usr/local’ ‘–enable-zip’ ‘–with-imap=/usr/local/imap’ ‘–with-imap-ssl=/sw’ ‘–with-kerberos’ ‘–enable-mbstring’ ‘–with-mcrypt=/sw’ ‘–with-pdo-mysql=/usr/local/mysql/bin/mysql_config’ ‘–with-pdo-dblib=/usr/local’ ‘–enable-pdo’
  2. make
  3. sudo make install

You are off to the races!!!

You can now install open source tools such as:

I plan to use both, but Symfony will allow me to read the schema directly from the SQL Server, and build out ORM objects based on their schema!!!

Good luck!

P.S. Dont forget to restart Apache!!! PHP lives in memory based on the last apache restart, so you wont see changes reflected until you force restart apache.

Text* Snippets: Recursively remove all .svn directories [shell] [svn] [bash]

I am always looking for this command.

Usually, you if you need a code base without the .svn directories, you can just do an svn export. This is especially good for deploying to web applications from known revisions/releases inside of version control.

Sometimes however, there arises the situation where a collection of files that were once in version control, and were orphaned for whatever reason, and that code needs to get re-added to version control, the .svn directories present in the directories will conflict with a new svn add command. In that case use this command:

find . -name .svn -print0 | xargs -0 rm -rf

So the Saga of the Coffee + Laptop continued today.

Upon the Computer gaining its heartbeat back, I quickly realized that there were sections of my Hard Drive that had mysteriously disappeared!

So here are the bits of intelligence that I can share with the world.

Long ago, when I first bought my 15″ Powerbook, the Logic Unit failed, not once, but twice.  That machine was taken back from Apple, thanks to my purchase of the 3 year Apple Care Protection plan.  As this occured right during the transition from PowerPC to Intel based computers, I was offered a brand new MacBook Pro.  This was the first release of the machines, in fact they were so new they weren’t even in the store yet.   I would have had to wait for 2 weeks, and as many of you freelance web developers know, that is just not possible.

So I opted for the 17″ PowerBook pimped out to the max.

The problem here, is that I was given an Apple Care Tech Tools Deluxe cd based on my first computer, and was not given a new cd when I received the 17″ machine.  Why does this matter?  Because when you try to boot your 17″ PowerBook with a 15″ Tech Tool cd, you get a Kernel Panics.

Use this link, to get a disk image (DVD/CD) of the new version of the software.
Back to the present.

Apple’s built in Disk Utility did not repair my corrupted hard drive.

Apple’s Tech Tool Deluxe Volume Repair tool did not fix my corrupted hard drive.

What did the trick?

DiskWarrior 4 from Alsoft.

512msw4dvbl_aa280_.jpg

At $99 this is not necessarily cheap, but it did the trick right away.

I recommend.

If you spend as much time on your computer as I do, you start to take concern for its well being. Most of the time this involves doing regular backups (Not the best at that), running software updates to protect your sweet lappy, and just being generally careful around your expensive equipment. Last night, for a brief moment in time I thought, “hey my lappy is running kind of slow, maybe it needs a pick me up, the kind of pick me up that only a Kayak’s Skim Latte can provide !!!”. It was then that the entire contents of this latte was spillled through the rear heat exhaust openings of my 17″ powerbook, you know cause that looked like what might have been a human mouth.

Quickly, expletives were shouted, at my realization that I had not helped my sweet lappy, but rather wounded it deeply, as my speakers crackled, and desktop froze to a grinding halt.

I thought to myself, “Quick turn it on its side to allow coffee to drain out !!” What foolishness we do when our young ones are threatened.

So next step, I dash out of the coffee shop holding laptop flat so as to halt the spread of the evil beverage throughout the chassis. I get home, tear around the house looking for the correct screwdriver to undo the chassis to get a look at the damage. I got open a few, but then was thwarted because of not having a small enough screwdriver to open up the case.

I then thought to myself, who could I call to help with through this difficult time? Who could empathize with my situation, as well as help me out of the mess I was in.

I think it is important to note at this point, that I am a web developer, and spend nearly 70 percent of my life on this laptop. I had work for a client that had parts that had not been checked into the subversion repository at work, and would be lost if I could not get the system back up and running.

Gabriel Serafini to the rescue! He had the tools, the empathy, and the know-how to get my sweet lappy back into good health.

Lets take a look!

Lappy with Case Opened Up.

photo_100107_001.jpg

More Lappy with Case Opened Up.
photo_100107_002.jpg

More Lappy with Case Opened Up. (Keyboard section upside down)
photo_100107_003.jpg

Happy Lappy!!!!!!!

photo_100207_001.jpg

Thanks Gabriel!

Now my sweet lappy is running great, the speakers no longer crackle, and I was able to get a lot of the little orange balls in my laptop case cleaned out.

Anyone else found little orange balls that look like Fish Rouge (found often on sushi) in their laptop case?

The most current theory is that this is actually adhesive that has formed into pellets from the hear emitted from my laptop.