Skip to content

Instantly share code, notes, and snippets.

View Esl1h's full-sized avatar
🌎
“Don’t put all your greps in one awk.”

Esli Silva Esl1h

🌎
“Don’t put all your greps in one awk.”
View GitHub Profile
@Esl1h
Esl1h / download_images.py
Created April 27, 2026 19:05
Python Scripts to migrate my blog posts from Hashnode to Astro
#!/usr/bin/env python3
"""
Download Hashnode CDN images from migrated posts and rewrite URLs locally.
Run from the esli.blog project root AFTER migrate_hashnode.py:
python3 scripts/download_images.py
python3 scripts/download_images.py --dry-run
python3 scripts/download_images.py --posts-dir src/data/blog
Images are saved to:
# Esli's Blog
> Blog pessoal de Esli Silva — Linux power user desde 2003, Engenheiro, IT Manager, DevOps/SRE, Systems Administrator e professor. Baixista, praticante de Krav Maga e atirador esportivo. Conteúdo publicado em português brasileiro e inglês, com foco em Linux, criptografia, privacidade, DNS seguro, YubiKey, Vlang, SRE/DevOps e política de internet no Brasil.
## Sobre
- Autor: Esli Silva
- URL canônica: https://esli.blog.br
- URL curta: https://esli.blog
- Links e portfolio: https://esli.cafe
@Esl1h
Esl1h / git-multi-sync.sh
Created January 9, 2026 23:53
Git multi-remote sync tool that automatically adds, creates, and synchronizes repositories across multiple Git providers (GitHub, GitLab, Codeberg, Keybase) with aggregated push via origin.
#!/usr/bin/env bash
set -euo pipefail
# =============================================================================
# CONFIGURATION - Edit these values
# =============================================================================
# Usernames for each provider
GITHUB_USER="user"
GITLAB_USER="user"
@Esl1h
Esl1h / .gitconfig
Created January 1, 2026 14:59
Git Global Configs - files on your $HOME
# =============================================================================
# ~/.gitconfig - The Ultimate Git Configuration
# Esli Silva - SRE/DevOps Engineer
# Last updated: 2026-01
# =============================================================================
# -----------------------------------------------------------------------------
# Identity & Security
# -----------------------------------------------------------------------------
[user]
@Esl1h
Esl1h / CMDB.sh
Created December 29, 2025 21:36
CMDB: Steampipe + Powerpipe
#!/bin/bash
# CMDB.sh - Service manager for Steampipe + Powerpipe
# Usage: CMDB.sh {start|stop|status|restart}
# Detect script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Control files in the same directory as the script
PIDFILE="${SCRIPT_DIR}/powerpipe.pid"
LOGFILE="${SCRIPT_DIR}/powerpipe.log"
@Esl1h
Esl1h / gitflow-analyzer.sh
Created December 17, 2025 18:23
GitFlow Analyzer - Analyzes branch structure, PR history, and CI/CD pipelines
#!/bin/bash
#
# gitflow-analyzer.sh
# Analyzes branch structure, PR history, and CI/CD pipelines
#
# Usage: ./gitflow-analyzer.sh [repo_path] [output_file]
#
# Supported CI/CD platforms:
# - Bitbucket Pipelines
# - GitHub Actions
@Esl1h
Esl1h / adb-remove-packages.sh
Last active September 9, 2025 13:27
By a list, trying remove or disable all installed packages on Android device
#!/bin/bash
# Used to turn ann old smartphone into a DAP (Digital Audio Player)
# https://esli.blog.br/transformando-antigo-smartphone-em-dap
set +e
export ANDROID_SERIAL=ZF523242ZG # 'adb devices' command to find your device
LIST=packages-remove.txt
echo "Loading package list..."
@Esl1h
Esl1h / encrypt.exp
Created July 8, 2025 13:01
Using picocrypt CLI with bash/expect to automate some encryption
#!/usr/bin/expect -f
# This script encrypts a file using picocrypt
# Install picocrypt CLI and expect
# ./encrypt.exp 'YourPassword' yourFolderOrFiles
set password [lindex $argv 0]
set file [lindex $argv 1]
spawn picocrypt $file
@Esl1h
Esl1h / SRE_en.md
Created April 26, 2025 22:32
System Prompt for SRE, DevOps, Sysadmins and Engineers

You are an Artificial Intelligence assistant specialized in infrastructure operations, SRE, system administration, and DevOps. Your goal is to provide accurate, secure, and practical answers for professionals working in IT management, automation, monitoring, and troubleshooting.

General Guidelines:

  • Always prioritize security, best practices, and automation.
  • Be objective, clear, and avoid ambiguity.
  • When suggesting commands, scripts, or configurations, briefly explain what each part does.
@Esl1h
Esl1h / deploy.v
Last active April 5, 2025 22:31
deploy.vsh
#!/usr/bin/env -S v
// A linha cima associa pelo env o .vsh ao V
// Então basta dar permissão de execução (+x) executar o script .vsh no terminal
// como `./deploy.vsh`
// print command then execute it
fn sh(cmd string) {
println('❯ ${cmd}')
print(execute_or_exit(cmd).output)