Skip to content

Instantly share code, notes, and snippets.

View victor-oliveira1's full-sized avatar

Victor Oliveira victor-oliveira1

  • São Bernardo do Campo, SP
View GitHub Profile
@victor-oliveira1
victor-oliveira1 / gist:f584289d69675c91cca99d6ae2e17620
Last active September 16, 2021 12:34
OpenGL on Sublime Text
By default, Sublime Text uses software renderer on Linux. Using OpenGL can improve performance.
To enable OpenGL, add the following lines to Sublime Text preferences file:
"hardware_acceleration": "opengl",
@victor-oliveira1
victor-oliveira1 / vacinas_covid.sh
Last active October 19, 2021 16:23
Informa as doses disponíveis para vacinação contra COVID em São Bernardo do Campo
#!/usr/bin/env bash
# Informa as doses disponíveis para vacinação contra COVID em SBC - SP
# Necessário instalar o programa jq
# Exemplos:
# - getVacina 1
# - getVacina 2 ASTRAZENECA
# - getVacina 3
# Victor Oliveira <[email protected]>
getVacina() {
@victor-oliveira1
victor-oliveira1 / pushover-notify.sh
Created October 19, 2021 18:00
Send messages from bash using Pushover service
#!/usr/bin/env bash
# pushover-notify
# Send notifications using the Pushover service
# Example:
# - $ pushover-notify "Test Message"
# Victor Oliveira <[email protected]>
SECRETS="${HOME}/.pushover/secrets"
@victor-oliveira1
victor-oliveira1 / crontab-sync.sh
Last active October 20, 2021 03:37
Sync crontab using pastebin service
#!/usr/bin/env bash
# Sync crontab using pastebin service
# Victor Oliveira <[email protected]>
CRONFILE="/tmp/crontab.old"
CRONFILENEW="/tmp/crontab.new"
PBURL="https://pastebin.com/raw/YOUR_PASTE"
@victor-oliveira1
victor-oliveira1 / bluez-switcher.sh
Created November 4, 2021 19:38
Switch profiles on bluez cards with alsa (A2DP and HFP)
#!/usr/bin/env bash
# Switch profiles between bluez cards (A2DP and HFP)
# Check profiles and cards with: pactl list cards
# Victor Oliveira <[email protected]>
CARD="bluez_card.AA_BB_CC_DD_EE_FF"
while read LINE; do
test -n "${CARD_FOUND}" && {
@victor-oliveira1
victor-oliveira1 / gist:ce7ade85b44c327f8a540b65d53300f8
Created November 9, 2021 01:44
Change codecs on bluetooth devices (Linux)
# List available codecs
pactl send-message /card/bluez_card.XX_XX_XX_XX_XX_XX/bluez list-codec
# Get active codec
pactl send-message /card/bluez_card.XX_XX_XX_XX_XX_XX/bluez get-codec
# Change codec
pactl send-message /card/bluez_card.XX_XX_XX_XX_XX_XX/bluez switch-codec '"CODEC"'
@victor-oliveira1
victor-oliveira1 / README.md
Last active November 12, 2021 16:39
Criando um ambiente para boot via PXE (Debian)

Descrição

Configure um ambiente para incializar sistemas usando uma interface de rede em computadores BIOS ou UEFI

Preparando o ambiente

  1. Usando o gerenciador de pacotes do sistema (apt-get, dnf, etc), instale os pacotes abaixo:
    • dnsmasq
    • pxelinux
    • 7zip
  2. Adicione as linhas abaixo ao arquivo /etc/dnsmasq.d/pxe.conf:
    port=0
@victor-oliveira1
victor-oliveira1 / [email protected]
Last active December 29, 2022 02:19
Openport Systemd Service
[Unit]
Description=Start Openport service on port %i
[Service]
ExecStart=/usr/bin/openport %i
User=pi
Restart=always
[Install]
WantedBy=multi-user.target
@victor-oliveira1
victor-oliveira1 / savesync.path
Created December 27, 2022 20:24
[Lakka][Retroarch] Savefile sync between devices
[Unit]
Description=Savesync Path Watcher
BindsTo=storage-roms-smb.mount
[Path]
PathChanged=/storage/savefiles/
[Install]
WantedBy=storage-roms-smb.mount
@victor-oliveira1
victor-oliveira1 / lakka_install.sh
Created December 29, 2022 02:20
Install Lakka on 2GB SDCard
#!/usr/bin/env bash
IMAGE="$1"
DISK="$2"
TEMPDIR=$(mktemp -d)
parted --script "$DISK" \
mklabel msdos \
mkpart primary fat32 0% 1G \
mkpart primary ext4 1G 100%
sync