Skip to content

Instantly share code, notes, and snippets.

View fakihariefnoto's full-sized avatar
😌
on fire

Fakih Arief Noto fakihariefnoto

😌
on fire
View GitHub Profile
@fakihariefnoto
fakihariefnoto / golang_httprouter_disable_access_dir.go
Created March 15, 2021 12:16
golang httprouter disable access index folder but allow for dynamic filename to serve files
// import "github.com/julienschmidt/httprouter"
// example router
// Serve static files for Assets
router := httprouter.New()
router.GET("/fonts/*filepath", fileHandler("/fonts/"))
router.GET("/styles/*filepath", fileHandler("/styles/"))
router.GET("/scripts/*filepath", fileHandler("/scripts/"))
router.GET("/img/*filepath", fileHandler("/img/"))
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
# Unzip
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
@fakihariefnoto
fakihariefnoto / Linux command cheat sheet.md
Last active May 12, 2020 15:46
list of linux command cheat sheet if you forget

Get Most Open Connection in Port 80

netstat -tn 2>/dev/null | grep :80 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr | head

@fakihariefnoto
fakihariefnoto / [Note] Linux Need to Install.md
Last active July 19, 2018 12:28
list tools need to install after reinstall linux

IDE

  • VSCode (with plugins Git Lens)
  • Atom (Alternative after VSCode)
  • Sublime text (third choice)
  • Android Studio

Tools

  • Golang
  • AG (silversearch) (sudo apt install silversearcher-ag)
  • NSQ
@fakihariefnoto
fakihariefnoto / Setup Golang.md
Last active October 7, 2023 22:27
Setup golang, goroot, gopath, gobin

After download and move to your interested folder, add this line to ~/.bashrc and ~/.profile

export GOPATH=$HOME/gowork
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOPATH/bin
export GOROOT=/usr/local/go

export PATH=$PATH:$GOROOT/bin