Category Archives: Software tools

Folding lines in Sublime

In one of my projects I am adding a good amount of logging to my code, with the result of getting a lot of distracting lines that end up hiding what is really going on.

I was searching for a plugin that can fold lines containing a text fragment in my editors, and found Filter Lines for Sublime.

After installing the plugin, I went to Edit | Code Folding | Fold with Regex  and entered ^((?!logger.).)*$  as my expression.

As a result, I went from

Sublime not folded

to

Sublime logger filtered

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Time tracking with Toggl

My friend Magoo is using toggl for time tracking and decided to give it a go. I usually apply pomodoros when I am programming, but although they are ok to keep me focused in the task at hand, I don’t like the fact that after they are gone I don’t have any way to keep track of what I was doing (because the reality is that I usually get interrupted and have to jump to some other project at least for some minutes)

My first impression wasn’t the best, it looked like an early version of a promising tool but still rough in every sense, but after adding some workspaces, clients and projects it started to look more usable.

When I realised that they have an Android client, a desktop version, and a Chrome integration that can be used inside Trello my respect grew a lot more.

I don’t think it will be the last tool I try for the task (there are things that I am still missing), but it is a lot better than any other option I have tried.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

A tool to generate .gitignore files

For some time I have been using gitignore.io to create the .gitignore file used in my projects.

The content in many cases seems to be overkill (because it includes common libraries used by the language or tools selected), but it is better than the option of accidentally adding files to git that later need to be removed.

 

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Performance problems in Vagrant when using host files into guest

I am working in an application that has to access a good number of resource files (good both in numbers and file sizes). As usual I am working in a Vagrant instance, and everything was going fine for the initial work.

But eventually the number of files passed from just testing to production, and while developing in my host the file access operation was ok (in the order of seconds to load everything), when the same code was running in Vagrant it took more than ten minutes to be ready.

At first I thought it was a memory problem, and increasing it to 6GB helped a bit (nine minutes instead of ten), it still didn’t cut.

I tried creating an instance in AWS, and surprising enough the performance was similar to running in my Mac.

I decided to copy all the files to the Vagrant instance, and then the problem was sorted, performance is on par with the host and AWS. That was it. Looking at the documentation, I noticed a shared directory option that is rsync, but I haven’t tried it, because I wrote a set of scripts that take care of preparing those resources to be deployed (both in Amazon and Vagrant) and dropping them on destination (which is a nice addition to my attempts to automate as much as I can both in development and deployment).

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

NodeJS meetup

Past night I went to a NodeJS meetup about micro servers and Docker instead of working at home. It was very interesting to see their approach to data distribution. I find it similar to NServiceBus, which I was trying to use at emuse, but with a more lightweight approach.

What I like is the lack of network structure definition upfront (which is heavy enough in the things I am doing). In my case, I need to define each endpoint, and then annotate them on each client server. Instead, the demo was about sending all data to a bus and detecting the pattern of each message, and acting based on its details. Then, every server receive every message, and if the message has details saying that a given server has to process it, the server will work on the data and post the results back on the bus for the next service.

Work pipeline definition should then be simple and easy to change. My only concern is about network traffic (how many messages are you going to have around?), but I can think of a couple of ways to address that (probably the SenecaJS code has some solutions too, I will have to check).

The talk about Docker was more in line with its documentation, and I didn’t get too much out of it because I was going through in the previous days, but still it was good to align it with the bus architecture.

All in all, it was an evening well spent.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Ghost continued

Vagrant is up and running, and I completed the script to deploy Ghost on it. But still it isn’t running. I mapped the port 3168 from Vagrant to 8080 in my laptop, but there is no ghost jumping around in my browser. I can do a curl in the terminal during an ssh into Vagrant, but if I try to cal from outside I get a ‘connection reset by peer’ error message.

The problem seems to be with VirtualBox. After a good amount of googling, I found a message pointing to a problem with VirtualBox Guest Addditions, but I couldn’t fix it yet, and it is late enough to go to bed. There are a few updates on the project, but they are still not good.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather