Saturday, 7 September 2013

Iron Man Zombie Robot Hitler is not happy - and he has a gatling gun

No.
I'm not kidding.
Ben keeps finding these movies.
I don't know how he does it.

He's a node warrior.

In any case 'Nazis at the Centre of the Earth' is worth a look.
If you are into gouging your eyes out with forks that is.

It's appalling.
There are so many 'WTFFF?' moments in this movie I couldn't even begin to do justice to it.
Although in this case justice might be better served by getting every copy on the planet and burning them.
Oh.. And the extra two F's are 100% totally insufficient.

I think the point when I said "Ok. This is very, very bad" was when an Lockheed P-3 Orion survey plane encounters the Nazi saucer rising out of the Antarctic ice and the radio conversation goes something like this:

Pilot: "I'd like to report a UFO!"
Off-Camera Dude: "UFO?"
Pilot: "Yes! It's huge!"
Off-Camera Dude: "You're cleared to engage!"

Wait. What? Engage? With what? Bad language? This is an Orion, not an F-18!

And then the Orion launches 8, yes *eight*, Hellfire missiles at the saucer.

"Calm down Kim... Breathe..."

Two things.

1) It's a frackin' survey plane. I know the Americans go a little gun happy arming things, but an Orion? In Antarctica? Hellfires? Eight of them?

2) As the pilot of the Orion, I would notice that the saucer is size of Nebraska. Oh. And the rivets holding it together were 3 foot across. Eight Hellfires would not be enough. Sixty four wouldn't be enough. I'd be "gone".

Oh.. And Robot Hitler? Cool. In a "WTF?" kinda way. I kept asking myself some things:

1) Why does he need to sit down? He's a frickin' robot.
2) Robot Hitler?
3) Gatling gun?
4) [Head explodes]

But I digress.

Wait. Where was i?
Oh yes.
It's KRAP.
But in a that "Wouldn't Miss It For The World" kinda way.
A kinda "Robot Hitler with a Gatling Gun" kinda way.

Wednesday, 4 September 2013

A Movie, my D&D roots and software development

Hmm.
Just finished watching "Tad - The Lost Explorer".
Worth it btw... So go find it and watch it.

In any case...
There was a scene where the explorers reach a chamber.
With dozens of different coloured ropes hanging down.
They eventually picked the right one of course...
And the door opened and the movie continued.

I was reminded of my D&D roots back in the 70's.
I ran a dungeon.
A bad one.
An evil one.
A 'gotcha' one.
An 'oh... I'm dead.. Frack!' one.

One weekend I had a dozen or so people trying to navigate my dungeon.
They encountered a room.
With coloured ropes hanging down.
And a door on the other side with "нажмите сюда" on a button.

(For those that don't know any Cyrillic it *very* roughly means "press here" - I'm not a Russian speaker so I apologise in advance for any butchering of the language)

So...
Here was a bunch of very smart people debating how to get across the room and open the door...

And did they debate?

Hell yeah.

For four weekends they investigated every rock, every crack, every sand grain at the entrance of the room.

I waited... Impatiently I might add...

On the fourth weekend, they had catalogued every rock, every crack, every sand grain...
They roped themselves together and formed a line across the room.
The one at the front (A guy who nearly had a heart attack doing it) strapped three spears together...
And with the air buzzing with protection spells, pressed the button.

And...

And...

The door opened.
The rest started the most excruciating process of getting each member, their donkeys, their supplies across that room.
They all made it.

Why? Because there was no trap...
They were inculcated with the idea that every move would be a deadly one.
My dungeons were death traps.
The slightest mis-step would end everyone.

That room.
They called it "The Room Of Sorrows."
Not that room.
I just put a simple room.
No traps.
No death.
No hidden issues.

I marvelled at their ingenuity at bypassing traps that weren't there.

They made it and congratulated each other.

And now, I look back and see how often a team of developers often does the same.
Not every issue is a "Room Of Sorrows."
You don't need to spend hours on some issues.

Sometimes you need to have the b***s to just barrel in and TRUST that you are frackin' smart enough and ugly enough to work out the issues as you take the path.

Pick a path.

Commit.

Oh. And Push... Mustn't forget the push.

Monday, 2 September 2013

GalactiCraft! OMG!

Ok. Haven't posted for a while as I've been rather busy.
Yesterday (Sunday) I decided to rebuild our internal network minecraft server up.
Got bukkit and configured it up and allowed external access to it for my family.

