Skip to content

Instantly share code, notes, and snippets.

View kenriortega's full-sized avatar
🏠
Working from home

Kenrique Ortega kenriortega

🏠
Working from home
View GitHub Profile
@kenriortega
kenriortega / main.go
Created July 5, 2021 02:48 — forked from StarBuckR/main.go
Golang Ldap Authentication, Bind and Search, including Anonymous Bind
package main
import (
"fmt"
"log"
"github.com/go-ldap/ldap/v3"
)
const (
@kenriortega
kenriortega / proxy.go
Created July 6, 2021 21:52 — forked from vmihailenco/proxy.go
Simple TCP proxy in Golang
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"

Step 1

To create a cluster, we need to spin up a few empty Redis instances and configure them to run in cluster mode.

Here’s a minimal configuration file for Redis Cluster:

# redis.conf file
port 7000
@kenriortega
kenriortega / gist:87c8d1be0c2372670bf5d07717dbcaca
Created January 13, 2022 14:36 — forked from technoweenie/gist:1072829
.netrc file so you can push/pull to https git repos without entering your creds all the time
machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET
@kenriortega
kenriortega / lambda-vpc.yml
Created February 26, 2022 01:00 — forked from ultimagriever/lambda-vpc.yml
SAM Template with VPC
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Resources:
VPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
InternetGateway:
@kenriortega
kenriortega / README.md
Created March 11, 2022 02:43 — forked from goliatone/README.md
Postgres TRIGGER to call NOTIFY with a JSON payload

This TRIGGER function calls PosgreSQL's NOTIFY command with a JSON payload. You can listen for these calls and then send the JSON payload to a message queue (like AMQP/RabbitMQ) or trigger other actions.

Create the trigger with notify_trigger.sql.

When declaring the trigger, supply the column names you want the JSON payload to contain as arguments to the function (see create_triggers.sql)

The payload returns a JSON object:

package query_builder
import (
"strings"
"strconv"
"html/template"
"fmt"
)
type DynamicQueryBuilder string
@kenriortega
kenriortega / .block
Last active March 28, 2022 11:48 — forked from Berzeg/.block
Electrocardiogram
license: gpl-3.0
height: 300
@kenriortega
kenriortega / elasticsearch.fsx
Created April 12, 2022 22:02 — forked from mjul/elasticsearch.fsx
Elasticsearch in F# example
// paket add nuget NEST
#I "../../packages"
#r "Elasticsearch.Net/lib/net46/Elasticsearch.Net.dll"
#r "NEST/lib/net46/Nest.dll"
open System
//open Elasticsearch.Net
open Nest