Skip to content

Instantly share code, notes, and snippets.

View dxdns's full-sized avatar

Diógenes Rodrigues dxdns

View GitHub Profile
@dxdns
dxdns / wsl-info.md
Created September 23, 2024 22:31 — forked from WillianTomaz/wsl-info.md
Instruções do WSL (Instalação, Backup e Restauração)

Instruções para Instalação, Backup e Restauração do WSL 2

  • Observação:

    • Sempre buscar pela documentação oficial, este documento é um tutorial
      que pode não te atender conforme tenha novas atualizações do processo de instalação.
    • As referências estão no final do documento.
  • Foi utilizado:

  • Windows 10

@dxdns
dxdns / data.json
Last active August 16, 2024 13:31
projects
[
{"name": "nfe-to-pdf", "language": "typescript"},
{"name": "image-to-text", "language": "typescript"},
{"name": "files", "language": "typescript"},
{"name": "calculator-st", "language": "typescript"},
{"name": "sql", "language": "typescript"}
]
func openbrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
@dxdns
dxdns / revprox.go
Created May 18, 2024 00:23 — forked from JalfResi/revprox.go
Simple reverse proxy in Go
package main
import(
"log"
"net/url"
"net/http"
"net/http/httputil"
)
func main() {
@dxdns
dxdns / go-module-rename.sh
Created February 17, 2024 15:10
go-module-rename
OLD_MODULE_NAME="old-module-name"
read -p "Enter OLD_MODULE_NAME: " OLD_MODULE_NAME
NEW_MODULE_NAME="hello-host"
read -p "Enter NEW_MODULE_NAME: " NEW_MODULE_NAME
go mod edit -module $NEW_MODULE_NAME
find . -name '*.go' -print0 \
| xargs -0 sed -i -e "s|${OLD_MODULE_NAME}|${NEW_MODULE_NAME}|"
@dxdns
dxdns / README.md
Created February 2, 2024 20:41 — forked from tmiller/README.md
A very simple example of using a map of channels for pub/sub in go.
@dxdns
dxdns / sender.go
Created February 2, 2024 17:05 — forked from douglasmakey/sender.go
Golang - send an email with attachments.
package main
import (
"bytes"
"encoding/base64"
"fmt"
"io/ioutil"
"mime/multipart"
"net/smtp"
"os"
@dxdns
dxdns / filename-test
Last active November 23, 2023 12:13
0.2
We couldn’t find that file to show.
@dxdns
dxdns / golang-tls.md
Created May 24, 2023 18:01 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
,_---~~~~~----._
_,,_,*^____ _____``*g*\"*,
/ __/ /' ^. / \ ^@q f
[ @f | @)) | | @)) l 0 _/
\`/ \~____ / __ \_____/ \
| _l__l_ I
} [______] I
] | | | |
] ~ ~ |
| |