In any case, while doing this I stumbled on Galacticraft.
It's a tekkit mod that is just hilarious and looks very cool.

The site is at:

http://micdoodle8.com/mods/galacticraft

And you should *definitely* watch the podcasts by yoglabs.
Hysterically funny.
I cracked up repeatedly.

My favorite parts are.. are...
Oh what the heck...
ALL OF THEM.
Giant three headed creepers, spiders with spacesuits, Shai Hulud, alien eggs, variable gravity, slow motion skeleton arrows...
I just giggle madly if I think of the spider with a helmet and air tanks.

I could go on...
But you need to go and watch the podcasts.
Do it.
Do it now...

Oh... Shai Hulud... If you haven't watched or read Dune, this won't mean anything.
But don't despair! Go get the book, or watch the movies.
My favorite is the De Laurentius "theatrical" version. (We have all the versions)




Saturday, 17 August 2013

Harley and Callum - Foster Cats 14 and 15

Here are a few shots of our latest foster cats Harley (a male sleek black cat) and Callum (a male ginger cutie).
These two are completely inseparable.
They play and cuddle constantly.
They are also 'lickers'.
I've been cat-foliated several times now and my ears are squeeky clean if a bit sore.
Harley loves to groom and spends ages tugged and licking my hair.





Monday, 8 July 2013

CouchDB Sinatra REST bare-metal call test application

Some months ago I was involved in configuring an API to use with CouchDB. In the process of this, I created a test application using Sinatra to utilize the various CouchDB REST calls. This is that application.

Later I created a MUCH more sophisticated set of sub-apps in Padrino to utilize the lessons learned. For some time now I have been asked to release it into the wild to aid other developers, but have been too busy. Now I have time. Hence this post.

It is not great. It is not well written. It is not documented. It has no tests. But it works.

It was written in one day to get the process of using rest-client to operate against a test CouchDB database. That is all.

I make no apologies for the code.

It works. That is all.

To use it:

1) Install CouchDB someplace.

I have it on an external server as exampled in the config/couchdb.yml file.

2) Clone the repo from https://github.com/ZenGirl/CouchDBSinatraRestAPI

Goes without saying...

3) Change the config/couchdb.yml file

Change to suit.

4) Fire it up

bundle install
rackup -s thin -o 0.0.0.0 -p 9292 -E development config.ru

Then open a browser to http://0.0.0.0:9292/index.html and start playing.

Honestly!

I would love to here from cloners who would like enhancements as I'm always ready to learn. If you see a problem, or want to have me change something, tell me.

Sunday, 7 July 2013

Well, it's official. I've been unemployed for 6 months and broke.

I left Guvera officially mid last year due to fairly dramatic family needs. Then Guvera asked me back on contract which I could do while handling those family issues. I finished up that contract just before christmas to work on some other exciting projects.

I have tons of work on several major startups since then. Mainly Rails, Padrino and Java with some PHP and Systems Admin work. While those startups may still create income, none of them have produced dollar 1 so far.

So I have no option but to hit the job market and try to find work to pay the bills. So if you're looking for a highly experienced technologist, toolmaker, solution architect, problem solver, trouble shooter, firefighter and innovator, then go no further. Have a look at my LinkedIn profile to see if you could use my skill sets. In particular see my colleagues recommendations.

Here's a quick run down of who I am and what I can do:

I have over thirty years experience in computing and have worked for large multi-nationals such as Sun Microsystems, Microsoft, Western Mining Corporation and many, many startups. I have written Unix Systems Administration manuals and have taught systems administration and programming to both groups and individuals.

I love technology!
Since the late 70’s I have been involved in the open source community and contributed heavily to many early projects. My code exists in many implementations of linux and I have even been cited on a man page (albeit for a game). Ben and I own far too much tech... We even have a first gen MakerBot and have used it to fix quite a few things around the house!

TDD is a part of everything I write and has been for many years. Unfortunately I have found that many companies consider TDD to be a waste of programming resource, which I consider short sighted.

Release early, release often. I have always advocated this and used (and built) many deployment tools such as Capistrano et al to get code live quickly.

I have used MySQL, MongoDB and recently CouchDB to handle large amounts of data. A recent project involved 100’s of millions of documents handling companies historical data.

