Control your cloud from node.js

There was no node.js module implementing Onapp API, so I realized that it should be a good idea to implement it for my first npm published module. 🙂

There are still a lot of methods to implement, but the basic stuff is there. When i have time i will implement more.

Module’s structure is similar to other node client implementations out there, it is very readable.

node.js community is awesome and is certainly something I’m going to be doing more often.

Check it out at: https://github.com/apocas/node-onapp

Installation, as usual, is done using npm awesomeness

npm install onapp

In order to started you need to instantiate a client.

var onapp = require('onapp');

var config = {
 username: 'username@email.com',
 apiKey: 'api_hash',
 serverUrl: 'http://192.168.1.1'
};

var client = onapp.createClient(config);

The options passed during VM creation, are exactly accordingly to Onapp API. This way you create a VM like you were using the original API.

var options = {
  memory: '1024',
  cpus: '1',
  cpu_shares: '50',
  hostname: 'tests.tests.com',
  label: 'VM from node',
  primary_disk_size: '10',
  swap_disk_size: '1',
  primary_network_id: '2',
  template_id: '6',
  hypervisor_id: 2,
  initial_root_password: '12345675',
  rate_limit: 'none'
};

client.createVirtualMachine(options, function (err, vm) {
  if(err !== null) {
    console.log(err);
  } else {
    console.log(vm);
  }
});

Powering off a VM.

client.getVirtualMachine('vm_id', function (err, vm) {
  if(err !== null) {
    console.log(err);
  } else {
    vm.off(function(error, data){});
    //vm.reboot(function(error, data){});
    //...
  }
});
Advertisements

Hiring passionately

During all these years as a lecturer I had the opportunity to be involved directly or indirectly in the recruitment of some of my best senior students into the market.

In all my life I never had to look for a job or even tried it, somehow people just end on finding me trough my work or added value I brought to their product and/or business model. So I never really had the opportunity to see the other side of the coin.

Recently I realized something, why do people ask for facts in interviews? just why??

It’s not even a good screening method, which is critical. It’s way worse to ditch a good candidate than to hire a bad one, just think the added value you just lost. The bad one you can ditch him, the good one you may never see he’s potential until your competitor bets on him.

People know facts when they are in college, at that time they have time for facts they don’t have to bother with really important things across multiple stacks and the impact of decisions they make on the final product.

What are facts?

Well facts can be a lot of things, but the most common “type” of fact are those stupid basic things you do everyday that you just don’t memorize and instead you keep Googling/reading manual/…. whenever you need them.

Why?? Just because they are so stupid/basic they don’t need understanding, just memory. If you are like me I just don’t memorize them I prefer to keep my mind clean and “defragmented” for the real important data and how I’m going to crush it.

Indeed facts are the easiest measurable thing you have, but this does not mean you can or should measure knowledge using facts instead you really should think what are you measuring with facts and if this is what you are looking for.

Instead of only trying to measure knowledge, you should be trying to measure love, passion, dedication, excitement. Someone with these characteristics will never stop until it has all the knowledge needed to get things done.

You can even look at this from a darwinistic view, if you get someone smart and passionate about your product they will certainly adapt to be overcome. This is key to survive in those harsh moments like changing your entire stack/tools, without passion people will just jump to another product which uses their most comfortable stack/tools.

I have learned one important thing, JUST TALK. Really, instead of an interview do a conversation/meeting just have a conversation about the current state of things, what is their vision about a specific technology they used, projects, …, you don’t event need to talk about your specific needs at this time.

There’s a lot of good people out there that just want to talk because sometimes it’s not easy to find someone to talk to. And then if things click between both parts, “business” comes in.