Skip to content

Instantly share code, notes, and snippets.

View felipsmartins's full-sized avatar
🇧🇷
loading, please wait a few seconds...

Martins, F. felipsmartins

🇧🇷
loading, please wait a few seconds...
View GitHub Profile
@felipsmartins
felipsmartins / flameshot-install.sh
Last active August 30, 2024 22:46
Flameshot install (AppImage)
#!/usr/bin/env bash
# WHY use this script?
# 1. Sometimes deb or flatpak packages can't play well with wayland system (under debian 12 for example), so appimage do.
# 2. AppImage can't configure desktop entry and app icon and you can't install appimagelauncher (TheAssassin/AppImageLauncher).
set -euo pipefail
FLAMESHOT_TEMPDIR=/tmp/flameshot
FLAMESHOT_RELEASE_URL="https://github.com/flameshot-org/flameshot/releases/download/v12.1.0/Flameshot-12.1.0.x86_64.AppImage"
@felipsmartins
felipsmartins / strings.c
Last active August 31, 2024 22:15
String functions - Reinventng the wheel
#define _POSIX_C_SOURCE 199309L /* shall be >= 199309L */
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
// clear; gcc -Wall strings.c -o strings && ./strings
// WARNING: This code is not safe to use in real life.
@felipsmartins
felipsmartins / personalxrandr.sh
Last active April 14, 2024 00:26
xrandr posicionamento telas
#!/usr/bin/bash
set -euo pipefail
# ----------------------------------------------------------------------------------------
# https://man.archlinux.org/man/xrandr.1
# https://wiki.ubuntu.com/X/Config/Resolution
CLIPS_DIR=~/clips
# ASUS TUF (MAIN) DISPLAY POS
@felipsmartins
felipsmartins / local-container-registry.sh
Last active July 19, 2023 20:49
DOCKER CONTAINERS LOCAL REGISTRY
#https://docs.docker.com/registry/deploying/
docker run -d -p 5000:5000 --name registry -v /home/martins/devel/docker/local-registry:/var/lib/registry registry:2
# test steps
#docker pull ubuntu:16.04
#docker tag ubuntu:16.04 localhost:5000/my-ubuntu
#docker push localhost:5000/my-ubuntu
#docker image remove ubuntu:16.04
#docker image remove localhost:5000/my-ubuntu
#docker pull localhost:5000/my-ubuntu
@felipsmartins
felipsmartins / minikube-setup.sh
Last active July 14, 2023 14:55
rootless docker minikube
docker context # should be: rootless
minikube start --kubernetes-version=1.22.17 --driver=docker --container-runtime=containerd
# loading local docker image into cluster
# NOTE: use "imagePullPolicy: IfNotPresent"
minikube image load drf3-lab
# switch cluster
kubectl config use-context <NAME>
@felipsmartins
felipsmartins / fix.md
Last active July 12, 2023 17:50
jetbrains pycharm - docker can't use local pre-built image
@felipsmartins
felipsmartins / openvpn3-debian12-bookworm-compilation.sh
Last active July 10, 2023 04:59
openvpn3-debian12-bookworm-compilation.sh
#!/usr/bin/sh
sudo apt-get install build-essential git pkg-config autoconf \
autoconf-archive libglib2.0-dev libjsoncpp-dev \
uuid-dev liblz4-dev libcap-ng-dev libxml2-utils \
python3-minimal python3-dbus python3-docutils \
python3-jinja2 libxml2-utils libtinyxml2-dev \
policykit-1 libsystemd-dev python3-systemd
git clone git://github.com/OpenVPN/openvpn3-linux
@felipsmartins
felipsmartins / nvidia-replay.sh
Last active July 9, 2023 18:46
nvidia shadow play like
# example: DP-0
MONITOR=$__GL_SYNC_DISPLAY_DEVICE
# old working comand on debian 11
# gpu-screen-recorder -o ~/clips -c mp4 -f 60 -r 15 -w $MONITOR -a "$X_AUDIO1.monitor"
# updated command
DEFAULT_AUDIO_OUTPUT=$(pactl get-default-sink)
DEFAULT_AUDIO_INPUT=$(pactl get-default-source)
gpu-screen-recorder -o ~/clips -c mp4 -f 60 -r 15 -w $MONITOR -a "$DEFAULT_AUDIO_OUTPUT.monitor|$DEFAULT_AUDIO_INPUT"
@felipsmartins
felipsmartins / delete-boot-entry.txt
Created July 8, 2023 04:01
delete a boot entry
# example
~ % sudo efibootmgr
BootCurrent: 0009
Timeout: 1 seconds
BootOrder: 0009,0008,000E,0000
Boot0000 Windows Boot Manager
Boot0008 ubuntu
Boot0009* debian
Boot000E UEFI: SanDisk, Partition 1
@felipsmartins
felipsmartins / akko-abnt2-remap-keys.txt
Last active June 16, 2023 19:03
AKKO ABNT2 remap keys (GNOME)
# keycode 105: tecla ctrl direito
# keycode 108: tecla alt direito (AKA AltGr)
# os comandos abaixo transforma seu "AltGr" em ";" e o "Ctrl direito" em ":"
xmodmap -e "keycode 105 = colon"
xmodmap -e "keycode 108 = semicolon"
# Ou imprimir:
# ";" quando <Ctrl direito> for pressionado
# ":" quando <Ctrl direito> + <Shift> for pressionado