Skip to content

Instantly share code, notes, and snippets.

View mariomac's full-sized avatar

Mario Macias mariomac

View GitHub Profile
@mariomac
mariomac / gist:89727a3aaa908d9ae2027168ee9d9ecf
Created December 23, 2022 09:57
Cleanup Samsung Galaxy tab S3
# from: https://medium.com/@kaikoenig/samsungs-bloatware-disgrace-c7d14a298ad7
# Sistema > Información del software > Tocar 7 veces "Numero de compilación"
# Opciones Desarrollador > Depuración por USB
adb devices
adb shell
pm list packages | grep "package:com.microsoft" | awk -F: '{print $2}'
pm uninstall -k --user 0 com.microsoft.office.excel
pm uninstall -k --user 0 com.microsoft.office.onenote
@mariomac
mariomac / README.md
Last active April 6, 2022 11:05
Privileged Netobs Agent WIP

Problem: the privileged pod can be correctly deployed in OpenShift but the netobserv-agent fails in Kubernetes when it tries to remove the memory lock, internally executing the prlimit syscall. The received error is "operation not permitted".

time="2022-04-06T11:04:27Z" level=fatal msg="can't start netobserv-agent"
error="removing mem lock: failed to set memlock rlimit: operation not permitted"

We have tested it in Kind and Minikube. Maybe we should try it in another Vanilla K8s distribution.

@mariomac
mariomac / reflect_test.go
Created February 25, 2022 15:57
Go reflection API performance
All the three benchmarks do the same operation:
go test -bench=. ./examples/... -test.run=^$ -benchmem -cpu 2,4,6
? github.com/mariomac/go-pipes/examples/basic [no test files]
goos: darwin
goarch: amd64
pkg: github.com/mariomac/go-pipes/examples/tests
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkNative-2 3277838 362.9 ns/op 0 B/op 0 allocs/op
BenchmarkNative-4 3263050 364.7 ns/op 0 B/op 0 allocs/op
@mariomac
mariomac / cartridge.asm
Created November 26, 2021 10:29 — forked from theNestruo/cartridge.asm
Simplified MSXlib cartridge header, entry point and initialization
; =============================================================================
; MSX cartridge (ROM) header, entry point and initialization
; =============================================================================
IF (CFG_INIT_ROM_SIZE < 32)
org $4000, $4000 + (CFG_INIT_ROM_SIZE * $0400) - 1
ELSE
org $4000, $bfff
ENDIF ; IF (CFG_INIT_ROM_SIZE < 32)
@mariomac
mariomac / instructions.md
Last active November 26, 2021 09:32
Deploy development version of the CNO and OVS-Kubernetes

Deploy development version of the CNO and OVS-Kubernetes

Using pre-built images (at quay.io/mmacias)

Download the CNO:

git clone github.com/openshift/cluster-network-operator
@mariomac
mariomac / dragon_ball_z_combate.c
Last active December 13, 2019 17:17
Bola de Drac Z: el combate definitivo
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#define ESTADO_JUGANDO 0
#define ESTADO_GOKU_GANA 1
#define ESTADO_FREEZER_GANA 2
#define ESTADO_NAMEK_DESTRUIDO 3
#define ACCION_ATACAR 'A'