Changing video playback speed

I was using iMovie ’08 to do some video editing and I wanted to turn a one hour long video into something shorter.

It turns out iMovie ’08 doesn’t support a slow/fast motion effect even though previous versions supported this. I struggled to find a good alternative that allowed me to speed up playback of my video.

I ended up using two command line tools. FFmpeg and MJPEG Tools.

I installed both using MacPorts:

sudo port install ffmpeg
sudo port install mjpegtools

The command to create a fast motion video was:

ffmpeg -i [input_file] -f yuv4mpegpipe - | yuvfps -s [frame_rate] -r [frame_rate]  | ffmpeg -f yuv4mpegpipe -i - -b 57600k -y [output_file]

where

  • input_file – the original source file
  • frame_rate – the resulting frame rate (X:Y)
  • output_file – the output file

The key here is the frame_rate value. Assuming your original video file is X and you want your video to play N times faster, you should sent your new frame rate to be (X*N):1 For example, if your video has a frame rate of 25 fps and you want to increase playback by 4 times, you should use 100:1 for your frame_rate value. You can use the same command to create a slow motion movie. If you wanted to slow the video down to about half speed, you would use 12fps or 13fps for a 25 fps movie. You can find the current fps of your video by running

ffmpeg -i [input_file]

What I did to turn a 50 min movie to a ~12 min video:

ffmpeg -i video.m4v -f yuv4mpegpipe - | yuvfps -s 100:1 -r 100:1  | ffmpeg -f yuv4mpegpipe -i - -b 57600k -y result.avi

It’s been awhile since I played around with video editing. I forgot how long video processing takes. I need a new computer.

Changing video playback speed

Checkboxes in Stripes and Spring MVC

When building dynamic web sites with lots of javascript UI components being created on the client, understanding how the web framework you’re using will process the request and what must be done to update fields accordingly is even more important.

Specifically, checkboxes have always been a pain to deal with. The gotcha with checkboxes are if a checkbox isn’t checked, the request doesn’t send the parameter so it requires some additional checks to detect that the user deselected something that was there to update the field accordingly. I’ve been playing around with the Stripes framework and ran into this issue.

With Stripes, you can render a checkbox using their JSP tag:

<stripes:checkbox checked="true" name="property1" value="yes"/>
<stripes:checkbox checked="true" name="property2" value="no"/>

When the “checked” value is equal to “value” value, Stripes will render the checkbox as checked. So with the code shown, two checkboxes will be shown with the first checked and the second unchecked.

If a user reverses this by unchecking the first, checking the second, and submit the form, the HTTP request will only see that property2=no. Before the form was submitted, “property1” had a value of “yes”. Now, “property1” won’t even appear in the request parameters, so we have to do special handling to check for the absent of the parameter to update “property1” to whatever value it should be when it is not checked.

In Spring MVC with form binding, checkboxes are dealt with a little differently. Using Spring MVC’s form JSP tag, you can do:

  <form:checkbox path="property1" value="yes"/>
  <form:checkbox path="property2" value="no"/>

Assuming your command bean is named “person”, this will generate the following HTML:

        <input name="person.property1" type="checkbox" value="yes"/>
        <input type="hidden" value="1" name="_person.property1"/>
        <input name="person.property2" type="checkbox" value="no"/>
        <input type="hidden" value="1" name="_person.property2"/>

As noted by the docs,

What you might not expect to see is the additional hidden field after each checkbox. When a checkbox in an HTML page is not checked, its value will not be sent to the server as part of the HTTP request parameters once the form is submitted, so we need a workaround for this quirk in HTML in order for Spring form data binding to work. The checkbox tag follows the existing Spring convention of including a hidden parameter prefixed by an underscore (“_”) for each checkbox. By doing this, you are effectively telling Spring that “the checkbox was visible in the form and I want my object to which the form data will be bound to reflect the state of the checkbox no matter what”.

Spring MVC also provides a “checkboxes” tag which allows you to render a list of checkbox boxes without having to wrap the “checkbox” tag around a JSTL forEach.

Hopefully, that gives you some insight into how to work with checkboxes in Stripes and Spring MVC.

Checkboxes in Stripes and Spring MVC

Setup Apache on Mac OSX Leopard

I’ve had my Macbook for a little over a year now. However, I just recently found out Leopard comes with apache (apache2 to be specific) already installed. To verify this is true, open up Terminal and type

  
>> apachectl -V
Server version: Apache/2.2.9 (Unix)
Server built:   Sep 19 2008 10:58:54
Server's Module Magic Number: 20051115:15
Server loaded:  APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FLOCK_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/usr"
 -D SUEXEC_BIN="/usr/bin/suexec"
 -D DEFAULT_PIDLOG="/private/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/private/var/run/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/private/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"

To start up apache, you can do it a couple of ways.

Type sudo apachectl -k start

or

web-sharing

  1. Go to System Preferences
  2. Click on Sharing
  3. Check the box that says Web Sharing

You can go to http://localhost or the URL provided in the Web Sharing screen to confirm apache is running and is able to serve up requests.

There is also a ~/Sites directory in your home folder. Apache is already setup to serve up files from this directory under http://localhost/~[username] where [username] is your user account name. Any files here will be render for example ~/Sites/index.html is accessible from the browser via http://localhost/~[username]/index.html.

One note to get this to work. Out of the box, all requests to /Sites result in a Forbidden 403 error. To resolve this issue, modify the conf file specified above as SERVER_CONFIG_FILE (/private/etc/apache2/httpd.conf in my case) from

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

to

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Allow from all
</Directory>

Restart apache (sudo apachectl -k restart) and try going to http://localhost/~[username] again.

Setup Apache on Mac OSX Leopard

Cleaning up iPhoto

The longer I use iPhoto, the more I hate it. When I initially started using it, I would import photos but choose not to copy the originals to the iPhoto Library. In the past year or so, I’ve started to just allow iPhoto to copy the originals to the iPhoto Library. So now, I ended up with photos scattered all over the place. This was a pain to maintain and figure out where my photos were.

I decided that I want all photos to be in one place and if I was going to use iPhoto, I’m going to import by copying the originals to the iPhoto Library. Before I could get all of this to happen, I had to backup all of existing photos that were not in the iPhoto Library to an external hard drive. Planning on importing these photos over again from the external hard drive, I then deleted all of these photos through Finder. Going back into iPhoto, I still saw the thumbnails for the photos I just deleted. If I attempt to open any of them though, it complained it couldn’t find the original. What a mess. There doesn’t seem to be a way to refresh your iPhoto Library and it would remove photos it doesn’t have references to any more.

I figure the easiest way to get my iPhoto Library setup the way I want it is to start from scratch. So I went under my Pictures directory and renamed iPhoto Library to iPhoto Library.original. Opening up iPhoto again, you get prompted to search for your Library or create a new one. I choose create a new iPhoto Library and now I can begin importing my photos.

iphoto-prefs

After making sure I have the option to copy items to iPhoto Library when importing, I can now import photos from my external hard drive.

Great! Now I have all of my scattered photos in iPhoto Library. But what about the photos I had imported to the original iPhoto Library ( the ones under iPhoto Library.original)? Well, there didn’t seem to be an easy way to import non-broken originals form one iPhoto Library to another from the GUI so I went to the command line.

All of the original photos that are imported to an iPhoto Library are under a folder called Originals. However, due to the way iPhoto manages the photos, this also includes the broken files that reference the photos I had deleted. Basically I wanted to get rid of all of these broken references before importing all of the photos from my original iPhoto Library to the new one I am creating. Here’s how I did it.

  1. Open up Terminal
  2. Change directory to the original iPhoto Library’s Originals directory (~/Pictures/iPhoto Library.original/Originals)
  3. The broken references aren’t actually symbolic links. They seem to be using extended file attributes to denote where the original file actually is (see xattr).  Since we deleted the actual photos, to identify these files type:
    find . -size 0
    

    to get a list of all of the 0 byte files.

  4. To remove them:
    find . -name "*.jpg" -size 0 -exec rm {}  ;
    

    or if you want to just move them elsewhere:

    find . -name "*.jpg" -size 0 -exec mv {} $dest ;
    

    where $dest is the path to where you want to move the files

  5. To delete all of the empty directories (that represent your events) for clean up purposes:
    find . -depth -type d -empty -exec rmdir {} ;

Now your original iPhoto Library should only contain photos that were imported by copying the originals to the iPhoto Library.

To finish importing everything, open iPhoto, choosing your new iPhoto Library and import the Originals directory from the original iPhoto Library (~/Pictures/iPhoto Library.originals/Originals). You might have to copy this folder someplace else since the Import menu doesn’t allow you to specify going into the iPhoto Library.originals package.

After about 5 hours of battling with iPhoto, I think I finally have all of my photos reimported to a fresh iPhoto Library with no duplicates and broken file references. Having to do all of this really makes me think to just switch to something else. How do you guys feel about iPhoto? What are some good alternatives? Picasa anyone?

Cleaning up iPhoto

Using validates_presence_of on a boolean field? Should use validates_inclusion_of!

rsvp.theoandpat.com had boolean flag to marked whether or not a visitor was going to be able to make it to our wedding. Unfortunately, if you selected you were not able to make it and submit the form, the application would return saying it could not process your submission because you have to say that you are going to make it. I argued, this is an RSVP form so you have to accept if you are RSVPing. That’s the point of the RSVP! Only people RSVP would bother submitting the form!  Pat wasn’t too happy about that and ask/told me to fix it. 

Digging into it, it turns out the way  for validates_presence_of relies on Object#blank which of course when sent

false.blank? # returns true

Reading up on the documentation, it is suggested to use validates_inclusion_of when dealing with booleans.

The one line change solved the problem:

validates_inclusion_of :accepted, :in => [true, false]
Using validates_presence_of on a boolean field? Should use validates_inclusion_of!

Reduce MySQL memory usage

As I am running more and more on my 256mb slice, I’m trying to squeeze more performance out of the system. After a bit of digging, I’ve made a few changes.

First thing I did was switch out the default mysql config with one tweaked for smaller boxes. This configuration actually came with the mysql installation under /usr/share/doc/mysql-server-5.0/examples/. Just backup your existing my.cnf (mine is located under /etc/mysql) and use the following:

# The following options will be passed to all MySQL clients
[client]
port		= 3306
socket		= /var/run/mysqld/mysqld.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port		= 3306
socket		= /var/run/mysqld/mysqld.sock
skip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (using the "enable-named-pipe" option) will render mysqld useless!
# 
#skip-networking
server-id	= 1

# Uncomment the following if you want to log updates
#log-bin=mysql-bin

# Uncomment the following if you are NOT using BDB tables
#skip-bdb

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/lib/mysql/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql/
#innodb_log_arch_dir = /var/lib/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 8M
sort_buffer_size = 8M

[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M

[mysqlhotcopy]
interactive-timeout

You can see estimated memory usage with a config if you just copy paste the configuration file here.

Restart MySQL (/etc/init.d/mysql restart).

The second thing I did was check out MySQLTuner. Just download the perl script and run it. It will run some analysis on your mysql setup and provide some performance and configuration tweak recommendations.

Sample output looks like this:

 >>  MySQLTuner 1.0.0 - Major Hayden 
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >>  Run with '--help' for additional options and output filtering
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password: 

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.0.51a-3ubuntu5.4
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster 
[--] Data in MyISAM tables: 867K (Tables: 18)
[--] Data in InnoDB tables: 704K (Tables: 40)
[!!] Total fragmented tables: 2

-------- Performance Metrics -------------------------------------------------
[--] Up for: 14h 57m 0s (17K q [0.316 qps], 699 conn, TX: 55M, RX: 3M)
[--] Reads / Writes: 96% / 4%
[--] Total buffers: 26.0M global + 824.0K per thread (100 max threads)
[OK] Maximum possible memory usage: 106.5M (41% of installed RAM)
[OK] Slow queries: 0% (0/17K)
[OK] Highest usage of available connections: 6% (6/100)
[!!] Key buffer size / total MyISAM indexes: 16.0K/381.0K
[!!] Key buffer hit rate: 88.5% (154K cached / 17K reads)
[!!] Query cache is disabled
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 4K sorts)
[!!] Temporary tables created on disk: 30% (1K on disk / 4K total)
[!!] Thread cache is disabled
[!!] Table cache hit rate: 0% (4 open / 7K opened)
[OK] Open file limit used: 0% (8/1K)
[OK] Table locks acquired immediately: 99% (17K immediate / 17K locks)
[OK] InnoDB data size / buffer pool: 704.0K/8.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    MySQL started within last 24 hours - recommendations may be inaccurate
    Enable the slow query log to troubleshoot bad queries
    When making adjustments, make tmp_table_size/max_heap_table_size equal
    Reduce your SELECT DISTINCT queries without LIMIT clauses
    Set thread_cache_size to 4 as a starting value
    Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
    key_buffer_size (> 381.0K)
    query_cache_size (>= 8M)
    tmp_table_size (> 32M)
    max_heap_table_size (> 16M)
    thread_cache_size (start at 4)
    table_cache (> 4)

I haven’t made any of the recommended changes yet though. I am going to try to see how this default small config performs.

I’ll try to follow up with any of my findings.

Reduce MySQL memory usage

Rails initial request slow with mod_rails

