Thursday, May 12, 2016

How to continuously integrate with Jenkins

Hi there!

"Continuous integration" gets thrown around a lot, but what does it really mean?

Unless you've been in a development role, it can be a little hard to define.

In short, it's a service that will automatically try to merge developer branches and test them before they are integrated into the main project code.

It's all in the effort to detect issues before they can cause real problems.

Let's get started then!

Jenkins is a time-tested tool for managing build servers, and by natural extension, continuous integration as well.

Jenkins can look a little ugly, but it gets the job done!
First, provision a server with any OS of your choosing. (Jenkins has some options now!)

Next, follow the instructions on the Jenkins site to download for your OS.

Install and let me know if you have any issues!  At the time of writing, Jenkins is now releasing v2.3 which has major changes to the setup process.

After changing the admin password, you have the option to install some suggested plugins, which is what makes Jenkins the most flexible CI tool! I highly recommend it!

One of the plugins installed is git integration, so you can easily link a Github repository with a freestyle project.

One plugin I've used in the past is the pull request builder, a great integration for larger teams where you'll want finer controls over what's being built and why.

That's really it!  Make sure to (build if necessary, and) run your test suite during the jenkins job and finally package and store to application it in your build repository for easy deployment later!

Let me know if you experience any funny business during setup and I'll add more to this guide, enjoy!

How to integrate a Ruby script into ZeroMQ

Hey there!

I'm going to walk you through the steps of integrating a basic Ruby script into a microservice architecture.

Microservices are typically managed via REST HTTP calls or a message queue.

In this example, I'll be using ZeroMQ a speedy message queue.

Be sure to understand what microservices are before we get too far into it!

First, let's make an example Ruby script to integrate.

This is an hello world example taken from the ZeroMQ documentation.

Here's the corresponding server side response.

As you can see, there's little overhead that you must include for a functioning message queue operating a simple request response pattern.

Give it a try, and let me know your thoughts!

Thursday, April 7, 2016

How to manage traffic with Elastic Load Balancing

Distributes application traffic over multiple EC2 instances.
  1. Knowledge
    1. Load balancing is the process of ditributing a large amount of traffic to multiple servers.
    2. Without load balancing, certain application servers would fail, while others go under utilized.
  2. Strategy
    1. The first step is to define the load balancer within AWS.
    2. Next, assign security groups to the load balancer.
    3. Then. configure health checks for the EC2 instances.
    4. Finally, tag, verify and create your new load balancer.
  3. Execution

Wednesday, April 6, 2016

How to deploy applications with Elastic Beanstalk

Easy to begin, impossible to outgrow.
  1. Knowledge
    1. Elastic Beanstalk is a Amazon Web Service for deploying and hosting software applications.
    2. If this sounds like Heroku, your intuition is correct.
  2. Strategy
    1. Here's a tutorial specific for deploying a Django application.
    2. Setup a python environment with Django.
    3. Create a Django project.
    4. Configure the app for Elastic Beanstalk.
    5. Deploy with the EB CLI.
  3. Execution
    1. Common issues:
      1. Powershell ExecutionPolicy
      2. EB CLI Could not find any platforms
      3. Server 404 response after deploy

Friday, March 11, 2016

How to create a JSON API with Rails

  1. Knowledge
    Optimizing for programmer happiness.
    1. Rails is a MVC framework, lending wonderfully for whipping up clean, RESTful interfaces.
    2. Not sure where to get started? Try this.
    3. Gems like jBuilder can greatly simplify the JSON declaration process. 
  2. Strategy
    1. Add a `northof` method to your `app/controllers/houses_controller.rb` file.  This will handle the input parameters and pass the variables to your JSON view.
    2. Create a `app/views/northof.json.jbuilder` file.  This defines the actual JSON response format. 
    3. Add a GET route to the resource member block within your `config/routes.rb` file.
  3. Execution

Wednesday, February 24, 2016

