Booyakasha! http://blog.chipcastle.com A blog by Chip Castle posterous.com Mon, 29 Aug 2011 08:25:00 -0700 Comical talk on design by Stefan Sagmeister http://blog.chipcastle.com/67482024 http://blog.chipcastle.com/67482024

 http://www.ted.com/talks/lang/eng/stefan_sagmeister_shares_happy_design.html

 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Tue, 05 Apr 2011 17:59:02 -0700 Loading ActiveRecord models in a Rails app from Sinatra http://blog.chipcastle.com/loading-activerecord-models-in-a-rails-app-fr http://blog.chipcastle.com/loading-activerecord-models-in-a-rails-app-fr

# This example is available on Github at https://github.com/chip/invoicethat-admin

# For simplicity's sake, I put this into app.rb

# Root directory of my Rails app
    RAILS_ROOT = '/Users/deploy/Sites/rails_invoice'

    # Setup load_paths for ActiveSupport
    require 'active_support'
    relative_load_paths = %w(app/models)
    ::ActiveSupport::Dependencies.load_paths = relative_load_paths.map { |path|
      File.expand_path(path, RAILS_ROOT)
    }
    
    # Connect to the Rails app database
    require 'active_record'
    config_path     = File.expand_path('config/database.yml', RAILS_ROOT)
    all_envs_config = YAML.load(File.read(config_path))
    config          = all_envs_config[ENV['RACK_ENV']]
    ::ActiveRecord::Base.establish_connection(config)

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Thu, 31 Mar 2011 14:19:00 -0700 Beautiful building in San Francisco, September 2010 http://blog.chipcastle.com/beautiful-building-in-san-francisco-september http://blog.chipcastle.com/beautiful-building-in-san-francisco-september

Grant_street_building_-_sf

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Thu, 31 Mar 2011 14:13:00 -0700 My wife in South Beach Miami, May 2010 http://blog.chipcastle.com/my-wife-in-south-beach-miami-may-2010 http://blog.chipcastle.com/my-wife-in-south-beach-miami-may-2010

Nikki_south_beach

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Thu, 31 Mar 2011 14:09:24 -0700 Balloon ride in Napa Valley, September 2010 http://blog.chipcastle.com/balloon-ride-in-napa-valley-september-2010 http://blog.chipcastle.com/balloon-ride-in-napa-valley-september-2010

Balloon_ride

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Tue, 13 Jan 2009 23:56:00 -0800 Postfix: purge all messages in the mail queue http://blog.chipcastle.com/2009/01/postfix-purge-all-messages-in-mail.html http://blog.chipcastle.com/2009/01/postfix-purge-all-messages-in-mail.html Today I needed to purge all of the messages in the mail queue of my development machine. After googling around a bit, I found the answer in 'man postsuper':


sudo postsuper -d ALL

I guess it always helps to READ the man pages. ;)

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Mon, 01 Dec 2008 13:03:00 -0800 Postfix aliases not working for root? http://blog.chipcastle.com/2008/12/postfix-aliases-not-working-for-root.html http://blog.chipcastle.com/2008/12/postfix-aliases-not-working-for-root.html While working on a new mail server this morning, I found that root was not receiving mail, so I needed a quick fix.

Platform issues might be relevant for some admins, so let's find out how the server is configured to run Postfix...

sudo postconf -d | grep ^mail_version
mail_version = 2.3.8
cat /etc/issue
Debian GNU/Linux 4.0

Now that I have those particulars, I need to query the aliases database. But, how do you find that out? Let's look further...

sudo postconf -n | grep ^alias
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases

Perfect. Let's move on to finding who receives root mail.

postmap -q root hash:/etc/aliases

Wha??? No results? That an easy enough fix. Just fire up your favorite editor for /etc/aliases to add an entry for root.

root: you@domain.com
mailer-daemon: postmaster
postmaster: root

Of course, don't forget that you@domain.com should be changed to suit your needs.

But, we're not done! At this point, Postfix is not aware of our new alias settings, as it reads /etc/aliases.db, not /etc/aliases, so let's fix this.

Some of the documentation I came across referred to using postmap to rebuild aliases.db, but I found that I ran into the 'record is in "key: value" format; is this an alias file?' warning. Well, I probably wasn't doing something right, so instead I tried an alternative:

