« Earlier 6 items total Later »

On this page: 

Install Rails/lighttpd with DarwinPorts for Tiger

install darwinports package

Add 'export PATH=/opt/local/bin:$PATH' to ~/.bashrc

sudo port -d selfupdate

sudo port install ruby

sudo port install rb-rubygems

sudo gem install rails --include-dependencies

sudo port install readline

sudo port install lighttpd

vi /opt/local/etc/lighttpd.conf [edit lighttpd.conf to your liking]

set up launchd item for lighttpd
        -- restart lighttpd: sudo launchctl stop net.lighttpd
                             sudo launchctl start net.lighttpd

sudo port install fcgi

sudo port install rb-fcgi
         
install official OS X MySQL package (not darwinports)

sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql


Links:
darwinports package
launchd item
OS X MySQL package

svnserve launchd item for OS X 10.4

It's not that straightforward getting svnserve to work under launchd. I can't take the credit for this but I thought it would be useful to have it here on TextSnippets.

1) Install subversion if you don't have it already. Here's how with DarwinPorts.

sudo port install subversion


2) Create your Subversion repository (for my own use, I used /Users/xyz/Repositories) e.g.

svnadmin create /Users/xyz/Repositories


3) Place the following XML into a file named org.tigris.subversion.svnserve in the /Library/LaunchDaemons directory.





        Debug
        
        GroupName
        xyz
        Label
        org.tigris.subversion.svnserve
        OnDemand
        
        Program
        /opt/local/bin/svnserve
        ProgramArguments
        
                svnserve
                --inetd
                --root=/Users/xyz/Repositories
        
        ServiceDescription
        SVN Version Control System
        Sockets
        
                Listeners
                
                        SockFamily
                        IPv4
                        SockServiceName
                        svn
                        SockType
                        stream
                
        
        Umask
        2
        UserName
        xyz
        inetdCompatibility
        
                Wait
                
        




You'll need to change xyz to your user name ...

4) Test it out by doing a

sudo launchctl load /Library/LaunchDaemons/org.tigris.subversion.svnserve

sudo launchctl start /Library/LaunchDaemons/org.tigris.subversion.svnserve

svn co svn://your.host.name/aModule/In/Your/Repository

Rails MySQL Session Sweeper

1) Download the launchd GUI, Lingon, from: http://lingon.sourceforge.net/

2) Add hourly job:

$RAILS_APP_DIR/script/runner 'ActiveRecord::Base.connection.delete("DELETE FROM sessions WHERE updated_at < now() - INTERVAL 1 HOUR")'


3) My launchd task plist file (yours will vary):





        Label
        us.boygeni.mysql-session-sweeper
        LowPriorityIO
        
        ProgramArguments
        
                /users/defeated/Sites/rails_apps/boygenius/script/runner
                'ActiveRecord::Base.connection.delete("DELETE FROM sessions WHERE updated_at < now() - INTERVAL 1 HOUR")'
        
        RunAtLoad
        
        StartInterval
        3600


Rounded Mac Input Box

This html code makes an input box that looks like the one found at here (Under the search downloads box) It works only on macs(safari tiger only i believe) and does not validate. Note: type="search" is what makes it work.

Set the default compiler on Mac OS X Tiger

Some stuff won't compile with the shiny new gcc 4.0 on Tiger.
To use gcc 3.3 :
sudo gcc_select 3.3


To revert to gcc 4.0 :
sudo gcc_select 4.0


(found on the forum, thanks Damelon!)

MySQL launchd item for Mac OS X Tiger

(Originally posted at Unquiet)

I had to reinstall Mysql because it wasn’t one of the things I backed up before erasing my hard drive. Since I’m now running Mac OS X 10.4 “Tiger”, I decided to set it up to start when the system boots, but the system for creating startup items has changed slightly. So I saved the following xml in /Library/LaunchDaemons/com.mysql.Mysql.plist:


    
    
    
        Label
        com.mysql.Mysql
        OnDemand
        
        ProgramArguments
        
                /usr/local/mysql/bin/mysqld_safe
        
        ServiceDescription
        Mysql 4.1 Database Server
        UserName
        mysql
        WorkingDirectory
        /usr/local/mysql
    
    


Note that I'm using the official OSX distribution of MySQL... but with a few changes to match your database location, you can get this to work with other installs (fink, darwinports, etc).

« Earlier 6 items total Later »