How to design behavior with user stories

  1. Knowledge
    Processes captured in the everyday language of the end user.
    1. User stories are written from a user's perspective, and describe how and why the user is using the software.
    2. User stories should satisfy the INVEST principles.
    3. For a user story to be ready for development, the team should be able to describe the technical tasks (develop, test, deploy) for the bug fixes and new features required to complete that user story.
  2. Strategy
    1. Just about all user stories follow this structure:
      1. As a <type of user>, 
      2. I want <some goal>, 
      3. so that <some reason>.
    2. User stories must be prioritized by the product owner so that highest value features are completed and delivered first.
  3. Execution

How to visualize users with personas

  1. Knowledge
    Biographies of fictitious users of the future product.
    1. Personas are a way to visualize all the future users of an application.
    2. With personas and BDD, we can design user stories based around these understood roles.
  2. Strategy
    1. Begin with a table 3 columns wide. 
    2. Title the columns:
      1. Picture & Name
      2. Personal Information
      3. Goals & Responsibilities
    3. Create semi-fictional personas for all possible users; considering chief officer, investor, auditor, regulator and manager in addition to the usual buyer and seller.
    4. Google image searching for the job title is a quick hack for believable pictures.
    5. Enter semi-fictional personal data to complete the personas. 
  3. Execution

Monday, February 22, 2016

How to recover from disasters with Barman

Disaster recovery for PostgreSQL databases.
  1. Knowledge
    1. Barman is a database recovery tool.
  2. Strategy
    1. Install Barman with yum on the backup server.
    2. Verify the barman user has ssh access to the postgres user on the main server.
    3. Verify the postgres user has ssh access to the barman user on the backup server.
    4. Verify the barman user can connect to the database on the main server.
    5. Configure Barman with default settings, noting the incoming_wals_directory.
    6. Configure Barman to enable continuous WAL archiving.
    7. Restart the server.
    8. Test new backup and restore functionality.
  3. Execution

Thursday, February 18, 2016

How to virtualize a private network with Azure

A growing collection of integrated cloud services.
  1. Knowledge
    1. Azure is Microsoft's cloud PaaS.
  2. Strategy
    1. Call support, those portals are a mess.
  3. Execution

Friday, January 29, 2016

How to monitor logs with Splunk

Operational intelligence and log management.
  1. Knowledge
    1. Splunk is a log monitoring solution.
  2. Strategy
    1. Install Splunk as host server.
    2. Configure host to listen to clients on the default port.
    3. Install the Universal Forwarder as a rpm on client machines.
    4. Configure the forwarders to send to the host.
    5. Verify it all works.
  3. Execution

Friday, December 18, 2015

How to base data with PostgreSQL

The world's most advanced open source database.
  1. Knowledge
    1. PostgreSQL is an open-source database.
  2. Strategy
    1. Install on AWS EC2 Ubuntu.
    2. Configure the database.
    3. A example Python script is provided.
  3. Execution

Thursday, December 17, 2015

How to store data with Druid

Fast column-oriented distributed datastore.
  1. Knowledge
    1. Druid is an open-source distributed data store, currently utilized by Netflix, Yahoo and others.
  2. Strategy
    1. Download the tarball.
    2. Dependencies
      1. Apache Derby
        1. Install the tarball.
        2. Configuration.
      2. Zookeeper
        1. Install by tutorial instructions.
    3. Run the server.
    4. Execute a simple query.
    5. Execute a complex query, fast.
  3. Execution

Friday, December 11, 2015

How to contain software with Docker

Lightweight. Open. Secure.
  1. Knowledge
    1. Docker allows you to package an application with all its dependencies into a standardized unit for software deployment.
  2. Strategy
    1. Linux
      1. Tutorial
    2. Mac OS X
    3. Windows
  3. Execution

Thursday, December 10, 2015

How to teach a machine to learn

Machine learning in Python.
  1. Knowledge
    1. Scikit-learn is a toolkit for machine learning in Python.
    2. It explains how it solves machine learning problems. 
  2. Strategy
    1. Scikit-learn provides a tutorial for getting started.
    2. Although, where do we even start if our application is huge, nuanced and complex? Let's use nearest-neighbor thinking to build off a similar solution! (a quick google search found it)
  3. Execution

