Archive

Archive for the ‘Uncategorized’ Category

homebrew + python

December 30th, 2011 rupert No comments

Read http://docs.python-guide.org/en/latest/starting/installation/

Installation

/usr/local/Cellar% brew install python --framework
==> Downloading http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
File already downloaded in /Users/rupert/Library/Caches/Homebrew
==> Patching
patching file Lib/whichdb.py
Hunk #1 succeeded at 91 with fuzz 1.
==> ./configure --prefix=/usr/local/Cellar/python/2.7.2 --enable-framework=/usr/local/Cellar/python/2.7.2/Frameworks
==> make
==> make install
==> Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.24.tar.gz
File already downloaded in /Users/rupert/Library/Caches/Homebrew
==> /usr/local/Cellar/python/2.7.2/bin/python setup.py install
==> Caveats
A "distutils.cfg" has been written to:
  /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils
specifing the install-scripts folder as:
  /usr/local/share/python
 
If you install Python packages via "python setup.py install", easy_install, pip,
any provided scripts will go into the install-scripts folder above, so you may
want to add it to your PATH.
 
Distribute has been installed, so easy_install is available.
To update distribute itself outside of Homebrew:
    /usr/local/share/python/easy_install pip
    /usr/local/share/python/pip install --upgrade distribute
 
See: https://github.com/mxcl/homebrew/wiki/Homebrew-and-Python
 
Framework Python was installed to:
  /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework
 
You may want to symlink this Framework to a standard OS X location,
such as:
    mkdir ~/Frameworks
    ln -s "/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework" ~/Frameworks
==> Summary
/usr/local/Cellar/python/2.7.2: 4808 files, 77M, built in 86 seconds
brew install python --framework  76.78s user 21.49s system 112% cpu 1:27.00 total

Symlinks

The following links were created below to ensure that 2.7 is the latest Python picked up during installation of other software (i.e postgresql)

sudo ln -s /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7 /System/Library/Frameworks/Python.framework/Versions/2.7
sudo ln -s /usr/local/share/python/easy_install /usr/bin/easy_install
sudo ln -s /usr/local/share/python/easy_install-2.7 /usr/bin/easy_install-2.7
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /usr/bin/python2.7
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config /usr/bin/python2.7-config
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.7/bin/pydoc2.7 /usr/bin/pydoc2.7
sudo ln -s /usr/bin/python2.7 /usr/bin/python
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.7 /System/Library/Frameworks/Python.framework/Versions/Current
mkdir -p /Library/Python/2.7
ln -s /usr/local/lib/python2.7/site-packages /Library/Python/2.7/site-packages

Site-Packages. Where?

Note that site-packages will be installed in

/usr/local/lib/python2.7/site-packages
~% ls -la /Library/Python/2.6/site-packages
total 136
drwxrwxr-x  14 root    admin    476 30 Dec 18:13 ./
drwxrwxr-x   4 root    admin    136 30 Dec 18:11 ../
-rw-r--r--@  1 rupert  admin   6148 30 Dec 18:13 .DS_Store
-rw-rw-r--   1 root    admin    119 11 Feb  2010 README
-rw-r--r--   1 rupert  admin    241 30 Dec 18:01 easy-install.pth
-rw-r--r--   1 rupert  admin   3129 30 Dec 18:02 googlemaps-1.0.2-py2.6.egg-info
-rw-r--r--   1 rupert  admin  19703 16 Oct  2009 googlemaps.py
-rw-r--r--   1 rupert  admin  19153 30 Dec 18:02 googlemaps.pyc
drwxr-xr-x  39 root    admin   1326  7 Feb  2010 mod_python/
-rw-r--r--   1 root    admin    267  7 Feb  2010 mod_python-3.3.2_dev_20080819-py2.6.egg-info
drwxr-xr-x   8 rupert  admin    272 30 Dec 18:13 nominatim/
-rw-r--r--   1 rupert  admin   4462 30 Dec 18:08 nominatim-0.90-py2.6.egg
drwxr-xr-x  15 rupert  admin    510 30 Dec 18:01 simplejson/
drwxr-xr-x   4 rupert  admin    136 30 Dec 18:13 simplejson-2.3.1-py2.6.egg/
~% ls -la /Library/Python/2.7/site-packages
lrwxr-xr-x  1 root  admin  38 30 Dec 18:23 /Library/Python/2.7/site-packages@ -> /usr/local/lib/python2.7/site-packages
~% which python
/usr/local/bin/python
~% python --version
Python 2.7.2

Installing PHP on OSX

December 28th, 2011 rupert No comments

I need wordpress + nominatim running on OSX and since it uses php…