sudo newaliases
sudo postfix reload

I then check my work...

sudo postmap -q root /etc/aliases

This time, I got the expected results: you@domain.com. Nice. So I watched the mail logs as I sent a test mail message:

sudo tail -f /var/log/mail.log

For me, it worked. Yay!

If your message could not be delivered, make sure you read the mail logs carefully for specific errors. Your server configuration might need to be tuned depending on your needs and the error generated, but that's for another post.

Cheers.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Fri, 07 Nov 2008 20:23:00 -0800 Importing subversion repo into git http://blog.chipcastle.com/2008/11/importing-subversion-repo-into-git.html http://blog.chipcastle.com/2008/11/importing-subversion-repo-into-git.html Recently I imported a subversion repo for one of my projects into git. However, I had a non-standard directory setup since I did not follow the common /path/to/repo/project/{trunk,tags,branches} directory layout convention. Instead, I had originally setup /path/to/repo. I needed a way to specify that I didn't have a trunk directory.

Here's what I did to import that into a git repo:

git svn clone -t '' -b '' -T '' svn+ssh://host.tld/path/to/repo/
Upon running this command, I did see errors stating that I hadn't specified branches or tags properly, so it's possible that those flags are superfluous in my case, but in any event the -T '' was essential to a successful import.

In the process of finding the magic flag for importing, I found http://jo.irisson.free.fr/?p=64 to be particularly descriptive and helpful in my understanding of the import process. However, git-svnimport has been deprecated, so I used git-svn instead.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Wed, 17 Sep 2008 15:28:00 -0700 MacPorts outdated command http://blog.chipcastle.com/2008/09/macports-outdated-command.html http://blog.chipcastle.com/2008/09/macports-outdated-command.html I recently ran into issues reinstalling apache2 on Leopard version 10.5.4 using MacPorts, and found that the "outdated" command came to my rescue!

I had never used this before, but running it as follows showed me a lot of useful information about the ports on my system:

sudo port outdated
I used the results of this command to cherry pick what I needed to upgrade. Apparently, all I needed to do in my situation was upgrade apr, but I went ahead and upgraded a number of other ports for good measure, following this procedure:
sudo port selfupdate
sudo port install db44 +darwin_8
sudo port outdated
sudo port upgrade apr bzip2 gcc_select libevent libpcap \
libxml2 memcached pcre
sudo port upgrade apache2
After all of this, I restarted apache.

I found http://www.nabble.com/Issue-installing-Apache-2-on-Leopard-td16426260.html to be especially helpful during the process, but mainly was happy to discover the "outdated" command. I hope you find this useful, too.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Sat, 13 Sep 2008 05:56:00 -0700 git installation on osx 10.4.11 - fetch failures http://blog.chipcastle.com/2008/09/git-installation-on-osx-10411-fetch.html http://blog.chipcastle.com/2008/09/git-installation-on-osx-10411-fetch.html I recently ran into trouble installing the Macports git-core on my Powerbook G4 with OS X version 10.4.11, so I followed the instructions at http://forums.macnn.com/82/applications/368517/macports-fixing-fetch-failed-manual-download/ to get started.

Since I found that each git-core dependency failed due to fetch errors, I decided to override that behavior, as described at http://guide.macports.org/#development.examples.eliminate.

Basically, it is a simple 3 step process to follow:

  1. Attempt to install the port
  2. Manually download the source file that could not be fetched
  3. Edit the Portfile and start the process again
===============================================================

Here's exactly how I did it...

1. Attempt to install the port

Here I am attempting to install the git-core port, but it fails on rsync:

chip-castles-powerbook-g4-17:/opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/popt deploy$ sudo port install git-core
Portfile changed since last build; discarding previous state.
---> Fetching rsync
---> Attempting to fetch rsync-3.0.4.tar.gz from http://rsync.samba.org/ftp/rsync/
---> Attempting to fetch rsync-3.0.4.tar.gz from http://rsync.samba.org/ftp/rsync/src/
---> Attempting to fetch rsync-3.0.4.tar.gz from http://svn.macports.org/repository/macports/distfiles/rsync
---> Attempting to fetch rsync-3.0.4.tar.gz from http://svn.macports.org/repository/macports/distfiles/general/
---> Attempting to fetch rsync-3.0.4.tar.gz from http://svn.macports.org/repository/macports/downloads/rsync
Error: Target org.macports.fetch returned: fetch failed
Error: The following dependencies failed to build: rsync
Error: Status 1 encountered during processing.


