Showing posts from 2017

Using ansible for deploying applications to aws cloud

Hello guys, in one of my previous post I have explained how can you deploy your simple application to AWS. In that post, we have created an AWS cloud account and then ran an ec2 instance manually using the AWS console UI and then by doing ssh into the machine from our local, we were able to deploy our application to the AWS. But this is not always a best practice to follow. This will be best if we could do this just by running some script once.  Actually, there are a couple of services which actually does the same thing for us and makes our life much easier.

Ansible is one of such service which we can use to create & configure AWS. In this post, I will explain how we can use ansible to start an ec2 instance and then deploy our application in that instance and finally terminating the instance when we are done.

Now before we can proceed first we need to know some basic things about Ansible. It is open source automation platform. It is very simple, efficient and powerful. Every ansi…

How to use s3 bucket with node.js

Hello guys, in this tutorial I will show you how we can use amazon s3 bucket with nodejs to store your files and fetch them whenever required. Before we start let me explain what exactly is s3 Bucket.

Basically, amazon s3 is a cloud storage where you can store your data (pictures, videos, documents etc). S3 buckets are very simple to configure and have high availability and high security which makes it very popular. In s3 buckets you can easily do some important stuff like restricting access to some users, scaling as much as you want and also automatically determining the life of the items which are getting stored.

Now, in order to use s3 bucket to store data you first need to create a bucket and for this, you need an AWS account. You can follow my previous post for creating a new AWS account if you need any help. You can have a maximum of 100 buckets linked to each of your AWS accounts. In order to create a bucket, you need to provide a name for your bucket and AWS region where you …

Implementing a Self Organizing List in Go

Hello guys, I have recently written a library implementing self-organizing list in Go language. This was a part of my experiments with Go. Go indeed is a very awesome language to learn. Some of the good things about Go is that it's very fast as this is a compiled language. And it has some inbuild strict checking so this will basically force you to write good quality code with no unused variables and all. Go also has standard libraries for unit test and benchmarking which is very simple to implement. So basically you won't need to look for compatible libraries for creating benchmarks and writing test cases for your projects.

So now coming to our topic self-organizing list. The self-organizing list is a kind of self-learning list which will rearrange its elements based on their usage to improve their average access time. The aim of the self-organizing list is to improve the efficiency of linear search by moving more frequently accessed items towards the head of the list.

There a…

Breaking a monolithic architecture based application into various microservices and creating an installer to start all the services

Hello guys, in this post I will explain how you can break your monolithic architecture based application into different services and also I will show how you can start all the components by taking care of their dependencies. This will be a basic guide only as your application might be having some more dependencies. But I will make sure this post will give you at least some basic idea about how you can proceed. Before we dive into this let's have some idea about what is monolithic architecture and discuss some of its pros and cons.

In Monolithic architecture, all the components of the application are tightly coupled together. In this type of architecture, all the components are interconnected and dependent on each other. Even a small change in any one particular component might need rewriting the entire application as they are tightly coupled together. But on the good side applications based on this architecture are easy to develop, test and debug.

Lets us take an example of a sim…

How to Dockerize an application and push it to dockerhub

Hey guys in this post I will explain you how to Dockerize your application, and also push it to the dockerhub. In the recent years, docker has managed to grow pretty well and now a lot of people and organizations are getting inclined to it. The main reason for its ever growing popularity is the environment docker containers offer. Inside a docker container all the dependencies of your app can be made available and these dependencies will be independent of the host environment on which you are running the container. And the best thing is you can easily share these containers with others and they will be able to run it in their own environment without any compatibility issues.

Just think of the scenario that you made an application which is having many dependencies say git, npm etc. and in order to build this in your development environment without using docker, you must have installed these dependencies on your machine. Now you build your app and want to share this with somebody else …

How to integrate a payment gateway into your WordPress website for donations without using woocommerce

Hey guys today I will explain how to integrate a payment gateway into your WordPress website for donation purposes. I was searching this for a long time but always end up with plugins which were using Paypal or stripe only. So the problem with them was that they mostly accept credit cards or their specific accounts but I wanted something generic with all the available payment options like credit card, debit card and net banking. And also I was looking something with Indian currency option preloaded but Paypal does not support this. And most of the available plugins with all these options were dependent on woocommerce so we can use them only if we have a woocommerce plugin preinstalled, but we might want to add a donation option to a normal WordPress website also which is not using woocommerce.

So finally I found a very beautiful and elegant plugin designed exclusively for this purpose only and which can be live instantly. So let's introduce you to Give . Give is designed exclusiv…

Making your node.js app live using AWS

In this post, I will show how to make a node.js app live using AWS. For this, I will first show how to create a simple hello world app using node.js.
Lets get started:

Create your project folder ( mkdir sampleNodeApp )Move to that folder ( cd sampleNodeApp )Create a file server.jsCreate another subFolder inside your project folder publicMove to public ( cd public )Create a file index.htmlMove to your main directory ( cd .. )Update server.js to have the following content var express = require('express') var app = express()
app.get('/', function (req, res) {   res.sendFile(__dirname + '/public/index.html'); })
app.listen(3000, function () {   console.log('Example app listening on port 3000!') })
     9. Update index.html inside public folder to have following content
         <html>            <head>      <title>        This is a sample app.       </title>             </head>             <body>        Welcome Everybody!    …