Skip to content

Instantly share code, notes, and snippets.

View jesusvazquez's full-sized avatar
👣
Leaving footprints all over

Jesus Vazquez jesusvazquez

👣
Leaving footprints all over
View GitHub Profile
Fri Jun 29 14:35:32 UTC 2018
@jesusvazquez
jesusvazquez / multiple-push-urls.md
Created July 31, 2018 12:43 — forked from bjmiller121/multiple-push-urls.md
Add multiple push URLs to a single git remote

Sometimes you need to keep two upstreams in sync with eachother. For example, you might need to both push to your testing environment and your GitHub repo at the same time. In order to do this simultaneously in one git command, here's a little trick to add multiple push URLs to a single remote.

Once you have a remote set up for one of your upstreams, run these commands with:

git remote set-url --add --push [remote] [original repo URL]
git remote set-url --add --push [remote] [second repo URL]

Once set up, git remote -v should show two (push) URLs and one (fetch) URL. Something like this:

SSH Cheatsheet

Commands

Generate strong ed25519 key

ssh-keygen -t ed25519 -b 4096

References for the above command

@jesusvazquez
jesusvazquez / .ideavimrc
Created August 28, 2018 21:05 — forked from bennyyip/.ideavimrc
idea vim plugin config
set hlsearch
set scrolloff=3
set ignorecase smartcase
set showmode
set history=1000
"" easy system clipboard copy/paste
"noremap <space>y "*y
"noremap <space>Y "*Y
"noremap <space>p "*p
@jesusvazquez
jesusvazquez / bash_cmds.md
Last active September 14, 2018 08:53
Bash Useful Commands

Linux Stuff

for i in ls ; do stat $i ; done

iotop - Read Write speeds iftop - Network current speeds

Disks

Test write speed

@jesusvazquez
jesusvazquez / prometheus_cheatsheet.md
Created March 5, 2019 10:25
Prometheus Cheatsheet
  • Metric cardinality

count by(__name__) ({__name__=~".*"})

@jesusvazquez
jesusvazquez / migrate_to_go_mod.sh
Last active April 16, 2019 18:22
Migrate golang project from dep to go mod
# Quick list of steps to initialize go mod in your go project.
# Make sure to do this out of the GOPATH or play around with GO111MODULE env var
# Initialize project
go mod init github.com/<repository_path>/<project_name>
go build -o /tmp/main main.go
rm /tmp/main
# Remove traces of dep
rm -rf vendor
rm Gopkg.*
# Verify dependencies are there
@jesusvazquez
jesusvazquez / go-tools.sh
Last active May 7, 2019 17:21
Go tools for development
# Tools for developing using go
go get golang.org/x/tools/cmd/gotype
go get github.com/securego/gosec/cmd/gosec
go get github.com/mdempsky/maligned
@jesusvazquez
jesusvazquez / postgres-cheatsheet.md
Created May 11, 2019 19:35 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@jesusvazquez
jesusvazquez / pipes.go
Created March 4, 2020 21:02
Know if a go program is receiving stdin input or not
package main
import (
"io/ioutil"
"os"
"github.com/sirupsen/logrus"
)
func main() {