I am no stranger to working from home and can be incredibly productive. For the last 6 months of last year I contracted to a major music distribution company and worked from home with occasional in-house and Skype meetings.

So if I fit your needs, get in touch!

Sunday, 30 June 2013

"Scratches to Scratches" a version of David Bowie lyrics for cat people!

"Scratches to Scratches"

Try listening to Ashes to Ashes after reading these lyrics Ben and I came up with:

Do you remember a cat that's been
In such an early lol
I've heard a rumour from Animal Welfare
Oh no, don't say it's true

They got a message
from the Ceiling Cat
"I'm hungry, hope you're hungry too
I've eaten all I've needed to eat
Nomming details following"

The eating of nothing is boring
Just pictures of grumpy cats in synthesis and I
Ain't got no money and I ain't got no food
But I'm hoping to scratch but the sofa it's unallowed

Scratches to scratches, punk to punky
We know Ginger Tom's a punkie
Strung out in catnip's high
Hitting an all-time low

Time and again I tell myself
I'll not eat tonight
But the little can openers call to me
Oh no, not again
I'm playing with a valuable friend
"I'm hungry, hope you're hungry too"
One flash of led light but no catching it

I never done good things
I never done bad things
I never did anything out of the house
Want an claw to break the skin
Wanna eat right now

My mother said to get things done

You'd better not mess with Ginger Tom

The dreaded 'attack prevented by Rack::Protection::AuthenticityToken' problem

I have a Padrino app with multiple sub-apps.
Each of those sub-apps is not really an app, but rather a set of APIs.
To illustrate here is the super-basic layout:

├── API
│   └── v1
│       ├── airports
│       │   ├── app.rb
│       │   ├── config
│       │   │   └── boot.rb
│       │   ├── controllers
│       │   │   └── airports.rb
│       │   ├── db
│       │   │   └── seed.rake
│       │   └── models
│       │       └── airport.rb
│       └── sessions
│           ├── app.rb
│           ├── config
│           │   └── boot.rb
│           ├── controllers
│           │   └── sessions.rb
│           ├── db
│           │   └── seed.rake
│           └── models
├── Capfile
├── Gemfile
├── Gemfile.lock
├── README.md
├── Rakefile
├── app
│   ├── app.rb
│   ├── controllers
│   ├── helpers
│   └── views
├── config
│   ├── apps.rb
│   ├── boot.rb
│   ├── database.rb
│   └── deploy.rb
├── config.ru
├── db
├── lib
├── library
├── log
├── models
├── public
│   ├── airports.html
│   ├── favicon.ico
│   ├── home.html
│   ├── images
│   │   └── logo.jpg
│   ├── javascripts
│   │   ├── application.js
│   │   ├── jquery-ujs.js
│   │   └── jquery.js
│   ├── login.html
│   ├── logout.html
│   └── stylesheets
│       ├── application.css
│       ├── bootstrap.css
│       └── reset.css
├── spec
│   ├── spec.rake
│   └── spec_helper.rb
└── tmp

Notice that folder 'API'? That's what holds all the sub-apps.
In this simple case, there are just two.
Each has a minimal set of folders and what not.
The bulk of the work is done in the public html files via jQuery.
So for example, you want a html file to have jQuery make a call to login a user:

The html:

<div id="ProfileLogin">
    <h1>LOGIN</h1>

    <div id="ProfileLoginErrors"></div>
    <form id="ProfileLoginForm" method="post">
        <label for="ProfileLoginUsername">Username:</label>
        <input id="ProfileLoginUsername" name="username" type="text"/>
        <label for="ProfileLoginPassword">Password:</label>
        <input id="ProfileLoginPassword" name="password" type="text"/>
        <input id="ProfileLoginSubmit" type="submit" value="Login"/>
    </form>
</div>

The jQuery:

    <script type="text/javascript">
        $(document).ready(function () {
            $('#ProfileLoginForm').on('submit', function (event) {
                event.preventDefault();
                var postData = $('#ProfileLoginForm').serialize()
                $.ajax({
                    type: 'POST',
                    url: '/api/v1/sessions/login',
                    data: postData,
                    success: function (data, textStatus, jqXHR) {
                        if (data.errors) {
                            $('#ProfileLoginErrors').html(data.errors);
                        } else {
                            window.location.href = '/home.html';
                        }
                    },
                    fail: function (data, textStatus, jqXHR) {
                        $('#ProfileLoginErrors').html(data);
                    }
                })
            });
        });
    </script>