Wednesday, December 9, 2015

How to keep secrets with Vault

A tool for managing secrets.
  1. Knowledge
    1. Vault is a data-store for your infrastructure's tokens, passwords, certificates, API keys, and generally all things secret.
  2. Strategy
    1. Installation
      1. Download and install the binary.
    2. Configuration
      1. A config file is loaded with the Vault CLI -config flag.
      2. Two fields are required, Backend and Listener.
        1. Backend is where the Vault data is stored.
        2. Listener is where Vault receives API requests.
  3. Execution

Thursday, December 3, 2015

How to monitor services with Consul

  1. Knowledge
    Service discovery and configuration made easy

  2. Strategy
    1. Installation
    2. Configuration
  3. Execution

Wednesday, December 2, 2015

How to add dynamic text to Rails applications

How can you change your application from this...
To this?
It's simple! Just use embedded ruby!

EDIT: Thanks to Action Dan for some feedback that picks into the niche differences of web application frameworks.

Bear in mind this is a Rails specific post, but I will say that for purposes of building larger applications, the ability to organize and refactor code begins to become a problem. 



Rails also offers uniform ways to add and remove helper functions through package management, so I'm actually using the current_user function generated by adding the Clearance gem to my project. 

The simple markup syntax is one small reason people like using Ruby on Rails to develop web applications.

Using a helper function (that I didn't even have to write) are two "behind the scenes" benefits of using Rails to develop.

If your confused about the current_user helper I'm using, read more here.

Program on!

Saturday, October 10, 2015

Software Licensing Overview (Open Source and Closed Source)

This is a cross-post from Lockboxx!! Read dat shiiii

The world of Free Software licenses and Open Source Software licenses can be massive and confusing, compiled with the endless Proprietary Software licenses (regardless if Commercial or not), it can be hard to understand from a distance. I wanted to take a second to set aside some general high level categories with examples in each camp, to give people a general / quick idea of what a license might mean and which direction they want to head. I don't mean to water down the huge world of open source software licenses, but simplify peoples approach and understanding. It should also be noted that while I am a fan of law / ethics / philosophy in computer science, I am not a lawyer. I also found a really great site to help me make my choice.

Highly permissive software licenses:
These licenses generally provide free software with few constraints on derivative works:
Unlicense
WTFPL
MIT / BSD
Apache 2.0

Copy Left software licenses:
Most of these have some requirement of derivative works having the same software license agreement or similar qualities:
GPL
GNU GPL 2.0
GPLv3
Mozilla Public License 2.0

Highly restrictive / special conditions licenses:
These are typically representative of specific service agreements between two individual parties:
No License (same as Copyright)
EULAs (End User License Agreements)
Proprietary software licenses

What really started this conversation for me, was that publishing public code on Github didn't give other Github users the rights I thought it did. For example, code published on Github (based on Github EULA) without a license gives other Github users the right to view and fork the code, but beyond that the code is protected under Copyright, potentially scaring many developers away. I also feel like a big part of understanding software licensing is understanding the history of software licensing. At the end of the day the choice is yours and you should make the choice based on protecting and propelling the software you care about into the world.



Sunday, October 4, 2015

Raspberry Pi Model Differences

Hey All, sometimes I get confused between all of the different Raspberry Pi models out there, so I thought I would document a few of them here for quick and easy reference. Remember that the biggest difference is the Model 1 uses ARM v6 and Model 2 uses ARM v7, so the same operating system won't run on both platforms!!

And some more facts about each model:

Pi Model 2 B

Pi Model 1 B+

Pi Model 1 B

Pi Model 1 A+ (not shown here)

Pi Model 1 A   (not shown here)

Thursday, October 1, 2015

How to be successful

Check this out, now.

He hits the mark on a lot.

Namely, when you fail, you learn.

He speaks about three things.
  1. Knowledge
  2. Strategy
  3. Execution
Seriously, watch it...

The first half is the important part.  Second half is about selling his program. lol. torrentz ftw.