Following up on my previous post , I’ve been experience slow load times (10-15 secs) on the initial request after application restarts. This has to do with the way mod_rails manages application instances (Although, I experienced this when using mongrel_cluster and proxy balancers). It will spin up instances on page request and each instance has an idle timeout. This just means after the timeout expires, mod_rails will shutdown that instance to conserve memory allocation. While you can change timeout value (see PassengerPoolIdleTime), this will only cause all instances that get spin up to live longer. After high load times, these instances will stick around longer than neccessary.

For low traffic sites (like mine), this idle timeout may be reached causing the next visitor to our website to experience a really long delay before page load. What we really want is an option to set a minimum number of instances. This would allow us to automatically spin up an instance during start up and keep it around. Unfortunately at this time, it doesn’t look like there is a way to set this.

As a workaround, I’ve setup a crontab that makes a request to my application every 5 minutes to prevent mod_rails from killing off all application instances.

To do this just run:

crontab -e

And then specific the following cron

*/5 * * * * wget -O /dev/null http://www.myapp.com 2>/dev/null

You can verify this is working correctly but just tailing your application logs and verify every 5 minutes you get a request.

You can also run

 passenger-status

You should see at least the count variable to be at least 1 instance.

Note, this workaround will not immediate start up an instance upon restart. You can add an initial request as part of your post deploy capistrano task though. You probably should be making sure your application is up after deploying or restarting the application anyways.

Rails initial request slow with mod_rails

Setting up Phusion Passenger (mod_rails) with Capistrano support

I had heard of mod_rails awhile back but never had the time to take a closer look at it. While setting up a new rails app, I was getting frustrated with all of the configuration I needed to do to get the mongrel clusters and proxy balancers setup. So I decided to give passenger a chance. I’m a fan now 🙂

The process was dead simple.

  1. Install the passenger gem
    sudo gem install passenger
  2. Install passenger as an Apache module
    passenger-install-apache2-module
  3. Load the passenger apache module by editing the Apache config
    LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.5/ext/apache2/mod_passenger.so
    PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.5
    PassengerRuby /usr/bin/ruby1.8
    
  4. Restart Apache

If all things went well, you have everything installed you need. If there were some missing dependencies, you should be presented with how to install those dependencies.

In the installation output, it tells you how to mod_railsify your apps by creating a vhost as such:

<VirtualHost *:80>
    ServerName www.mywebsite.com
    DocumentRoot /home/deploy/mywebsite/public
</VirtualHost>

That’s it! No more of this proxy balancer and mongrel_cluster.yml configuration.

There’s some magic going on in the background. As requests come in, passenger will spin up more application instances. For more tweaking your configuration options check out the user guide.

Go to your website and you should see your rails app up and running.

So now we have your app up and running, how do we update or restart our app? Passenger provides two ways for us to do this.

The first is whenever apache is restarted, your application is restarted.

The second way allows us to restart a specified application without affecting Apache. Whenever passenger detects tmp/restart.txt, it will restart the application instances for us. We can integrate this into our Capistrano deploy flow by adding the following our config/deploy.rb

namespace :passenger do
  desc "Restart Application"
  task :restart do
    run "touch #{current_path}/tmp/restart.txt"
  end
end

after :deploy, "passenger:restart"

This will create that restart.txt after the cap:deploy task gets executed, causing the application to restart.

Finally, passenger comes with some pretty useful utilities.

Check out passenger-status which produces output showing current passenger server statuses.

Sample output:

----------- General information -----------
max      = 6
count    = 1
active   = 0
inactive = 1
Using global queue: no
Waiting on global queue: 0

----------- Applications -----------
/home/deploy/www.myapp.com/releases/20081206183156: 
  PID: 30784     Sessions: 0

Another utility passenger-memory-status gives you insight into how much memory is being used by apache and passenger.

Sample output:

-------------- Apache processes ---------------
PID    PPID   Threads  VMSize    Private  Name
-----------------------------------------------
12841  1      1        225.9 MB  0.0 MB   /usr/sbin/apache2 -k start
28294  12841  1        248.4 MB  21.4 MB  /usr/sbin/apache2 -k start
28300  12841  1        243.7 MB  0.5 MB   /usr/sbin/apache2 -k start
28306  12841  1        248.4 MB  4.4 MB   /usr/sbin/apache2 -k start
28357  12841  1        249.1 MB  19.8 MB  /usr/sbin/apache2 -k start
29400  12841  1        249.4 MB  3.7 MB   /usr/sbin/apache2 -k start
29788  12841  1        249.3 MB  21.7 MB  /usr/sbin/apache2 -k start
29834  12841  1        245.8 MB  18.9 MB  /usr/sbin/apache2 -k start
29836  12841  1        245.8 MB  9.3 MB   /usr/sbin/apache2 -k start
29868  12841  1        245.8 MB  2.4 MB   /usr/sbin/apache2 -k start
29870  12841  1        246.5 MB  5.2 MB   /usr/sbin/apache2 -k start
### Processes: 11
### Total private dirty RSS: 107.44 MB

--------- Passenger processes ----------
PID    Threads  VMSize    Private  Name
----------------------------------------
28031  10       15.3 MB   0.1 MB   /usr/lib/ruby/gems/1.8/gems/passenger-2.0.5/ext/apache2/ApplicationPoolServerExecutable 0 /usr/lib/ruby/gems/1.8/gems/passenger-2.0.5/bin/passenger-spawn-server  /usr/bin/ruby1.8  /tmp/passenger_status.12841.fifo
28032  2        48.7 MB   0.6 MB   Passenger spawn server
29161  1        114.8 MB  0.7 MB   Passenger FrameworkSpawner: 2.1.2
30461  1        122.8 MB  32.3 MB  Passenger ApplicationSpawner: /home/deploy/www.myapp.com/releases/20081206183156
30784  1        129.3 MB  33.4 MB  Rails: /home/deploy/www.myapp.com/releases/20081206183156
### Processes: 5
### Total private dirty RSS: 67.08 MB

Pretty sweet.

Setting up Phusion Passenger (mod_rails) with Capistrano support

2 ways to fix transparent PNG files in IE6

I fired up Photoshop for the first time in a long time. I created a transparent PNG for an image that would be used as a CSS background-image. It keeps displaying with a gray background even though the page background color was something else.

This is a pretty well documented bug. Luckily, there are a couple of ways to fix this.

Here are my two favorites:

The first solution is well documented:

Download iepngfix.zip. The development version 2.0 Alpha 3 has support for background position and repeat. Extract the zip and copy iepngfix.htc and blank.gif somewhere. I put in under stylesheets.

Add the following snippet to your CSS stylesheet:

img { 
	behavior: url(/stylesheets/iepngfix.htc); 
}

And you’re done! Hit refresh in IE6 and transparent PNG images should render correctly now.

You can add apply this fix to other elements that may be using PNG images as CSS background images as such:

img, #logo { 
	behavior: url(/stylesheets/iepngfix.htc); 
}

where logo is a div that has a background-image that is a transparent PNG.

Note: If you are using v2.0 and want to take advantage of background-repeat and position support, copy iepngfix_tilebg.js to your javascripts folder and include the js file in the HTML files you need it for.

The second way to fix this is to get everyone off IE6 but I guess that’s just wishful thinking…

2 ways to fix transparent PNG files in IE6

undefined local variable or method `remote_gemspecs’

I decided I wanted to dedicate some time this weekend working on some side projects. Of course before I start, I needed to get the latest and greatest updates so I ran gem update and got the following error

theo@theo~/dev $ sudo gem update
Updating installed gems
...
Updating rubygems-update
Successfully installed rubygems-update-1.3.1
ERROR:  While executing gem ... (NameError)
    undefined local variable or method `remote_gemspecs' for #

Reading the release notes:

NOTE: RubyGems 1.1 and 1.2 have problems upgrading when there is no
rubygems-update installed. You will need to follow the second set of update
instructions if you see “Nothing to update”.

shows that we need to install and run the rubygem-update gem to get this fixed

  theo@theo~/dev $ sudo gem install rubygems-update
Successfully installed rubygems-update-1.3.1
1 gem installed
  theo@theo~/dev $ sudo update_rubygems 
Installing RubyGems 1.3.1
mkdir -p /Library/Ruby/Site/1.8
mkdir -p /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin
install -c -m 0644 rbconfig/datadir.rb /Library/Ruby/Site/1.8/rbconfig/datadir.rb
install -c -m 0644 rubygems/builder.rb /Library/Ruby/Site/1.8/rubygems/builder.rb
install -c -m 0644 rubygems/command.rb /Library/Ruby/Site/1.8/rubygems/command.rb
install -c -m 0644 rubygems/command_manager.rb /Library/Ruby/Site/1.8/rubygems/command_manager.rb
install -c -m 0644 rubygems/commands/build_command.rb /Library/Ruby/Site/1.8/rubygems/commands/build_command.rb
install -c -m 0644 rubygems/commands/cert_command.rb /Library/Ruby/Site/1.8/rubygems/commands/cert_command.rb
install -c -m 0644 rubygems/commands/check_command.rb /Library/Ruby/Site/1.8/rubygems/commands/check_command.rb
install -c -m 0644 rubygems/commands/cleanup_command.rb /Library/Ruby/Site/1.8/rubygems/commands/cleanup_command.rb
install -c -m 0644 rubygems/commands/contents_command.rb /Library/Ruby/Site/1.8/rubygems/commands/contents_command.rb
install -c -m 0644 rubygems/commands/dependency_command.rb /Library/Ruby/Site/1.8/rubygems/commands/dependency_command.rb
install -c -m 0644 rubygems/commands/environment_command.rb /Library/Ruby/Site/1.8/rubygems/commands/environment_command.rb
install -c -m 0644 rubygems/commands/fetch_command.rb /Library/Ruby/Site/1.8/rubygems/commands/fetch_command.rb
install -c -m 0644 rubygems/commands/generate_index_command.rb /Library/Ruby/Site/1.8/rubygems/commands/generate_index_command.rb
install -c -m 0644 rubygems/commands/help_command.rb /Library/Ruby/Site/1.8/rubygems/commands/help_command.rb
install -c -m 0644 rubygems/commands/install_command.rb /Library/Ruby/Site/1.8/rubygems/commands/install_command.rb
install -c -m 0644 rubygems/commands/list_command.rb /Library/Ruby/Site/1.8/rubygems/commands/list_command.rb
install -c -m 0644 rubygems/commands/lock_command.rb /Library/Ruby/Site/1.8/rubygems/commands/lock_command.rb
install -c -m 0644 rubygems/commands/mirror_command.rb /Library/Ruby/Site/1.8/rubygems/commands/mirror_command.rb
install -c -m 0644 rubygems/commands/outdated_command.rb /Library/Ruby/Site/1.8/rubygems/commands/outdated_command.rb
install -c -m 0644 rubygems/commands/pristine_command.rb /Library/Ruby/Site/1.8/rubygems/commands/pristine_command.rb
install -c -m 0644 rubygems/commands/query_command.rb /Library/Ruby/Site/1.8/rubygems/commands/query_command.rb
install -c -m 0644 rubygems/commands/rdoc_command.rb /Library/Ruby/Site/1.8/rubygems/commands/rdoc_command.rb
install -c -m 0644 rubygems/commands/search_command.rb /Library/Ruby/Site/1.8/rubygems/commands/search_command.rb
install -c -m 0644 rubygems/commands/server_command.rb /Library/Ruby/Site/1.8/rubygems/commands/server_command.rb
install -c -m 0644 rubygems/commands/sources_command.rb /Library/Ruby/Site/1.8/rubygems/commands/sources_command.rb
install -c -m 0644 rubygems/commands/specification_command.rb /Library/Ruby/Site/1.8/rubygems/commands/specification_command.rb
install -c -m 0644 rubygems/commands/stale_command.rb /Library/Ruby/Site/1.8/rubygems/commands/stale_command.rb
install -c -m 0644 rubygems/commands/uninstall_command.rb /Library/Ruby/Site/1.8/rubygems/commands/uninstall_command.rb
install -c -m 0644 rubygems/commands/unpack_command.rb /Library/Ruby/Site/1.8/rubygems/commands/unpack_command.rb
install -c -m 0644 rubygems/commands/update_command.rb /Library/Ruby/Site/1.8/rubygems/commands/update_command.rb
install -c -m 0644 rubygems/commands/which_command.rb /Library/Ruby/Site/1.8/rubygems/commands/which_command.rb
install -c -m 0644 rubygems/config_file.rb /Library/Ruby/Site/1.8/rubygems/config_file.rb
install -c -m 0644 rubygems/custom_require.rb /Library/Ruby/Site/1.8/rubygems/custom_require.rb
install -c -m 0644 rubygems/defaults.rb /Library/Ruby/Site/1.8/rubygems/defaults.rb
install -c -m 0644 rubygems/dependency.rb /Library/Ruby/Site/1.8/rubygems/dependency.rb
install -c -m 0644 rubygems/dependency_installer.rb /Library/Ruby/Site/1.8/rubygems/dependency_installer.rb
install -c -m 0644 rubygems/dependency_list.rb /Library/Ruby/Site/1.8/rubygems/dependency_list.rb
install -c -m 0644 rubygems/digest/digest_adapter.rb /Library/Ruby/Site/1.8/rubygems/digest/digest_adapter.rb
install -c -m 0644 rubygems/digest/md5.rb /Library/Ruby/Site/1.8/rubygems/digest/md5.rb
install -c -m 0644 rubygems/digest/sha1.rb /Library/Ruby/Site/1.8/rubygems/digest/sha1.rb
install -c -m 0644 rubygems/digest/sha2.rb /Library/Ruby/Site/1.8/rubygems/digest/sha2.rb
install -c -m 0644 rubygems/doc_manager.rb /Library/Ruby/Site/1.8/rubygems/doc_manager.rb
install -c -m 0644 rubygems/exceptions.rb /Library/Ruby/Site/1.8/rubygems/exceptions.rb
install -c -m 0644 rubygems/ext/builder.rb /Library/Ruby/Site/1.8/rubygems/ext/builder.rb
install -c -m 0644 rubygems/ext/configure_builder.rb /Library/Ruby/Site/1.8/rubygems/ext/configure_builder.rb
install -c -m 0644 rubygems/ext/ext_conf_builder.rb /Library/Ruby/Site/1.8/rubygems/ext/ext_conf_builder.rb
install -c -m 0644 rubygems/ext/rake_builder.rb /Library/Ruby/Site/1.8/rubygems/ext/rake_builder.rb
install -c -m 0644 rubygems/ext.rb /Library/Ruby/Site/1.8/rubygems/ext.rb
install -c -m 0644 rubygems/format.rb /Library/Ruby/Site/1.8/rubygems/format.rb
install -c -m 0644 rubygems/gem_openssl.rb /Library/Ruby/Site/1.8/rubygems/gem_openssl.rb
install -c -m 0644 rubygems/gem_path_searcher.rb /Library/Ruby/Site/1.8/rubygems/gem_path_searcher.rb
install -c -m 0644 rubygems/gem_runner.rb /Library/Ruby/Site/1.8/rubygems/gem_runner.rb
install -c -m 0644 rubygems/indexer.rb /Library/Ruby/Site/1.8/rubygems/indexer.rb
install -c -m 0644 rubygems/install_update_options.rb /Library/Ruby/Site/1.8/rubygems/install_update_options.rb
install -c -m 0644 rubygems/installer.rb /Library/Ruby/Site/1.8/rubygems/installer.rb
install -c -m 0644 rubygems/local_remote_options.rb /Library/Ruby/Site/1.8/rubygems/local_remote_options.rb
install -c -m 0644 rubygems/old_format.rb /Library/Ruby/Site/1.8/rubygems/old_format.rb
install -c -m 0644 rubygems/package/f_sync_dir.rb /Library/Ruby/Site/1.8/rubygems/package/f_sync_dir.rb
install -c -m 0644 rubygems/package/tar_header.rb /Library/Ruby/Site/1.8/rubygems/package/tar_header.rb
install -c -m 0644 rubygems/package/tar_input.rb /Library/Ruby/Site/1.8/rubygems/package/tar_input.rb
install -c -m 0644 rubygems/package/tar_output.rb /Library/Ruby/Site/1.8/rubygems/package/tar_output.rb
install -c -m 0644 rubygems/package/tar_reader/entry.rb /Library/Ruby/Site/1.8/rubygems/package/tar_reader/entry.rb
install -c -m 0644 rubygems/package/tar_reader.rb /Library/Ruby/Site/1.8/rubygems/package/tar_reader.rb
install -c -m 0644 rubygems/package/tar_writer.rb /Library/Ruby/Site/1.8/rubygems/package/tar_writer.rb
install -c -m 0644 rubygems/package.rb /Library/Ruby/Site/1.8/rubygems/package.rb
install -c -m 0644 rubygems/platform.rb /Library/Ruby/Site/1.8/rubygems/platform.rb
install -c -m 0644 rubygems/remote_fetcher.rb /Library/Ruby/Site/1.8/rubygems/remote_fetcher.rb
install -c -m 0644 rubygems/require_paths_builder.rb /Library/Ruby/Site/1.8/rubygems/require_paths_builder.rb
install -c -m 0644 rubygems/requirement.rb /Library/Ruby/Site/1.8/rubygems/requirement.rb
install -c -m 0644 rubygems/rubygems_version.rb /Library/Ruby/Site/1.8/rubygems/rubygems_version.rb
install -c -m 0644 rubygems/security.rb /Library/Ruby/Site/1.8/rubygems/security.rb
install -c -m 0644 rubygems/server.rb /Library/Ruby/Site/1.8/rubygems/server.rb
install -c -m 0644 rubygems/source_index.rb /Library/Ruby/Site/1.8/rubygems/source_index.rb
install -c -m 0644 rubygems/source_info_cache.rb /Library/Ruby/Site/1.8/rubygems/source_info_cache.rb
install -c -m 0644 rubygems/source_info_cache_entry.rb /Library/Ruby/Site/1.8/rubygems/source_info_cache_entry.rb
install -c -m 0644 rubygems/spec_fetcher.rb /Library/Ruby/Site/1.8/rubygems/spec_fetcher.rb
install -c -m 0644 rubygems/specification.rb /Library/Ruby/Site/1.8/rubygems/specification.rb
install -c -m 0644 rubygems/test_utilities.rb /Library/Ruby/Site/1.8/rubygems/test_utilities.rb
install -c -m 0644 rubygems/timer.rb /Library/Ruby/Site/1.8/rubygems/timer.rb
install -c -m 0644 rubygems/uninstaller.rb /Library/Ruby/Site/1.8/rubygems/uninstaller.rb
install -c -m 0644 rubygems/user_interaction.rb /Library/Ruby/Site/1.8/rubygems/user_interaction.rb
install -c -m 0644 rubygems/validator.rb /Library/Ruby/Site/1.8/rubygems/validator.rb
install -c -m 0644 rubygems/version.rb /Library/Ruby/Site/1.8/rubygems/version.rb
install -c -m 0644 rubygems/version_option.rb /Library/Ruby/Site/1.8/rubygems/version_option.rb
install -c -m 0644 rubygems.rb /Library/Ruby/Site/1.8/rubygems.rb
install -c -m 0644 ubygems.rb /Library/Ruby/Site/1.8/ubygems.rb
cp gem /tmp/gem
install -c -m 0755 /tmp/gem /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem
rm /tmp/gem
rm -f /Users/theo/.gem/source_cache
rm -f /Library/Ruby/Gems/1.8/source_cache
Removing old RubyGems RDoc and ri
rm -rf /Library/Ruby/Gems/1.8/doc/rubygems-1.2.0
Installing rubygems-1.3.1 ri into /Library/Ruby/Gems/1.8/doc/rubygems-1.3.1/ri
Installing rubygems-1.3.1 rdoc into /Library/Ruby/Gems/1.8/doc/rubygems-1.3.1/rdoc

