Skip to content

Instantly share code, notes, and snippets.

View gmsotavio's full-sized avatar

Otavio Augusto Gomes gmsotavio

  • Inobram Automações
  • Paraná State, Brazil
  • 19:18 (UTC -03:00)
View GitHub Profile
@ayoubzulfiqar
ayoubzulfiqar / folder_structure.md
Created September 5, 2023 06:12
The Folder Structure for Every Golang Project

Go - The Ultimate Folder Structure

Organizing your Go (Golang) project's folder structure can help improve code readability, maintainability, and scalability. While there is no one-size-fits-all structure, here's a common folder structure for a Go project:

project-root/
    ├── cmd/
    │   ├── your-app-name/
    │   │   ├── main.go         # Application entry point
    │   │   └── ...             # Other application-specific files
@Esl1h
Esl1h / bash_parse_example.sh
Last active September 19, 2023 11:12
How to parse and use yaml file in bash/shell script.
#!/bin/bash
function parse_yaml {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\):|\1|" \
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;

Install navidrome on FreeNAS Jail / FreeBSD 11.4 & 12.2

https://www.navidrome.org/

  • date: 2020-08-21, navidrome 0.30.1, needs go 1.14 and node v14
  • update: 2020-10-28, navidrome 0.36.1, needs go 1.15 and node v14; newer go version in repo: pkg update, pkg upgrade followed by pkg install taglib and the build went through
  • update: 2021-01-20, FreeBSD 12, navidrome 0.39, needs go 1.15 and node v14; FreeBSD 12 repo contains node v15, installed node14 and npm-node14 instead of node and npm
  • update: 2021-04-30, FreeBSD 12, navidrome 0.42, needs go 1.16 (in repo), kept node v14 with a minor update; removed wrapper script from service below
  • update: 2021-08-04, FreeBSD 12, navidrome 0.44.1, needs node v16

Improvements / TODO

@rishavpandey43
rishavpandey43 / git-commit-styleguide.md
Last active May 5, 2024 20:14
This gist consist of the rules and best practice of good conventional git commit message

Git Commit Messages Style-Guides

  • Use the present tense ("Add feature" not "Added feature")
  • Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
  • Limit the first line to 72 characters or less
  • Reference issues and pull requests liberally after the first line
  • When only changing documentation, include [ci skip] in the commit title
  • Consider starting the commit message with an applicable emoji

Types

@lbussy
lbussy / README.md
Last active March 17, 2024 21:00
External Button Shutdown for Raspberry Pi

Shutdown Raspberry Pi with a Single Button

There are two methods:

  1. Scripted Method
  2. Boot Overlay Method (also below as "tl;dr")

tl;dr Version

Add the following to your /boot/config.txt and reboot:

@Quick104
Quick104 / readme.md
Last active April 30, 2024 17:31
Expose a server behind CG:NAT via Wireguard
@pautiina
pautiina / sysctl.conf
Created October 16, 2018 11:53 — forked from jahil/sysctl.conf
calomel.org freebsd network tuning
# FreeBSD 10.2 -- /etc/sysctl.conf version 0.47
# https://calomel.org/freebsd_network_tuning.html
#
# low latency is important so we highly recommend that you disable hyper
# threading on Intel CPUs as it has an unpredictable affect on latency, cpu
# cache misses and load.
#
# These settings are specifically tuned for a "low" latency FIOS (300/300) and
# gigabit LAN connections. If you have 10gig or 40gig you will need to increase
# the network buffers as proposed. "man tuning" for more information.
@gmsotavio
gmsotavio / queue_example_threads.c
Created August 8, 2018 12:56 — forked from gustavorv86/c_priority_queue_threads.c
POSIX message queue example written in C/C++
#include <fcntl.h>
#include <mqueue.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
@mwidmann
mwidmann / add_local_trusted_ca_for_valid_https.md
Last active March 22, 2024 10:30
Generating trusted SSL keys for development

Generating SSL keys for development

Installation

Thanks to minica it is very easy to create trusted SSL certificates that have a very long expiration date.

In order to get started you have to have the go tools installed and set up correctly in your environment.

Setup

@F21
F21 / signing-gpg-keys.md
Last active May 5, 2024 20:59
Signing someone's GPG key

This is a quick guide of the commands we use to sign someone's GPG key in a virtual key signing party.

Note: The steps cover only the technical aspects of signing someone's key. Before signing someone's key, you must verify their identity. This is usually done by showing government-issued ID and confirming the key's fingerprint

The commands will work for both GPG and GPG2.

I use Julian's key for the examples. His key id is 2AD3FAE3. You should substitute with the appropriate key id when running the commands.

Signing the key

  1. List the keys currently in your keyring: gpg --list-keys.