Skip to content

Instantly share code, notes, and snippets.

View jensmeindertsma's full-sized avatar
🌲
int vsf_sysutil_extra();

Jens Meindertsma jensmeindertsma

🌲
int vsf_sysutil_extra();
View GitHub Profile
#!/bin/bash
# Try to get IPv4 address and mask from tun0
tun_info=$(ip -4 addr show tun0 2>/dev/null | grep -oP 'inet \K[\d.]+/\d+')
# Try to get IPv4 address and mask from eth0 if tun0 fails
eth_info=$(ip -4 addr show eth0 2>/dev/null | grep -oP 'inet \K[\d.]+/\d+')
# Decide which to display
if [[ -n "$tun_info" ]]; then
@jensmeindertsma
jensmeindertsma / deploy.sh
Last active July 6, 2025 09:01
VPS-based deployment pipeline
#!/bin/bash
# From commit to running globally within a minute!
# 1. Build & upload your image
# 2. Configure environment variables and more
# 3. `deploy.sh` takes care of the rest!
# Ensure script receives an argument for container name
if [ -z "$1" ]; then
echo "Usage: $0 <container_name>"
exit 1