------------------------------------------------------------------------------

= Announce: RubyGems Release 1.3.0

NOTE:  RubyGems 1.1 and 1.2 have problems upgrading when there is no
rubygems-update installed.  You will need to follow the second set of update
instructions if you see "Nothing to update".

Release 1.3.0 fixes some bugs.

Bugs fixed:

* Disregard ownership of ~ under Windows while creating ~/.gem.  Fixes
  issues related to no uid support under Windows.
* Fix requires for Gem::inflate, Gem::deflate, etc.
* Make Gem.dir respect :gemhome value from config.  (Note: this feature may be
  removed since it is hard to implement on 1.9.)
* Kernel methods are now private.  Patch #20801 by Stefan Rusterholz.
* Gem::location_of_caller now behaves on Windows.  Patch by Daniel Berger.
* Silence PATH warning.

Deprecation Notices:

* Gem::manage_gems will be removed on or after March 2009.

For a full list of changes to RubyGems and the contributor for each change, see
the ChangeLog file.

Special thanks to Chad Wooley for backwards compatibility testing and Luis
Lavena for continuing windows support.

== How can I get RubyGems?

NOTE:  If you have installed RubyGems using a package system you may want to
install a new RubyGems through the same packaging system.

If you have a recent version of RubyGems (0.8.5 or later), then all
you need to do is:

  $ gem update --system   (you might need to be admin/root)

