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
  • 02:49 (UTC -03:00)
View GitHub Profile
import redis
import time
import threading
# Conectando ao servidor Redis
redis_client = redis.StrictRedis(host='localhost', port=6379, db=0)
# Função para publicar números sequenciais a cada 100ms
@gmsotavio
gmsotavio / delete_git_submodule.md
Created March 22, 2024 18:34 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@gmsotavio
gmsotavio / pfctl-cheatsheet.txt
Created November 24, 2023 20:24 — forked from johnbianchi/pfctl-cheatsheet.txt
pfctl cheat sheet
#### General PFCTL Commands ####
$ pfctl -d disable # packet-filtering
$ pfctl -e enable # packet-filtering
$ pfctl -q # run quiet
$ pfctl -v -v # run even more verbose
#### Loading PF Rules ####
$ pfctl -f /etc/pf.conf # load /etc/pf.conf
$ pfctl -n -f /etc/pf.conf # parse /etc/pf.conf, but dont load it
$ pfctl -R -f /etc/pf.conf # load only the FILTER rules
$ pfctl -N -f /etc/pf.conf # load only the NAT rules
@gmsotavio
gmsotavio / corrupted_pdfs.sh
Last active October 28, 2023 21:12
List corrupted pdf files in a directory
#!/bin/bash
# Navigate to the folder containing your PDF files
cd /path/to/pdfs
# Create an empty text file to store the list of corrupted PDFs
corrupted_pdfs="corrupted_pdfs.txt"
> "$corrupted_pdfs"
# Loop through all PDF files and check for corruption
@gmsotavio
gmsotavio / vpn.md
Created October 2, 2023 02:36 — forked from joepie91/vpn.md
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@gmsotavio
gmsotavio / git-commit-styleguide.md
Created December 15, 2022 10:52 — forked from rishavpandey43/git-commit-styleguide.md
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

@gmsotavio
gmsotavio / ipfw.sh
Created October 12, 2022 19:06 — forked from Jehops/ipfw.sh
ipfw config
#!/bin/sh
# This is an attempt at an ipfw config for a cluster with a master node and many
# compute nodes. The master node is acting as a gateway for the compute nodes
# in the LAN (192.168.0.0/24).
#
# A jail running on one of the compute nodes with address 192.168.0.118 is to be
# accessible from the outside (using redirect_addr 192.168.0.118
# 129.173.118.118). The address 129.173.118.118 is an alias for the WAN
# interface that will only be used to direct traffic to this jail.
@gmsotavio
gmsotavio / sysctl.conf
Created October 11, 2022 11:38 — forked from pautiina/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 / csumattr.sh
Created May 28, 2022 19:51 — forked from tsmetana/csumattr.sh
Store file checksum in the extended attribute
#!/usr/bin/bash
#
# Set/check SHA256 file checksum stored in the file's extended attributes
#
csum_attr="user.sha256sum"
check_path="."
action=""
usage() {