Skip to content

Instantly share code, notes, and snippets.

@jppampin
jppampin / 00_Introduction.md
Last active December 9, 2019 03:30
Building an Elasticsearch + Kivana + Serilog-Elasticsearch-Sink stack

Introduction

To track an Asp .Net Core WebApi behavior, we can use lots of differents logging stacks. Thinking about some high performant and easy to implement, we can combine elasticsearch + kibana, and serilog-elasticsearch-sink as client.

Here we i'm going to register a recipe to accomplish a full elasticsearch + kibana + asp .net core integration

  1. Build a elasticsearch + kibana stack using the new docker feature called 'stack'
  2. Create a .Net Core WebApi app
  3. Add serilog.elasticsearch.snik and *serilog.logging' to the WebApi project
  4. Configure the serilog sink insde the WebApi app
@jppampin
jppampin / .01_Instructions.md
Last active October 24, 2019 14:12
How to setup gitlab and gitlab-runner with docker and docker stack

Introduction

In the long path to DevOps, we will need some tool which simplified our lives. That tool has a name and it's Gitlab. Following are the steps which i did to achive the goal of getting Gitlab running in a docker stack, configured using a docker-compose.yml file

Steps

Create the local folders if the you are not going to use volumes

# gitlab persistence
sudo mkdir -p /srv/gitlab/config
@jppampin
jppampin / 01_HttpClientExceptionFilterAttribute.md
Last active July 12, 2019 04:18
Como generar un Exception Filter para ASP .Net Core Mvc / WebApi

Creacion de un atributo custom para manejo de excepciones

Para manejar las excepciones, podemos decorar un controller con un atributo custom que permita manejar las excepciones y generar la mensajeria que necesitemos

namespace webapi_poc.Extensions
{
    using System;
    using System.Net;
 using System.Net.Http;
@jppampin
jppampin / 01_Ionic_4_React.md
Last active January 13, 2020 20:36
Ionic 4 with react
@jppampin
jppampin / python_matplotlib.md
Last active April 4, 2019 19:01
Como diagramar figuras con matplotlib en python

Introduccion

En python podemos graficar figuras con la librería matplotlib, a continuación se demuestra código en python para graficar cuadrados y círculos con leyendas.

import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle, Circle

fig = plt.figure()

Ejemplod e Provider para consumir un servicio y exponerlo en una página

Consumo un Servicio REST, y devuelvo un observable que es el origne de datos para una lista de elementos.

  • El provider lo genero con el comando ionic g provider morfi
  • El server lo inicio con ionic serve --lab
@jppampin
jppampin / 1_WAS_7_REST_Setup_With_Wink_and_Jackson.md
Last active December 8, 2019 23:48
Websphere Application Server 7.x: Maven project for a Rest API