New Cloud Foundry Client Tool -> CF

cf 1.0.0

Friendly command-line interface for Cloud Foundry Version 2 – a client-side tool that is identical to the existing vmc tool for Cloud Foundry Version 1. This is version two of the cloud foundry command line tool. We use it to tap into the second version of cloud foundry, known as V2. This tool requires cloud_controller_ng.

Picture 6

Go here: http://rubygems.org/gems/cf for install details – note that you will need a functioning ruby environment including the ‘gems’ feature of ruby. You can see if you have it by typing :

gem

on your terminal command line. See this : Picture 5

from your terminal command line after successfully confirming gems is present, install the CF client tool, next:

gem install cf

I’ve also installed another piece of the puzzle to play with called ‘cfoundry’. You won’t need this, so just look in middle of this screenshot. Note that i had to use the super user prefix ‘sudo’ to get enough authority to proceed. sudo gem install cf

If you know anything about ruby Gems, this documentation may mean something to you : http://rubydoc.info/gems/cf/1.0.0/frames

See more details of mailing list and conversations here about Cloud Foundry NG (Next Generation) – V2 : http://www.cloudfoundry.com/getinvolved

Am not quite clear on this yet but will post more later once i do some research on it. The NG version of Cloud Foundry will require name spaces and/or organizations as a component to uniquely identify an application. So to use the ‘CF‘ tool, we need additional parameters to log on to the remote server. More soon -

Properly installed, you might see your session look like this : Picture 2


Update :

Have found some new cloud foundry documentation reflecting the changes in work practices from version one. We have further details on the actual commands to be found in the new ‘CF’ tool – so look here.

An overview of the organization and spaces features can be found here. See this example :Diagram of Spaces and Organizations

We can use our new ‘CF’ tool to manage both these attributes. There also appear to be some programmable API interfaces we can use to create automated solutions to manage them. One of these is the Java client library (vcap-java-client). It’s to interact with a Cloud Foundry instance. This library is used by the Cloud Foundry Maven plugin, the Cloud Foundry Gradle plugin, the Cloud Foundry STS integration, and other Java-based tools. Cool. Ruby versions are also there. It all appears to hinge on the use of RESTful API connections.

Gradle

Since i use gradle as a build tool, i like this plugin to give my gradle build a connection to a remote Cloud Foundry server. See more on the plugin for gradle here: http://docs.cloudfoundry.com/docs/using/managing-apps/build-tools/gradle.html with nice examples. Hope to blog on this a bit more once i get a spell of time for some research.  MORE:-> spent several hours trying to get this gradle plugin to work, or at least load/resolve the proper location for it – to no avail. So either it has moved, or  more likely, i do not understand how to properly declare maven repository addresses. There are other plugins for gradle to reach Cloud Foundry, so will look again once i have more time.

buildscript {
  repositories {
    mavenCentral()
    maven { url "http://repo.springsource.org/libs-milestone-s3-cache" }
  }
  dependencies {
    classpath group: 'org.gradle.api.plugins', name: 'gradle-cf-plugin', version: '0.2.0'
  }
}

apply plugin: 'cloudfoundry'

cloudfoundry {
  username = 'jondoe@gmail.com'
  password = 'mypassword'
  application = 'test_grails_app'
  framework = 'grails'
  file = new File('/path/to/app.war')
  uris = ['http://caelyfproject5.cloudfoundry.com']
}

How To Convert Firefox Bookmark Dates Using Groovy/Java

Firefox offers us two ways to keep our bookmarks, 1: backup as a json formatted file or 2: export as an html file.

This tip is for the json backup crowd :)

When we backup our bookmarks from Firefox, they come out formatted as json. The dates found therein are stored in what’s known as epoch dates ( read this ) though include millesecond precision – meaning 1,000 trailing milliseconds. So, for example, the firefox bookmark lastModified date of  1366313580447014 is really just 1366313580447. So when we write code, we divide by 1,000 to remove that part. My groovy code sample seemed to work when it looked like this :

