Skip to content

Instantly share code, notes, and snippets.

View mayconvm's full-sized avatar

Maycon Moreira mayconvm

View GitHub Profile
@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
@mayconvm
mayconvm / my.cnf
Created September 20, 2019 08:13
Show mysql query in real-time
[mysqld]
log_error=/var/log/mysql/mysql.error.log
general_log_file=/var/log/mysql/mysql.general.log
general_log=1
; slow_query_log=0
; slow_query_log_file=/var/log/mysql/mysql.slow.log
; long_query_time=1
; log-queries-not-using-indexes
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/opt/Postman/app/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
EOL
@mayconvm
mayconvm / read_csv.sh
Created September 2, 2019 11:28
read csv with terminal
#!/bin/bash
sed "s/;/\t/g" $1 | less -S