Skip to content

Instantly share code, notes, and snippets.

View bergpb's full-sized avatar
💻
https://blog.bergpb.dev

Lindemberg Barbosa bergpb

💻
https://blog.bergpb.dev
View GitHub Profile

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@bergpb
bergpb / instructions.md
Last active December 14, 2022 12:04
k3s with MetalLB - Sketch

K3S + MetalLB

Install k3s + MetalLB in a cluster with RaspberryPi.

Instructions:

  1. Edit /boot/cmdline.txt file and the configuration at the end of line: cgroup_memory=1 cgroup_enable=memory
  2. On control node, generate a secret and install k3s:

TOKEN=`python3 -c "import secrets; print(secrets.token_hex(32))"`

@bergpb
bergpb / results.txt
Last active November 25, 2022 12:14
Speed results
----------------- SD CARD Sandisk 32GB Class 4 ----------------
pi@raspberrypi:~ $ cat /proc/cpuinfo | grep Model
Model : Raspberry Pi Zero Rev 1.3
pi@raspberrypi:~ $ ./test_disk_size.sh
Variable local not set, default will be /tmp/test_disk_speed
Variable size not set, default will be 1000
Testing writing speed...
500+0 records in
500+0 records out
524288000 bytes (524 MB, 500 MiB) copied, 67.8816 s, 7.7 MB/s
@bergpb
bergpb / test_disk_speed.sh
Created November 25, 2022 11:45
Test disk speed using dd
#!/bin/bash
local=$1
size=$2
if [[ ! -n $local ]]; then
echo "Variable local not set, default will be /tmp/test_disk_speed"
local='/tmp/test_disk_speed'
fi
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