2. Manually download the source file that could not be fetched

Based on the errors above, I pointed my web browser to http://rsync.samba.org/ftp/rsync/ and downloaded rsync-3.0.4.tar.gz.

Since it downloaded to ~/Desktop, I had to copy it to the appropriate location, which in my case was under:

/opt/local/var/macports/distfiles/
More specifically, I did this:

sudo cp ~/Desktop/rsync-3.0.4.tar.gz /opt/local/var/macports/distfiles/rsync/

As a precautionary measure, it is best to run md5 against the downloaded file to be sure that it matches the checksum listed in the Portfile.

3. Edit the Portfile and start the process again

Now I need to find the Portfile. It varies for each dependency, but on my laptop I always use this as a base directory:

/opt/local/var/macports/sources/rsync.macports.org/release/ports/
However, each dependency is not always neatly under this directory, as in the case of rsync, so I had to do a little searching, as follows:

chip-castles-powerbook-g4-17:/opt/local/var/macports/sources/rsync.macports.org/release/ports deploy$ find . -name "rsync*"

./net/rsync
./net/rsync/files/rsyncd.conf.example
./net/rsync-devel
./net/rsync-lart
So I cd into net/rsync and edit the Portfile by adding a "fetch {}" directive to override this stage in the port installation process. I found that it worked successfully when I put it as the first option with braces, generally found after the initial variables are set. In this example, it is between config.cflags and pre-configure directives.

Here's my rsync Portfile:

# $Id: Portfile 39822 2008-09-06 22:37:30Z simon@macports.org $

PortSystem 1.0

name rsync
version 3.0.4
categories net
platforms darwin freebsd sunos
maintainers simon openmaintainer
description Tool that provides fast incremental file transfer.
long_description rsync is an open source utility that provides fast \
incremental file transfer. rsync is freely available \
under the GNU General Public License and is currently \
being maintained by Wayne Davison. \
\
Rsync version 3.0.4 has been released. This is a \
bug-fix release. Related pages: \
http://rsync.samba.org/ftp/rsync/rsync-${version}-NEWS

homepage http://samba.org/rsync/
master_sites http://rsync.samba.org/ftp/rsync/ \
http://rsync.samba.org/ftp/rsync/src/
checksums ${distname}${extract.suffix} \
md5 2b2d159c9bd1b5f8adfd8b13da3a1f3f \
sha1 e89ed8d84fe0b6740208ba8183ee1dbc220ba5e5 \
rmd160 5e0082c7751205e16431471bdc5f48f87ae26b1a
distname rsync-${version}

depends_lib port:popt port:libiconv

patchfiles patch-fileflags.diff \
patch-crtimes.diff
patch.pre_args -p1

configure.args --mandir=${prefix}/share/man \
--with-rsyncd-conf=${prefix}/etc/rsyncd.conf \
--enable-ipv6 \
--enable-xattr-support
configure.cflags "-Os -I${prefix}/include"

fetch {}

pre-configure {
system "cd ${worksrcpath}; ./prepare-source"
}

post-destroot {
xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
xinstall -m 644 -W ${worksrcpath} \
COPYING INSTALL NEWS OLDNEWS TODO README doc/README-SGML \
doc/profile.txt doc/rsync.sgml \
${destroot}${prefix}/share/doc/${name}
}

platform darwin 7 {
configure.args-delete --enable-xattr-support
configure.args-append --disable-acl-support --disable-xattr-support
}

livecheck.check regex
livecheck.regex "Rsync version (\\d+(?:\\.\\d+)*) released"

variant no_macosx_metadata description {Don't preserve Mac OS X file \
flags and creation times} {
patchfiles-delete fileflags.diff \
crtimes.diff
}

