AWS CodePipeline

In a previous post I wrote about AWS CodeBuild, which allows us to run our builds using AWS infrastructure. In this post we are going one step further and explore CodePipeline; AWS’ solution for continuos delivery.

Some of Pipelines’ features:

  • Detect code changes and start Pipeline automatically
  • Split releases into stages (One per environment, for example)
  • Pause the releases if a step fails
  • Allow steps to only proceed after manual approval
Read More

Introduction to AWS CodeBuild

CodeBuild is AWS’ offering for running builds in the cloud. We can think of it as an alternative to TravisCI or CircleCI.

Concepts

There are 4 things we need to configure as part of a CodeBuild project:

  • Source - Get the code we want to build. At the time of this writing, we can retrieve code from S3, GitHub, Bitbucket or CodeCommit (AWS’ code hosting offering)
  • Environment - Type of machine to use for the builds
  • Buildspec - Commands to run as part of the build
  • Artifacts - Artifacts to publish to S3 (Optional)
Read More

Identity and Access Management with AWS IAM

In a previous post I wrote about AWS CLI. In that post I explained how to create an admin user and how to use that user with the CLI. In this post I’m going to go in more depth into AWS IAM and show some examples.

The root user

When someone signs up to AWS they will need to provide an e-mail address and password they want to use to access their account. At this point, they are the only person who knows that combination of e-mail and password, so it can be safely assumed that whoever holds those two pieces of information is the owner of the account.

The owner of the account has the power to create or delete resources as they desire, so it’s very important that the password doesn’t fall in the wrong hands.

Read More

Null terminated and length prefixed strings

Null terminated strings

Null terminated strings (also called C strings) store a string as a sequence of characters terminated by a null character (\0).

For example, if we have a variable with the string taco, in a character array, it would look like this:

1
2
index: 0 | 1 | 2 | 3 | 4
value: t | a | c | o | \0

Notice that even though, taco is only 4 characters, it is necesary to allocate an extra byte for the null characer (\0).

Read More

How hard drives work

As computer users, we are accustomed to storing data to retrieve it sometime in the future. Today there are many ways to do this. If you take a photo on your cell phone, it’s going to be saved into the phones internal flash memory (or an external flash card). If you have a modern computer it’s likely that you have a Solid State Drive (SSD). It’s also possible to save your data in the “cloud”. So, why focus on Hard drives?

Hard Disk Drives (HDD) have been a reliable way to store data since the 1950’s. Cloud providers (AWS, Azure, Google Cloud) have HDD offerings that are cheaper than the SSD alternatives. At the time I wrote this article, if I want to buy a 5TB HDD, I would have to pay around $100 USD; if I want to buy 5TB SSD I would have to pay around $500 USD. For this reason HDDs are still widely used.

Read More

Introduction to Apache Ant

I just started working with Java and I have realized I don’t know much about how the build system works. In this article I’m going to explore Java’s build system. Ant is analogous to Make, Gradle or Gulp. It’s main goal is to automate the process of running tasks. More specifically, it is often used to compile code, run tests, etc.

Installation

Ant is a Java application, so a Java Runtime Environment is necessary. The installation will vary depending on your environment, so you might want to check the official documentation. If you use ubuntu, you can use apt-get:

1
sudo apt-get install ant

To verify the installation was successful:

1
ant -version
Read More

Introduction to AWS CLI

I’m going to start working a lot with AWS, so I will need to get familiar with they’re tools. One of the most important tools to get familiar with, is their CLI.

Although it is possible to do most things from AWS management console, learning how to use the CLI allows for scripting and automation, which can help increase productivity.

AWS Management Console

Installation

To install AWS CLI we need Python 3.4 or later. Use --version to verify it’s installed:

Read More

Introduction to CircleCI

I have a few private Github repositories where I use Travis for running checks on each of my commits. A couple of days ago I received a message from Travis telling me that I only had 10 builds left as part of my trial. Luckily, someone told me CircleCI allows unlimited private builds for free, so I’m going to try it out.

Creating an account

The first step is to create an account. They allow to sign up with Github, so I just chose that option:

Sign up with Github

Read More

Simple Back-ups with PostgreSQL

I have a PostgreSQL database that I want to back-up periodically in case my server crashes suddenly. In this post I’m going to explore a simple but efficient way to create a back-up and how to apply it.

SQL Dump

When we take an SQL dump from a database, we will get a file with the SQL commands necessary to recreate the database to the current state.

To take an SQL dump for a PostgreSQL database, we can use pg_dump:

Read More