https://www.gravatar.com/avatar/7ccf1999fbd849e739bbc3403990689d?s=240&d=mp

Daniel Mason

Site Reliability Engineer, Dad, Pilot

GeoIP blocking countries using Nginx

Quick and easy way to block entire countries using simple nginx rules. Note this is for Ubuntu/Nginx but may work on other systems. Install required packages & add to nginx config. The GeoIP DB will be under /usr/shared/GeoIP/GeoIPv6.dat (Or GeoIP.dat for v4 only): 1 2 apt install -y libnginx-mod-http-geoip geoip-database echo 'geoip_country /usr/share/GeoIP/GeoIPv6.dat;' > /etc/nginx/conf.d/geoip.conf Add this block under the main “http” block in nginx.conf: 1 2 3 4 5 # /etc/nginx/nginx.

Expanding OpnSense root disk (21.7+)

Expanding root partition on OpnSense VM Expand underlying VM disk Reboot Run below commands to online resize Reboot (Optional?) 1 2 3 4 5 6 7 8 # View the layout gpart show # Resolve GPT issue before extending gpart recover da0 # Make it use all the new space gpart resize -i 3 da0 # Grow the FS to fill the new partition growfs /dev/gpt/rootfs

iCloud synced SSH configs on macOS

Maintaining SSH configs can be a pain when you’re hopping between multiple devices, even more when syncing apps (Synology/NextCloud/etc) are blocked on some networks/devices. Make sure you have iCloud Drive enabled and this will symlink your SSH config + key to a folder in iCloud Drive and sync across devices. The iCloud Drive is located at ~/Library/Mobile Documents/com~apple~CloudDocs. By putting this file + your config/id_rsa files in here, it will simply symlink them.

Mastodon.nz and the recent twitter influx

Where to begin.. It’s been an interesting fortnight! I started hosting mastodon.nz around January 2020 on my home ‘server’ for myself and few friends. It started off as a small LXC container inside Proxmox with 2 cores and 2GB RAM allocated. It stayed this way until about 6 months ago when I kept having scheduled power outages and I couldn’t keep running it from my house while maintaining a reasonable uptime.

Configuring an APRS receiver with an RTL-SDR and Direwolf

What is APRS? Automatic Packet Reporting System! Essentially a VHF radio sending out GPS location pings in the 2M ham band which can be seen at aprs.fi. If you take a look at that link you will often see radiosondes and their reported data, weather stations as well as bunch of amateur operators transmitting data all over the world. Fascinating stuff. I recently got my hands on an RTL-SDR v3 which claims much better accuracy and performance over previous models.