Skip to content

Instantly share code, notes, and snippets.

View luandro's full-sized avatar

luandro luandro

View GitHub Profile
📊 CORE DOMAIN TABLES:
==================================================
🏷️ COMMUNITIES:
• id bigint NOT NULL
• name character varying
• locale character varying
• country character varying
• created_at timestamp without time zone NOT NULL
@luandro
luandro / generate_smp_from_xyz.sh
Created August 20, 2025 02:34
Generate SMP from QGIS XYZ
#!/bin/bash
# List all folders except numeric folders
options=($(ls -d */ | grep -Ev '^[0-9]+/$' | grep -v 'generated_smp/'))
echo "Select a folder:"
select selected_folder in "${options[@]}"; do
if [[ -n $selected_folder ]]; then
# Remove trailing slash
selected_folder=${selected_folder%/}
#!/bin/bash
# THIS SCRIPT IS FOR DEVELOPMENT USSAGE ONLY
# Do not use it on production
# It creates a temporal unprotected ssh key and add it as unique key on the
# /etc/dropbear/authorized_keys on destination ip, which is not safe.
# It copy to an ip a specific package on a libremesh node.
# Run it from lime packages folder
# Example:
# ./update_packs.sh 10.13.0.1 ubus-lime-metrics
@luandro
luandro / style.json
Created May 9, 2025 15:09
Mapbox studio style.json example
{
"version": 8,
"name": "Wayana - Guyane Français",
"metadata": {
"mapbox:autocomposite": true,
"mapbox:thumb": "data:image/webp;base64,UklGRvYRAABXRUJQVlA4TOkRAAAvO8AOAE0obNu2DcIjo3Ub0f+AHv4MjgTYeAl+lgyZhNz0TDge4JxjNyDJBoDLBaNIkhTlgX+JfC9mBh1sI0ly0jG8Sf4RYWFevYnWGopRbdtKDk4AAvwRPnKnfwAC/Bj+V/8DUEplNDIVVgAYTTvGcX/d63KuTk5BlZ4p/Otxr5txucdRpLgTbT397VepMiJ761nA/cF4PslYGqeMmLUCZAVjKv17QV3HmfYFnDBy/vw74U7YAycAUCgkABhDQds2TMwf9g6GiJiAQhVSKH5KwQh6Uo4kyZEkmUcO/O0L8s/RfpeDwxhUVbrIVBY4QIAn5Ui2XVtRrn3QwgxsYIZPGAmeMNMauu/di25s266taMyFVh4RK4sgyQFLdd8dCtxISgZ3h+MLtqxtTyNJ+n5JtoO5GLKqmpnv6roHNzRLmw3MFVMxV1YlZ0ZkgEHS/zXmbEFpR7ZtVZKkfe57H/yHe0BypqVZNTOjhJNprSXmbg0mQNNokWRmZijwIg/2CPf//3v32rG2bXkj6b7f70dbbpWbmTuamRDXMKugiJmZmaMOZxO0kMmY0dgy/NL/fW8octsG6ejK8Ib3nz/n/6Mq3rBKa6Xx/AnAXwGYUvoJRpp/TgeSUsQYLU8FkIQEAJMloyIBQAomAQtAKBLx38oABAgNCAIgmJIIEEICqDCBDUlQBQBCIFVenHmebeN+TBIaCKCJNKRBG2YUQ3GBURgBUHAeIKwjARAAhHVGkNCB2yYRUgAUAzZwkGPLYphimvJC22ZdG3WtyIioKt0oWSnwQb2LXtSlJKIIOPEkadwoKjABQ9jIArqpzFpun5T3ju+3
@luandro
luandro / all-setup.sh
Last active April 16, 2025 23:53
bash <(curl -fsSL "https://gist.githubusercontent.com/luandro/00177d5429c2416ad82440035ac3e6ed/raw/all-setup.sh") - Scripts for setting up servers. Includes for migrating Docker default folder to another location, hardening a server, creating swap.
#!/usr/bin/env bash
set -e
# Location of raw scripts
RAW_URL="https://gist.githubusercontent.com/luandro/00177d5429c2416ad82440035ac3e6ed/raw"
echo "=== RUNNING HARDENING SCRIPT ==="
curl -fsSL "$RAW_URL/harden-ubuntu.sh" -o /tmp/harden-ubuntu.sh
chmod +x /tmp/harden-ubuntu.sh
sudo /tmp/harden-ubuntu.sh
@luandro
luandro / download_files_from_email_eml_file.sh
Last active August 31, 2023 15:20
Downloads Google Drive attachments from a EML file.
#!/bin/bash
# Check if an argument has been provided
if [ $# -eq 0 ]; then
echo "No argument provided. Please enter the .eml file path:"
read file_path
else
file_path=$1
fi
@luandro
luandro / generate-defaults.sh
Last active August 8, 2023 00:19
Generates a Mapeo config defaults.json based on the items within the presets folder and their geometry fields. Execute from the Mapeo configuration project's folder root.
#!/bin/bash
# Path to the presets folder
presetsFolder="./presets"
# Path to defaults.json
defaultsPath="./defaults.json"
# Temp file for jq output
tempFile=$(mktemp)
@luandro
luandro / computer_gateway.sh
Created August 7, 2023 23:42
This bash script is used to set up and tear down a simple internet gateway. It uses the ip, iptables, ufw, and dnsmasq utilities to configure network interfaces, set up NAT (Network Address Translation), configure a firewall, and set up a DHCP server.
#!/bin/bash
# Check if script is run as root
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
# Check if required utilities are installed
for util in ip iptables ufw dnsmasq; do
@luandro
luandro / cpe_borda.md
Last active October 19, 2022 12:18
CPE 210 na borda

/etc/config/network:

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
@luandro
luandro / configure_local_balena.sh
Created October 5, 2021 19:36
Installing Balena OS on Digital Ocean server
# Install Balena cli: https://github.com/balena-io/balena-cli/blob/master/INSTALL.md
echo "balenaUrl: 'balena.coolab.org'" >> ~/.balenarc.yml
export NODE_EXTRA_CA_CERTS='/etc/ssl/private/ca.crt'
balena login