Skip to content

Instantly share code, notes, and snippets.

View mayconvm's full-sized avatar

Maycon Moreira mayconvm

View GitHub Profile
@mayconvm
mayconvm / decode_whatsapp.go
Created April 29, 2025 10:55
Decode file from Whatsapp
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"errors"
"fmt"
@mayconvm
mayconvm / ffmpeg-compress-mp4
Last active June 4, 2025 15:30 — forked from lukehedger/ffmpeg-compress-mp4
Compress mp4 using FFMPEG
#!/bin/bash
ffmpeg -i "$1" -crf 27 -preset veryfast -movflags +faststart -r 30 -vcodec libx264 -acodec aac "$2"
@mayconvm
mayconvm / DEPLOY_WITH_KAMAL_ON_DEDICATED_SERVER.md
Created September 18, 2024 14:18 — forked from n-studio/DEPLOY_WITH_KAMAL_ON_DEDICATED_SERVER.md
Deploy a web app on a dedicated server with Kamal

Notes

This guide uses Kamal 1.8.1

Motivation

Kamal was designed with 1 service = 1 droplet/VPS in mind.
But I'm cheap and I want to be able to deploy multiple demo/poc apps apps on my $20/month dedicated server.
What the hell, I'll even host my private container registry on it.

@mayconvm
mayconvm / gist:991c925ac26a4ce713992d05fd208c4f
Created March 18, 2020 10:29 — forked from szydan/gist:b225749445b3602083ed
<U+FEFF> character showing up in files. How to remove them?
1) In your terminal, open the file using vim:
vim file_name
2) Remove all BOM characters:
:set nobomb
3) Save the file:
:wq
tmp_ssh_host=$(echo $(git remote get-url origin) | sed 's/https:\/\/bitbucket.org\//git@bitbucket.org:/g')
git remote remove origin && git remote add origin $tmp_ssh_host
sudo tcpdump -i enp2s0 tcp and port 80 -s0 -vv -X
@mayconvm
mayconvm / sync_database
Created November 22, 2019 14:45
MYSQL Sync table
SYNC TABLE
mysqldump --opt --user=<youruser> --password=<yourpassword> -host <yourhost> \
<yourDB> <yourtable> | mysql -u <newserveruser> -p<password>
@mayconvm
mayconvm / mysql
Created October 9, 2019 08:30
Better database Mysql
# Read
* https://dev.mysql.com/doc/refman/8.0/en/innodb-redo-log.html
* https://dev.mysql.com/doc/internals/en/join-buffer-size.html
# Tools
* https://github.com/major/MySQLTuner-perl
@mayconvm
mayconvm / .tmux.conf
Last active January 8, 2024 13:37
Settings to tmux
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
#color pallete
set -g default-terminal "screen-256color"
# Enable mouse control (clickable windows, panes, resizable panes)
#set -g mouse-select-window on
Tooling integration with the official sublime-build plugin.
Automatic formatting with the Gofmt plugin and goimports.
Code linting with the SublimeLinter plugin and gometalinter.
Autocompletion with the gocode package.
Code navigation with the GoGuru plugin.
Snippet management with Sublime Text's inbuilt tool and the PackageResourceViewer plugin.
https://www.alexedwards.net/blog/streamline-your-sublime-text-and-go-workflow