NOTE:  RubyGems 1.1 and 1.2 have problems upgrading when there is no
rubygems-update installed.  You will need to follow the second set of update
instructions if you see "Nothing to update".

NOTE: You may have to run the command twice if you have any previosly
installed rubygems-update gems.

If you have an older version of RubyGems installed, then you can still
do it in two steps:

  $ gem install rubygems-update  (again, might need to be admin/root)
  $ update_rubygems              (... here too)

If you don't have any gems install, there is still the pre-gem
approach to getting software ... doing it manually:

1. DOWNLOAD FROM: http://rubyforge.org/frs/?group_id=126
2. UNPACK INTO A DIRECTORY AND CD THERE
3. INSTALL WITH:  ruby setup.rb  (you may need admin/root privilege)

== To File Bugs

The RubyGems bug tracker can be found on RubyForge at:
http://rubyforge.org/tracker/?func=add&group_id=126&atid=575

When filing a bug, `gem env` output will be helpful in diagnosing the issue.

If you find a bug where RubyGems crashes, please provide debug output. You can
do that with `gem --debug the_command`.

== Thanks

Keep those gems coming!

-- Jim & Chad & Eric (for the RubyGems team)


------------------------------------------------------------------------------

RubyGems installed the following executables:
	/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem

If `gem` was installed by a previous RubyGems installation, you may need
to remove it by hand.

undefined local variable or method `remote_gemspecs’