variant rsyncd description {Installs rsyncd.conf and a StartupItem for rsyncd} {
post-destroot {
xinstall -m 644 ${filespath}/rsyncd.conf.example \
${destroot}${prefix}/etc/rsyncd.conf.example
reinplace "s|__PREFIX__|${prefix}|g" \
${destroot}${prefix}/etc/rsyncd.conf.example
}

post-install {
ui_msg "****************************************************************"
ui_msg "* *"
ui_msg "* To use the rsyncd server you must rename *"
ui_msg "* ${prefix}/etc/rsyncd.conf.example to rsyncd.conf and add *"
ui_msg "* your modules there. See 'man rsyncd.conf' for more *"
ui_msg "* information. *"
ui_msg "* *"
ui_msg "****************************************************************"
}

startupitem.create yes
startupitem.name rsyncd
startupitem.logfile ${prefix}/var/log/rsyncd.log
startupitem.start "${prefix}/bin/rsync --daemon --config=${prefix}/etc/rsyncd.conf"
startupitem.stop "kill `cat ${prefix}/var/run/rsyncd.pid`"
startupitem.pidfile auto ${prefix}/var/run/rsyncd.pid
}

==================================

Basically, I repeat this process for each fetch failure. For git-core, there were a good number of them. Off the top of my head: curl, expat, gettext, ncurses, openssh, perl5.10, perl5.8, pkgconfig, popt.

There were probably others, but I think you get the idea.

HTH/chip

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Tue, 02 Sep 2008 19:49:00 -0700 no such file to load -- capistrano/ext/multistage http://blog.chipcastle.com/2008/09/no-such-file-to-load.html http://blog.chipcastle.com/2008/09/no-such-file-to-load.html I ran into this error the other day when running "cap -T"
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- capistrano/ext/multistage (LoadError)

I did this to fix:


sudo gem install capistrano-ext
sudo gem uninstall capistrano
sudo gem install capistrano

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Fri, 29 Aug 2008 23:07:00 -0700 installing webby on ubuntu 7.10 http://blog.chipcastle.com/2008/08/installing-webby-on-ubuntu-710.html http://blog.chipcastle.com/2008/08/installing-webby-on-ubuntu-710.html I recently found this cool little tool for quickly creating websites. It's called webby. Check eeet!

OK. I have to admit, I'm just getting started. But I did run into some issues installing it on Ubuntu 7.10 and wanted to share how I fixed them.

So, I tried installing per the website tutorial, like so:

sudo gem install webby

However, it complained since I didn't have the correct version of hpricot:

ERROR: Error installing webby:
webby requires hpricot (= 0.6.0, runtime)

No worries. Just do this prior to installing webby:

sudo gem install hpricot --version=0.6.0

Remember, the --version option is the key!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Fri, 29 Aug 2008 22:46:00 -0700 ruby & rubygems tips for Ubuntu 7.10 http://blog.chipcastle.com/2008/08/ruby-rubygems-tips-for-ubuntu-710.html http://blog.chipcastle.com/2008/08/ruby-rubygems-tips-for-ubuntu-710.html ruby issues

By default, installing ruby alone doesn't give you the necessary library bindings that you might need later. I solved this like so:

sudo apt-get install ruby1.8-dev libyaml-ruby libzlib-ruby

During this process, I also noticed another command that might ease this process in the future, although I don't have a clean slate to work with, but it's worth noting nonetheless:

sudo apt-get install ruby-full

rubygems issues:

Sometimes rubygems has issues with stalling, at least in my experience, so one way of dealing with that is to issue this to clear out the cache:

sudo gem update -V

And then update the system in verbose mode:

sudo gem update --system -V

I also found that I needed to edit /usr/bin/gem as follows:

require 'rubygems'
require 'rubygems/gem_runner'

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Fri, 08 Aug 2008 22:13:00 -0700 Subversion - forgot to create trunk, branches, tags http://blog.chipcastle.com/2008/08/subversion-forgot-to-create-trunk.html http://blog.chipcastle.com/2008/08/subversion-forgot-to-create-trunk.html I had a project checked out of my subversion repository that I had forgotten to create the trunk, branches and tags directories, so I needed a quick fix. Before following these instructions, it is helpful to have no local modifications (i.e., do a commit prior to doing this):

cd ~/sandbox
svn checkout file://path/to/repo tmpwc
cd tmpwc
svn mkdir trunk
for f in *; do svn mv $f trunk; done
svn mkdir branches tags
svn commit -m "Finally got organized!"

