Archive for the ‘App Stuff’ Category

Installing PokerTracker on a Mac

Wednesday, March 12th, 2008

Download the pokertracker installer and install using the unsupported software installation for crossover. I want to use the postgres database server as the database as I have always hated Access and getting that to work with crossover has had mixed reviews according to some forum posts I have seen, although crossover lists various Access versions as supported.

To install postgres I used the instructions on the developer.apple site - http://developer.apple.com/internet/opensource/postgres.html

I need to install fink (http://www.finkproject.org/download/index.php) as well. I am using Leopard, and at the time of writing, there is no binary, so I need to get the source. After downloading I realised I had no c compiler installed! A handy error message told me I needed the developer tools:

....
Checking cc... not found.
ERROR: There is no C compiler on your system. Make sure that the Developer
Tools are installed.

Got the XCode3 stuff from http://developer.apple.com/tools/download/ and just installed the XCodeTools.mpkg package. This took just under 10 minutes to install, most of the time seemed to be installing documentation, which is nice. Seems a bit strange that a Mac doesn’t come with any compiler, but I am used to Linux when it comes to non-Windows machines, and this is my first Mac.

I have used WebObjects before and had no interest in that, so left it out. Reminds me too much of a sketchy project I worked on in another lifetime.

Once the dev tools are all installed, I can run the fink ./bootstrap command again. Unsurprisingly, I went for the defaults for most of the options, although I did turn on the unstable option as I like new broken stuff and I went for UK based mirrors…
I then was told to make a cup of tea in the INSTALL notes, so I did. At 23.58. Lets see how long this takes :)
… good job i waited as first curl call timed out :) happily downloading from another mirror.

I also notice, as I sit back down that my MacBook Pro is making more fan noise than ever. Hardest its worked so far methinks. At least it now knows what is ahead of it.

While this was grinding away, I downloaded the PostgreSQL source, as there is obviously no binary for OSX. I went for the 8.3 version and seeing as I saw bzip2 flash past on this fink thing, I went for the postgresql-8.3.0.tar.bz2 source files.

Fink finished at 00.11. Might be a late one, but I am warming to this task I think.

Now the instructions say install the readline using fink, but this happens:

me:fink-0.28.0 me$ sudo  /sw/bin/fink install readline
Password:
Scanning package description files..........
Information about 268 packages read in 0 seconds.
Failed: no package found for specification 'readline'!

This sucks. I added /sw/bin to my $PATH to make things easier and had a look at the other options for fink. A list was what i was after and this gave me:

me:fink-0.28.0 me$ fink list readline
Scanning package description files..........
Information about 268 packages read in 0 seconds.
 p   term-readline-pm588                      [virtual package]

This doesn’t look right. As readline is a GNU app, I wondered if the gnu mirror was cocked up, so went looking for a conf file rather than having to rerun the configuration again. It is /sw/etc/fink.conf and all the mirrors are listed there. As the terminal window does not have infinite window buffer size, the other mirror options had vanished into terminal nirvana, so I checked the gnu site for different mirrors (I could just download the readline source from here, but I am determined now). I added Mirror-gnu: ftp://ftp.cwru.edu to the list. This did sweet FA. I ran a fink selfupdate and watched the Dual Core go. I did have a lot of mirror trouble it seemed. Not sure if my connection is crapping out or if they are just unavailable. Got one in the end.

me:fink-0.28.0 me$ fink list readline
Information about 6504 packages read in 1 seconds.
     readline               4.3-1028          Comfortable terminal input library
     readline-java          0.8.0-1024        Readline support for Java
     readline-shlibs        4.3-1028          Comfortable terminal input library
     readline5              5.0-1005          Comfortable terminal input library
     readline5-shlibs       5.0-1005          Comfortable terminal input library
     term-readline-gnu-pm5  1.15-1004         Perl extension for the GNU Readline
     term-readline-pm       1.0203-12         Minimal interface to Readline
 p   term-readline-pm588                      [virtual package]

Cool. Went for the 5 version. More Core Duo action.

On to Postgres, files downloaded, we are nearly ready to crack on with this latest nonsense:

