Skip to content

Instantly share code, notes, and snippets.

View fulvi0's full-sized avatar
🏠
Working...

Carlos Antonio fulvi0

🏠
Working...
View GitHub Profile
"use strict";
const amqp = require("amqplib");
const { rejects } = require("assert");
const EventEmitter = require("events");
const { CORE_SCHEMA } = require("js-yaml");
const { v4: uuidv4 } = require("uuid");
// this queue name will be attached to "replyTo" property on producer's message,
// and the consumer will use it to know which queue to the response back to the producer
const REPLY_QUEUE = "amq.rabbitmq.reply-to";
#include <Espalexa.h>
#include <ESP8266WiFiMulti.h>
#include <Ticker.h>
#define ZC 5
#define TRIAC 4
#define ESPuS 155 //5 ticks per us 150 = 30 us
#define ESPERAMIN 1000 // 200us
ESP8266WiFiMulti WiFiMulti;
Espalexa espalexa;
Ticker timer;
Listen 0.0.0.0:443 https
TraceEnable off
ServerSignature Off
ServerTokens Prod
WSGIPythonHome /opt/privacyidea
WSGISocketPrefix /var/run/wsgi
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
@fulvi0
fulvi0 / keycloak.sh
Created April 29, 2021 14:42 — forked from luciddreamz/keycloak.sh
Keycloak Admin API Rest Example: Get User
#!/bin/bash
# requires https://stedolan.github.io/jq/download/
# config
KEYCLOAK_URL=http://localhost:8080/auth
KEYCLOAK_REALM=realm
KEYCLOAK_CLIENT_ID=clientId
KEYCLOAK_CLIENT_SECRET=clientSecret
USER_ID=userId
@fulvi0
fulvi0 / multiple-repository-and-identities-git-configuration.md
Created December 4, 2020 16:30 — forked from bgauduch/multiple-repository-and-identities-git-configuration.md
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
apiVersion: v1
kind: Namespace
metadata:
name: kong
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: kongclusterplugins.configuration.konghq.com
spec:
@fulvi0
fulvi0 / gist:3d72864f41b75f06e041309147f49e0e
Created May 6, 2020 02:30 — forked from carmark/gist:4aa32cacd4d041448c39ad8deb87135f
A sample Docker workflow with Nginx, Node.js and Redis

For this example, I have a very simple Node.js applications that increments a counter stored on Redis. I want to run Redis and the node application independently as I want to have the ability to scale the node application depending on the load. To start off, I have 3 instances of the node server running the application. I have an Nginx server in front of node for load balancing the node instances.

Let’s now talk in terms of containers, specifically Docker containers. Simple; 1 container for each service/process!

  • 1 Redis container
  • 3 Node containers
  • 1 Nginx container So, the overall picture looks something like this:

#!/bin/bash
echo "updating distro \n"
sudo apt-get update -y
echo "installing necessary packages \n"
sudo apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
@fulvi0
fulvi0 / sonarqube-docker-compose.yml
Last active September 15, 2019 20:37 — forked from Warchant/sonarqube-docker-compose.yml
docker-compose file to setup production-ready sonarqube
version: "3"
services:
web:
image: nginx:alpine
ports:
- "8080:80"
volumes:
- ./site.conf:/etc/nginx/conf.d/site.conf
@fulvi0
fulvi0 / self-signed-certificate-with-custom-ca.md
Created July 19, 2019 21:35 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096