Skip to content

Instantly share code, notes, and snippets.

View aldoborrero's full-sized avatar

Aldo aldoborrero

View GitHub Profile
@aldoborrero
aldoborrero / caddy.sh
Created October 31, 2025 18:43
Caddy + Netbird + Authentik
#!/usr/bin/env bash
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NC='\033[0m'
msg_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
@aldoborrero
aldoborrero / caddy.sh
Last active October 31, 2025 16:02
Caddy + Authentik Proxy + Netbird
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2025 community-scripts
# Author: Aldo
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://caddyserver.com/
APP="Caddy"
var_tags="reverse-proxy"
var_cpu="1"
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2025 tteck
# Author: tteck (tteckster)
# Modified to include Cloudflare DNS support
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://caddyserver.com/
APP="Caddy"
var_tags="${var_tags:-webserver}"
@aldoborrero
aldoborrero / oci-arm.py
Created October 16, 2025 08:11
Nixified OCI ARM grabber
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p python3 python3Packages.oci python3Packages.requests python3Packages.rich
"""
Oracle Cloud ARM Instance Creator
Continuously attempts to create an ARM instance in Oracle Cloud Free Tier
"""
import argparse
import json
# Function to ensure a dir exists
ensure_directory_exists() {
local dir="${1}"
if [ ! -d "${dir}" ]; then
mkdir -p "${dir}"
fi
}
# Function to use nix flakes if exists
use_flake_if_nix_installed() {
@aldoborrero
aldoborrero / main.go
Created September 14, 2023 10:36
hd-wallet-generator
package main
import (
"crypto/rand"
"encoding/hex"
"encoding/json"
"fmt"
"github.com/alecthomas/kong"
"github.com/ethereum/go-ethereum/crypto"
"github.com/pelletier/go-toml"
@aldoborrero
aldoborrero / README.md
Created November 25, 2022 21:03
How to setup a Nix binary cache with Terraform in DigitalOcean Spaces + CDN and custom subdomain in Cloudflare
@aldoborrero
aldoborrero / cloudflare.tf
Created November 25, 2022 20:57
How to setup a Nix binary cache in DigitalOcean Spaces + CDN, with custom domain in Cloudflare with Terraform
locals {
domain = "example.com"
}
data "cloudflare_zone" "domain" {
name = local.domain
}
resource "tls_private_key" "nix_store_origin_key" {
algorithm = "RSA"
@aldoborrero
aldoborrero / BluetoothCompat.java
Last active October 16, 2016 18:28
This class is a helper for performing Bluetooth operations in a reactive way. Part of this code is extracted and inspired from library RxBluetooth, created by Addenie (https://github.com/adennie/RxBluetooth/blob/master/rxbluetooth/src/main/java/com/andydennie/rxbluetooth/RxBluetooth.java). License of all files contained in this gist is Apache 2.0.
public class BluetoothCompat {
public static boolean createBondCompat(final BluetoothDevice device)
throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
return device.createBond();
} else {
Method method = device.getClass().getMethod("createBond", (Class[]) null);
final Object invoke = method.invoke(device, (Object[]) null);
return (Boolean) invoke;
@aldoborrero
aldoborrero / BluetoothCompat.java
Created October 14, 2016 14:23
This class is a helper for performing Bluetooth operations in a reactive way. Part of this code is extracted from library RxBluetooth created Addenie (https://github.com/adennie/RxBluetooth/blob/master/rxbluetooth/src/main/java/com/andydennie/rxbluetooth/RxBluetooth.java)
public class BluetoothCompat {
public static boolean createBondCompat(final BluetoothDevice device)
throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
return device.createBond();
} else {
Method method = device.getClass().getMethod("createBond", (Class[]) null);
final Object invoke = method.invoke(device, (Object[]) null);
return (Boolean) invoke;