Now when you do a POST, and look at the development log, you see this:

 WARN -  attack prevented by Rack::Protection::AuthenticityToken
DEBUG -      POST (0.0035s) /api/v1/sessions/login - 403 Forbidden

Damn. Rack::Protection::AuthenticityToken is stopping us getting in.
The problem is that Rack::Protection uses a hidden value to ensure you're being called from where it expects.

The code responsible is in /Users/[you]/.rvm/gems/ruby-2.0.0-p0/gems/rack-protection-1.5.0/lib/rack/protection/authenticity_token.rb.
It looks like this:

require 'rack/protection'

module Rack
  module Protection
    ##
    # Prevented attack::   CSRF
    # Supported browsers:: all
    # More infos::         http://en.wikipedia.org/wiki/Cross-site_request_forgery
    #
    # Only accepts unsafe HTTP requests if a given access token matches the token
    # included in the session.
    #
    # Compatible with Rails and rack-csrf.
    class AuthenticityToken < Base
      def accepts?(env)
        return true if safe? env
        session = session env
        token   = session[:csrf] ||= session['_csrf_token'] || random_string
        env['HTTP_X_CSRF_TOKEN'] == token or
          Request.new(env).params['authenticity_token'] == token
      end
    end
  end
end

And the reason is returns false is because 'authenticity_token' hasn't been provided.

Don't bother going into and mucking about with:

set :protection, true
set :protect_from_csrf, true
set :allow_disabled_csrf, true

It won't help. The problem is you're not passing the 'authenticity_token' in the POST request.
The cure:

  // REQUIRES the authenticity token appended!
  var postData = $('#ProfileLoginForm').serialize() + '&authenticity_token=' + CSRF_TOKEN;

Now where did that CSRF_TOKEN come from?
Ah. And here's the trick.
First modify your public/javascripts/applications.js and add this:

var CSRF_TOKEN = '';

function configureCSRF() {
    $.ajax({
        type: 'GET', url: '/api/v1/sessions/csrf_token',
        async: false,
        cache: false,
        success: function (data, textStatus, jqXHR) {
            CSRF_TOKEN = data.csrf;
        },
        fail: function (data, textStatus, jqXHR) {
        }
    })
}

Just see that a call is being made to '/api/v1/sessions/csrf_token' and on success, a global CSRF_TOKEN is being set.
So what is the call '/api/v1/sessions/csrf_token' look like?

get :csrf_token, :map => '/csrf_token', :provides => :json do
  logger.debug 'Retrieving csrf_token'
  result = {
      :csrf => session[:csrf]
  }
  JSON.pretty_generate result
end

Ok. So how do you use it?
You change your javascript to:

<script type="text/javascript">
    configureCSRF();
    $(document).ready(function () {
        $('#ProfileLoginForm').on('submit', function (event) {
            event.preventDefault();
            // REQUIRES the authenticity token appended!
            var postData = $('#ProfileLoginForm').serialize() + '&authenticity_token=' + CSRF_TOKEN;
            $.ajax({
                type: 'POST',
                url: '/api/v1/sessions/login',
                data: postData,
                success: function (data, textStatus, jqXHR) {
                    if (data.errors) {
                        $('#ProfileLoginErrors').html(data.errors);
                    } else {
                        window.location.href = '/home.html';
                    }
                },
                fail: function (data, textStatus, jqXHR) {
                    $('#ProfileLoginErrors').html(data);
                }
            })
        });
    });
</script>

You could also add:

headers: {
    'HTTP_X_CSRF_TOKEN': CSRF_TOKEN
},

To the call, but I found it was not necessary.

YMMV.

Friday, 28 June 2013

Nitrous.IO! First impression after public beta release

Ok. I signed on as soon as I heard about this at the end of May 2013 because it was exactly what I was looking for.
I just received the email confirming the public beta, I decided to do some testing for 'real' and see if it really suited my needs in the 'real' world.

First step was to login and confirm my email. No problem.
Got extra N2O because I was part of the first signers and that's very cool.

Oh I forgot to mention; I'm using Chrome Version 27.0.1453.116.

So... I configured a box.
Neat easy and fast.
At the main window, I immediately started digging around.
First let's take a look at the system:

