Monthly Archives: April 2014

Ubuntu version

As a reminder to myself, to check the version of Ubuntu in the terminal the command is

and you get something like



Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather


in every application now I have at least some logging going on, and if I don’t I am missing it. But having servers distributed around, getting details from the logs is a lot more difficult than when the whole application lived in a single server/directory.

There are services on the Internet now (I friend interviewed with some guys coming out of UCD, just a couple of kilometers from home), and some others like New Relic are going further ahead and giving you profiling details too. But I am not that eager to go with Internet services.

The option then is to deploy my own, or to use an existing package. I tried collecting my own details, but in the end it look too laborious, and I am not getting that much value from the extra effort.

From searching on the Internet one of the candidates is Logstash. It combines logging with ElasticSearch, I tool that I tried briefly and really liked, then I decided to give it a go. One of my colleagues at Ngramatic tried it, but bombed soon after following the tutorial, then we left it aside.

Now, at home, is time to try it. The first step is to make a Vagrant machine for deployment, to follow the tutorial.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

More work on Ngramatic

Past night I took a break and went early to bed (during the weekend I drink less coffee than usual, and probably that has something to do with my sleepiness). But tonight I fired the machine again after dinner, working into Ngramatic to get a fresh version out.

Right now I am cleaning the code and adding a new set of HTTP controls to fire the processes from a web client. Monitoring and orchestration are more valuable than usual with a mesh architecture, and I am trying to cover as much as I can outside the working day.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

More work for Ngramatic

Today I continued working in Ngramatic’s code instead of a side project. I know that it might not be the best idea, but I really want to see the product moving, and a quick fix of half an hour end up eating two hours and something.

While I was waiting for scripts to run, I gave a quick shot to deploy Ghost in OVH. The site is still not working, it is complaining about the access rights, and I haven’t really looked at them yet.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Domains and hosting

Nothing too exciting tonight. I was checking hostings outside AWS, because the prices don’t fly too well with me if it is only for a messing around after working hours.

In the end I picked up a VPS Classic from OVH. For 6.5 euros I get two cores, 2GB of RAM and 25 GB of disk, which should be enough to do some experiments. The contract goes monthly, then I can stop it for the price of three coffees. Not too bad.

Then I was busy with administrivia, a few of my registered domains are close to be renewed, and I am consolidating all those operations with the guys in Blacknight.

Tomorrow I will try to deploy Ghost there, and see how it works.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Ghost working in Vagrant

Perfect, effectively the problem with Ghost not being forwarded was that the address use by Node to listen is, by default,

A quick edit in the config.js file to replace the Production settings with instead did the trick, and now Ghost is running in my Vagrant instance, and accessible from my laptop browser, and it looks good.

Making a post is very simple (I have been using markdown for a year now, to write anything I need formatted). There are no funny questions, nothing strange. Ghost seems to have a very low barrier to entry.

Tomorrow I will look on how to edit the theme, and to load my content generated with WordPress.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Configure Ubuntu Server to ssh with key and no password

Earlier I was configuring a machine with Ubuntu Server to be used as our build/process server. In the last months I was doing everything in Vagrant or AWS, but this one is a physical machine, and I have to do everything from scratch.

Being used to Python Fabric now, I wanted a way to run my scripts remotely. First I needed to enable SSH in the new server and to deploy keys to authenticate when ssh to it. OpenSSH went in as part of the deployment of Ubuntu, so that was easy.

Making the keys was clear enough with the instructions. As a reminder for me (I will probably need to do it again), I will recap the steps here:

  • In my own laptop, I run:
  • The last command fire a command line dialog asking for the file name to use for the keys (I used ngramaticbuild), and a passphrase. I left the passphrase empty, to not be asked for it. The end result are ¬†two files, one public (extension .pub) and one private key. The private key stays in my laptop, the public file goes to the new server.
  • Then I ssh to the new server, logged in using username and password, and created a directory:

    where ngramatic is the account I created in the server earlier.
  • I opened another terminal in my laptop and copied the public key to the new server

    where is the address of the new server.
  • Having the files in place, I did an:
  • And then configured ssh to read the keys when required:

    and in the editor I put the line

    and saved.
  • A restart of OpenSSH closes the activity to authenticate with a key file:
  • I closed my ssh session, opened it again from the directory where i have my private key and I wasn’t asked for a password to login, which is good:
  • But if I did a sudo command, I was asked again for the password. Given I run scripts from Fabric, firing dialogs is not an option. The solution was simple, but took me some time to find it. The fix is to change the sudoers configuration:

    and add at the bottom of the file:

After that my Fabric scripts are running happy, and I should be able to treat a physical server the same as the ones provided by AWS or Vagrant.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Binding mistake

OK, in the end my problem with port forwarding was the binding I was using in my test application. Interesting enough, it is a time now since I was using Vagrant and NodeJS every day, and it showed up in my confusion.

I did a little application to test why I wasn’t able to reach my guest server from my host machine. I tried changing the forwarded port number and enabled firewalls, but nothing happened. Initially I assumed that there was a problem between Vagrant and Ubuntu, then I tried with different OSs, different versions of Ubuntu, but there was no improvement.

Here is the code I used, blindly taken from the NodeJS page:

Then I tried using Apache as a test application and it worked fine. That removed Vagrant as the problem, but i wasn’t that sure about Ubuntu. I tried with the firewalls again, but no luck. Finally, after reading the same documentation again and again, I noticed the details about binding the NodeJS application. I was using localhost as the server, but I needed to replace it with A second later, my test was passing, I slapped my face (because I read that, and have done it many times before), and I am now writing and heading to bed. It was frustrating, but I am happy in the end. Tomorrow I should be able to deploy Ghost properly, meanwhile, the little test is here:


Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather