Skip to content

Instantly share code, notes, and snippets.

@alanvitor
alanvitor / keybase.md
Created October 3, 2023 21:42 — forked from webframp/keybase.md
Signing git commits on github using keybase.io gpg key

Probably one of the easiest things you'll ever do with gpg

Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH

First get the public key

keybase pgp export | gpg --import

Next get the private key

@alanvitor
alanvitor / dockerun.sh
Last active May 12, 2023 14:14
Local folder on ubuntu docker
docker run -it -v .:/app -w /app ubuntu bash
@alanvitor
alanvitor / json_to_csv.py
Created November 10, 2022 14:34
JSON to CSV using pandas lib
#!/usr/bin/env python3
import sys
import pandas
def convert():
if len(sys.argv) == 1:
print("Missing json file name")
return
@alanvitor
alanvitor / rancher_desktop.md
Last active February 15, 2022 21:27
Switching from Docker Desktop to Rancher Desktop

Mac OS

  • Install Rancher Desktop
  • remove old Docker Desktop symbolic links in /usr/local/bin
    $ rm /usr/local/bin/docker*
    $ rm /usr/local/bin/kubectl
  • install docker compose with brew
@alanvitor
alanvitor / snippets.js
Last active November 7, 2021 14:41
Some useful JS snippets
// Generally, run in browser's console.
// re-enable paste in forms
document.addEventListener('paste', e => e.stopImmediatePropagation(), true);
@alanvitor
alanvitor / fresh_fedora_install.md
Last active February 15, 2022 21:28
Fresh Fedora post install

Enable some dnf flags

$ sudo vi /etc/dnf/dnf.conf

# add:
fastestmirror=1
max_parallel_downloads=10
deltarpm=true

$ sudo dnf clean all
@alanvitor
alanvitor / utils.sh
Created August 19, 2021 18:39
Bash command line uitilities
# current time in seconds (linux epoch)
date +%s
# get the seconds since some date
date -d "Aug 02 1992" +%s
@alanvitor
alanvitor / utils.js
Last active January 16, 2023 21:41
Search in this gist for <something> before npm install / yarn add <something>
// sleep
// usage: await sleep(<seconds>);
export const sleep = async (sec) => {
return await new Promise(resolve => setTimeout(resolve, sec * 1000));
};
// uuid
export const uuid = () => {
let i, random, uuid = '';
for (i = 0; i < 32; i++) {

Keybase proof

I hereby claim:

  • I am alanvitor on github.
  • I am alanvitor (https://keybase.io/alanvitor) on keybase.
  • I have a public key whose fingerprint is 9C6E BFFA 6DDD 3528 D12F 4763 C4D4 87F5 3D69 9DDB

To claim this, I am signing this object: