Skip to content

Instantly share code, notes, and snippets.

View joaomlneto's full-sized avatar

João Neto joaomlneto

View GitHub Profile
@joaomlneto
joaomlneto / README.md
Last active July 29, 2022 14:15
Generate AsyncAPI during Maven build

This is an example of how to invoke AsyncAPI generator during a maven build, in three steps:

  1. Use download-maven-plugin to download the required files. A bit hacky, but required if you need authentication to access it... The downside is that you can't split your definition in multiple files, or you'll have to download them all. Feedback is welcome.
  2. Use exec-maven-plugin to invoke the AsyncAPI generator with the specified arguments
  3. Use build-helper-maven-plugin to signal maven to also include the newly-generated sources as source folders.
@joaomlneto
joaomlneto / keybase.md
Created June 27, 2022 10:24
keybase.md

Keybase proof

I hereby claim:

  • I am joaomlneto on github.
  • I am joaomlneto (https://keybase.io/joaomlneto) on keybase.
  • I have a public key ASBpsuwJW2IwIFuC-GryGotazM8jTpLolFZllRrO6HbZ7Ao

To claim this, I am signing this object:

@joaomlneto
joaomlneto / stripe-keys-and-ids.tsv
Created June 21, 2022 15:52 — forked from fnky/stripe-keys-and-ids.tsv
Stripe keys and IDs
Prefix Description Notes
ac_ Platform Client ID Identifier for an auth code/client id.
acct_ Account ID Identifier for an Account object.
ba_ Bank Account ID Identifier for a Bank Account object.
card_ Card ID Identifier for a Card object.
cbtxn_ Customer Balance Transaction ID Identifier for a Customer Balance Transaction object.
ch_ Charge ID Identifier for a Charge object.
cn_ Credit Note ID Identifier for a Credit Note object.
cs_live_ Live Checkout Session ID Identifier for a checkout Session object in live mode.
cs_test_ Test Checkout Session ID Identifier for a checkout Session object in test mode.
@joaomlneto
joaomlneto / update_chart.yml
Created May 18, 2022 05:47
Publishing Helm Chart to private repository using GitHub Actions
(...)
jobs:
package:
name: Package Helm Chart
runs-on: ubuntu-latest
outputs:
chart_filename: ${{ steps.chart_filename.outputs.chart_filename }}
steps:
- name: Checkout Repository
@joaomlneto
joaomlneto / .vimrc
Created November 12, 2021 16:26
.vimrc
" show line numbers
set nu
" enable syntax highlighting
syntax on
" set tab size to 2 spaces
set ts=2
" enable mouse use in all modes
@joaomlneto
joaomlneto / install_monaco_font.sh
Created September 27, 2019 12:52 — forked from rogerleite/install_monaco_font.sh
Install Monaco font in Linux
#!/bin/bash
#script extraido de: http://paulocassiano.wordpress.com/2008/08/29/deixando-o-gedit-com-a-cara-do-textmate/
#tip for better "resolution" here: http://blog.siverti.com.br/2008/05/22/fonte-monaco-no-ubuntugedit/
cd /usr/share/fonts/truetype/
#TODO: put validation if folder already exists
sudo mkdir ttf-monaco
@joaomlneto
joaomlneto / mac-client.sh
Last active July 13, 2023 06:29
Fast NFS volume on macOS
#!/usr/bin/env bash
# mount /home/joaomlneto @ linux-vm
mkdir -p /Users/joaomlneto/nfs/linux-vm
mount -t nfs -o nolocks,locallocks,rw,soft,intr,rsize=8192,wsize=8192,timeo=900,retrans=3,proto=tcp \
linux-vm:/home/joaomlneto \
/Users/joaomlneto/nfs/linux-vm
@joaomlneto
joaomlneto / signals.c
Created February 12, 2019 16:14
linux signals benchmarking
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <time.h>
#include <unistd.h>
#include <signal.h>
#include <ucontext.h>
#include <fcntl.h>
#include <execinfo.h>
#include <sys/mman.h>
@joaomlneto
joaomlneto / mprotect_bench.c
Created February 12, 2019 13:05
mprotect benchmarks
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <time.h>
#include <unistd.h>
#include <sys/mman.h>
#define SIZE (1ull<<35) // 32GB
#define N (SIZE/sizeof(uint64_t))
#define NTIMES 100
@joaomlneto
joaomlneto / how-to-install-latest-gcc-on-ubuntu-lts.txt
Created January 3, 2019 23:15 — forked from application2000/how-to-install-latest-gcc-on-ubuntu-lts.txt
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \