Skip to content

Instantly share code, notes, and snippets.

View 9bany's full-sized avatar
🏠
Working from home

Bany 9bany

🏠
Working from home
View GitHub Profile
FROM golang:1.23.0-bookworm AS build
ARG upx_version=4.2.4
RUN apt-get update && apt-get install -y --no-install-recommends xz-utils && \
curl -Ls https://github.com/upx/upx/releases/download/v${upx_version}/upx-${upx_version}-amd64_linux.tar.xz -o - | tar xvJf - -C /tmp && \
cp /tmp/upx-${upx_version}-amd64_linux/upx /usr/local/bin/ && \
chmod +x /usr/local/bin/upx && \
apt-get remove -y xz-utils && \
rm -rf /var/lib/apt/lists/*
@9bany
9bany / 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"
)
@9bany
9bany / 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
@9bany
9bany / 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
@9bany
9bany / 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