« Page 13 of 18 »

  1. Textmate is a superb text/code editor for the Mac that makes extensive use of keyboard shortcuts to make your life easier.

    One of the most important shortcuts in Textmate is Control-Escape, which opens a "Gear" menu with important context-sensitive functions. However, if you turn on the Screen Sharing or Remote Management features of your Mac, you will find that the Control-Escape key combination no longer works. The remote-access applications hijack this shortcut.

    To continue using the default Control-Escape shortcut with Textmate, you have no choice but to turn off all of the remote-access applications.

    If this is not an option, you will need to configure Texmate to recognise a new shortcut for the gear menu. Here are the steps to substitute Command-Escape for the Control-Escape shortcut:

    1. Prevent the Command-Escape shortcut from starting Front Row, by opening the Keyboard and Mouse preferences and disabling the first shortcut option: "Hide and show Front Row"
    2. Remap the Gear activation key by setting an application property for Textmate with the following command (all on one line):

      defaults write com.macromates.textmate OakBundleItemsPopUpMenuKeyEquivalent "@\033"
      

    Relaunch Textmate, and you should now be able to use the Command-Escape shortcut to access the gear menu.

    You can find more information about Textmate shortcut keys and the Control-Escape issue at the following links:

    There are comments.

  2. Amazon has announced the availability of two new Elastic Compute Cloud (EC2) instance types with increased CPU processing power, bringing the total number of instance types to five.

    The new instances are termed "High-CPU" versions, and they have a focus on raw processing power as measured in EC2 Compute Units (ECUs). The following table puts the new c1.medium and c1.xlarge instances in perspective:

    Name ECUs Memory Storage Platform Hourly Price


    m1.small 1 1.7 GB 160 GB 32-bit 10¢ c1.medium 5 1.7 GB 350 GB 32-bit 20¢ m1.large 4 7.5 GB 850 GB 64-bit 40¢ c1.xlarge 20 7 GB 1690 GB 64-bit 80¢ m1.xlarge 8 15 GB 1690 GB 64-bit 80¢

    For a more detailed overview of the instance types available in EC2, see the Instance Types section in the service's API documentation.

    There are comments.

  3. I have added an article about my PAWS Marketplace example application to the AWS resources site: PAWS Marketplace - A Rails Marketplace Application in the Cloud.

    The PAWS Marketplace is a proof-of-concept Ruby on Rails web application that runs entirely on Amazon Web Services. The application’s web site allows anyone with an Amazon Payments account to buy or sell digital products, while the marketplace’s owner earns commissions for the sales it performs. In addition to serving as an example marketplace implementation, this application is interesting because it uses the SimpleDB service to store its data instead of a traditional relational database.

    The article describes how to install and run the marketplace web site yourself. It also includes links to the example code, and to a screencast video that demonstrates how to configure and use the marketplace web site.

    There are comments.

  4. If you need to compile or run Java programs from the command line, it can be a real hassle to identify all the jar libraries the program requires and include them in your classpath.

    Here is a short script that will do this work for you on Unix, Linux or Mac systems. It finds all the jar files in the current directory or its subdirectories, and merges the list into a classpath string delimited by colon (:) characters.

    export CP=`find . -name '*.jar' | tr "\n" :`
    

    You can then run your program like so:

    java -classpath $CP MyProgram
    

    There are comments.

  5. Amazon has announced beta support for the Copy Object operation in S3. This feature was pre-announced in March.

    The copy functionality allows you to copy objects within or between your S3 buckets, and optionally to replace the metadata associated with the object in the process. The single new operation makes it possible to copy, move, and rename your S3 objects, and you can even update an object's metadata by copying the object in-place.

    The feature is only in beta release at this stage and you cannot yet copy objects between the US and EU (Europe) locations.

    I have added support for this operation to the JetS3t library toolkit, so check out the latest version from CVS if you want to try it out.

    For those using the example code from Programming Amazon Web Services (affiliate link), here is a method you can add to the S3 class in S3.rb to implement the copy feature:

    def copy_object(source_bucket_name, source_object_key,
      dest_bucket_name, dest_object_key, acl=nil, new_metadata=nil)
    
      headers = {}
    
      # Identify the source object
      headers['x-amz-copy-source'] = CGI::escape(
        source_bucket_name + '/' + source_object_key)
    
      # Copy metadata from original object, or replace the metadata.
      if new_metadata.nil?
        headers['x-amz-metadata-directive'] = 'COPY'
      else
        headers['x-amz-metadata-directive'] = 'REPLACE'
        headers.merge!(new_metadata)
      end
    
      # The Content-Length header must always be set.
      headers['Content-Length'] = '0'
    
      # Set the canned policy, may be: 'private', 'public-read',
      # 'public-read-write', 'authenticated-read'
      headers['x-amz-acl'] = acl if acl
    
      uri = generate_s3_uri(dest_bucket_name, dest_object_key)
      do_rest('PUT', uri, nil, headers)
      return true
    end
    

    The following command uses the copy_object method to copy an object named Object.txt from one bucket to another and make the resulting object publicly-accessible:

    s3.copy_object('from-bucket', 'Object.txt',
      'to-bucket', 'Object.txt', 'public-read')
    

    The following code will replace an object's metadata in-place without creating a new object. This allows us to set new values for the content type and "example-name" metadata items:

    metadata = {
      'Content-Type' => 'text/xml',
      'x-amz-meta-example-name' => 'Example Value'}
    
    s3.copy_object('from-bucket', 'Object.txt',
      'from-bucket', 'Object.txt', 'private', metadata)
    

    There are comments.

« Page 13 of 18 »