This solution was found as part of a larger thread of correspondence, found here:
http://svn.haxx.se/users/archive-2007-10/0600.shtml

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Tue, 08 Jul 2008 19:59:00 -0700 OS X Wake On Lan http://blog.chipcastle.com/2008/07/os-x-wake-on-lan.html http://blog.chipcastle.com/2008/07/os-x-wake-on-lan.html Today, while at my office, I decided to work on a php project since I had a little time available. Once inside my project, I noticed that the code was slightly out of sync with what I had remembered working on recently at home. Suddenly, I realized I had forgotten to perform that super important final commit on my subversion repository... Doh!

Oh well. No worries, I thought. I'll just ssh into my imac at home and run the svn commit from there. But wait - my imac was in sleep mode and simply wouldn't allow me to connect. I thought, now what?

Well, a quick googling revealed this very important post:
http://www.macosxhints.com/article.php?story=20020220095929695

Although there were Python and Perl solutions presented, I decided to implement the example provided in PHP since it required no special libraries to run. Here's the code (Special THANKS to karnat10 for posting this one!):

###########################################

function wakeonlan($ip,$mac) {

$socket = fsockopen("udp://".$ip,9,$errno);

if (!$errno) {
$magicpacket = str_repeat(chr(0xff),6).str_repeat(pack("H*",$mac),16);
fputs($socket,$magicpacket);
fclose($socket);
}
}

// Call the function like this:

wakeonlan("12.34.56.78","a0b1c2d3f456");

###########################################

Now, all I had to do was fill in my IP address where there was "12.34.56.78" and my imac's MAC address where there was "a0b1c2d3f456".

Once that was done, I named this script wake_up_imac.php and placed it in ~/bin on my office mac mini.

After running the command "php ~/bin/wake_up_imac.php", I was in - Whooot!!!

Then I setup a few aliases in ~/.bash_login to ease my login process:

alias wake_up_imac="php ~/bin/wake_up_imac.php"
alias ssh_home="wake_up_imac; ssh user@12.34.56.78"

Now to login to my imac at home, all I have to do is run "ssh_home". It doesn't matter whether the imac is in sleep mode or not since the alias takes care of the waking up prior to the ssh login.

Wow... I'm super stoked. Now I'm off to perform that commit. ;)

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Sat, 21 Jun 2008 22:58:00 -0700 svn import for invoice that (cakephp script version) http://blog.chipcastle.com/2008/06/svn-import-for-invoice-that-cakephp.html http://blog.chipcastle.com/2008/06/svn-import-for-invoice-that-cakephp.html # On slicehost, /home/deploy/svn contains some of my repositories.
# Let's create a new one for this project:
svnadmin create /home/deploy/svn/php

# On my iMac development machine, go to the directory that contains my project:
cd /Users/deploy/invoicethat_cakephp/cake_1.2.0.7125-rc1

# Perform the import from the development machine
svn import -m "Initial import of invoicethat php script using cake_1.2.0.7125-rcl" . \
svn+invoicessh://<ip address="" for="" slicehost="" vps="">/home/deploy/svn/php/invoicethat_cakephp

# Move original code out of the way on development machine
cd ~
mv invoicethat_cakephp invoicethat_cakephp.orig
mkdir invoicethat_cakephp
cd invoicethat_cakephp

# From development machine, perform checkout from repository stored on Slicehost VPS
svn co svn+invoicessh://209.20.68.69/home/deploy/svn/php/invoicethat_cakephp cake_1.2.0.7125-rc1

# Add original symlinks back so aliases work
ln -s cake_1.2.0.7125-rc1/ cake
ln -s cake_1.2.0.7125-rc1/ invoicethat_cakephp

# Cleanup permission issues
cd app
chmod -R a+w tmp

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Sat, 21 Jun 2008 13:05:00 -0700 Passenger (mod_rails) on ubuntu with SSL and 2 environments http://blog.chipcastle.com/2008/06/passenger-modrails-on-ubuntu-with-ssl.html http://blog.chipcastle.com/2008/06/passenger-modrails-on-ubuntu-with-ssl.html I installed the latest version of Passenger from git, which now supports RailsEnv on a per VirtualHost basis. Here's my config:

