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 / personalxrandr.sh
Last active March 23, 2024 18:17
xrandr posicionamento telas
#!/usr/bin/bash
# martins@martins ~ % xrandr --listactivemonitors
# Monitors: 3
# 0: +*DP-0 1920/527x1080/296+2576+2160 DP-0
# 1: +DP-2 3840/697x2160/392+1616+0 DP-2
# 2: +DP-4 2560/798x1080/334+0+2160 DP-4
# ----------------------------------------------------------------------------------------
# https://man.archlinux.org/man/xrandr.1
# https://wiki.ubuntu.com/X/Config/Resolution
@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
#/usr/bin/env bash
# por algum motivo NVENC somente funciona se executar ffmpeg antes.
# for whatever reason sometimes OBS NVENC works only when running ffmpeg before
ffmpeg -y -i ~/input.mp4 -c:v h264_nvenc /tmp/output.mp4;
echo "---------------------------------------------------------------------------------------------------------------------\n";
XDG_CURRENT_DESKTOP=GNOME /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=obs com.obsproject.Studio
@felipsmartins
felipsmartins / ffmpeg-test-nvenc.txt
Last active March 25, 2023 15:39
ffmpeg -y -i ~/input.mp4 -c:v h264_nvenc /tmp/output.mp4
ffmpeg -y -i ~/input.mp4 -c:v h264_nvenc /tmp/output.mp4
ffmpeg version N-109033-g86157f5a25 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 10 (Debian 10.2.1-6)
configuration: --enable-nonfree --enable-cuda-nvcc --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64
libavutil 57. 42.100 / 57. 42.100
libavcodec 59. 52.100 / 59. 52.100
libavformat 59. 34.101 / 59. 34.101
libavdevice 59. 8.101 / 59. 8.101
libavfilter 8. 50.100 / 8. 50.100
libswscale 6. 8.112 / 6. 8.112