action@kimbo-review-99999:~/workspace$ lsb_release -a
No LSB modules are available.  
Distributor ID: Ubuntu 
Description:  Ubuntu 12.04.2 LTS 
Release:  12.04  
Codename: precise  

(FYI: The boxname is not the real one for obvious reasons...)

Ok. Ubuntu 12.04. There's a later version (which I've upgraded to on one of my home machines due to some gigabit network driver issues) but I wasn't about to try to do a sudo apt-get do-release-upgrade for obvious reasons.

Next networking:

action@kimbo-review-99999:~/workspace$ ifconfig -a  
eth0  Link encap:Ethernet  HWaddr 02:00:c0:a8:fd:f6  
  inet addr:192.168.253.246  Bcast:192.168.253.255  Mask:255.255.255.0 
  inet6 addr: fe80::c0ff:fea8:fdf6/64 Scope:Link 
  ...elided for brevity...

Ok. So know we know that subnets they're using. A quick check on the 'boxes' page (which is very well built I have to say) showed my external hostname. A quick check with nslookup shows it as running off AWS:

bandit:~ kim$ nslookup kimbo-review-99999.apse2.actionbox.io
Server:  192.168.170.1
Address: 192.168.170.1#53

Non-authoritative answer:
kimbo-review-99999.apse2.actionbox.io canonical name = ec2-54-252-89-123.ap-southeast-2.compute.amazonaws.com.
Name: ec2-54-252-89-123.ap-southeast-2.compute.amazonaws.com
Address: 54.252.89.123
Now let's see who I am:

action@kimbo-review-99999:~/workspace$ who  
action pts/1  2013-06-28 02:10 (ip-10-240-57-14.ap-southeast-2.compute.internal)
Interesting. User 'action'. So I had a look at `/etc/passwd` and noticed that `www-data` is included for Apache2 and `puppet` for... well... `puppet`.

Now for giggles I did this:

action@kimbo-review-99999:~$ uptime 
 02:27:42 up 23 days,  9:58,  1 user,  load average: 0.02, 0.06, 0.11  
What? 23 days? Ah. Neat. It appears that boxes are 'pre-provisioned' and assigned a name and extras during the 'provisioning' process.
Clever. Like that. Must remember that.

UPDATE: Whoops. Ben pointed out my mistake. They aren't pre-provisioned. It's likely a clone of a VM that was configured 24 days ago. My bad.

Now let's dig around the home folder:

action@kimbo-review-99999:~$ ls -aF /home/action  
./ .bash_history  .bash_profile  .cache/  .gemrc  .nvm/ .rvm/  .tmux.conf  workspace/  .zshrc  
../  .bash_logout .bashrc  .gem/  .gitconfig  .profile  .ssh/  .VERSION  .zprofile 
Ok. The .gemrc has good stuff in it:

install: --no-rdoc --no-ri 
update: --no-rdoc --no-ri  
gem: --no-rdoc --no-ri 
And the .gitconfig also:

[color]  
  ui = auto  
[alias]  
  st = status  
  di = diff  
  ci = commit  
  br = branch  
  llog = log --date=local  
[rerere] 
  enabled = true 
The .profile is normal and basic. The .tmux.conf is fine:

action@kimbo-review-99999:~$ cat .tmux.conf 
# shell  
set-option -g default-shell /bin/bash  
set -g default-terminal "screen-256color"  
There is a .VERSION file which looks interesting. I'm presuming this is part of the puppet process.
I'm also presuming the .ssh folder keys are used for the same purpose (they are for action@apse2.actionbox.io).

Next a dig around /etc...
Noticed there are no cron jobs configured.
The /etc/hosts is interesting as it has that old 'Ubuntu 127.0.1.1' address thing going on.
The /etc/nsswitch.conf is minimal with the hosts set to files dns.
The /etc/resolv.conf is interesting also. Mine is set to this:

action@kimbo-review-99999:~$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) 
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN  
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) 
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN  
nameserver 172.16.0.23 
search us-west-1.compute.internal  
Which is curious since I configured an 'Oceania' box since I'm in Australia. Oh well.

The /etc/timezone file shows the zone is set to Etc/UTC. If you want to I guess you could change this to your local time zone for your logs.

Now the /etc/init.d folder. Mostly standard stuff and no Apache1 or NGinx.
Ah. That's a question I wanted to ask! How the frack do you configure a 'production' environment.
I'll come back to that.