# /etc/apache2/mods-enabled/passenger.load
LoadModule passenger_module /home/deploy/passenger/ext/apache2/mod_passenger.so
PassengerRoot /home/deploy/passenger
PassengerRuby /usr/bin/ruby1.8
# ----
# /etc/apache2/mods-enabled/passenger.conf, which may need tweaking

# Never spawn more than three processes
RailsMaxPoolSize 3

# Despawn a process when it has been idle for 180 seconds
RailsPoolIdleTime 180
# ----
# Main domain with SSL enabled and running in a production environment
<virtualhost *:80="">

ServerName domain.com
ServerAlias www.domain.com

Redirect / https://domain.com/

</virtualhost>

<virtualhost *:443="">
SSLEngine on
SSLCertificateFile /etc/ssl/certs/combined.crt
SSLCertificateKeyFile /etc/ssl/private/domain.com.key

ServerName domain.com
DocumentRoot /home/deploy/public_html/domain.com/current/public
RailsEnv production

# Custom log file locations
ErrorLog /home/deploy/public_html/domain.com/current/log/error.log
CustomLog /home/deploy/public_html/domain.com/current/log/access.log combined

</virtualhost>
#----
# "staging" Sub domain with SSL enabled and running in staging environment
<virtualhost *:80="">

ServerName staging.domain.com
Redirect / https://staging.domain.com/

</virtualhost>

<virtualhost *:443="">
SSLEngine on
SSLCertificateFile /etc/ssl/certs/combined.crt
SSLCertificateKeyFile /etc/ssl/private/domain.com.key

ServerName staging.domain.com
DocumentRoot /home/deploy/public_html/staging.domain.com/current/public
RailsEnv staging

# Custom log file locations
ErrorLog /home/deploy/public_html/staging.domain.com/current/log/error.log
CustomLog /home/deploy/public_html/staging.domain.com/current/log/access.log combined

</virtualhost>
#----

Also of note is that /etc/init.d/apache2 stop is broken, so I created a bash alias as follows as a workaround:
alias apstop='sudo killall -9 apache2'

Further work should be to monitor the server's memory consumption and load and tune passenger accordingly.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Thu, 27 Mar 2008 21:30:00 -0700 How to : Connect to Ubuntu NFS from Mac OSX http://blog.chipcastle.com/2008/03/how-to-connect-to-ubuntu-nfs-from-mac.html http://blog.chipcastle.com/2008/03/how-to-connect-to-ubuntu-nfs-from-mac.html http://www.snovak.com/index.php/Tutorials/Network/How-to-Connect-to-Ubuntu-NF...

How to : Connect to Ubuntu NFS from Mac OSX
Connect to a Ubuntu Linux NFS server from a Mac running OSX.
This works especially well with Gigabyte ethernet.
firestarter reports a ~ 25 Mbs transfer rate.
First make sure you have all of the proper packages on the Ubuntu side (tested in Feisty Fawn):

In terminal:
sudo apt-get install nfs-kernel-server nfs-common portmap


Now open /etc/export

In terminal:
sudo vim /etc/exports

add this and save:
/home/whatEverDirectory 192.168.0.104(rw,async,all_squash,insecure,anonuid=1000,anongid=1000)

restart nfs
In terminal:
sudo /etc/init.d/nfs-kernel-server restart

On the Mac client side:

open the finder
In the menu bar: go>Connect to Server
type: nfs://IPAddressOfServer/home/whatEverDirecotry

If I ever need to connect from the Linux box to my Mac, I'll update the tutorial later.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Sat, 01 Mar 2008 00:30:00 -0800 restful_authentication tutorial http://blog.chipcastle.com/2008/02/restfulauthentication-tutorial.html http://blog.chipcastle.com/2008/02/restfulauthentication-tutorial.html http://www.railsforum.com/viewtopic.php?id=14216&p=1

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle
Thu, 28 Feb 2008 16:11:00 -0800 rails validation test helper methods http://blog.chipcastle.com/2008/02/rails-validation-test-helper-methods.html http://blog.chipcastle.com/2008/02/rails-validation-test-helper-methods.html http://www.daikini.com/past/2007/6/10/rails_validation_helpers/

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1120967/gravatar.jpg http://posterous.com/users/heO3PoXdyncOS Chip Castle chipcastle Chip Castle