Skip to content

Instantly share code, notes, and snippets.

View udhos's full-sized avatar
👾
Wondering

udhos

👾
Wondering
  • São Paulo, Brazil
View GitHub Profile
@udhos
udhos / rabbitmq.md
Created April 11, 2022 21:30
rabbitmq

https://registry.hub.docker.com/_/rabbitmq/

docker run -it --hostname my-rabbit --name some-rabbit -e RABBITMQ_DEFAULT_USER=guest -e RABBITMQ_DEFAULT_PASS=guest -p 5672:5672 -p 0.0.0.0:15672:15672 -p 8080:8080 rabbitmq:3-management
@udhos
udhos / aws-api-gateway-private-invoke.md
Created April 7, 2022 15:08
aws-api-gateway-private-invoke

1. Enable Private DNS Name

Na criação do VPC Endpoint, a opção Enable Private DNS Name:

  • Habilita esses DNS names privados no VPC:
  execute-api.us-east-2.amazonaws.com
*.execute-api.us-east-2.amazonaws.com
  • Porém a presença desses domínios privados impede a resolução de execute-api público no VPC. Mesmo assim, ainda é possível chamar uma API pública pelo seu Custom Domain Name, se houver.
package main
import (
"fmt"
"golang.org/x/net/context"
cc "golang.org/x/oauth2/clientcredentials"
"io/ioutil"
"net/http"
"os"
)
@udhos
udhos / golang Io.Reader.md
Created March 19, 2022 14:42
golang Io.Reader
type Reader struct {
    data []byte
    readIndex int64
}

func (r *Reader) Read(p []byte) (n int, err error) {
    if r.readIndex >= int64(len(r.data)) {
 err = io.EOF
@udhos
udhos / goland recursive descent parser.md
Created March 19, 2022 03:32
golang recursive descent parser
@udhos
udhos / gist:a708820a8fac470b1d59ccbcfd56c43d
Created February 17, 2022 02:12 — forked from Rafe/gist:3102414
AWK cheatsheet
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008
Compiled by Eric Pement - eric [at] pement.org version 0.27
Latest version of this file (in English) is usually at:
http://www.pement.org/awk/awk1line.txt
This file will also be available in other languages:
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt
USAGE:
@udhos
udhos / dynamodb partiql.md
Last active December 3, 2021 17:50
dynamodb partiql

Console:

SELECT * FROM "cb-events"."eventType-index"
	WHERE "eventType" = 'phone-updated'
    AND eventDate >= '2021-10-01'
    AND eventDate <= '2021-10-02'

CLI:

@udhos
udhos / service account permissions.md
Created November 22, 2021 21:50
service account permissions