Next I checked the svn and git commands:

action@kimbo-review-99999:~$ svn --version  
svn, version 1.6.17 (r1128011) 
 compiled Dec 17 2011, 16:12:52  
 
Copyright (C) 2000-2009 CollabNet. 
Subversion is open source software, see http://subversion.apache.org/  
This product includes software developed by CollabNet (http://www.Collab.Net/).  
 
The following repository access (RA) modules are available:  
 
* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.  
  - handles 'http' scheme  
  - handles 'https' scheme 
* ra_svn : Module for accessing a repository using the svn network protocol. 
  - with Cyrus SASL authentication 
  - handles 'svn' scheme 
* ra_local : Module for accessing a repository on local disk.  
  - handles 'file' scheme  
 
action@kimbo-review-99999:~$ git --version  
git version 1.7.9.5  
Ok. The git version is less than 1.7.10 so if you are using capistrano from your own physical box you *may* encounter the old "cap constantly asking for passwords even though they've been defined in the deploy.rb" problem.

Ok. I configured a RoR box, so let's do some digging.
First, of course, is ruby.

action@kimbo-review-99999:~/workspace$ ruby -v  
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux]  
Neat. Ruby2 p147 has just been released and hopefully that will be installed on new boxes and be upgradeable on already provisioned ones.
Next, let's see some system stats:

Since I am going to test padrino I did a gem install padrino and it installed very quickly!
The rails gems like activerecord were all 3.2 by the way.
So next I changed directory to the `workspace` and generated a plain app.
Blisteringly quick.
So cd to the workspace app and do a bundle install...
Not so blistering, but fast enough.
It showed that we are using sinatra (1.4.3) and padrino (0.11.2).
So let's play with starting the app:

action@kimbo-review-99999:~/workspace/kimbo$ padrino start  
WARN: Unresolved specs during Gem::Specification.reset:  
  rack (>= 1.0.0, ~> 1.4)  
  activesupport (>= 3.1.0) 
WARN: Clearing out unresolved specs. 
Please report a bug if this causes problems. 
=> Padrino/0.11.2 has taken the stage development at http://127.0.0.1:3000 
[2013-06-28 02:57:14] INFO  WEBrick 1.3.1  
[2013-06-28 02:57:14] INFO  ruby 2.0.0 (2013-05-14) [x86_64-linux] 
[2013-06-28 02:57:14] INFO  WEBrick::HTTPServer#start: pid=969 port=3000 

Ok. I browsed to it from the 'preview' menu (port 3000) as that was what WEBrick starts on.

BLAM!

We couldn't find a server running on this port – are you sure there is a server running?
Make sure to bind your server to host 0.0.0.0 (instead of localhost/127.0.0.1).
Ah. Fracking obvious. So a restart of WEBrick with the host and port set:

action@kimbo-review-99999:~/workspace/kimbo$ padrino start -p 3000 -e development -h 0.0.0.0  
WARN: Unresolved specs during Gem::Specification.reset:  
  rack (>= 1.0.0, ~> 1.4)  
  activesupport (>= 3.1.0) 
WARN: Clearing out unresolved specs. 
Please report a bug if this causes problems. 
=> Padrino/0.11.2 has taken the stage development at http://0.0.0.0:3000 
[2013-06-28 03:02:49] INFO  WEBrick 1.3.1  
[2013-06-28 03:02:49] INFO  ruby 2.0.0 (2013-05-14) [x86_64-linux] 
[2013-06-28 03:02:49] INFO  WEBrick::HTTPServer#start: pid=978 port=3000 
And the 'preview' works. Cool. Don't like the look of those gem messages, but I'll leave that for now.

Let's try thin:

action@kimbo-review-99999:~/workspace/kimbo$ padrino start -p 3000 -e development -h 0.0.0.0 -a thin  
WARN: Unresolved specs during Gem::Specification.reset:  
  rack (>= 1.0.0, ~> 1.4)  
  activesupport (>= 3.1.0) 
