Category Archives: Ubuntu

Updating Git in Ubuntu

Today I needed to update Git in my Ubuntu machines, and this is a note to myself to remember the process:

The command add-apt-repository needs some prerequisites as well (they were not installed in one of my machines):

 

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

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

Logstash

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

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, 127.0.0.1

A quick edit in the config.js file to replace the Production settings with 0.0.0.0 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 123.123.123.123 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

Deploying Ghost in Vagrant

After my break to crystallize the deployment of Ngramatic in AWS, I am back with Ghost. The problem was not with my scripts but with VirtualBox itself. I had version 4.2 of Virtualbox, and it didn’t like my deployment for some reason. I got the clue when I tried them in the Mac, without any problems. A few searches and updates put things back in place.

But, I still don’t have the deployment running at home. My Ubuntu laptop gets kicked out of the Ubuntu Vagrant, with a ‘connection reset by peer’. I am still lost, and it is late enough to be sleeping already. I tried port forwarding, and a private network, but no luck. I will try again tomorrow on the Mac.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Liveish in AWS

A short post today, because I am ready to go to sleep.

Putting an hour here and there today, finally the servers are live in Amazon, and doing part of the trick. I realised that there are problems with the data, but I am sure we will be able to sort them out tomorrow.

The site is not open to the public yet, but hopefully it will be out soon. I am a very happy monkey today! And now it is time to go back to side projects for real!

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Another day pushing the product ahead

Once again I am breaking the rule of leaving the day work project for the day, because I am trying to deploy it in AWS before Monday.

From the fact that I didn’t take the time to do deployment earlier, I am paying with the extra weight now of making sure it works properly, and that I can deploy it again and be reasonably sure it works. It has no surprises, I did the job before, but it still consumes a good amount of time. I am making extra checks for connectivity, configuring ports, addressing security issues, and after all that the program is still off the real world and just running inside the work network. But, as the story goes, it could have been worse.

While I am waiting for the scripts to run, I started reading Rework, from the guys at 37signals. My friend Magoo mentioned it a few days ago and I usually follow his recommendations. I didn’t find it irreverent, but my communication style is probably rougher than my friend’s. And a lot of the recommendations from the book resonate very well with my current line of thinking (the ‘a month’s evenings‘ theme looks like taken from the first few chapters of the book). It is very easy reading, and valuable as well.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Getting the product ready

Tonight, instead of being in a side project I am finishing the last few items to get Ngramatic‘s product ready to start demoing. It wasn’t a project as the last previous few, because there were too many moving parts to be able to go straight to production from day one, but after two months of hard work it should be deployed in AWS by Monday.

The process involves a number of Java servers, an Angular front end and NodeJS in the middle of two, all using ZeroMQ as the channel. Deployment is done with Python Fabric, and it runs in Ubuntu in AWS. For development we were using the local machines, but soon we will move to Vagrant. I wonder if I should try to use Docker, but I am not that comfortable with it yet.

Now, I have to finish the last monitoring calls, and sort out CORS in Restify. Piece of cake (from Conor’s birthday past week).

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather