Skip to content

Instantly share code, notes, and snippets.

View broklyngagah's full-sized avatar

pieter lelaona broklyngagah

  • Rebelworks
  • Jakarta
View GitHub Profile
@broklyngagah
broklyngagah / concurrency.go
Created December 16, 2023 03:19
GO Concurrency Performance
package main
import (
"fmt"
"sync"
"time"
)
func process(data int) int {
time.Sleep(time.Second * 2)
@broklyngagah
broklyngagah / generate_rsa_ssh_keys.go
Created May 25, 2023 02:25 — forked from goliatone/generate_rsa_ssh_keys.go
Generate SSH RSA Private/Public Key pair with Golang
// This shows an example of how to generate a SSH RSA Private/Public key pair and save it locally
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"golang.org/x/crypto/ssh"
@broklyngagah
broklyngagah / build4123.sublime4.key
Created December 25, 2022 20:46 — forked from skoqaq/build4123.sublime4.key
Sublime Text 4 License Key
—– BEGIN LICENSE —–
Mifeng User
Single User License
EA7E-1184812
C0DAA9CD 6BE825B5 FF935692 1750523A
EDF59D3F A3BD6C96 F8D33866 3F1CCCEA
1C25BE4D 25B1C4CC 5110C20E 5246CC42
D232C83B C99CCC42 0E32890C B6CBF018
B1D4C178 2F9DDB16 ABAA74E5 95304BEF
9D0CCFA9 8AF8F8E2 1E0A955E 4771A576
@broklyngagah
broklyngagah / MacOS-Multi-Version-Go-With-Homebrew.md
Created November 11, 2021 18:55 — forked from BigOokie/MacOS-Multi-Version-Go-With-Homebrew.md
Manage multiple versins of Go on MacOS with Homebrew

This process would likely apply to other Homebrew formula also.

First search for your desired package:

brew search go

You should get a list of results that include the below. Not "go" is very unspecific so you may get a lot of results:

@broklyngagah
broklyngagah / pgx_json.go
Created June 13, 2021 09:33 — forked from rrafal/pgx_json.go
Use JSON column with golang pgx driver.
package main
import (
"fmt"
"encoding/json"
"github.com/jackc/pgx"
"log"
)
var schema = `
@broklyngagah
broklyngagah / install-comodo-ssl-cert-for-nginx.rst
Created November 20, 2020 00:12 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@broklyngagah
broklyngagah / upload-file-to-amazon-s3-golang.md
Created September 15, 2020 10:14 — forked from hiyali/upload-file-to-amazon-s3-golang.md
Upload file to amazon s3 with s3 filepath on golang

syncer.go

/*
  https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object-acl.html
  https://docs.aws.amazon.com/zh_cn/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html
  https://github.com/awslabs/aws-go-wordfreq-sample/blob/master/cmd/uploads3/main.go
  https://docs.aws.amazon.com/sdk-for-go/api/aws/

  1. Create bucket in s3 & get the keys
  - login to UI web aws s3 interface
package error
import "fmt"
const (
ErHashchk = 1000
ErNisamchk = 1001
ErNo = 1002
ErYes = 1003
ErCantCreateFile = 1004
@broklyngagah
broklyngagah / SSL.md
Created August 29, 2019 09:10 — forked from gangsta/SSL.md
How to Setting Up a Comodo SSL Cert

How to Setting Up a Comodo SSL Cert

  • I advice you to buy SSL Certs from officially Comodo only , or some SSL reseller whose you trust.

These are the steps I went through to set up an SSL cert. Purchase the cert

Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You’ll be asked for the content of the CSR file when ordering the certificate:

openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr
@broklyngagah
broklyngagah / ca.md
Created April 21, 2019 16:26 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.