WARN: Clearing out unresolved specs. 
Please report a bug if this causes problems. 
=> Padrino/0.11.2 has taken the stage development at http://0.0.0.0:3000 
<= Padrino leaves the gun, takes the cannoli 
/home/action/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.5.2/lib/rack/handler/thin.rb:1:in `require': cannot load such file -- thin (LoadError)  
  from /home/action/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.5.2/lib/rack/handler/thin.rb:1:in `<top (required)>' 
  from /home/action/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.5.2/lib/rack/handler.rb:20:in `const_get'  
...elided for brevity...

BLAM!

Odd. Sure I saw it in the gem list --local... Is it installed?

action@kimbo-review-99999:~/workspace/kimbo$ which thin 
action@kimbo-review-99999:~/workspace/kimbo$ gem list --local | grep thin 
So I was wrong. Not installed.
Install it:

action@kimbo-review-99999:~/workspace/kimbo$ gem install thin 
Fetching: eventmachine-1.0.3.gem (100%)  
Building native extensions.  This could take a while...  
Successfully installed eventmachine-1.0.3  
Fetching: daemons-1.1.9.gem (100%) 
Successfully installed daemons-1.1.9 
Fetching: thin-1.5.1.gem (100%)  
Building native extensions.  This could take a while...  
Successfully installed thin-1.5.1  
3 gems installed 
And try again:

action@kimbo-review-99999:~/workspace/kimbo$ padrino start -p 3000 -e development -h 0.0.0.0 -a thin  
WARN: Unresolved specs during Gem::Specification.reset:  
  rack (>= 1.0.0, ~> 1.4)  
  activesupport (>= 3.1.0) 
WARN: Clearing out unresolved specs. 
Please report a bug if this causes problems. 
=> Padrino/0.11.2 has taken the stage development at http://0.0.0.0:3000 
<= Padrino leaves the gun, takes the cannoli 
/home/action/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.5.2/lib/rack/handler/thin.rb:1:in `require': cannot load such file -- thin (LoadError)  
  from /home/action/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.5.2/lib/rack/handler/thin.rb:1:in `<top (required)>' 
  from /home/action/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.5.2/lib/rack/handler.rb:20:in `const_get'  
...elided for brevity...

BLAM!

Oh my lord I'm a dummy. Look at the Gemfile:

# Server requirements
# gem 'thin' # or mongrel
# gem 'trinidad', :platform => 'jruby'
Ok. (Hmm. JRuby would be interesting to test... :-)
Uncomment thin and bundle install and try again:

action@kimbo-review-99999:~/workspace/kimbo$ padrino start -p 3000 -e development -h 0.0.0.0 -a thin  
WARN: Unresolved specs during Gem::Specification.reset:  
  rack (>= 1.0.0, ~> 1.4)  
  activesupport (>= 3.1.0) 
WARN: Clearing out unresolved specs. 
Please report a bug if this causes problems. 
=> Padrino/0.11.2 has taken the stage development at http://0.0.0.0:3000 
>> Thin web server (v1.5.1 codename Straight Razor)  
>> Maximum connections set to 1024 
>> Listening on 0.0.0.0:3000, CTRL+C to stop 
Check preview again and we see the "Sinatra doesn’t know this ditty." which is fine.

Ok. We have got somewhere.
Just because I'm cantankerous, I always enable development and test logging 'my way'.
If you want to do this, edit your config/boot.rb and add this:

Padrino::Logger::Config[:development] = {
  :log_level => :debug,
  :stream => :stdout,
  :format_datetime => '%Y-%m-%d %H:%M:%S'
}
Padrino::Logger::Config[:test] = {
  :log_level => :debug,
  :stream => :stdout,
  :format_datetime => '%Y-%m-%d %H:%M:%S'
}
I normally adjust the format of the output as well, but I won't bore you.
For the record, I also uncomment the I18n.default_locale = :en line.

One thing I need to mention is the font. Why can't I change it?
I know I'm old and have bad eyes, but I prefer a MUCH smaller font to get a better view.

I found that the in browser editor gets it 'almost' right - curlys don't line up the way I like.
I also noticed that when you click on the language button or soft tabs button you have to re-click the button to get the menu to go away.
Clicking in the editor window doesn't do it.
In fact, ALL buttons have this behaviour which I find personally irritating.
You may feel different and that's fine.
I'm spoiled I guess using IDEs like RubyMine.

No I tried the 'chat' mode with Ben (who is downstairs writing a non-technical review) and up came a 'Collaborators' popup.

"This feature is experimental"

Ah. But heck, I'll try it. So I typed in his email and the first part worked.
To get your collaborator to have editing on a file, you open it in your editor and click the 'Collab Mode' button.
Neat. It's experimental - YMMV.

