Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Available to Work

Mauri de Souza Meneguzzo mauri870

💻
Available to Work
View GitHub Profile
@mauri870
mauri870 / u9fs-sharing-unix-files-with-plan9.md
Last active Jun 8, 2021
Sharing UNIX files with a Plan9 instance through 9P
View u9fs-sharing-unix-files-with-plan9.md

Hi,

this gist summarizes how to share UNIX files/folders with a Plan9 instance using u9fs.

First of all, grab the latest u9fs release from source or install it with the package manager of your preference, then build and install.

Please be sure to find the correct path to your u9fs binary because it may differ based on the installation, normally it is /usr/local/bin/u9fs or /usr/bin/u9fs.

On older unix/linux systems you may use inetd, which is already covered by the u9fs man page.

@mauri870
mauri870 / tensorflow_audio_to_mfcc.py
Last active Mar 10, 2020
Wav audio to mfcc features in tensorflow 1.15
View tensorflow_audio_to_mfcc.py
import tensorflow as tf
# FIXME: audio_ops.decode_wav is deprecated, use tensorflow_io.IOTensor.from_audio
from tensorflow.contrib.framework.python.ops import audio_ops
# Enable eager execution for a more interactive frontend.
# If using the default graph mode, you'll probably need to run in a session.
tf.enable_eager_execution()
@tf.function
def audio_to_mfccs(
@mauri870
mauri870 / asterisk-17.x-bfd-debian-bullseye.patch
Last active Feb 18, 2020
Asterisk PABX patch for GNU BFD in Debian Bullseye — undefined reference to bfd_get_section_flags, bfd_get_section_vma and bfd_get_section_size
View asterisk-17.x-bfd-debian-bullseye.patch
diff --git a/main/backtrace.c b/main/backtrace.c
index 2623d7ff87..9b80622b04 100644
--- a/main/backtrace.c
+++ b/main/backtrace.c
@@ -124,12 +124,12 @@ static void process_section(bfd *bfdobj, asection *section, void *obj)
offset = data->pc - (data->dynamic ? (bfd_vma)(uintptr_t) data->dli.dli_fbase : 0);
- if (!(bfd_get_section_flags(bfdobj, section) & SEC_ALLOC)) {
+ if (!(bfd_section_flags(section) & SEC_ALLOC)) {
@mauri870
mauri870 / asterisk-unpause-all-members-not-ready-in-queue.sh
Created Jan 13, 2020
Unpause all paused agentes not in use in a Asterisk queue
View asterisk-unpause-all-members-not-ready-in-queue.sh
#!/bin/sh
set -e
asterisk -rx "queue show ${1}"
grep '(paused) (Not in use)' |
awk '{$1=$1};1' |
cut -d' ' -f1 |
while read -r member
do
@mauri870
mauri870 / br-abnt2
Last active May 10, 2019
br-abnt2 kbmap for Plan9. Unfortunatelly I could't figure out how to make the acentuation work, hence the 0 value in line 1, 4, 9 and 12
View br-abnt2
0 26 0
0 27 '[
0 39 'ç
0 40 0
0 41 ''
0 43 ']
0 53 ';
0 115 '/
1 26 0
1 27 '{
@mauri870
mauri870 / tf-serving-client.go
Last active Oct 30, 2020
Tensorflow Serving Go client for the inception model
View tf-serving-client.go
// Tensorflow Serving Go client for the inception model
// go get github.com/golang/protobuf/ptypes/wrappers google.golang.org/grpc
//
// Compile the proto files:
//
// git clone https://github.com/tensorflow/serving.git
// git clone https://github.com/tensorflow/tensorflow.git
//
// mkdir -p vendor
@mauri870
mauri870 / autoreload.sh
Created May 19, 2017
Rerun pdflatex on the fly when a file changes
View autoreload.sh
#!/bin/bash
ls *.{tex,bib} | entr sh -c "bibtex main && pdflatex -synctex=1 -interaction=nonstopmode main.tex"
@mauri870
mauri870 / manjaro-avell-g1513.md
Last active Sep 17, 2020
Installation of Manjaro 17 and nvidia/bumblebee drivers on Avell G1513
View manjaro-avell-g1513.md

After a weekend of research, stress and pain I finally figure out how to install manjaro 17 and configure the nvidia/bumblebee drivers on my avell laptop

Here's my notebook specs:

$ inxi -MGCNA

Machine:   Device: laptop System: Avell High Performance product: 1513
           Mobo: N/A model: N/A v: 0.1 UEFI: American Megatrends v: N.1.02 date: 09/28/2016
Battery    BAT0: charge: 44.0 Wh 100.0% condition: 44.0/44.0 Wh (100%)
@mauri870
mauri870 / queue.go
Last active Nov 20, 2016
Go program representing a queue data structure. Test it https://play.golang.org/p/QXC3OkMMT3
View queue.go
package main
import (
"fmt"
)
func main() {
// Create a new Queue
queue := NewQueue()
@mauri870
mauri870 / stack.go
Last active Nov 20, 2016
Go program representing a stack data structure. Test it https://play.golang.org/p/gBUeebGQVr
View stack.go
package main
import (
"fmt"
)
func main() {
// Create a new Stack
stack := NewStack()