We, at Shippable, are using Docker extensively and ALL of our services(frontend, backend, messaging, etc) are now successfully running inside containers. The latest addition to this is Logstash, which is an awesome tool to store, manage and make sense of tons of logs that are spewed out by a typical application. Its for the same use case we decided to use Logstash which basically collects the data from all our containers to make it easier for us to track down exceptions and some important events. I’ll start by defining a simple Logstash setup to do this and then conclude by wrapping everything into a neat Dockerfile which, in essence, will be all you need to then run Logstash successfully.
1. Download the logstash jar
2. Create the config file (name it ls.conf) to be used by Logstash which defines how(and from where) Logstash takes the input data and how(and where) it dumps the output. The simplest config is something like this (taken from logstash getting-started tutorial). There are two sections in the config file by the name “input” and “output”. In each section, we can … Read the rest
In this tutorial, I will be making a simple authentication flow using the technologies that we have already discussed. By the end of this tutorial, you would have made a flow similar to the one indicated by the diagram below. This will also help you see how you can make your views more intelligent, readable and easy to build.
In the PREVIOUS POST we build the application views. To give some intelligence to those views
we are going to use some of the amazing features of JADE. I recommend you go through the
documentation of JADE to get an idea how decision making can be done in the views only.
This will be required, for example, while rendering a ‘Logout’ button. This button should only be shown if the user is logged in. So, instead of checking on each render call, we will put the logic to check and then render the appropriate view in the views(topbar.jade, in this case) only.
Lets go one step at a time here. We are assuming here that the user credentials are already present in the database. If you are referring to the project’s CODE, then just run the file named ‘insertUser’ … Read the rest
Moving on with the next part of this series of tutorial, today I will give an introduction about the Jade template engine for Nodejs and Bootstrap tookit provided by twitter. In the PREVIOUS post, I have described about the basic layout of a nodejs application based on express engine and we have till now run a very basic(and mostly useless) server. By the end of this tutorial, we would’ve made a nice looking container that will hold the various parts of our application.
What I have in mind is basically something like following diagram.
This is the most simplistic layout and we will work with it for some time before changing it.
Lets start with Jade first.
For an extensive list of jade features, visit the jade github page.
the main configuration and boot file for the application. This will describe the global includes, the server configurations(deployment/test/production, etc), the available routes and any other data that is required by the application for initial bootstrap. The current app.js file only includes ‘express’ (huh).
var express = require('express');
After this we create a server by issuing the following statement
var app = module.exports = express.createServer();
This creates a new server object for us and also makes it available outside this file by exporting it.… Read the rest
As promised, I now begin the series of tutorials on the amazing new technology called Node.js which I have started working on some time back. Though I don’t promise that the methods I suggest are the best way to achieve the required goal, but I can guarantee that they work.
There… thats it. In its entirety, node has a minimalistic core which provides it the amazing flexibility to be extended. There are many amazing features in node that you can read about in its official documentation.
Before you proceed, I strongly recommend you read THIS tutorial and TRY all the examples given in it to get the idea of how node works with asynchronous callbacks. Though it would be better if you did the whole thing step by step yourself, below is the link to my github profile where you can download the completed example .
This tutorial is inspired by the screen-cast HERE and is a more basic version than shown there.
Basics: GWT event-bus, as the name suggests is used for passing events between panels and other widgets so that they can communicate with each other. For this, a widget specifies what event it is going to fire and any widget or class that is interested in receiving that event registers themselves with that particular event. The event bus is the entity that facilitates this. It can be thought of as a common stream that broadcasts events as they are fired and anyone who is attached to it receiving the events which they specified they were interested in at the time of registering themselves with the bus.
With this short introduction,I will proceed to give an example.
1. Create a project in Eclipse: File -> New -> Project -> Google -> Web Development Project. It is assumed that the user has GWT plugins installed for eclipse. This example was made using Gwt 2.2. Give the Project Name as ‘GwtEventBus’ and package name as ‘com.dev’. Leave the rest of the settings as they are and create the project.
Well, I have been doing this the moment I decided to use linux which is quite a few years back, but I can that I have never found a perfect way to partition my disks in a way that will take care of all the future requirements of adding/deleting an os. I had Ubuntu and windows 7 before this weekend and I wanted fedora 14- 64bit as a third os and hence I was stuck to figure out how to manipulate my disks now. The following was the partition layout before adding fedora.
where the  defines primary partitions. I thought that if I wanted to add another linux partition, I would just shrink the last DATA partition and make that.
Now the problem with that is we can only make 4 primary partitions and ONE extended partition (More on partitions here and here). So that meant that I had to first free up some space, which was the easy part, and then somehow use that space as an extended partition to install fedora. By this time you must have envisioned the problem this led to. I … Read the rest
This one turned out to be a tough one and I had to spend quite a lot of time to figure it out and eventually got to know that there is no straight way to achieve this.
The problem was that I wanted to have a layout in which there was a text at the top, and five options for selecting the answer with radio buttons in front of each options to select one of those. Everything is straight till the time you get to the last part, i.e. selecting ONE of the options.
In android, you need to put the radio buttons in a radioGroup to enable single selection among that group. But its MANDATORY that the radiobuttons have the radio group as the immediate parent and hence if you are looking for any sort of a layout other than the one in which your radiobuttons are immediate children of a radiogroup, you have to go down the hard way.
The links this and this will give you a fairly nice idea as to how to approach this issue. In short, just create an onClickListener() and attach it to each of the buttons in your layout. In the onClick() … Read the rest
This is one blog that has really helped me to understand how many things work in android. The language is good, and the examples work more often than not. Just a heads up, do the basic android research before getting into this one.