Ok. One thing I noticed is that there is no config/database stuff.
Now while clicking about on the menus I saw the following options on the 'Connect' menu: 'MongoDB (MongoLab)' and 'PostgreSQL (Heroku)'.
These point to help pages with extensive details on how to get connected to them, so I won't go into it in detail.
You'll have to install the ORMs etc and configure them yourself of course.

One niggle: when on the 'Connect' pages, it's tempting to click the 'Help Center' button at the top.
Unfortunately, this is a href to the page you're on.
Not helpful.
So if you want to go to the actual help center, you'll have to use http://help.nitrous.io
The Help Center is well laid out and easy to navigate but does have some

Conclusion:

Frackin love it. It has quirks but is just a development environment. Ben tried it on the iPad and apart from not listening to attached keyboard commands it worked just fine.

You *could* run up NGinx or Apache2 on your box and have a 'stage/production' environment, but if you are using Heroku or ilk, why bother?
You *could* install MySQL or CouchDB or whatever locally. I didn't try it.
Does it violate some part of the acceptable terms or policy?
Can't see anything on the help center about this.
Need to read a bit more.

Just a point... If you're just using the system as a development environment, why would you need a box with 2Gb memory and 20Tb (Correction 20Gb - been in the big data world too long) of storage just for development? At $89.95 a month this seems over the top. There is an implication (for me) that if you're paying $90 a month you would expect to be able to install extra packages and use the box at least as a staging if not production server.

There are some quirks.

If you use git (you do use it right?) then it's cmdline only.
Maybe they'll add it to the menu to allow issue/branch/merge/commit/push like RubyMine but I'm ok with the cmdline.

Also a website oddness. Once you've gone to the https://www.nitrous.io/app once, you can't seem to get back to the main site at http://nitrous.io - you just keep getting redirected to your app boxes page. Browser issue? In any case it's annoying.
I had to open a new 'incognito' window to get to https://www.nitrous.io/pricing.

There are a few spelling errors and what not, but we're all developers right?

Deployment

Heroku integration
Deplying to Heroku

`Deplying`?

Also I have to say that when I followed the link for connecting to GitHub, I saw the authorize page:
"Authorize Nitrous.IO?
The app Nitrous.IO will be able to:
Read your public information.
Update your user profile.
Update your public and private repositories (Commits, Issues, etc)."
Wait. Update my public information? Make *ANY* change to my public and private repos? How do I authorize that from GitHub to stop someone hacking Nitrous and getting access to my repos? Hmm. Kinda facebookie. Scared to enter my details on that one. Same for LinkedIn. Although I'm obviously trusting GitHub and LinkedIn to not get hacked...

Oh! I forgot: READ THE:

'Acceptible use policy' (http://help.nitrous.io/admin-aup/) especially the 'Quota & Limits' part.

'Terms of use' (http://help.nitrous.io/admin-terms/) especially '8. License from You'

But I love it.
I'll use it.
It won't replace RubyMine, but it's not supposed to.
It's to allow project development anywhere not just on your local desktop.
ChromeBook on the train home anyone?

I give it 5 pings.

FYI: You can get me extra N2O by following this link: https://www.nitrous.io/join/CL9mwvyYmwY

UPDATE: I was discussing my post with Ben and something occurred to me. How would this work with teams? I could easily see that a sole developer (or a duo) would find the system fantastic to work with. But with teams? Here's a simple example:

Ben and Kim are developers. Let's say Ben creates a box to work on. He creates an app. Kim wants in. How does that work? She has access to the box as per http://help.nitrous.io/collab/ but does she start a new instance of the app so she can work on it? How does it fit together when you may have dozens of people working on a project? They each have a Nitrous account, and the IDE open, but do they all have a WEBrick (or Thin - whatever) running? And since it's in development mode, won't changes Ben makes to the code get reloaded by Kims instance of WEBrick? They may be silly or just plain invalid questions, but I need to play with that to answer the question fully. Another post.

Tuesday, 18 June 2013

Moose the foster cat likes to Chill-Ax...

Moose the foster cat has some quirks.
One is his habit of sitting in what seems to me to be uncomfortable positions.
Here's one:


Odd no?

FYI while I was typing this, he jumped up next to the keyboard and tried to chew my glasses.
While I was wearing them.
I also now have fur up my nose.