Posts

Showing posts from December, 2018

Moving to my own website kimsereylam.com

New contents are now posted to my personal website https://www.kimsereylam.com
Enjoy!

Load test your API with Vegeta

Image
Load test your API with VegetaVegeta is a open source HTTP load testing tool. Today I’ll demonstrate how quickly and easily we can load test our API endpoint using it in three parts:Get VegetaSetup a target fileGenerate reports1. Get VegetaVegeta binaries are available on GitHub Releases. For Windows, all we need to do is to get the Windows executable and unzip it for example under C:\vegeta.
The vegeta.exe is the executable we will be using. To make sure it works as expected, we can display the usage guide by execute vegeta.exe without any arguments.> vegeta.exe Usage: vegeta [global flags] <command> [command flags] global flags: -cpus int Number of CPUs to use (default 4) -profile string Enable profiling of [cpu, heap] -version Print version and exit attack command: -body string Requests body file -cert string ... The main concept of Vegeta are the targets. A target represents an endpoint which will be load tested - or in Vegeta …

Create React App with Mobx in Typescript

Create React App with Mobx in TypescriptI have been using state management frameworks for the past few years, mainly with Angular and NGRX. Today we will see how we can get started with Create-React-App using Mobx as a state management system.Bootstrap a fresh applicationCreate componentsCreate an observable state / storeCreate observers components1. Bootstrap a fresh applicationStart by installing the latest version of NPM then use npx to setup a fresh project.npx create-react-app my-app --typescript Then navigate to /my-app and run npm start. This will start the application in a development server with a live reload. The command run by npm start is defined under package.jsonscripts > start and runs react-scripts start.cd my-app npm start The application should now build and run properly and any changes done on the application should be reflected on the browser. We now have all the necessary tool to start writing code in React.2. Create componentsIn React with Typescript, creating…

Setup HTTPS with Nginx on Azure Ubuntu VM

Image
Setup HTTPS with Nginx on Azure Ubuntu VMToday we will see how we can setup HTTPS on using Certbot Nginx configuration on an Azure Ubuntu VM. This post will be composed of three steps:Prepare the VMInstall NginxInstall Certbot1. Prepare the VMWe start first by creating an Azure VM on Ubuntu 18.04 with either password or SSH and allowing HTTP, HTTPS, SSH.Once done, we can select a custom DNS for our VM. This makes it easier to SSH but also it will be required for our SSL certificate setup.We set the Assignment as Static then we choose a DNS name label. Here we choose azure-test-vm therefore the VM will be accessible at azure-test-vm.southcentralus.cloudapp.azure.com.We should now be able to SSH into the VM using the command:ssh kimserey@azure-test-vm.southcentralus.cloudapp.azure.com 2. Install NginxNext once we are in the VM, we can install Nginx by installing the following:sudo apt-get update sudo apt-get install nginx Once installed, as we already have opened the HTTP port during cr…