Skip to content

Instantly share code, notes, and snippets.

View 0del's full-sized avatar
🏠
Working from home

Bany 0del

🏠
Working from home
View GitHub Profile
@0del
0del / main.go
Created July 30, 2022 08:45 — forked from montanaflynn/main.go
Gin request timeout middleware and handler
package main
import (
"context"
"log"
"net/http"
"time"
"github.com/gin-gonic/gin"
)
@0del
0del / unmaskdocker.sh
Created June 16, 2022 07:46 — forked from jthmiranda/unmaskdocker.sh
to enable again when docker daemon is masked... yet don't know why happen
# when you try to start docker
# sudo systemctl start docker
# and the output is: Failed to start docker.service: Unit docker.service is masked.
#
#
# ls -la /etc/systemd/system | grep docker
# see for /dev/null if there is
systemctl unmask docker.service
systemctl unmask docker.socket
systemctl start docker.service
@0del
0del / unmaskdocker.sh
Created June 16, 2022 07:46 — forked from jthmiranda/unmaskdocker.sh
to enable again when docker daemon is masked... yet don't know why happen
# when you try to start docker
# sudo systemctl start docker
# and the output is: Failed to start docker.service: Unit docker.service is masked.
#
#
# ls -la /etc/systemd/system | grep docker
# see for /dev/null if there is
systemctl unmask docker.service
systemctl unmask docker.socket
systemctl start docker.service
@0del
0del / JSON.go
Created March 14, 2022 06:53 — forked from AlexMocioi/JSON.go
Map json to struct in GO, for direct marshal, unmarshal
package main
import "encoding/json"
import "fmt"
type Person struct {
Name string `json:"name"`
(from : https://simplifiedthinking.co.uk/2015/10/03/install-mqtt-server/ )
Installing Brew
The Mosquitto MQTT Server can be easily installed using Homebrew. If it’s not installed on your system already, then a quick visit to the homepage will give you all you need to get going. Homebrew is an OS X Package Manager for installing and updating non-Mac OS X utilities that are more commonly found in other variants of Linux. To install the basic package manager run the following command.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Installing Mosquitto MQTT