def convertDate(def epoch)
{
     long dv = epoch / 1000; // divide by 1,000 to avoid milliseconds 
     String dt = new java.text.SimpleDateFormat("dd/MMM/yyyy HH:mm:ss").format(new java.util.Date (dv)); 
     // to get epoch date: 
     // long epoch = new java.text.SimpleDateFormat("MM/dd/yyyy HH:mm:ss").parse("01/01/1970 01:00:00").getTime() * 1000; 
     return dt; 
} // end of def

So for a test sample, i did a firefox backup to get bookmarks-2013-04-29.json. Then added some groovy sugar to parse the text with json slurper.

json.lastModified :1366313580447014
convert from epoch date:18/Apr/2013 21:33:00

from :
println “convert from epoch date:”+convertDate(json.lastModified)

Teardrops

Teardrops - a song on Womack & Womack‘s fourth studio albumConscience (1988). The songwriters were listed as Cecil and Linda Womack, who also served as the producers of the track alongside Chris Blackwell. Released as the album’s lead single during the third quarter of 1988 (see 1988 in music), it charted highly around the world, reaching number one in Australia and the Netherlands, number two in Germany andSwitzerland, and number three in the UK.

Here are the original from Cecil and Linda and a cover by Joss Stone – both versions are super. Which one do you like ?


Can’t confirm this but the blond singer here has been identified as Lee Ann Womack, though her discography and wiki do not list her as a participant.

TenFourFox (aka Firefox) V20.0 ready for Apple iMac PPC’s G3,G4 & G5

The staff at Floodgap Software have worked overtime to keep us older Apple iMac people happy by reworking the Mozilla source code for Firefox. This allows them to produce a version of this famous browser for the PowerPC chipsets found in older Apple iMac, Powerbooks, etc. Supported chipsets include G3, G4 and G5 processors. You can look at their Floodgap Intro Page here: http://www.floodgap.com/software/tenfourfox/

Grab a download of the TenFourFox Version (Firefox) for your iMac PowerPC Chipset system here: http://code.google.com/p/tenfourfox/downloads/list. You will need to know which processor your system has.

The release notes can be found here : http://code.google.com/p/tenfourfox/wiki/ReleaseNotes200

Developer notes can be found here: http://tenfourfox.blogspot.fr/

Building a Git Client 1.8.2 on Apple iMac PPC OSX 10.5.8

Preview

My aging Apple iMac has a G7450 PPC chipset. It has seen many developer wars from years gone by, and still it does frequent battle with software developed solely for the Intel world of Apple.

Now

As my current efforts revolve around learning Git tooling, it became apparent that very old versions of Git clients would not offer the new features we need when developing and packaging code. This forced me to pull out my 20 year old notes on how to code and compile in the C programming language. Ug! It’s like reliving a nightmare – now i remember why i learned cobol, rpg and java !

Rescue

A bit of googling found this link from shiningthrough.co.uk which gives us a clear set of instructions to build the latest git client from C source code. You’ll need an Apple with a PPC chipset ( if you are using an Intel chipset, this post is not for you! ), a C compiler (mine came with the Apple development tool Xcode), the C source code, a bunch of free disk space, patience, and luck.

Picture 2Git Client

To build a recent version of the git client, here is an overview of the steps we’ll follow :

  1. Download a recent version of the Git client from here. This is for version 1.8.2.tar.gz or you can choose a later version if you must.
  2. Open a command terminal
  3. Unpack / unzip the downloaded archive
  4. Change to the directory where you downloaded the C source code from above
  5. Compile the source code
  6. Install the compiled program
  7. Test

Terminal Commands

From your terminal command line, do these steps :

Get source code as above

cd ~/Downloads
tar -xjf git-1.8.2.tar.gz
cd git-1.8.2
make prefix=/usr/local
sudo make prefix=/usr/local install

// after you restart your system / or at least logon again as your user

git –version

// you should see something like this:
iMac:git-1.8.2 jim$ ./git -version
Unknown option: -version
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
iMac:git-1.8.2 jim$ ./git –version
git version 1.8.2