Skip to content

Instantly share code, notes, and snippets.

View sandromello's full-sized avatar

Sandro Mello sandromello

View GitHub Profile
@sandromello
sandromello / hoopagent-secretsmanager.md
Last active July 18, 2023 14:09
hoopagent-secretsmanager.md

On a Linux VM

  1. Install the cli
curl -s -L https://releases.hoop.dev/release/install-cli.sh | sh
  1. Create the systemd unit
@sandromello
sandromello / hoop-as-a-lib.md
Last active June 9, 2023 20:22
Example how to load C lib from GO

Build the C Lib

go build -o agent.so -buildmode=c-shared main.go

Python

No dependencies required

@sandromello
sandromello / main.py
Created September 2, 2022 15:13
Runops Webhooks Receiver
from flask import Flask, request
from svix.webhooks import Webhook, WebhookVerificationError
app = Flask(__name__)
# obtained in the svix web panel
# https://docs.runops.io/docs/webhooks/#receiving-webhooks
signing_secret = ''
@app.route("/runops", methods=['POST'])
@sandromello
sandromello / test.sh
Created January 19, 2022 15:22
test.sh
echo $1 $2
@sandromello
sandromello / contract-cancel.md
Created February 3, 2021 21:16
contract-cancel.md
@sandromello
sandromello / averbacao-tag.sh
Last active December 14, 2020 14:24
averbacao-tag
ACCESSTOKEN=
curl 'https://integration.nonprod.taginfraestrutura.com.br/receivable/consent/optin' \
--header "Authorization: Bearer ${ACCESSTOKEN}" \
--header 'Content-Type: application/json' \
--data-raw '{
"optIns": [
{
"beneficiary":"72963718000194",
"assetHolder": "16036234000129",
"acquirer": "31688539000109",
@sandromello
sandromello / smtp-send.go
Created November 4, 2020 16:38
Smtp Send Example
package main
import (
"bytes"
"crypto/tls"
"errors"
"fmt"
"net"
"net/smtp"
"text/template"

Token Input

input:
  token:
    sub: foo
    group: tenant-admin
    tenant: tn-3293298
  method: GET
 path: /v1/saga/
@sandromello
sandromello / istio-google-proxy.yaml
Created April 24, 2020 17:53
Example Terminating TLS and proxying to an TLS external address
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: google-proxy-test
spec:
hosts:
- google-proxy-test.mydomain.tld
gateways:
- istio-gateway
http:
@sandromello
sandromello / volume-mapping.yml
Created January 15, 2020 17:44
Volume Mapping
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: nginx-ig
name: nginx-ig
spec:
replicas: 2
selector:
matchLabels: