Jun 11, 2004

Is Linux getting fat?

The Fast-Food Syndrome: The Linux Platform is Getting Fat - OSNews.com I tend to agree with much of what was mentioned in OSNews post, even though it is not a good sign :) I still remember my old P100 with, ugh, 16(?) Mb and a puny 2Mb video -- that thing could run much of the same (functionally) stuff a new P4 3G does, except with soooo much less eyecandy. True, I the day I saw Enlightenment screenshot I wanted it. And I ended up spending half a week getting all the prerequisites, compiling it all myself. All ended up with me doing a mega-upgrade of my installation (Slackware at that time) *and* hardware... But it was cool. And I could make my Linux box look almost like a Mac :) Now that I own a Mac (typing this one on Safari right now, sir) -- I would love to see more simplicity, lighter and more functional things. Instead -- half of KDE themes you're likely to see on KDE Look are Windows XP rip-offs. GNOME is trying to creatively copy-cat Mac (OS 9, more like). And one needs to install 30 other things to get GnuCash to balance your checkbook...

Jun 8, 2004

PostgreSQL on MacOS X

There are quite a few resources available on the ’Net about compilation and setup of PostgreSQL on a Mac OS X. This O’Reily article, and this one from Apple just to name a few. For me, where both these articles are falling short is in describing how to set Postgres to start automatically when I boot my Mac. Interestingly, I had to read an article about Oracle on a Mac to see how this can be done for Postgres. Naturally, it is very simple. As long as you followed all the instructions in either of above 2 articles (I opted for installing Postgres and dependencies out of Darwinports, as I am a bit repelled by Fink), all you need to do is:
  1. Create a directory /Library/StartupItems/Postgres
  2. Create 2 files in that directory: Postgres and StartupParameters.plist. Note that a startup script must be called the same as a directory!
  3. chmod(1) above files sensibly (700 is a good option) and chown(1) them to be owned by root:wheel.
  4. Put the following into the Postgres startup script:
    #!/bin/sh
    
    #
    # For postmaster startup options, edit $PGDATA/postgresql.conf
    #
    # Note that PGDATA is set in ~${PGUSER}/.profile, don't try to manipulate it here!
    #
    
    . /etc/rc.common
    
    PREFIX=/opt/local
    PGBIN=${PREFIX}/bin
    PGUSER=postgres
    
    StartService ()
    {
        if [ -x ${PGBIN}/pg_ctl ]; then
            ConsoleMessage "Starting PostgreSQL"
            su -l ${PGUSER} -c "[ -d \${PGDATA} ] && exec ${PREFIX}/bin/pg_ctl start -s -w"
        fi
    }
    
    StopService ()
    {
        if [ -x ${PGBIN}/pg_ctl ]; then
            ConsoleMessage "Stopping PostgreSQL"
            su -l ${PGUSER} -c "exec ${PREFIX}/bin/pg_ctl stop -m fast"
        fi  
    }
    
    RestartService ()
    {
        if [ -x ${PGBIN}/pg_ctl ]; then
            ConsoleMessage "Restarting PostgreSQL"
            su -l ${PGUSER} -c "exec ${PREFIX}/bin/pg_ctl restart -s -m fast"
        fi
    }
    
    RunService "$1"
    
    
  5. Puth the following into StartupParameters.plist:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Description</key>
    <string>PostgreSQL 7.4.1 Database Server</string>
    <key>Provides</key>
    <array>
    <string>PostgreSQL 7.4.1 Database</string>
    </array>
    <key>Requires</key>
    <array>
    <string>Disks</string>
    </array>
    <key>Uses</key>
    <array>
    <string>Disks</string>
    <string>Network</string>
    <string>NFS</string>
    </array>
    <key>OrderPreference</key>
    <string>Late</string>
    </dict>
    </plist>
You can now try and run sudo /Library/StartupItems/Postgres/Postgres start to check if it all works.

Jun 6, 2004

ONLamp.com: Interesting New Ports [Mar. 25, 2004]

Dru Lavigne has posted a new column at O'Reily's BSD Devcenter on hte subject of FreeBSD ports: ONLamp.com: Interesting New Ports [Mar. 25, 2004]. This port in particular is interesting, since it seems to live up to the promise to help tightening a few bolts of FreeBSD security.

Jun 4, 2004

Wireless today

I have joined the happy crowd of WRT54G owners just a day after a major security hole was reported in the little box that could. Needless to say, admin password was changed immediately after the router has been powered up.