http://www.php.net/manual/en/install.unix.apache2.php

1. Installation

./configure --prefix=/usr/local/php-5.3.8 --with-mysql --with-pgsql=/usr/local/postgresql --with-apxs2=/usr/local/apache2/bin/apxs
make
sudo make install
rupert-mbp~/Desktop/php-5.3.8% sudo make install
Password:
Installing PHP SAPI module:       apache2handler
/usr/local/apache2.2.14/build/instdso.sh SH_LIBTOOL='/usr/local/apache2.2.14/build/libtool' libs/libphp5.so /usr/local/apache2.2.14/modules
/usr/local/apache2.2.14/build/libtool --mode=install cp libs/libphp5.so /usr/local/apache2.2.14/modules/
cp libs/libphp5.so /usr/local/apache2.2.14/modules/libphp5.so
Warning!  dlname not found in /usr/local/apache2.2.14/modules/libphp5.so.
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache2.2.14/modules/libphp5.so
[activating module `php5' in /usr/local/apache2.2.14/conf/httpd.conf]
Installing PHP CLI binary:        /usr/local/php-5.3.8/bin/
Installing PHP CLI man page:      /usr/local/php-5.3.8/man/man1/
Installing build environment:     /usr/local/php-5.3.8/lib/php/build/
Installing header files:          /usr/local/php-5.3.8/include/php/
Installing helper programs:       /usr/local/php-5.3.8/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/local/php-5.3.8/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/local/php-5.3.8/lib/php/
[PEAR] Archive_Tar    - installed: 1.3.7
[PEAR] Console_Getopt - installed: 1.3.0
[PEAR] Structures_Graph- installed: 1.0.4
[PEAR] XML_Util       - installed: 1.2.1
[PEAR] PEAR           - installed: 1.9.4
Wrote PEAR system config file at: /usr/local/php-5.3.8/etc/pear.conf
You may want to add: /usr/local/php-5.3.8/lib/php to your php.ini include_path
/Users/rupert/Desktop/php-5.3.8/build/shtool install -c ext/phar/phar.phar /usr/local/php-5.3.8/bin
ln -s -f /usr/local/php-5.3.8/bin/phar.phar /usr/local/php-5.3.8/bin/phar
Installing PDO headers:          /usr/local/php-5.3.8/include/php/ext/pdo/
sudo make install  5.52s user 9.35s system 79% cpu 18.819 total

2. Configuration
Specify php.ini per virtualhost

PHPINIDir /etc

Categories: Uncategorized Tags: ,

homebrew + php

November 14th, 2011 rupert No comments

Update
This is now been depracated and used as reference only. I opted to install php via source here

1. Cleanup existing PHP
So by default, OSX Leopard/Snow Leopard?, comes with apache2 and php installed.

mv /usr/local/include/php /usr/local/include/php.old
mv /usr/local/lib/php /usr/local/lib/php.old

2. Install PHP

http://notfornoone.com/2010/07/install-php53-homebrew-snow-leopard/

~/Desktop% brew install php --with-apache --with-mysql --with-pgsql
==> Installing php dependency: jpeg
==> Installing php dependency: mcrypt
==> Installing php dependency: gettext
==> Installing php
....
==> cp ./php.ini-production /usr/local/Cellar/php/5.3.8/etc/php.ini
==> chmod 644 /usr/local/Cellar/php/5.3.8/lib/php/.lock
==> Caveats
   To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php5_module    /usr/local/Cellar/php/5.3.8/libexec/apache2/libphp5.so
 
    The php.ini file can be found in:
      /usr/local/Cellar/php/5.3.8/etc/php.ini
brew install php --with-apache --with-mysql --with-pgsql 452.56s user 272.47s system 126% cpu 9:31.75 total

The most important here is the compiled libphp5.so which we will hook into apache2.

3. Hookup Apache2 to libphp5
Depending on your installation, edit httpd.conf and make sure you have this line

LoadModule php5_module    /usr/local/Cellar/php/5.3.8/libexec/apache2/libphp5.so

4. Test

% php -m #List all php modules
mysql
mysqli
pdo_mysql
pdo_pgsql
pgsql
/usr/local/bin% l php #brew makes the symlinks
lrwxr-xr-x  1 rupert  admin    27B 14 Nov 14:42 php@ -> ../Cellar/php/5.3.8/bin/php

Well if you have a wordpress site, you can test if the whole thing works.

5. Restart Apache

sudo /Library/StartupItems/Apache2/Apache2 restart

UPDATE: Dec 19, 2011
Maintaining php installations via homebrew is such a pain. I reverted back via source.
1. Download php from source
2. Configure

./configure --prefix=/usr/local/php5.3.8 \
  --mandir=/usr/share/man \
  --infodir=/usr/share/info \
  --sysconfdir=/etc \
  --with-config-file-path=/etc \
  --with-zlib \
  --with-zlib-dir=/usr \
  --with-openssl \
  --without-iconv \
  --enable-exif \
  --enable-ftp \
  --enable-mbstring \
  --enable-mbregex \
  --enable-sockets \
  --with-mysql=/usr/local/mysql \
  --with-pdo-mysql=/usr/local/mysql \
  --with-mysqli=/usr/local/mysql/bin/mysql_config \
  --with-apxs2=/usr/local/apache2/bin/apxs

3. Make and Make Install

~/Desktop/php-5.3.8% sudo make install
Password:
Installing PHP SAPI module:       apache2handler
/usr/local/apache2.2.14/build/instdso.sh SH_LIBTOOL='/usr/local/apache2.2.14/build/libtool' libs/libphp5.so /usr/local/apache2.2.14/modules
/usr/local/apache2.2.14/build/libtool --mode=install cp libs/libphp5.so /usr/local/apache2.2.14/modules/
cp libs/libphp5.so /usr/local/apache2.2.14/modules/libphp5.so
Warning!  dlname not found in /usr/local/apache2.2.14/modules/libphp5.so.
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache2.2.14/modules/libphp5.so
[activating module `php5' in /usr/local/apache2.2.14/conf/httpd.conf]
Installing PHP CLI binary:        /usr/local/php5.3.8/bin/
Installing PHP CLI man page:      /usr/share/man/man1/
Installing build environment:     /usr/local/php5.3.8/lib/php/build/
Installing header files:          /usr/local/php5.3.8/include/php/
Installing helper programs:       /usr/local/php5.3.8/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/share/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/local/php5.3.8/lib/php/
[PEAR] Archive_Tar    - installed: 1.3.7
[PEAR] Console_Getopt - installed: 1.3.0
[PEAR] Structures_Graph- installed: 1.0.4
[PEAR] XML_Util: upgrade to a newer version (1.2.1 is not newer than 1.2.1)
[PEAR] PEAR           - installed: 1.9.4
Wrote PEAR system config file at: /etc/pear.conf
You may want to add: /usr/local/php5.3.8/lib/php to your php.ini include_path
/Users/rupert/Desktop/php-5.3.8/build/shtool install -c ext/phar/phar.phar /usr/local/php5.3.8/bin
ln -s -f /usr/local/php5.3.8/bin/phar.phar /usr/local/php5.3.8/bin/phar
Installing PDO headers:          /usr/local/php5.3.8/include/php/ext/pdo/
sudo make install  6.84s user 11.50s system 80% cpu 22.843 total
Categories: Uncategorized Tags: ,

IBM DB2 Express C and Spatial Extender

June 2nd, 2007 rupert Comments off

1. Download DB2 Express C db2exc_912_WIN_x86.zip

2. Download DB2 Spatial Extender from the DB9 Fix Pack. Choose your OS and browse over “DB2 Spatial Extender -> Language Independent”. There is a current problem installing the DB2 Spatial Extender from the main “Spatial Offering” Site with DB2 Express C because of the versions, DB2 Express C was made after FP2 (Fix Pack 2), while DB2 Spatial Extender was made before FP2. When installing the old DB2 Spatial Extender, it will prompt you with “No Action Available”, to resolve the problem, install the DB2 Spatial Extender FP2 (v9fp2_win_gse.exe).

3. Leveraging MySQL skills to learn DB2 Express contains comparison between MySQL and DB2. It also contains default installation instructions which make installing easier.

4. New to DB2 from the DB2 Wiki is a good start in understanding DB2′s concepts.

5. Browse over the User Guide of Spatial Extender to understand the Spatial Extender capabilities.

6. Geoserver Integration? Read Open Web Mapping from Penn State Univ.

7. Manually starting DB2 Services on boot:

DB2 – DB2COPY – DB2 – Allows applications to create, update, control, and manage relational databases.

DB2 Management Service (DB2COPY1) – Manages DB2 registry entries for backward compatibility purposes for the DB2 Copy DB2COPY1

DB2 Remote Command Server (DB2COPY1) – Supports remote DB2 command execution for the DB2 copy named DB2COPY1.

DB2 Security Server (DB2COPY1) – Authenticates DB2 database users when the authentication is performed at the client computer for the DB2 copy named DB2COPY1.

DB2DAS – DB2DAS00 – Supports local and remote database administrative requests.

Categories: Uncategorized Tags: