Skip to content

Instantly share code, notes, and snippets.


Richard Gomes frgomes

View GitHub Profile
View ElanTabletWACOM.txt
Section "InputClass"
Identifier "Wacom driver override"
MatchProduct "ELAN2514:00 04F3:2B05"
MatchDevicePath "/dev/input/event*"
Driver "wacom"
frgomes /
Last active May 3, 2021
Bash - Matrix multiplication, passing associative arrays to functions, returning associative arrays from functions
#!/bin/bash -eu
function linalg_matrix_dump {
local -n M=${1}
local -a data=(${M[data]})
typeset -i rows=${M[rows]}
typeset -i cols=${M[cols]}
typeset -i i j
printf "%s:\n" ${1}
for ((i=0;i<rows;i++)) ; do
frgomes /
Last active Apr 17, 2021
Python - github_clone_user - clones all repositories of type=sources
#!/usr/bin/env python3
import json
import requests
import argparse
import os
import sys
from git import Repo
frgomes / gist:46d60e1da1d76df878323467a9930a8e
Created Apr 7, 2021
Rust - LinkedList and DoubleLinkedList
View gist:46d60e1da1d76df878323467a9930a8e
mod LinkedList {
type Link<T> = Option<Box<Node<T>>>;
struct Node<T> {
value: T,
next: Link<T>,
mod DoubleLinkedList {
use core::cell::RefCell;
frgomes /
Last active Mar 25, 2021
bash - run cmake out of tree / run cmake out of project

Instead of running cmake in tree such as:

git clone

cd wabt
mkdir build
cd build
cmake ..
cmake --build .
frgomes / gist:4cb640a4507976f50a3b5847f8fd77d1
Last active Mar 3, 2021
salt: Create Salt installation in a virtual environment
View gist:4cb640a4507976f50a3b5847f8fd77d1
#!/bin/bash -ex
# This script creates a Salt installation inside a virtual environment so that
# a steteful infrastructure aiming customer A is absolutely oblivious of customer B.
# No changes are required on configuration files, so that you can be sure that
# whatever you keep in the source control is valid in production. All you have to do
# in production is copying the trees /etc/salt and /srv/salt from the source control
# to their glorified places /etc/salt and /srv/salt in production.
frgomes /
Created Feb 9, 2021
Python - Find public keys matching a given list of patterns
def contents(ssh, files):
for file in files:
path = '{}/{}'.format(ssh, file)
yield open(path).read().replace("\n", "")
def keysFor(args):
ssh = '{}/.ssh'.format(os.environ['HOME'])
extensions = [ '.pub' ]
files = [f for f in os.listdir(ssh) if os.path.splitext(f)[1] in extensions]
keys = [k for k in contents(ssh, files) if k.split(' ')[2] in args]
frgomes /
Last active Feb 20, 2020
keybase proof

Keybase proof

I hereby claim:

  • I am frgomes on github.
  • I am frgomes ( on keybase.
  • I have a public key ASC31pcPI9EG4dsquRu8NbKIIHYtjUkhHAL3LyVzzuwjyQo

To claim this, I am signing this object:

frgomes /
Last active Dec 12, 2019
bash - install RetroPie on UDOO Bold V8
## This script is instended to install RetroPie on a newly installed Debian Buster box.
## Hardware requirements:
## This script is known to work well with UDOO Bolt V8, which has an AMD Ryzen 1000 SoC.
## Software Requirements:
frgomes /
Last active Aug 18, 2019
k8s: find cluster names in kubectl configuration
// one-liner which converts YAML to JSON
function yaml2json {
python -c 'import sys, yaml, json; y=yaml.load(; print(json.dumps(y))'
function kubectl_clusters {
cat ~/.kube/config | yaml2json | jq '.clusters[].name' | sed 's/"//g'