Skip to content

Instantly share code, notes, and snippets.

View digenaldo's full-sized avatar
🔒

digenaldo neto digenaldo

🔒
View GitHub Profile
@digenaldo
digenaldo / funcoesProjeto.py
Created February 15, 2014 15:11
Projeto Biblioteca - Introdução a Programação - Python
#funções projeto gerenciador de bibliotecas
#autores: digenaldo neto, caio cezar, walber luis
def retornaLogin():
""" Verifica o arquivo e retorna todo o arquivo do funcionario em lista """
lista2 = []
arquivo = open('dadosFuncionarios.txt','r')
lista = arquivo.readlines()
for i in range(len(lista)):
string = lista[i]
@digenaldo
digenaldo / main.go
Last active January 28, 2019 18:39
server api
package main
import (
"fmt"
"log"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Hello from the api!")
@digenaldo
digenaldo / GoConcurrency.md
Created February 9, 2019 17:34 — forked from rushilgupta/GoConcurrency.md
Concurrency in golang and a mini Load-balancer

INTRO

Concurrency is a domain I have wanted to explore for a long time because the locks and the race conditions have always intimidated me. I recall somebody suggesting concurrency patterns in golang because they said "you share the data and not the variables".

Amused by that, I searched for "concurrency in golang" and bumped into this awesome slide by Rob Pike: https://talks.golang.org/2012/waza.slide#1 which does a great job of explaining channels, concurrency patterns and a mini-architecture of load-balancer (also explains the above one-liner).

Let's dig in:

Goroutines

@digenaldo
digenaldo / insert_pg.go
Created November 8, 2019 20:19 — forked from reterVision/insert_pg.go
A trivial program that uses goroutine to insert records into Postgres.
/*
Original idea from
http://www.acloudtree.com/how-to-shove-data-into-postgres-using-goroutinesgophers-and-golang/
*/
package main
import (
"log"
"time"
"os"
@digenaldo
digenaldo / docker-cleanup-resources.md
Created May 20, 2020 19:19 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@digenaldo
digenaldo / GoogleDorking.md
Created December 16, 2021 18:44 — forked from sundowndev/GoogleDorking.md
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@digenaldo
digenaldo / ubuntu_agnoster_install.md
Created December 27, 2021 20:30 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

package main
import (
"context"
"fmt"
"net"
"os/exec"
"strconv"
"strings"
"sync"