Skip to content

Instantly share code, notes, and snippets.

View bergpb's full-sized avatar
🏠
Working from home

Lindemberg Barbosa bergpb

🏠
Working from home
View GitHub Profile
sudo apt install curl gnupg -y
curl -fsSL https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/jellyfin.gpg
echo "deb [arch=$( dpkg --print-architecture )] https://repo.jellyfin.org/$( awk -F'=' '/^ID=/{ print $NF }' /etc/os-release ) $( awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release ) main" | sudo tee /etc/apt/sources.list.d/jellyfin.list
sudo apt update && sudo apt install jellyfin -y
@bergpb
bergpb / list-git-branches.groovy
Created October 27, 2022 16:55 — forked from ThabetAmer/list-git-branches.groovy
Jenkins Groovy script to read Git repo branches and list them in an array, can be suited with Active Choice Jenkins Plugin
#!/usr/bin/env groovy
/**
* List all Git branches of a repo.
* @author thabet.amer@gmail.com
* @since Jenkins 2.204.1
* @params String url for Git repo URL, String credentialID, Bool activeChoice if ActiveChoice plugin used, String defaultBranch
* @return String array of branch names
*
* Dependencies:
@bergpb
bergpb / fabfile.py
Created July 27, 2022 17:08 — forked from eshandas/fabfile.py
Fabric 2 file for helping in deployments and other housekeeping tasks
# Fabfile to:
# - update the remote system(s)
# - download and install an application
from fabric import Connection
from fabric import task
import os
import environ
root = environ.Path(__file__) - 1 # one folder back (/manage - 3 = /)
@bergpb
bergpb / esp32_ttgo_t5_213.yaml
Created July 16, 2022 14:01 — forked from TheGroundZero/esp32_ttgo_t5_213.yaml
TTGO T5 v2.3.1 2.13" display in ESPHome
# Board
# https://s.click.aliexpress.com/e/_9IDl91
# ESPHome docs:
# - https://esphome.io/components/display/waveshare_epaper.html
# - https://esphome.io/components/spi.html#spi
# - https://esphome.io/components/display/index.html#formatted-text
substitutions:
esphome_name: esp32_ttgo_t5
@bergpb
bergpb / export_and_install_vscode_extensions.sh
Created July 10, 2022 18:10
Export and Install VSCode extensions
# https://stackoverflow.com/questions/35773299/how-can-you-export-the-visual-studio-code-extension-list
# creating a file with all extensions
code --list-extensions > code_extensions.txt
# installing from a file
cat code_extensions.txt | xargs -L 1 code --install-extension
@bergpb
bergpb / install_wiringpi.sh
Created June 29, 2022 20:19
Install WiringPi and run pintest script
git clone https://github.com/WiringPi/WiringPi.git && \
cd WiringPi && \
./build && \
cd gpio && \
chmod +x pintest && \
./pintest
@bergpb
bergpb / install_speedtest_armf.sh
Last active November 12, 2022 23:03
Install Speedtest CLI in armf devices
mkdir -pv /home/$USER/.local/bin && \
cd /tmp && wget -c https://install.speedtest.net/app/cli/ookla-speedtest-1.1.1-linux-armhf.tgz && \
tar -xvf ookla-speedtest-1.1.1-linux-armhf.tgz && \
chmod +x speedtest && \
mv speedtest /home/$USER/.local/bin && \
speedtest --accept-license --accept-gdpr
@bergpb
bergpb / install_balena_engine.sh
Last active May 12, 2022 00:08
Install balena-engine
#!/bin/bash
# Special thanks for @rgaudin to share your project
# based on https://github.com/rgaudin/bard-image
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
@bergpb
bergpb / install_node_exporter
Created April 15, 2022 22:11
Install Node Exporter
# https://lukems.com/en/how-to-install-node-exporter-on-linux/
wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-armv6.tar.gz -O node_exporter-1.3.1.linux-armv6.tar.gz
tar xzvf node_exporter-1.3.1.linux-armv6.tar.gz
sudo cp node_exporter-1.3.1.linux-armv6/node_exporter /usr/local/bin/
sudo useradd -r -s /bin/false node_exporter
@bergpb
bergpb / install_pihole_exporter
Created April 15, 2022 22:11
Install PiHole Exporter
# https://www.observability.blog/monitoring-pi-hole-with-prometheus/
# https://github.com/eko/pihole-exporter
sudo curl https://github.com/eko/pihole-exporter/releases/download/v0.3.0/pihole_exporter-linux-arm --output /usr/local/bin/pihole_exporter
sudo useradd -r -s /bin/false pihole_exporter
# sudo chgrp pihole_exporter /usr/local/bin/pihole_exporter
sudo chown pihole_exporter:pihole_exporter /usr/local/bin/pihole_exporter