me:Downloads me$ md5 postgresql-8.3.0.tar.bz2
MD5 (postgresql-8.3.0.tar.bz2) = 53d6816eac7442f9bc8103439ebee22e
me:Downloads me$ cat postgresql-8.3.0.tar.bz2.md5
MD5 (postgresql-8.3.0.tar.bz2) = 53d6816eac7442f9bc8103439ebee22e

Rock n Roll. I can feel the tiredness of getting up early because of a timezone mistake and an evening boxing training taking its toll.
The INSTALL document has a short install instructions at the top. I will go through it and only put stuff here that deviated from the expected. I have a feeling old Core Duo is going to get another pounding.

First up, we need to do some extra includes for the ./configure, as mentioned in the apple.developer doc /configure –with-includes=/sw/include/ –with-libraries=/sw/lib
Second, I don’t have gmake, I have make so I used that instead.
Third, I forgot to sudo the make install, so got permission problems. If that is the only cock-up left in me tonight I will be very happy. Install completed pretty quick..
Some graphical UI stuff next according to apple.developer doc. I added the postgres user. When this was done, I could create a data directory for the db and then initialise it:

me:postgresql-8.3.0 me$ sudo sh
sh-3.2# mkdir /usr/local/pgsql/data
sh-3.2# chown postgres /usr/local/pgsql/data/
sh-3.2# su -l postgres
me:~ postgres$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data/
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale C.
The default database encoding has accordingly been set to SQL_ASCII.
The default text search configuration will be set to "english".

fixing permissions on existing directory /usr/local/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 20
selecting default shared_buffers/max_fsm_pages ... 2400kB/20000
creating configuration files ... ok
creating template1 database in /usr/local/pgsql/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.

Success. You can now start the database server using:

    /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data
or
    /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start

Oh man we are getting close now!

me:postgresql-8.3.0 me$ sudo su - postgres
me:~ postgres$ echo $PATH
/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/pgsql/bin:/sw/bin
me:~ postgres$ pg_ctl -D /usr/local/pgsql/data -l logfile start
server starting
me:~ postgres$ createdb pokertracker
me:~ postgres$ psql pokertracker
Welcome to psql 8.3.0, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

pokertracker-# \q
me:~ postgres$

Started up the PokerTracker application through crossover and lo and behold, it fails with:

unable to connect to the PTREG2 database

Goddamnit, is it trying to connect to Access DB first. If I remember correctly I think it does, and you have to convert the DB to be a Postgres one. Shite. It is now 1.30am and I need sleep. Next post is how I got hold of a version of Access 2000 :).

Permalinks .htaccess hiccup

Wednesday, February 13th, 2008

Trying to switch on nice urls.

I tried switching the Permalinks functionality on. I like the date and name one. However, it said I needed to update my .htaccess file as it is not writable.

I added the suggested changes and lo and behold:

Internal Server Error

The same happened when I removed the .htaccess file and made an empty one and granted permissions for the webserver to change it. Wordpress did just add the same code to the file, so not a real surprise.

I have the mod_rewrite option in the httpd.conf file, so what is going on?

First stop, apache error log:
/home/sites/home/web/blog/.htaccess: RewriteEngine not allowed here

Aha, we need to configure apache properly.

I added this to the virtual host section (shared server) and put in the full actual path (not symlinked one) and a quick apache restart later everything is now lovely

<Directory “/home/sites/home/web/blog”>
AllowOverride AuthConfig Options FileInfo
</Directory>

Upgrading WordPress to 2.3.3

Wednesday, February 13th, 2008

Upgrading wordpress to 2.3.3

While i wouldn’t normally bother documenting something like this, i have been getting into the habit of documenting all my steps in my job, so why not here.

Downloaded the tar.gz and uploaded to my webserver.

I checked the wp-admin/upgrade.php page and do not need a DB upgrade.

untared the tarball:

tar -zvx -C $SITE_PATH/web/blog/ -f wordpress-2.3.3.tar.gz
cp -R $SITE_PATH/web/blog/wordpress/* $SITE_PATH/web/blog/

All worked. Genius :). Short post…