On November 4 I put a self-hosted booking page online for my consulting work, in a hurry: someone had asked that morning to book a call with me that same day, and I wanted a page they could use before the day was out. It runs Cal.com, an open-source scheduling app, in a container I build myself for an ARM server in the cloud. Like most apps of its kind it needs a few secrets to work: a database password, signing keys, a Google OAuth client so it can put bookings on my calendar, and an SMTP login so it can email confirmations.
That last one is where I made the mistake that mattered. For the SMTP login I used a Gmail app password for my own address, as a stopgap: the plan was to swap it for a separate sending account, or a narrower credential, once the page was up and the booking was done. An app password is a full-strength credential: it sends mail as you, and it also reads mail as you over IMAP. A booking tool only needs to send. I gave it the whole mailbox, and “temporary” lasted exactly as long as it took someone to find it.
The image I built was based on Cal.com’s docker repository at its v5.9.10 tag. That tag pins the application as a git submodule, and the pinned commit was older than Cal.com’s own v5.9.10 release. The practical difference: my image shipped Next.js 15.5.4, which carries the vulnerable React Server Components code behind CVE-2025-55182, better known as React2Shell (Next.js tracks its own side of it as CVE-2025-66478). It is an unauthenticated remote code execution bug in App Router deployments: one crafted request and the attacker runs code inside your server. The fixed Next.js is 15.5.7; the built image’s package manifest said 15.5.4. It is on CISA’s Known Exploited Vulnerabilities list, and it is being mass-exploited by automated crews scanning the whole internet.
I did not get unlucky. I got scanned, like everyone else, and I was the one with the hole.
kworkerd and pulled an encrypted payload from a command-and-control host.That “SMTP health check” sitting in my Sent folder was the tell. I was not looking for it; I noticed a message I had not written. About 30 hours passed between the recorded environment dump and the moment I pulled the page offline, and the exposure may have started earlier, when the container was first compromised.
This is the part I most wanted to understand, because I have a nightly vulnerability scan across every container I run, and it did flag this. From the first night the booking page existed, the report had a row for CVE-2025-55182. Four things conspired to make that row invisible:
A detector that fires once and then goes quiet is a detector you will learn to ignore. Mine was working exactly as designed, and the design was wrong.
Once the Sent mail was understood, the order was: take the page offline, cut the container from the network, block the command-and-control address at both the cloud host and my home router, snapshot the container for forensics, dump the database, then rotate. Every credential I identified in that environment was revoked or rotated: the Google OAuth client was deleted and replaced, the app password was revoked, the database and signing keys were regenerated, and the image was rebuilt with the patched Next.js and redeployed only after the rotation.
Then the longer tail: a new password and fresh recovery settings on the Google account, sign-out of every session, review of every account that can reset itself by emailing me, and a careful pass through the mailbox itself for anything that should not sit in a third party’s hands. Three people had booked through the page during those days; their names and email addresses were in the database the attackers could reach, and I am telling each of them directly.
Whether anyone actually read my mail. I have evidence of harvesting and of one SMTP test, which is itself a use of the credential; I cannot establish whether the mailbox was read beyond that. Google’s logs for this edition do not record app-password IMAP sign-ins. “I can’t find it” is not the same as “it did not happen”, so I am treating the whole window as if the mailbox was readable, because it was.
So I built an instrument: a deliberately vulnerable copy of the same booking app on a throwaway server, with a decoy mailbox and its own throwaway password, logging everything that touched it. Over four days of lure, five different toolkits stole the decoy mail password a combined 425 times. For 87 hours none of them logged in to the decoy mailbox or tried to send mail with it. I checked the instrument against itself: a test login of my own was recorded correctly, so that zero is a measured zero, not a blind one. Twenty minutes before I tore it down, one login from a network none of the earlier visitors had used authenticated over SMTP and sent nothing: a credential checker like the one that left a message in my own Sent folder, and evidence of checking, not of reading. It is a self-hosted decoy rather than a Gmail account, and none of it proves what happened to my own mailbox. What it shows is the shape of these kits: harvest, verify, move on. I am still treating my own window as exposed; I now have a reason, rather than a hope, to think it was not read.
I run a lot of infrastructure for a one-person shop, and most of it is automated. The automation did its job here; it reported the bug. What was missing was the part that refuses to let a known-exploited hole sit on a public host for four days without a human saying “yes, I accept that”, and the part of me that would have waited an hour before putting something new on the internet for a stranger. Both exist now.
Since I wrote the lessons above, my nightly scan, now running against the vulnerability corpus a security friend had recommended, flagged a kernel bug rated critical, with a fix out from Ubuntu. It saw the bug on every host and filed each one into the fix queue with a seven-day deadline. That is exactly what it was built to do, and it was the wrong behaviour for this bug: a critical flaw on a host with public ports got the same calm seven-day row as a low-risk library on a box nobody can reach, and a fixed kernel that was installed but not yet booted was not a finding at all. One public server sat two days with the fix on disk and the old kernel running.
So lesson three has a sharper form. Counting findings hides the one that matters; severity without exposure hides it too. The scanner now has to know which of my hosts face the internet, and a critical finding on one of those is an alarm that reaches me, not a row that waits its turn. A kernel update is not done until the fixed kernel is the one running. And I took one more piece of that friend’s advice: an adversarial reviewer now reads every infrastructure change as it is built, not after it is live.
Thanks to the security professional who read the first draft and told me, in so many words, that it should never have been deployed, and to two friends in the guild who had suggested parts of this before I needed them. They were right, and the gates above are their arguments turned into code.
]]>I run Ubuntu 24.04 LTS on my daily-driver workstation. It shipped with kernel 6.8. After upgrading to the HWE kernel (6.17), two USB bugs I’d been fighting for months — one cosmetic, one that required hard reboots — were fixed without changing anything else about my system.
Every Ubuntu LTS release ships with a GA (General Availability) kernel — the version that was current when the release was finalized. For Ubuntu 24.04 LTS, that’s kernel 6.8. This kernel receives security patches for the full 5-year LTS lifecycle, but it doesn’t get new features, new drivers, or improvements to existing subsystems.
The HWE kernel is a newer kernel backported from a later Ubuntu release, packaged and tested for your LTS version. Canonical rolls these out roughly every 6 months, following each interim Ubuntu release. You get:
Think of it as upgrading the engine in your car without changing anything else. Same dashboard, same seats, same fuel system — just a newer engine that handles the road better.
One command:
sudo apt install linux-generic-hwe-24.04
Then reboot. That’s it. Verify with:
$ uname -r
6.17.0-19-generic
The GA kernel stays installed as a fallback — you can select it from the GRUB menu (“Advanced options for Ubuntu”) if the HWE kernel causes any issues. To go back permanently:
sudo apt install linux-generic
sudo apt remove linux-generic-hwe-24.04
I wrote about the full investigation in The USB Bug Trilogy. Here’s the short version of what the HWE kernel resolved.
My Razer Kiyo Pro webcam (1532:0e05) had a firmware bug that would crash the entire xHCI USB host controller, disconnecting every USB device — keyboard, mouse, audio, everything. The only recovery was a hard reboot.
On kernel 6.8, a stress test crashed the controller consistently around round 25. I wrote three kernel patches and a userspace watchdog to work around it.
On kernel 6.17, the same stress test passes 50/50 rounds with 0ms delay — completely stock, no patches or workarounds applied. The kernel now does two things the older version didn’t:
Hub-initiated U1 disabled due to long timeout 16800usThe kernel is now doing at runtime what my USB_QUIRK_NO_LPM patch was trying to do statically — detecting that the device can’t handle LPM and disabling it automatically.
A USB card reader (Genesys Logic 05e3:0751) was causing the kernel’s procs_blocked counter to leak during the boot-time async SCSI scan, making every monitoring tool report 40-60% iowait when there was actually zero disk I/O happening. On 6.8, the leaked count was 4-6. On 6.17, it dropped to 4 — partial improvement, but the bug is still present. I’ve filed it as Ubuntu bug #2146707.
Use HWE when:
Stick with GA when:
Note: Ubuntu Desktop has shipped with the HWE kernel by default since 20.04. If you installed from the desktop ISO, you might already be on HWE. Check with dpkg -l | grep linux-generic-hwe.
The HWE kernel follows a rolling update model within the LTS lifecycle:
| Ubuntu 24.04 LTS | GA Kernel | HWE Kernel |
|---|---|---|
| Release (Apr 2024) | 6.8 | 6.8 |
| 24.04.1 (Aug 2024) | 6.8 | 6.8 |
| 24.04.2 (Feb 2025) | 6.8 | 6.11+ |
| 24.04.3 (Aug 2025) | 6.8 | 6.14+ |
| 24.04.4 (Feb 2026) | 6.8 | 6.17+ |
The GA kernel stays at 6.8 for the entire 5-year support period. The HWE kernel steps forward every ~6 months, pulling from the next interim release. Both receive security patches.
There’s always a tradeoff between newer kernels and stability. A newer kernel means newer code paths that have had less production exposure. In my case, the tradeoff was obvious — a kernel that crashes my entire USB bus on a stock webcam isn’t “stable” in any meaningful sense. The HWE kernel was strictly better.
But your situation might be different. If your hardware works fine on the GA kernel, there’s no reason to chase a newer one. The best kernel is the one that runs your hardware without problems.
For me, sudo apt install linux-generic-hwe-24.04 turned a webcam that required three kernel patches and a watchdog daemon into one that just works. Sometimes the fix really is that simple.
I noticed my system was reporting 40-60% iowait in top and vmstat, with load averages spiking to 4-5 on an 8-core machine. My NVMe drive should be handling anything I throw at it. Something was wrong.
Running iotop showed zero actual disk I/O. Not a single byte being read or written. Yet the kernel insisted that processes were blocked waiting on I/O.
$ vmstat 1 3
procs -----------memory---------- ---swap-- -----io---- -system-- -------cpu-------
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 4 0 7810420 1361964 3957988 0 0 0 0 8303 23388 17 2 61 21 0
0 4 0 7869484 1361964 3958112 0 0 0 0 12885 18690 13 3 50 35 0
The b=4 column means 4 processes in uninterruptible sleep (D state). But when I checked:
$ ps -eo pid,state,comm | awk '$2 == "D"'
(nothing)
Zero processes in D state. The kernel’s procs_blocked counter in /proc/stat was stuck at 4, permanently inflating the iowait percentage. Every monitoring tool that reads /proc/stat — top, vmstat, htop, Grafana node_exporter — was showing phantom I/O wait.
Initially I blamed a Genesys Logic USB card reader (05e3:0751) connected through a VIA Labs USB hub (a KVM-style switch with two upstream ports and a button to toggle between hosts). But after extensive testing, the leak turned out to have two sources: the USB card reader AND four empty AHCI/SATA ports (ata3-6) on the motherboard. Both go through the same boot-time async SCSI scan path, and both leak the nr_iowait counter.
During boot, each synchronous SCSI probe command goes through blk_execute_rq() → io_schedule_timeout(), which sets current->in_iowait = 1 and increments the kernel’s nr_iowait counter. The matching decrement is missed during the boot-time async scan — leaking one count per command. The counter is stuck until reboot.
Critically, unbinding and rebinding the USB card reader after boot triggers the exact same code path but does not leak — proving the bug is specific to the early boot async scanning environment, not the probe logic itself.
b=0, but the counter leaked as soon as I plugged the hub back inusb-storage.quirks=05e3:0751:i — card reader properly ignored (confirmed in dmesg), but procs_blocked still 4 — the AHCI empty ports also leakscsi_mod.scan=sync — no effectusb-storage.quirks=05e3:0751:u (ignore UAS) — no effect, device doesn’t support UAS anywayusb-storage.delay_use=10 — no effect, the delay just postpones the same buggy probe pathlibata.force=3:disable,4:disable,5:disable,6:disable — dropped procs_blocked from 4 to 2, confirming AHCI ports as a leak sourceUsing ftrace with stack traces, I traced the exact code path that leaks the counter. Every SCSI probe command goes through:
io_schedule_timeout
← __wait_for_common
← wait_for_completion_io_timeout
← blk_execute_rq
← scsi_execute_cmd
← scsi_probe_lun
← do_scan_async
← async_run_entry_fn
The io_schedule_timeout() call sets current->in_iowait = 1 and increments the kernel’s nr_iowait counter. During normal operation, the matching decrement happens when the IO completes. But during the boot-time async SCSI scan, the decrement is missed — leaking one count per probe command.
The critical evidence: unbinding and rebinding the USB card reader after boot triggers the exact same code path but does NOT leak the counter. This proves the bug is specific to the boot-time async scanning environment, not the probe logic itself.
Update: Two leak sources identified. Further testing revealed that ignoring the card reader (quirks=:i) still left procs_blocked=4 — the four empty AHCI/SATA ports on the motherboard also leak through the same async scan path. Adding libata.force=3:disable,4:disable,5:disable,6:disable dropped the count from 4 to 2, confirming two independent sources. Both the USB and AHCI SCSI probe paths share the same buggy boot-time io_schedule_timeout accounting.
I’ve filed this as Ubuntu bug #2146707 with full ftrace data and a suggested diagnostic kernel patch.
There isn’t a clean one yet. The procs_blocked counter leak is a kernel bug that persists from at least 6.8 through 6.17. Your options are:
Option 1: Reduce the leak with kernel parameters:
# Edit /etc/default/grub, add to GRUB_CMDLINE_LINUX_DEFAULT:
# usb-storage.quirks=05e3:0751:i (ignores the card reader)
# libata.force=3:disable,4:disable,... (reduces AHCI leak)
# Then regenerate GRUB:
sudo update-grub
This won’t fully eliminate the leak (in my testing it dropped from 4 to 2), but it helps. Disabling unused SATA ports in BIOS may also help.
Option 2: Accept the cosmetic iowait — iotop is your source of truth for actual I/O activity. The phantom counter doesn’t affect real performance.
Since the warm reprobe (after boot) doesn’t leak the counter, you can safely enable the card reader when you need it. The usb-storage.quirks parameter is writable at runtime:
#!/bin/bash
# card-reader.sh — toggle Genesys Logic card reader on/off
# Boot uses quirks=:i to prevent the phantom iowait bug.
# Warm reprobe after boot is safe — does NOT leak the counter.
VENDOR="05e3"
PRODUCT="0751"
find_device() {
for dev in /sys/bus/usb/devices/*; do
[ "$(cat "$dev/idVendor" 2>/dev/null)" = "$VENDOR" ] &&
[ "$(cat "$dev/idProduct" 2>/dev/null)" = "$PRODUCT" ] &&
basename "$dev" && return 0
done
return 1
}
case "$1" in
on)
DEV=$(find_device) || { echo "Card reader not found"; exit 1; }
# Clear the ignore quirk
echo "${VENDOR}:${PRODUCT}:" | sudo tee /sys/module/usb_storage/parameters/quirks
# Rebind the driver
echo "${DEV}:1.0" | sudo tee /sys/bus/usb/drivers/usb-storage/bind
echo "Card reader enabled"
;;
off)
DEV=$(find_device) || { echo "Card reader not found"; exit 1; }
echo "${DEV}:1.0" | sudo tee /sys/bus/usb/drivers/usb-storage/unbind
echo "${VENDOR}:${PRODUCT}:i" | sudo tee /sys/module/usb_storage/parameters/quirks
echo "Card reader disabled"
;;
*) echo "Usage: $0 {on|off}" ;;
esac
If you’re seeing phantom iowait and suspect a USB mass storage device, here’s how to trace it. As root:
# 1. Check for the phantom counter
grep procs_blocked /proc/stat # nonzero?
ps -eo pid,state,comm | awk '$2 == "D"' # no D-state processes?
# 2. Set up ftrace
cd /sys/kernel/debug/tracing
echo 0 > tracing_on
echo > trace
echo function > current_tracer
echo io_schedule >> set_ftrace_filter
echo io_schedule_timeout >> set_ftrace_filter
echo blk_execute_rq >> set_ftrace_filter
echo scsi_execute_cmd >> set_ftrace_filter
echo 1 > options/func_stack_trace
echo 1 > tracing_on
# 3. Trigger a reprobe of the suspect device
echo <interface> > /sys/bus/usb/drivers/usb-storage/unbind
sleep 3
echo <interface> > /sys/bus/usb/drivers/usb-storage/bind
sleep 5
# 4. Stop and check
echo 0 > tracing_on
grep procs_blocked /proc/stat # did it increase?
cat trace > /tmp/scsi_trace.txt # save for analysis
If procs_blocked increases after the reprobe, the trace will show you exactly which SCSI commands are leaking the counter. If it stays the same (as it did for me), that narrows the bug to the boot-time async scan path.
The lesson: If your Linux system shows high iowait but iotop shows zero disk activity, check for USB mass storage devices. The SCSI probe path can permanently corrupt the kernel’s I/O accounting during boot.
My Razer Kiyo Pro webcam (1532:0e05, firmware 8.21) has a much more dramatic failure mode: it can crash the entire xHCI host controller, disconnecting every USB device on the bus — keyboard, mouse, audio interface, everything. The only recovery is a hard reboot.
The failure has two independent triggers, and the kernel’s built-in error recovery makes both of them worse.
The Kiyo Pro fails to reinitialize after USB Link Power Management (LPM) transitions. When the kernel tries to wake the camera from a low-power state, it produces EPIPE (-32) errors on UVC SET_CUR operations. The stalled endpoint triggers an xHCI stop-endpoint timeout, and the kernel declares the entire controller dead.
Approximately 25 rapid consecutive UVC SET_CUR operations overwhelm the camera’s firmware. The standard UVC error-recovery query (GET_CUR after EPIPE) amplifies the failure by sending a second transfer to the already-stalling device. The kernel detects the fault, resets the controller, the reset triggers another fault, and the system enters a death spiral.
Testing confirmed that disabling LPM alone is insufficient — a stress test with NO_LPM active still caused delayed controller death 13 minutes later via TRB warning escalation.
After installing the HWE (Hardware Enablement) kernel on Ubuntu 24.04 LTS (sudo apt install linux-generic-hwe-24.04), which brought me to 6.17.0-19-generic, I retested without any patches or workarounds applied.
Initially the v4l2-ctl stress test appeared to pass 50/50 rounds, but further testing revealed that udev workarounds (autosuspend disable, avoid_reset_quirk) were still active. With all workarounds removed, the stress test crashes at round 44 with repeated endpoint stalls. On 6.8, the same test crashed around round 25 — so 6.17 is slightly more resilient but still vulnerable.
However, starting a video call still triggers the full hc_died() cascade on 6.17. The crash path is different — it involves LPM transitions during isochronous stream setup rather than rapid control transfers:
usb 2-3.4: disable of device-initiated U1 failed.
usb 2-3.4: Failed to set U2 timeout to 0x0,error code -110
uvcvideo 2-3.4:1.1: usb_set_interface Failed to disable LPM
usb 2-3.4: Failed to query (SET_CUR) UVC control 11 on unit 3: -71 (exp. 1).
[errors escalate from -71 EPROTO to -110 ETIMEDOUT]
usb 2-3.4: 3:1: cannot set freq 48000 to ep 0x82
xhci_hcd 0000:00:14.0: xHCI host not responding to stop endpoint command
xhci_hcd 0000:00:14.0: xHCI host controller not responding, assume dead
xhci_hcd 0000:00:14.0: HC died; cleaning up
The trigger is the LPM U1/U2 transition when the kernel sets up the video stream. The kernel tries to disable LPM, that fails, the firmware locks up, and every subsequent transfer times out until the controller is declared dead. The kernel patches (especially USB_QUIRK_NO_LPM) are still needed to prevent this.
If you’re stuck on an older kernel, you’ll need multiple layers of defense:
snd-usb-audio quirk flags to skip sample rate readback and defer audio interface setup: options snd-usb-audio quirk_flags=0x4000001[email protected]:
USB_QUIRK_NO_LPM for device 1532:0e05UVC_QUIRK_CTRL_THROTTLE that rate-limits SET_CUR transfers (50ms minimum interval) and skips error-code queries after EPIPEavoid_reset_quirk=1 to prevent USB errors from cascading to the xHCI controllerIf you have a Razer Kiyo Pro on kernel 6.8 or earlier and just want it to stop crashing your USB bus:
# Disable LPM for the Kiyo at runtime
echo "1532:0e05:k" | sudo tee /sys/module/usbcore/parameters/quirks
# Make it permanent
echo 'options usbcore quirks=1532:0e05:k' | sudo tee /etc/modprobe.d/razer-kiyo-usb.conf
sudo update-initramfs -u
This only addresses the LPM trigger. Full protection on older kernels requires the CTRL_THROTTLE kernel patch. The best fix is upgrading to kernel 6.17 or later.
The investigation that led me down this rabbit hole started with a much simpler problem. I plugged in an old 128GB LITEON SATA SSD in a USB enclosure (Realtek RTL9201 bridge) to grab some files. Within minutes, my system ground to a halt — real iowait this time, 50-60%, with the NVMe feeling sluggish.
GNOME’s tracker-miner-fs-3 had automatically started indexing the drive. The old SSD contained a full Ubuntu installation — hundreds of thousands of files under /usr, /lib, /snap. Tracker was hammering it with random reads, and the slow SATA-over-USB interface was bottlenecking everything.
Killing tracker and unmounting the drive should have fixed it. But when I ran udisksctl unmount, the USB enclosure physically disconnected mid-cache-sync:
sd 6:0:0:0: [sdc] Synchronize Cache(10) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
This left 6 SCSI error handler threads stuck in uninterruptible sleep — and that’s when the phantom procs_blocked counter leak began. The threads eventually recovered, but the kernel’s accounting never decremented. This is the same class of bug as the card reader issue, just triggered through a different path (disconnect during cache flush vs. probe of removable media).
The Logitech StreamCam (046d:0893) is a USB 3.0 webcam that exposes both UVC video and UAC audio interfaces. On Ubuntu with Wayland and PipeWire, it mostly works — until you try to use it for streaming.
After switching from X11 to Wayland with PipeWire (for screen capture in OBS), the StreamCam mic worked fine in veadotube. But the moment I added a PipeWire screen capture source in OBS, the mic stopped working in both OBS and veadotube. WirePlumber logged:
Failed to call Lookup: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for camera
The issue is a conflict between PipeWire’s camera portal and the audio routing. When OBS requests screen capture through the PipeWire portal, WirePlumber’s session management interferes with the existing audio node connections to the StreamCam. The mic’s PipeWire node gets orphaned — it still exists, but no application can connect to it.
The StreamCam also exposed two other quirks:
usbreset "Logitech StreamCam" fails as a normal user. The fallback is toggling the sysfs authorized flag to force a re-enumeration: echo 0 > /sys/bus/usb/devices/*/authorized && echo 1 > /sys/bus/usb/devices/*/authorized/dev/video0 (main capture) and /dev/video1 (metadata). OBS can pick the wrong one, resulting in no video. Always use /dev/video0.Restart the entire PipeWire stack to clear stale node connections:
# Restart PipeWire stack (fixes mic routing)
systemctl --user restart pipewire pipewire-pulse wireplumber
# If that doesn't work, reset the USB device first
pkexec usbreset "Logitech StreamCam"
sleep 1
systemctl --user restart pipewire pipewire-pulse wireplumber
I wrote a fix-mic.sh script that automates this: it tests if the mic is working, and if not, resets the USB device and restarts PipeWire. It runs automatically as part of my streaming startup script.
All four bugs live in the space where USB hardware meets Linux’s kernel subsystems — SCSI, xHCI, UVC, UAC, and PipeWire. Each layer has its own error handling and recovery logic, and when a USB device misbehaves, these layers can interact in unexpected ways.
The specific issues:
If you’re running Linux with USB peripherals (especially on a workstation or homelab):
iotop — It reads per-process I/O accounting, which is more accurate than /proc/stat. When top shows high iowait but iotop shows zero, you know it’s a phantom counter.usb-storage quirks — If you have USB card readers or enclosures causing issues, the usb-storage.quirks boot parameter is your friend.usbcore quirks parameter can disable LPM per-device. On 6.17+, the kernel handles this automatically.sudo apt install linux-generic-hwe-24.04) improves xHCI error handling for control transfers, but the Razer Kiyo Pro crash during video calls still occurs. The kernel patches are still needed for full protection.udisksctl power-off before physically unplugging USB drives — this prevents the cache sync race condition that can leak kernel accounting state.systemctl --user restart pipewire pipewire-pulse wireplumber. PipeWire’s portal system can orphan audio nodes when managing video and audio from the same USB device.The Linux USB subsystem handles thousands of device combinations, and most of them work flawlessly. But when they don’t, the failure modes can be subtle and deeply confusing — phantom I/O wait, cascading controller resets, kernel counters that lie to every monitoring tool on your system, and audio routing that silently breaks. Understanding the layers underneath USB devices — SCSI, xHCI, UVC, PipeWire — is the key to diagnosing these issues.
All of the patches and scripts mentioned here are available on GitHub: kiyo-xhci-fix (Razer Kiyo Pro patches and watchdog) and streamcam-fixes (Logitech StreamCam mic fix).
]]>realm.watch and woke up to find every device on my network had lost its IPv4 address. Phones, laptops, servers, IoT devices — all down. Here’s what happened and how I tracked it down.
After enabling CF proxy, devices on my admin VLAN (10.0.6.0/24) stopped renewing their DHCPv4 leases. My workstation was being handed a DHCPv6 address instead. Disabling the orange cloud immediately fixed it. Toggling it back on broke things again — reproducible every time.
My first instinct was to blame my own infrastructure. I checked:
None of my infrastructure was the source. So I ran a targeted tcpdump on the VLAN 6 bridge:
tcpdump -i br-lan.6 'icmp6 and ip6[40]=134'
And there it was — a device I didn’t expect:
fe80::1c3c:3716:1534:2392 > ff02::1: ICMP6, router advertisement
Flags [managed, other stateful, ipv6 only]
router lifetime 0s
prefix: fd39:c3aa:8cfe:6bb8::/64, valid 1800s
route: fd40:b451:5824:1::/64, lifetime 1800s
The source MAC was 24:e5:0f:d7:01:1d — a Google device. I hit its local API:
curl http://10.0.6.124:8008/setup/eureka_info
It was my Kitchen hub — a Google Nest Hub sitting on the counter. It was acting as a Thread/Matter border router, broadcasting IPv6 Router Advertisements with the ipv6 only flag (RFC 8781). This flag tells every device on the network: \”IPv6 is sufficient, you don’t need IPv4.\”
When you enable CF proxy on a domain, Cloudflare automatically publishes AAAA (IPv6) records alongside the A record. This introduces IPv6 DNS activity on the LAN — clients start making IPv6 lookups, generating multicast traffic. The Nest Hub’s Thread border router detected this IPv6 activity and responded by broadcasting Router Advertisements telling every device on the network to go IPv6-only.
The effect was immediate and reproducible: orange cloud on → RAs start → DHCPv4 leases expire → network down. Orange cloud off → IPv6 DNS activity drops → RAs stop → devices recover.
Three layers of defense:
nft add rule inet fw4 forward ether saddr 24:e5:0f:d7:01:1d meta l4proto icmpv6 icmpv6 type nd-router-advert drop/setup/eureka_info) that returns device identity without authentication — invaluable for identifying mystery devices.The whole investigation took about an hour. The hardest part was accepting that my own infrastructure wasn’t the problem — it was a \$100 smart display on the kitchen counter.
]]>This build starts with modest hardware — a retired desktop with an Intel Sandy Bridge quad-core CPU, no discrete GPU, and a mix of drives:
| Component | Detail |
|---|---|
| CPU | Intel Sandy Bridge, 4 cores, AES-NI |
| RAM | 8GB DDR3 |
| Boot Drive | 112G WD SSD |
| Disk 1 | 932G Toshiba HDD |
| Disk 2 | 1.82T Seagate HDD |
| Disk 3 | 932G Western Digital HDD |
| GPU | Intel HD 2000/3000 (integrated only) |
No discrete GPU means no hardware transcoding — but that’s fine. We’ll configure everything for direct play and disable ML features that need GPU acceleration.
The storage layout uses two strategies: RAID 1 for active data that needs redundancy, and LVM for bulk archive storage.
┌─────────────────────────────────────────────────────────┐
│ /mnt/raid (923G) │
│ RAID 1 — "mirror" │
│ ┌─────────────────────┐ ┌─────────────────────┐ │
│ │ sda2 (923G) │ │ sdc3 (923G) │ │
│ │ Toshiba DT01ACA100 │ │ WD WD10EZEX │ │
│ └─────────────────────┘ └─────────────────────┘ │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ /mnt/storage (1.82T) │
│ LVM — VG "lvm" / LV "storage" │
│ ┌─────────────────────────────────────────────┐ │
│ │ sdb (1.82T) — Seagate ST2000VM003 │ │
│ └─────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ sdd — Boot Drive │
│ 112G WD SSD (ext4 + EFI) │
└─────────────────────────────────────────────────────────┘
RAID 1 mirrors two drives so active data (documents, photos, music, videos, projects) survives a single drive failure. LVM on the 1.82T Seagate holds archives and backups — data that either exists elsewhere or can be re-downloaded.
The key principle: irreplaceable data goes on RAID, regenerable data goes on LVM. This guides every storage decision on the server.
Setting up the RAID array was straightforward since it was a pre-existing array from 2019:
sudo mdadm --assemble /dev/md0 /dev/sda2 /dev/sdc3
sudo mount /dev/md0 /mnt/raid
The LVM volume just needed activation:
sudo lvchange -ay lvm/storage
sudo mount /dev/lvm/storage /mnt/storage
Both volumes auto-mount via /etc/fstab with the nofail flag, so the system boots even if a data disk fails.
The server exports both volumes over NFS v4.2 (for Linux clients) and SMB3 (for Windows and macOS).
NFSv4.2 is the cleanest option for Linux-to-Linux file sharing. The server uses a pseudo-root at /srv/nfs with bind mounts:
# /etc/exports
/srv/nfs 10.0.6.0/24(rw,sync,fsid=0,crossmnt,no_subtree_check)
/srv/nfs/raid 10.0.6.0/24(rw,sync,no_subtree_check)
/srv/nfs/storage 10.0.6.0/24(rw,sync,no_subtree_check)
Clients mount with a single line:
sudo mount -t nfs4 -o vers=4.2,noatime,nodiratime disks.local:/ /mnt/disks
For Windows and macOS clients, Samba serves the same volumes with SMB3 encryption and macOS Time Machine compatibility via the fruit VFS module. A dedicated family share gives household members access to shared music and documents.
The heart of this build is a Docker Compose stack running eight self-hosted services behind a Caddy reverse proxy:
| Service | Purpose | URL |
|---|---|---|
| Jellyfin | Video streaming | jellyfin.jphe.in |
| Navidrome | Music streaming (Subsonic API) | navidrome.jphe.in |
| Immich | Photo management & phone backup | immich.jphe.in |
| Syncthing | Bidirectional file sync | syncthing.jphe.in |
| Nextcloud | Calendar, contacts & webmail | nextcloud.jphe.in |
| Outline | Wiki & knowledge base | outline.jphe.in |
| Vaultwarden | Password manager (Bitwarden-compatible) | vault.jphe.in |
Without a discrete GPU, Jellyfin is configured for direct play only — no transcoding. This means clients need to support the media formats natively. In practice, most modern clients (phones, smart TVs, web browsers) handle H.264/H.265 just fine.
If a file won’t play on a particular client, I pre-transcode it on my workstation with ffmpeg before adding it to the library.
Navidrome is impressively lightweight — about 30MB of RAM to serve an entire music library. It speaks the Subsonic API, so any Subsonic-compatible client works: Symfonium on Android, play:Sub on iOS, or Sublime Music on Linux.
Immich provides a Google Photos-like experience for photo management and mobile backup. Since we have no GPU, the machine learning features (face detection, CLIP search) are disabled — but the core photo browsing, timeline, and mobile auto-upload work perfectly.
Getting Immich’s storage right took some iteration. The key insight: phone uploads are irreplaceable originals and need RAID redundancy, but thumbnails and transcoded videos are regenerable and can live on cheaper storage.
The final layout uses Docker bind mounts to split data across volumes:
volumes:
# Base upload directory on LVM (thumbnails, transcodes, backups)
- /mnt/storage/immich-data:/usr/src/app/upload
# Phone uploads overlaid onto RAID for redundancy
- /mnt/raid/immich-upload:/usr/src/app/upload/upload
- /mnt/raid/immich-library:/usr/src/app/upload/library
# External photo libraries (read-only)
- /mnt/raid/photos:/usr/src/app/external-raid:ro
Docker processes volume mounts in order, so the bind mounts for upload/ and library/ overlay onto the base LVM mount. This gives us:
| Data Type | Location | Why |
|---|---|---|
| Phone uploads (originals) | /mnt/raid (RAID 1) | Irreplaceable, needs redundancy |
| Thumbnails | /mnt/storage (LVM) | Regenerable from originals |
| Encoded video | /mnt/storage (LVM) | Regenerable from originals |
| DB backups | /mnt/storage (LVM) | Separate backup chain handles this |
| Postgres database | /mnt/raid (RAID 1) | Bind mount at /mnt/raid/docker/immich-db |
Lesson learned the hard way: Docker named volumes live under /var/lib/docker/volumes/ on the root filesystem — typically a small boot SSD. If Immich starts processing thousands of photos, thumbnails and transcoded videos can eat 20+ GB fast. Always use bind mounts to explicit paths on your data drives.
Old photos from cameras with dead batteries or no real-time clock often have EXIF dates like January 1, 1980 or December 26, 1970. Immich sorts by EXIF date, so these photos end up in the wrong decade.
For JPEGs, exiftool can fix the dates on disk:
exiftool -overwrite_original -DateTimeOriginal="2018:04:01 12:00:00" photo.JPG
For formats that don’t support EXIF writes (like AVI), fix the dates directly in Immich’s Postgres database:
docker exec immich-db psql -U postgres -d immich -c \
"UPDATE asset_exif SET \"dateTimeOriginal\" = '2023-05-01 12:00:00'
WHERE \"assetId\" IN (SELECT id FROM asset WHERE \"originalPath\" LIKE '%folder-name%');"
Nextcloud fills the last major gap in the self-hosted stack: CalDAV for calendar sync and CardDAV for contacts, plus a built-in webmail client that connects to existing email accounts via IMAP/SMTP.
The architecture mirrors Immich — Nextcloud Apache container backed by Postgres 16 and Redis, all on RAID bind mounts. CalDAV/CardDAV client autodiscovery requires /.well-known/caldav and /.well-known/carddav redirects in Caddy, per RFC 6764:
nextcloud.jphe.in {
redir /.well-known/carddav /remote.php/dav 301
redir /.well-known/caldav /remote.php/dav 301
reverse_proxy nextcloud:80
}
With these redirects, phone and desktop calendar/contacts clients only need the hostname — no manual URL entry required. One critical environment variable: OVERWRITEPROTOCOL=https tells Nextcloud it’s behind a TLS-terminating proxy, so it generates correct https:// links instead of http://.
Outline provides a clean, fast wiki for shared documentation and knowledge management. It’s the self-hosted alternative to Notion — Markdown-native, real-time collaborative editing, and a powerful search.
Rather than adding yet another authentication system, Outline uses Nextcloud as an OIDC provider. Anyone with a Nextcloud account can log into Outline — no separate credentials needed. This is configured by registering an OAuth2 client in Nextcloud’s admin settings and pointing Outline’s OIDC environment variables at Nextcloud’s authorization endpoints.
File uploads (images, attachments) are stored directly on the RAID filesystem rather than requiring an S3-compatible object store like MinIO. For a personal/family wiki, local storage is simpler and perfectly adequate — Outline supports this with FILE_STORAGE=local.
Vaultwarden is a lightweight, Rust-based implementation of the Bitwarden API. It runs on minimal resources and is fully compatible with all Bitwarden clients — browser extensions, mobile apps, and the bw CLI tool.
The database lives on RAID for redundancy, and automated daily backups provide an additional safety net (more on that below).
Syncthing keeps my ~/Projects directory synchronized between my workstation and the server’s RAID array. It’s bidirectional, peer-to-peer, and encrypted — no cloud service involved.
Every service gets its own subdomain with automatic Let’s Encrypt certificates. Caddy handles this with the Cloudflare DNS-01 challenge — no ports 80/443 need to be exposed to the internet.
One gotcha: the upstream caddy-dns/cloudflare module rejects Cloudflare’s newer cfut_-prefixed API tokens. I used a patched fork that fixes this.
The Caddyfile is clean — each service is just a few lines:
jellyfin.jphe.in {
reverse_proxy jellyfin:8096
}
If you’re uploading large videos through Immich (or any service behind Caddy), the default proxy timeouts will kill the connection mid-upload. The fix is to increase both the request body size limit and the proxy transport timeouts:
immich.jphe.in {
request_body {
max_size 20GB
}
reverse_proxy immich:2283 {
transport http {
read_timeout 600s
write_timeout 600s
}
}
}
Caddy supports hot-reloading — caddy reload applies config changes without dropping existing connections.
All the *.jphe.in DNS records point to the server’s Tailscale IP (100.x.x.x), not a public IP. This means:
*.jphe.in queries and resolves them to the local IP (10.0.6.120)No port forwarding. No dynamic DNS. No exposing services to the internet. Just install Tailscale on your devices and everything works.
A few targeted optimizations make a noticeable difference on this hardware:
| Setting | Value | Why |
|---|---|---|
| vm.swappiness | 10 | Prefer file cache over swap |
| vm.dirty_ratio | 40 | Allow large write batches before flushing |
| vm.vfs_cache_pressure | 50 | Keep directory/inode caches longer |
| net.ipv4.tcp_congestion_control | bbr | Google’s BBR for faster throughput |
| net.core.rmem_max / wmem_max | 16MB | Large TCP buffers for big file transfers |
HDDs get the mq-deadline scheduler with 2MB readahead and write caching enabled. The SSD boot drive uses none (passthrough). Head parking is disabled on the HDDs (hdparm -B254) to avoid the click-of-death wear pattern.
SSH is tuned to use hardware-accelerated AES-GCM ciphers (the Sandy Bridge CPU has AES-NI), and reverse DNS lookups are disabled for faster connections.
Terminal compatibility tip: If you use Kitty terminal, remote servers won’t have the xterm-kitty terminfo entry. Tools like top, htop, and nano will break. Fix it by installing the terminfo on the server:
infocmp -x xterm-kitty | ssh disks "mkdir -p ~/.terminfo && tic -x -o ~/.terminfo /dev/stdin"
The backup strategy has two layers: database dumps for application state, and BorgBackup for file-level deduplication.
Every service with a database gets a daily dump to /mnt/raid/backups/databases/:
| Service | DB Type | Method |
|---|---|---|
| Immich | Postgres | pg_dump (consistent snapshot) |
| Nextcloud | Postgres | pg_dump (consistent snapshot) |
| Outline | Postgres | pg_dump (consistent snapshot) |
| Vaultwarden | SQLite | sqlite3 .backup (safe while running) |
| Jellyfin | SQLite | sqlite3 .backup |
| Navidrome | SQLite | sqlite3 .backup |
The dumps land on RAID so they’re included in the Borg backup that follows. Old dumps are pruned after 7 days.
Why not just back up the database files directly? Postgres stores data across multiple files that must be consistent with each other. Copying them while Postgres is running can give you a corrupted snapshot. pg_dump produces a clean SQL dump regardless of database activity. SQLite has the same issue — the .backup command ensures a consistent copy.
BorgBackup runs 30 minutes after the database dumps, deduplicating critical data from RAID to the storage volume:
# Backs up: documents, keys, projects, database dumps, photos
# Retention: 7 daily, 4 weekly, 6 monthly
# Compression: zstd level 3
# Destination: /mnt/storage/backups/borg-raid
Borg’s deduplication means incremental backups are fast and space-efficient — only changed blocks are stored. The entire backup history compresses to around 320MB of deduplicated storage.
2:30 AM Database dumps → /mnt/raid/backups/databases/
3:00 AM Borg backup → /mnt/raid/* → /mnt/storage/backups/borg-raid/
6:00 AM Disk health → SMART checks, logged to /var/log/disk-health.log
This means the storage volume holds a complete, deduplicated history of everything on RAID — including consistent database snapshots.
Local backups protect against drive failure, but not against fire, theft, or disaster. For geographic redundancy, the server syncs critical data to cloud storage using rclone.
rclone is configured with three cloud remotes:
| Remote | Provider | Storage |
|---|---|---|
| box-personal | Box (personal) | 100GB |
| box-techempower | Box (work) | 100GB |
| gdrive | Google Drive | 25GB |
That’s 225GB of cloud storage across three accounts — enough for database dumps, documents, phone uploads, music, and a chunk of the photo library.
Google Drive is mounted as a regular filesystem at /mnt/gdrive using rclone’s FUSE mount capability, managed by a systemd service:
[Service]
Type=notify
User=jp
ExecStart=/usr/bin/rclone mount gdrive: /mnt/gdrive \
--vfs-cache-mode full \
--vfs-cache-max-size 2G \
--dir-cache-time 72h \
--allow-other
The --vfs-cache-mode full setting caches files locally before serving them, so reads and writes behave like a normal filesystem. The --allow-other flag (plus user_allow_other in /etc/fuse.conf) lets other system users and services like Samba access the mount.
Box and Google Drive both use OAuth2 for authentication, which normally requires a web browser. Since the server is headless, the trick is to run rclone config on a workstation that has a browser, complete the OAuth flow there, then copy ~/.config/rclone/rclone.conf to the server. The tokens persist in the config file and rclone handles refresh automatically.
smartd runs weekly short tests and monthly long tests on all drives. A custom health check script runs daily at 6am and logs to /var/log/disk-health.log. On a server with aging drives, early warning of failure is critical.
A few things I ran into during the build:
e2fsck before operating on corrupt inodes. I tried to clean up files on a filesystem with corrupt inodes and triggered a kernel panic — VFS spinlock deadlock. The fix was to unmount and run e2fsck -y first.pg_dump backup. Now every database gets a daily dump before Borg runs.read_timeout and write_timeout explicitly for services that handle large files.rsync, not mv, across filesystems. mv between different filesystems is a silent copy+delete with no progress indicator and no resume on failure. rsync -ah --progress gives you visibility and idempotent restarts.Here’s what the complete setup looks like:
| Layer | Technology |
|---|---|
| OS | Ubuntu 24.04 (headless) |
| Storage | mdadm RAID 1 + LVM |
| File Sharing | NFS v4.2 + Samba/SMB3 |
| Media | Jellyfin + Navidrome + Immich |
| PIM | Nextcloud (CalDAV/CardDAV/Mail) |
| Knowledge Base | Outline (Nextcloud OIDC auth) |
| Passwords | Vaultwarden (Bitwarden-compatible) |
| Sync | Syncthing |
| Reverse Proxy | Caddy + Let’s Encrypt (DNS-01) |
| Remote Access | Tailscale mesh VPN |
| Backups | Daily DB dumps + BorgBackup + rclone cloud sync |
| Cloud Storage | rclone → Box (2×100GB) + Google Drive (25GB FUSE mount) |
| Monitoring | smartd + daily health checks |
Total cost: effectively $0 in new hardware. The server is quiet, draws minimal power, and serves media to every device in the house — plus anywhere I have Tailscale installed.
If you have an old desktop gathering dust, it’s more than capable of running this entire stack. The only thing I’d eventually add is a discrete GPU for Jellyfin transcoding and Immich ML — but honestly, direct play has been perfectly fine.
]]>Route an entire VLAN through a WireGuard tunnel to an Azure VM, so every device on that network exits the internet from a cloud IP — with ad blocking, DNS encryption, and a kill switch. No split tunneling, no DNS leaks, no IPv6 leaks.
The result: connect to a dedicated “vpn” WiFi SSID at home, and all your traffic exits through Azure. Disconnect, and you are back on your normal internet. Simple for the user, robust underneath.
Devices on VLAN 9 ("vpn" WiFi)
↓ (policy routing)
OpenWrt router (gatekeeper) ──WireGuard──→ Azure VM (gig)
↓ ↓
AdGuard Home (LAN DNS) AdGuard Home (VPN DNS)
Cloudflare DoT upstream Cloudflare DoT upstream
Key components:
Install WireGuard and enable IP forwarding:
sudo apt install wireguard sudo sysctl -w net.ipv4.ip_forward=1 echo "net.ipv4.ip_forward=1" | sudo tee -a /etc/sysctl.conf
Generate keys and create /etc/wireguard/wg0.conf:
[Interface] Address = 10.5.34.1/24 ListenPort = 51820 PrivateKey = <server-private-key> PostUp = iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE PostDown = iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE [Peer] # gatekeeper PublicKey = <gatekeeper-public-key> AllowedIPs = 10.5.34.10/32
Enable and start:
sudo systemctl enable wg-quick@wg0 sudo systemctl start wg-quick@wg0
Open UDP port 51820 in the Azure Network Security Group and in UFW:
sudo ufw allow 51820/udp sudo ufw allow in on wg0 from 10.5.34.0/24
Install WireGuard:
opkg update opkg install wireguard-tools kmod-wireguard
Configure the interface via UCI:
uci set network.wireguardgig=interface uci set network.wireguardgig.proto=wireguard uci set network.wireguardgig.private_key=<gatekeeper-private-key> uci add_list network.wireguardgig.addresses=10.5.34.10/24 uci set network.wireguardgig.mtu=1420 uci set network.wireguardgig.metric=90 uci add network wireguard_wireguardgig uci set network.@wireguard_wireguardgig[-1].public_key=<server-public-key> uci set network.@wireguard_wireguardgig[-1].endpoint_host=<your-vm-hostname> uci set network.@wireguard_wireguardgig[-1].endpoint_port=51820 uci set network.@wireguard_wireguardgig[-1].persistent_keepalive=25 uci add_list network.@wireguard_wireguardgig[-1].allowed_ips=0.0.0.0/0 uci commit network /etc/init.d/network restart
Important: Add a static route to pin the WireGuard endpoint through your real WAN, so the tunnel does not try to route itself through itself:
uci add network route uci set network.@route[-1].interface=wan uci set network.@route[-1].target=<azure-vm-public-ip>/32 uci set network.@route[-1].gateway=<your-wan-gateway> uci commit network
Create a dedicated VPN network on VLAN 9. On OpenWrt:
# Bridge and VLAN interface uci set network.vpn=interface uci set network.vpn.proto=static uci set network.vpn.ipaddr=10.0.9.1 uci set network.vpn.netmask=255.255.255.0 uci set network.vpn.device=br-lan.9
Set up policy routing so VLAN 9 traffic uses the WireGuard tunnel instead of the normal WAN:
# Default route through tunnel in table 2 uci add network route uci set network.@route[-1].interface=wireguardgig uci set network.@route[-1].target=0.0.0.0/0 uci set network.@route[-1].table=2 # Rule: traffic from VPN zone uses table 2 uci add network rule uci set network.@rule[-1].src=10.0.9.0/24 uci set network.@rule[-1].lookup=2 uci commit network /etc/init.d/network restart
Devices on VLAN 9 now exit through Azure. Devices on every other VLAN are unaffected.
The firewall is critical. If the tunnel drops, VPN traffic must NOT fall back to the regular WAN.
# VPN zone — devices on VLAN 9 uci add firewall zone uci set firewall.@zone[-1].name=vpn uci set firewall.@zone[-1].input=REJECT uci set firewall.@zone[-1].output=ACCEPT uci set firewall.@zone[-1].forward=REJECT uci add_list firewall.@zone[-1].network=vpn # WAN guard zone — the WireGuard tunnel exit uci add firewall zone uci set firewall.@zone[-1].name=wanguard uci set firewall.@zone[-1].input=REJECT uci set firewall.@zone[-1].output=ACCEPT uci set firewall.@zone[-1].forward=REJECT uci add_list firewall.@zone[-1].network=wireguardgig uci set firewall.@zone[-1].masq=1 uci set firewall.@zone[-1].mtu_fix=1 # Only forwarding: vpn → wanguard (kill switch) uci add firewall forwarding uci set firewall.@forwarding[-1].src=vpn uci set firewall.@forwarding[-1].dest=wanguard # Allow DNS and DHCP into VPN zone # ... (DNS on port 53, DHCP on port 67) # Drop all IPv6 from VPN zone uci add firewall rule uci set firewall.@rule[-1].name=VPN-Drop-IPv6 uci set firewall.@rule[-1].src=vpn uci set firewall.@rule[-1].family=ipv6 uci set firewall.@rule[-1].proto=all uci set firewall.@rule[-1].target=DROP uci commit firewall /etc/init.d/firewall restart
There is no vpn → wan forwarding. If the tunnel is down, traffic is dropped — not leaked.
DNS is the most common VPN leak. We handle it in layers.
Install AdGuard Home on the Azure VM, listening only on the WireGuard address:
curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh
Configure via the web UI at http://10.5.34.1:3000:
10.5.34.1:53tls://1.1.1.1 and tls://1.0.0.1 (Cloudflare DNS-over-TLS)Both the web UI and DNS are bound to the WireGuard interface only — not accessible from the public internet.
Install from opkg and configure to listen on 127.0.0.1:5353, then point dnsmasq at it:
opkg install adguardhome # Point dnsmasq at AdGuard Home instead of Stubby uci add_list dhcp.@dnsmasq[0].server='127.0.0.1#5353' uci set dhcp.@dnsmasq[0].noresolv=1 uci commit dhcp /etc/init.d/dnsmasq restart
This replaces Stubby — AdGuard Home handles DNS-over-TLS upstream natively. The DNS chain becomes: dnsmasq (:53) → AdGuard Home (:5353) → Cloudflare DoT.
uci set dhcp.vpn.dhcp_option='6,10.5.34.1' uci commit dhcp
VPN clients receive 10.5.34.1 as their DNS server. Since this IP is on the WireGuard subnet, all DNS queries go through the tunnel to AdGuard Home on gig.
Some devices (Chromecast, Android) ignore DHCP and hardcode DNS servers like 8.8.8.8. A firewall DNAT redirect catches them:
uci add firewall redirect uci set firewall.@redirect[-1].target=DNAT uci set firewall.@redirect[-1].name='Intercept DNS VPN' uci set firewall.@redirect[-1].src=vpn uci set firewall.@redirect[-1].src_dport=53 uci set firewall.@redirect[-1].dest=wanguard uci set firewall.@redirect[-1].dest_ip=10.5.34.1 uci set firewall.@redirect[-1].dest_port=53 uci set firewall.@redirect[-1].proto='tcp udp' uci commit firewall /etc/init.d/firewall restart
Any DNS query leaving the VPN zone gets redirected to AdGuard Home on gig, through the tunnel. No exceptions.
IPv6 can leak your real address even when IPv4 is tunneled. Disable it at four layers:
net.ipv6.conf.br-lan/9.disable_ipv6=1Out of the box, the tunnel achieved ~305/332 Mbps (up/down). After tuning: ~390/453 Mbps.
net.ipv4.tcp_congestion_control=bbrnet.ipv4.tcp_ecn=1fq qdisc on eth0 and wg0 — BBR needs a pacing-aware qdisc. Without it, BBR falls back to burst-based sending which causes buffer bloatnet.ipv4.tcp_fastopen=3nat and ack-filter. Prevents buffer bloat/etc/hotplug.d/net/99-rpsOn an OpenWrt access point, create a 5GHz SSID that bridges to VLAN 9:
uci set wireless.vpn_5g=wifi-iface uci set wireless.vpn_5g.device=radio2 uci set wireless.vpn_5g.mode=ap uci set wireless.vpn_5g.ssid=vpn uci set wireless.vpn_5g.encryption=psk2 uci set wireless.vpn_5g.key=<your-password> uci set wireless.vpn_5g.network=vpn uci commit wireless wifi reload
The AP bridges the “vpn” SSID to VLAN 9. Connect to this SSID and all traffic routes through Azure.
From a device on the VPN WiFi:
# Check your exit IP — should be the Azure VM curl ifconfig.me # Check DNS — ad domains should be blocked nslookup ads.google.com # Expected: 127.0.0.1 # Check for DNS leaks at https://www.dnsleaktest.com # Should show Cloudflare, not your ISP # Check for IPv6 leaks at https://ipv6leak.com # Should show no IPv6 connectivity
AdGuard Home includes a web dashboard with a full query log. You can:
Access the dashboards at:
http://<router-ip>:3000http://10.5.34.1:3000 (through the tunnel)For even quicker toggling, the AdGuard Browser Extension lets you disable filtering per-site from the toolbar.
| Layer | What |
|---|---|
| Tunnel | WireGuard, MTU 1420, BBR, 25s keepalive |
| Routing | VLAN 9 → policy route table 2 → wireguardgig |
| Kill switch | vpn → wanguard only, no vpn → wan forwarding |
| DNS | AdGuard Home on both ends, Cloudflare DoT upstream |
| DNS leak prevention | DHCP option 6 + DNAT intercept for hardcoded DNS |
| IPv6 leak prevention | Disabled at sysctl, DHCP, RA, and firewall |
| Ad blocking | ~173K rules (AdGuard DNS + AdAway + Peter Lowe) |
| Performance | CAKE SQM, RPS, fq qdisc, tuned TCP buffers |
| Access | Dedicated 5GHz WiFi SSID — connect and go |
The whole setup was built and tuned in a single session with Claude Code handling the configuration across both hosts simultaneously — SSH into the router and VM, running commands, testing, and fixing issues in real time.
]]>I’ve been running jphein.com on a Google Cloud e2-micro instance since 2022. It started as a basic Docker Compose setup — WordPress, MySQL 5.7, and an nginx reverse proxy — with a backup script I wrote and mostly forgot about. Over time, things drifted: the auto-update script stopped working (silently!), legacy files accumulated, and MySQL 5.7 went end-of-life without me noticing.
I decided to use Claude Code to audit and harden the entire setup. Here’s what we found and fixed in a single session.
jp user wasn’t in the docker group. Every Sunday at 2am it would fail silently and report “completed successfully” because the pipe-to-while-read pattern swallowed all errors.GRANT ALL ON wp_db.* TO @% grants to nobody. If I ever needed to restore, the database user wouldn’t have access.X-Powered-By: PHP/8.3.30 to anyone who asked.acrobat) containing a plaintext password was sitting in the web root since 2022, publicly accessible.thread_stack from 128K to 256K and removing deprecated query_cache settings. The upgrade ran automatically when the new container started.apt-get install cron on every container restart, which was slow and fragile (network-dependent). Now cron is baked into the image.127.0.0.1 in docker-compose. Port 8080 removed from UFW.acrobat file.set -uo pipefail to the backup script.
Internet → Cloudflare → SWAG (nginx + Let's Encrypt)
↓
WordPress (PHP 8.3, custom Dockerfile)
↓
MySQL 8.0 (localhost only)
Backups: daily incremental to GCS via duplicity (6 months retention)
Updates: weekly via WP-CLI + Docker pull + apt upgrade
Alerts: msmtp → Gmail
Access: Tailscale only (no public SSH)
127.0.0.1 for services that don’t need external access.The whole audit and remediation took about an hour with Claude Code doing the heavy lifting — reading configs, running tests, making changes, and verifying everything worked after each step.
]]>What you’ll end up with:
What this costs: Nothing. GCP’s Always Free tier covers the VM, and the GCS bucket stays free as long as you keep it under 5 GB (backups for a small site are well under that).
GCP’s Always Free tier includes one e2-micro instance per month in certain US regions, forever — no credit card charges as long as you stay within the limits.
wordpress-server)us-east1, us-west1, or us-central1 (required for Always Free)e2-micro (2 vCPU, 1 GB RAM)The 30 GB disk is within the Always Free 30 GB/month standard disk limit. Do not use SSD — only standard persistent disk is free.
Once created, copy the External IP from the VM list. You’ll need it for DNS.
Click SSH in the GCP console to open a browser terminal. You’ll use this for the next step (installing Tailscale), after which you can close public SSH permanently.
Port 22 open to the internet is the single most-scanned port on any public server. Tailscale gives you a private encrypted network between your devices — SSH stays open on that network and closed to everyone else.
In the GCP browser SSH terminal:
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
tailscale up prints an authentication URL. Open it in your browser, log in with your Tailscale account, and the VM will appear in your Tailscale admin console.
Get the VM’s Tailscale IP (always in the 100.x.x.x range):
tailscale ip -4
Download from tailscale.com/download for macOS, Windows, or Linux and sign in with the same account. Both devices will now be on your private Tailscale network.
From your local machine:
ssh [email protected] # use the Tailscale IP from above
Confirm this works before the next step.
In the GCP console:
default-allow-ssh (allows TCP port 22 from 0.0.0.0/0)Port 22 is now closed to the public internet. Your Tailscale SSH connection still works because Tailscale operates over UDP 41641 (or falls back to HTTPS), not port 22.
GCP console SSH still works. The browser SSH button in the GCP console uses IAP (Identity-Aware Proxy), which tunnels through Google’s internal network — it does not go through the public firewall rule you just removed.
For maximum hardening, tell sshd to only listen on the Tailscale interface:
# Find the Tailscale interface name (usually tailscale0)
ip link show | grep tailscale
# Add to /etc/ssh/sshd_config:
echo "ListenAddress 100.x.x.x" | sudo tee -a /etc/ssh/sshd_config
sudo systemctl restart ssh
Replace 100.x.x.x with your actual Tailscale IP. After this, ssh to the public IP will simply time out even if the firewall rule were ever re-enabled.
A fresh Ubuntu 22.04 install on GCP is not optimised for a memory-constrained server. These steps reclaim memory and prevent a few common failure modes before you install anything.
The e2-micro has 1 GB of RAM. Without swap, a single memory spike from Docker pulling a new image or WordPress processing a large upload can OOM-kill a container. A swap file is cheap insurance.
# Check whether swap already exists
swapon --show
# If nothing is listed, create a 4 GB swap file
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# Make it permanent across reboots
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
The default vm.swappiness of 60 tells the kernel to move pages to swap aggressively. On a server where you want RAM for active processes, 10 is better — use swap as a last resort, not a first choice:
echo 'vm.swappiness=10' | sudo tee /etc/sysctl.d/99-tuning.conf
sudo sysctl -p /etc/sysctl.d/99-tuning.conf
# Verify
cat /proc/sys/vm/swappiness # should print 10
By default journald keeps logs until the disk is 10% full. On a 30 GB boot disk that means up to 3 GB of logs — a significant chunk of your free space. Cap it:
sudo mkdir -p /etc/systemd/journald.conf.d
sudo tee /etc/systemd/journald.conf.d/size.conf > /dev/null <<'EOF'
[Journal]
SystemMaxUse=200M
RuntimeMaxUse=50M
EOF
sudo systemctl restart systemd-journald
# Vacuum logs that are already over the new limit
sudo journalctl --vacuum-size=200M
multipathd — manages multipath block devices (SANs, iSCSI). Irrelevant on a GCP VM:
sudo systemctl disable --now multipathd
rsyslog — a second logging daemon that duplicates what journald already does. Ubuntu installs both by default:
sudo systemctl disable --now rsyslog
LXD — a full VM and container manager installed via snap. Not needed when you're using Docker:
sudo snap remove lxd
Removing LXD also removes the core18 and core20 snap bases it depended on, freeing several hundred MB of disk space.
UFW provides a local firewall layer in addition to GCP's network firewall — defense in depth:
sudo ufw allow 22/tcp # SSH (Tailscale access)
sudo ufw allow 80/tcp # HTTP (Let's Encrypt + redirect)
sudo ufw allow 443/tcp # HTTPS
sudo ufw allow 51820/udp # Tailscale (WireGuard)
sudo ufw enable
free -h
sudo docker stats --no-stream # run after Docker is installed
At idle you should see roughly 200 MB used by the OS, leaving ~750 MB for your containers.
Cloudflare is the recommended DNS provider for this setup. The free tier gives you DNS, DDoS protection, and a CDN — all at no cost. You just point your domain's nameservers at Cloudflare instead of your registrar.
arlo.ns.cloudflare.com
june.ns.cloudflare.comIn the Cloudflare dashboard under DNS → Records, add:
Type: A Name: @ IPv4: YOUR_VM_IP
Type: A Name: www IPv4: YOUR_VM_IP
Each DNS record has a Proxy status toggle — the orange cloud icon:
| Setting | What it means |
|---|---|
| Proxied (orange cloud) | Traffic flows through Cloudflare's CDN. Hides your VM's real IP, adds DDoS protection and caching. Recommended. |
| DNS only (grey cloud) | Cloudflare is just DNS. Traffic goes directly to your VM. |
Use proxied (orange cloud). It's one of the main reasons to use Cloudflare.
Let's Encrypt HTTP-01 validation works fine through the Cloudflare proxy — swag handles it automatically.
This is a required step when using the orange cloud proxy.
In Cloudflare: SSL/TLS → Overview → select Full (not Flexible, not Full Strict).
Let's Encrypt needs the domain to resolve before it can issue a certificate:
dig +short yourdomain.com
# Should return a Cloudflare IP (not your VM IP — that's expected when proxied)
# Test that port 80 reaches your server through Cloudflare
curl -I http://yourdomain.com
SSH into your VM and run:
# Install dependencies
sudo apt update && sudo apt install -y ca-certificates curl gnupg
# Add Docker's official GPG key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
| sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
# Add the Docker apt repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" \
| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker Engine and Compose plugin
sudo apt update && sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
# Add your user to the docker group (needed for cron scripts)
sudo usermod -aG docker $USER
# Verify
sudo docker compose version
Important: always use docker compose (with a space, V2). The old docker-compose hyphenated command is a separate, outdated Python tool that is incompatible with modern Docker image formats.
Important: adding your user to the docker group lets cron-scheduled scripts (backup, auto-update) access Docker without sudo. Log out and back in for the group change to take effect.
mkdir -p ~/mysite/{www,config}
mkdir -p ~/mysqldump
cd ~/mysite
Your layout will be:
~/mysite/
├── docker-compose.yml
├── wordpress.Dockerfile # Custom WordPress image with cron
├── default.conf # nginx config with security headers
├── custom.ini # PHP overrides
├── mpm_prefork.conf # Apache worker tuning
├── mysql.cnf # MySQL 8.0 low-memory tuning
├── .env # Secrets (gitignored)
├── config/ # swag runtime data (SSL certs, nginx state)
└── www/ # WordPress files
~/mysqldump/
└── database.sql # daily MySQL dump (written by backup script)
Create each file below. Replace yourdomain.com and [email protected] throughout.
.env (secrets)Keep passwords out of your compose file. Generate strong random passwords:
cat > .env <<'EOF'
MYSQL_ROOT_PASSWORD=CHANGE_ME_USE_openssl_rand_base64_16
MYSQL_PASSWORD=CHANGE_ME_USE_openssl_rand_base64_16
MYSQL_DATABASE=wp_db
MYSQL_USER=wp_db_user
EOF
chmod 600 .env
docker-compose.ymlThis defines three containers: swag (nginx + SSL), wordpress (Apache + PHP), and db (MySQL 8.0). All have memory limits to stay within the 1 GB budget. Ports are bound to 127.0.0.1 to prevent Docker from bypassing your firewall.
services:
swag:
image: linuxserver/swag
container_name: swag
restart: always
depends_on:
- wordpress
volumes:
- ./config:/config
- ./default.conf:/config/nginx/site-confs/default.conf
environment:
- [email protected]
- URL=yourdomain.com
- VALIDATION=http
- TZ=America/Los_Angeles
- PUID=1000
- PGID=1000
ports:
- "443:443"
- "80:80"
mem_limit: 128m
wordpress:
build:
context: .
dockerfile: wordpress.Dockerfile
container_name: wordpress
hostname: wordpress
depends_on:
- db
restart: always
ports:
- "127.0.0.1:8080:80"
volumes:
- ./www/:/var/www/html/
- ./custom.ini:/usr/local/etc/php/conf.d/custom.ini
- ./mpm_prefork.conf:/etc/apache2/mods-available/mpm_prefork.conf
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: ${MYSQL_USER}
WORDPRESS_DB_PASSWORD: ${MYSQL_PASSWORD}
WORDPRESS_DB_NAME: ${MYSQL_DATABASE}
WORDPRESS_CONFIG_EXTRA: |
define( 'WP_MEMORY_LIMIT', '96M' );
mem_limit: 300m
db:
image: mysql:8.0
container_name: db
volumes:
- /var/lib/mysql:/var/lib/mysql
- ./mysql.cnf:/etc/mysql/conf.d/lowmem.cnf
restart: always
ports:
- "127.0.0.1:3306:3306"
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
mem_limit: 128m
Why
127.0.0.1on ports? Docker manipulates iptables directly, bypassing UFW. Without the127.0.0.1:prefix, ports 3306 and 8080 would be publicly accessible even if UFW blocks them. Binding to localhost ensures only local connections and the swag reverse proxy can reach these services.
Why
/var/lib/mysqlon the host? Mounting the MySQL data directory directly on the host (rather than in a named Docker volume) means the database survives container removal and is easy to access for backups viamysqldump.
wordpress.DockerfileA custom Dockerfile that pre-installs cron into the WordPress image. This avoids running apt-get install on every container restart, which is slow and fragile:
FROM wordpress:latest
RUN apt-get update && \
apt-get install -y --no-install-recommends cron && \
rm -rf /var/lib/apt/lists/*
RUN echo '* * * * * www-data php /var/www/html/index.php -- wpaicg_builder=yes' > /etc/cron.d/wp-cron && \
chmod 0644 /etc/cron.d/wp-cron
CMD ["sh", "-c", "cron && docker-entrypoint.sh apache2-foreground"]
default.conf (nginx with security headers)Redirects HTTP → HTTPS, proxies everything to the WordPress container, and adds a full set of security headers:
server {
listen 80;
listen [::]:80;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
root /var/www/html/example;
index index.html index.htm index.php;
server_name _;
include /config/nginx/proxy-confs/*.subfolder.conf;
include /config/nginx/ssl.conf;
client_max_body_size 64m;
# Security headers
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
proxy_hide_header X-Powered-By;
location / {
try_files $uri $uri/ /index.php?$args @app;
}
location @app {
proxy_pass http://wordpress;
proxy_set_header Host $host;
proxy_redirect off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Real-IP $remote_addr;
}
}
The security headers do the following:
| Header | What it does |
|---|---|
Strict-Transport-Security |
Forces browsers to always use HTTPS for your domain |
X-Content-Type-Options |
Prevents browsers from MIME-type sniffing (blocks attacks that disguise scripts as images) |
X-Frame-Options |
Prevents your site from being embedded in iframes on other sites (clickjacking protection) |
Referrer-Policy |
Controls how much URL info is sent when users click links to other sites |
Permissions-Policy |
Explicitly disables access to camera, microphone, and geolocation APIs |
proxy_hide_header X-Powered-By |
Strips the PHP version header — less info for attackers |
custom.ini (PHP overrides)file_uploads = On
memory_limit = 128M
upload_max_filesize = 64M
max_input_vars = 3000
post_max_size = 64M
max_execution_time = 600
mpm_prefork.conf (Apache worker limits)Apache's default settings spawn up to 150 workers. On a 1 GB VM each PHP worker uses ~30 MB, so the default would consume all available memory. Cap it at 4:
<IfModule mpm_prefork_module>
StartServers 2
MinSpareServers 1
MaxSpareServers 3
MaxRequestWorkers 4
MaxConnectionsPerChild 200
</IfModule>
For a personal or low-traffic site, 4 concurrent requests is plenty. If you start seeing 503 errors under load, raise MaxRequestWorkers and bump the mem_limit in docker-compose.yml.
mysql.cnf (MySQL 8.0 memory tuning)MySQL's defaults assume a dedicated server with gigabytes of RAM. These settings bring it down to ~40 MB idle on a shared 1 GB host:
[mysqld]
# InnoDB — default is 128M, 32M is plenty for a small WordPress site
innodb_buffer_pool_size = 32M
innodb_log_file_size = 8M
innodb_flush_method = O_DIRECT
# Disabling performance_schema saves ~400MB at default settings
performance_schema = OFF
# Reduce caches from their large defaults
table_open_cache = 64
thread_cache_size = 4
thread_stack = 256K
# Per-connection buffers (only allocated when in use)
read_buffer_size = 128K
read_rnd_buffer_size = 128K
sort_buffer_size = 256K
join_buffer_size = 256K
Note:
thread_stackmust be at least 256K for MySQL 8.0 (128K worked in 5.7 but causes stack overflows in 8.0). Thequery_cachesettings from MySQL 5.7 have been removed entirely — MySQL 8.0 dropped the query cache feature.
cd ~/mysite
sudo docker compose up -d
Watch the logs to make sure everything comes up:
sudo docker compose logs -f
On first start, swag will:
You should see mysqld: ready for connections in the db logs and then the WordPress container come up. Once swag shows Server ready, visit https://yourdomain.com.
If Let's Encrypt fails, check that your DNS A record has propagated and that ports 80/443 are open in GCP's firewall.
Navigate to https://yourdomain.com — you'll see the WordPress installation wizard.
You're done. Your site is live at https://yourdomain.com with a valid SSL certificate that renews automatically.
Get notified when backups fail or updates have issues. We'll use msmtp — a lightweight SMTP client that sends through Gmail.
sudo DEBIAN_FRONTEND=noninteractive apt install -y msmtp msmtp-mta
Create ~/.msmtprc:
defaults
auth on
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile ~/.msmtp.log
account gmail
host smtp.gmail.com
port 587
from [email protected]
user [email protected]
password YOUR_APP_PASSWORD_HERE
account default : gmail
chmod 600 ~/.msmtprc
Test it:
echo "Test alert from $(hostname)" | msmtp [email protected]
The msmtp-mta package creates a sendmail symlink, so the backup and auto-update scripts can use sendmail to send alerts without any additional configuration.
This backup system dumps MySQL daily and backs up all site files to a Google Cloud Storage bucket using duplicity (incremental backups, ~6 months of history).
In the GCP console:
mysite-backup-abc123)The first 5 GB of GCS storage is free per month. A WordPress backup set is typically well under that.
sudo apt install -y duplicity python3-pip gcsfuse
gcsfuse lets you mount the GCS bucket as a local filesystem so duplicity can write to it. Authentication uses the VM's service account automatically — no key file needed.
mkdir -p ~/backup-bucket # GCS mount point
mkdir -p ~/mysqldump
Save this as ~/backup and make it executable (chmod +x ~/backup). Replace YOUR_BUCKET_NAME and [email protected]:
#!/bin/bash
set -uo pipefail
#
# backup — daily backup for mysite
# Dumps MySQL, backs up ~/mysite to GCS via duplicity.
# Run as your regular user (NOT sudo) — gcsfuse needs user permissions.
# Schedule: 0 0 * * * ~/backup > ~/backup.log 2>&1
#
NOTIFY_EMAIL="[email protected]"
WD="$HOME"
BUCKET="YOUR_BUCKET_NAME"
BACKUP_DEST="file://$WD/backup-bucket/backups"
# Load database credentials from .env
source "$WD/mysite/.env"
log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*"; }
fail() {
log "ERROR: $*"
local msg="Backup failed on $(hostname) at $(date): $*"
if command -v sendmail &>/dev/null; then
printf "Subject: Backup FAILED\nTo: %s\n\n%s\n" "$NOTIFY_EMAIL" "$msg" \
| sendmail "$NOTIFY_EMAIL"
fi
mount | grep -q "$WD/backup-bucket" && fusermount -u "$WD/backup-bucket"
exit 1
}
log "Backup started"
# 1. Mount GCS bucket
if mount | grep -q "$WD/backup-bucket"; then
log "Already mounted."
else
gcsfuse "$BUCKET" "$WD/backup-bucket" || fail "gcsfuse mount failed"
fi
# 2. Dump MySQL
log "Dumping MySQL..."
mysqldump --opt -h localhost --protocol=tcp \
--user="root" --password="$MYSQL_ROOT_PASSWORD" \
"$MYSQL_DATABASE" > "$WD/mysqldump/database.sql" \
|| fail "mysqldump failed"
log "Dump size: $(du -sh $WD/mysqldump/database.sql | cut -f1)"
# 3. Clean up any incomplete previous backup
duplicity cleanup --force --no-encryption "$BACKUP_DEST" \
|| log "WARNING: cleanup returned non-zero (may be harmless)"
# 4. Incremental backup (full if last full is >1 month old)
log "Running duplicity backup..."
duplicity --progress --no-encryption \
--exclude "$WD/backup-bucket" \
--full-if-older-than 1M \
"$WD" "$BACKUP_DEST" \
|| fail "duplicity failed"
# 5. Prune old chains — keep 6 fulls (~6 months)
duplicity remove-all-but-n-full 6 --force --no-encryption "$BACKUP_DEST" \
|| log "WARNING: prune returned non-zero (may be harmless)"
# 6. Unmount
fusermount -u "$WD/backup-bucket" || log "WARNING: unmount failed"
log "Backup completed successfully"
Key improvements over a basic backup script:
set -uo pipefail — catches unset variables and pipe failures.env — no passwords hardcoded in the scriptsendmail (provided by msmtp)Important: Run the backup script as your regular user, not with sudo. Running as root causes gcsfuse permission issues because the mount point ownership changes.
Test it manually before scheduling:
~/backup
cat ~/backup.log
Automate WordPress, Docker, and OS updates with a weekly script. Save this as ~/auto-update and make it executable:
#!/bin/bash
set -uo pipefail
#
# auto-update — weekly WordPress, Docker, and OS updates
# Run as your regular user (NOT sudo).
# Schedule: 0 2 * * 0 ~/auto-update > ~/auto-update.log 2>&1
#
NOTIFY_EMAIL="[email protected]"
SITE_DIR="$HOME/mysite"
COMPOSE="docker compose -f $SITE_DIR/docker-compose.yml"
SITE_URL="https://yourdomain.com"
HAD_ERRORS=false
log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*"; }
warn() { log "WARNING: $*"; HAD_ERRORS=true; }
# Load database credentials from .env
source "$SITE_DIR/.env"
wpcli() {
docker run --rm \
-v "$SITE_DIR/www":/var/www/html \
--network mysite_default \
-e WORDPRESS_DB_HOST=db \
-e WORDPRESS_DB_USER="$MYSQL_USER" \
-e WORDPRESS_DB_PASSWORD="$MYSQL_PASSWORD" \
-e WORDPRESS_DB_NAME="$MYSQL_DATABASE" \
wordpress:cli wp --allow-root "$@"
}
# Pre-flight: verify Docker access
docker info &>/dev/null || { log "ERROR: Cannot access Docker. Is $USER in the docker group?"; exit 1; }
# Verify site is up before starting
curl -sf "$SITE_URL" > /dev/null || { log "ERROR: Site is down before updates — aborting"; exit 1; }
log "Auto-update started"
# 1. WordPress updates via WP-CLI
log "Updating WordPress core..."
output=$(wpcli core update 2>&1) && log "$output" || warn "Core update issue: $output"
log "Updating plugins..."
output=$(wpcli plugin update --all 2>&1) && log "$output" || warn "Plugin update issue: $output"
log "Updating themes..."
output=$(wpcli theme update --all 2>&1) && log "$output" || warn "Theme update issue: $output"
# 2. Health check after WordPress updates
if ! curl -sf "$SITE_URL" > /dev/null; then
warn "Site is DOWN after WordPress updates — skipping Docker/OS updates"
# Send alert and exit
if command -v sendmail &>/dev/null; then
printf "Subject: Auto-update FAILED — site down\nTo: %s\n\n%s\n" \
"$NOTIFY_EMAIL" "Site went down after WordPress updates. Check immediately." \
| sendmail "$NOTIFY_EMAIL"
fi
exit 1
fi
# 3. Docker image updates
log "Pulling Docker images..."
$COMPOSE pull 2>&1 | while read -r line; do log "$line"; done
log "Recreating containers..."
$COMPOSE down && $COMPOSE up -d --build
sleep 15
# 4. OS updates
log "Running apt upgrade..."
sudo apt update -qq && sudo apt upgrade -y -qq 2>&1 | while read -r line; do log "$line"; done
# 5. Clean up
log "Pruning unused Docker images..."
docker image prune -f 2>&1 | while read -r line; do log "$line"; done
# 6. Send summary email
SUBJECT="Auto-update complete"
$HAD_ERRORS && SUBJECT="Auto-update complete (WARNINGS)"
if command -v sendmail &>/dev/null; then
{
printf "Subject: %s\nTo: %s\n\n" "$SUBJECT" "$NOTIFY_EMAIL"
cat ~/auto-update.log
} | sendmail "$NOTIFY_EMAIL"
fi
log "Auto-update finished"
crontab -e
Add:
# Daily backup at midnight
0 0 * * * /home/YOUR_USERNAME/backup > /home/YOUR_USERNAME/backup.log 2>&1
# Weekly auto-update: Sundays at 2am
0 2 * * 0 /home/YOUR_USERNAME/auto-update > /home/YOUR_USERNAME/auto-update.log 2>&1
Important: Both scripts must run as your regular user (not root). Your user must be in the docker group (sudo usermod -aG docker $USER).
sudo docker compose -f ~/mysite/docker-compose.yml ps
sudo docker stats --no-stream
sudo docker compose -f ~/mysite/docker-compose.yml logs --tail=50 db
sudo docker compose -f ~/mysite/docker-compose.yml logs --tail=50 wordpress
sudo docker compose -f ~/mysite/docker-compose.yml logs --tail=50 swag
sudo docker compose -f ~/mysite/docker-compose.yml restart wordpress
Easiest via the admin dashboard at https://yourdomain.com/wp-admin.
For command-line updates using WP-CLI (runs as a temporary container — nothing to install):
wpcli() {
sudo docker run --rm \
-v ~/mysite/www:/var/www/html \
--network mysite_default \
-e WORDPRESS_DB_HOST=db \
-e WORDPRESS_DB_USER=wp_db_user \
-e WORDPRESS_DB_PASSWORD=YOUR_APP_DB_PASSWORD \
-e WORDPRESS_DB_NAME=wp_db \
wordpress:cli wp --allow-root "$@"
}
wpcli core version
wpcli core update
wpcli plugin update --all
wpcli theme update --all
# Pull latest images and rebuild
sudo docker compose -f ~/mysite/docker-compose.yml pull
sudo docker compose -f ~/mysite/docker-compose.yml down
sudo docker compose -f ~/mysite/docker-compose.yml up -d --build
# Clean up old images
sudo docker image prune -f
To restore the database from the latest backup:
# Mount bucket
gcsfuse YOUR_BUCKET_NAME ~/backup-bucket
# Extract the database dump
duplicity restore \
--no-encryption \
--file-to-restore mysqldump/database.sql \
file://$HOME/backup-bucket/backups \
/tmp/database.sql
# Import it
mysql -h localhost --protocol=tcp -u root -pYOUR_ROOT_DB_PASSWORD wp_db < /tmp/database.sql
To restore WordPress files or restore from a specific date, swap in the appropriate --file-to-restore path and add --time "2025-06-01".
Let's Encrypt certificates renew automatically inside the swag container. No action needed. To check renewal status:
sudo docker logs swag 2>&1 | grep -i "cert\|renew\|expire" | tail -10
sudo apt update && sudo apt upgrade -y
# Check if a reboot is required
[ -f /var/run/reboot-required ] && echo "REBOOT NEEDED" || echo "No reboot needed"
# If a kernel update was installed — containers restart automatically via restart: always
sudo reboot
The e2-micro has 1 GB RAM. Here's how it's allocated at idle:
| Component | Idle usage | Hard limit |
|---|---|---|
| OS + Docker daemon | ~200 MB | — |
| swag (nginx) | ~42 MB | 128 MB |
| wordpress (Apache + PHP) | ~142 MB | 300 MB |
| db (MySQL 8.0) | ~58 MB | 128 MB |
| Total | ~442 MB | ~756 MB |
This leaves ~250 MB of headroom before the 1 GB ceiling. Under load, Apache spawns up to 4 PHP workers (capped by mpm_prefork.conf), each using ~30 MB — so peak WordPress memory is around 250 MB, still under the 300 MB container limit.
If a container ever exceeds its mem_limit, the kernel OOM-kills it and Docker immediately restarts it (restart: always). Check with sudo docker stats --no-stream if the site feels slow.
The three biggest memory levers, in order of impact:
performance_schema = OFF in mysql.cnf — saves up to 400 MBMaxRequestWorkers 4 in mpm_prefork.conf — caps Apache worker countinnodb_buffer_pool_size = 32M in mysql.cnf — cuts InnoDB cache from 128 MB# Check if the db container is running
sudo docker compose -f ~/mysite/docker-compose.yml ps
# If it's missing, start it
sudo docker compose -f ~/mysite/docker-compose.yml up -d db
# Check db logs for errors
sudo docker compose -f ~/mysite/docker-compose.yml logs --tail=30 db
# Test connection directly
mysql -h 127.0.0.1 -P 3306 -u root -pYOUR_ROOT_DB_PASSWORD -e "SELECT 1;"
dig +short yourdomain.com should return a Cloudflare IPsudo docker compose logs swag# Check memory — is any container near its limit?
sudo docker stats --no-stream
# Check Apache worker count inside the wordpress container
sudo docker exec wordpress apache2ctl status
If memory is tight, the safest fix is to upgrade the VM to e2-small (2 GB RAM, ~$17/month) rather than loosening the memory caps.
# Check for PHP errors
sudo docker logs wordpress 2>&1 | grep "PHP Fatal" | tail -10
# Disable the offending plugin by renaming its directory
sudo mv ~/mysite/www/wp-content/plugins/PLUGIN_NAME{,.disabled}
# Restart WordPress
sudo docker compose -f ~/mysite/docker-compose.yml restart wordpress
Most likely you ran it with sudo. The backup script must run as your regular user — gcsfuse mounts with user-level permissions that break when root takes over:
# Wrong
sudo ~/backup
# Right
~/backup
Docker manipulates iptables directly, bypassing UFW. If you expose a port in docker-compose.yml without the 127.0.0.1: prefix, it's publicly accessible regardless of UFW rules. Always bind non-public ports to localhost:
# Bad — publicly accessible even with UFW blocking 3306
ports:
- "3306:3306"
# Good — only accessible from the host
ports:
- "127.0.0.1:3306:3306"
]]>The most common type of charitable nonprofit organization is a 501(c)(3) organization, also known as a public charity. These organizations are exempt from federal income tax and are eligible to receive tax-deductible donations. The most common type of 501(c)(3) organizations are those that focus on providing education, health care, social services, or other types of charitable work.
For small starting organizations, the actual fees for starting a nonprofit can be relatively low, especially if the organization takes advantage of online filing options and does not require extensive legal or tax services. However, it’s important to keep in mind that even small nonprofits must still comply with all applicable laws and regulations, and it may be necessary to invest in professional services to ensure compliance and ensure the long-term success of the organization.
| Fee | Description | Amount |
|---|---|---|
| Domain name registration | Fees for registering a domain name for the nonprofit’s website | $10 per year |
| Secretary of State name reservation fee (optional) | Fees for reserving the name of the nonprofit with the California Secretary of State | $10 |
| State filing fee (online) | Filing fee for registering the nonprofit with the California Secretary of State (online) | Free |
| State filing fee (paper copy) (optional) | Filing fee for registering the nonprofit with the California Secretary of State (paper copy) | $5 |
| Employer Identification Number (EIN) | Federal tax ID number required for opening a bank account and filing taxes | Free |
| Bank account setup | Fees for opening a business bank account for the nonprofit | Free |
| Form 1023 filing fee | Filing fee for obtaining tax-exempt status from the IRS | $0 (for most small nonprofits) or $600 |
| California Franchise Tax Board fee | Filing fee for obtaining tax-exempt status from the California Franchise Tax Board | $25 |
| Filing a Statement of Information (Form SI-100) | For providing updated information about your nonprofit to the California Secretary of State. You have 90 days to do this. | $20, every two years |
How are you going to help? Your business may not engage in political activities and must not overcompensate its members. For Example:
“Our mission is to empower youth in underserved communities by providing access to education, mentorship, and leadership development opportunities. We believe that every young person has the potential to succeed and make a positive impact in their communities, and we strive to create a supportive and inclusive environment that helps them achieve their goals. Through our programs and partnerships, we aim to break down barriers to success and create a more equitable and just society for all.”
The Nonprofit Startup Assessment Tool is a resource provided by Candid, a nonprofit organization that provides tools and information for nonprofits and philanthropy. The tool is designed to help individuals and organizations that are considering starting a nonprofit understand the steps and considerations involved in the process.
To access the tool, simply follow the link below and scroll down to the “Nonprofit Startup Resources” section. From there, you can click on the “Startup Assessment Tool” link to begin the assessment. The tool will walk you through a series of questions about your organization and provide customized guidance based on your responses.
https://learning.candid.org/resources/nonprofit-startup-resources/
Remember that the tool is just a starting point, and there are many other resources available to help you start and run a successful nonprofit. Good luck on your nonprofit journey!
Looking for expert guidance in starting or growing your nonprofit organization? SCORE.org can help! 
SCORE is a national nonprofit organization that provides free mentoring services to small business owners and entrepreneurs, including those in the nonprofit sector. Their experienced mentors can offer valuable insights and guidance on a wide range of topics, from business planning and fundraising to marketing and strategic growth.
To request a mentor for your nonprofit organization, simply visit their website and fill out the Mentor Request Form. This form will help pair you with the best mentor based on your specific needs and goals.
Don’t navigate the world of nonprofit entrepreneurship alone – let SCORE help you achieve your goals! Contact them today to get started. 

Visit their website to learn more and fill out the form: https://www.score.org/find-mentor/request-mentor
A nonprofit ecosystem blueprint is like a business model canvas for nonprofits 
It helps break down key components such as
value proposition,
target beneficiaries,
key activities,
revenue streams and
partnerships. This helps develop a more comprehensive understanding of the organization and create a clear vision, well-designed strategy, and necessary resources to achieve your goals.
| Category | Description |
|---|---|
| KEY PARTNERS | List of organizations, gov’t offices, or individuals to partner with |
| PROGRAMMING | Details on the programming provided to fulfill the mission |
| ORGANIZATIONAL VALUE | Explanation of why the organization is uniquely suited to fulfill its mission and the problems it’s trying to solve |
| CONSUMER RELATIONSHIPS | Strategies for finding consumers to access the programming |
| CONSUMER SEGMENTS | Description of the key demographic for the programming |
| KEY RESOURCES | Physical space, staff, and tools needed to fulfill the mission |
| OUTREACH | Strategies for marketing the organization to consumers and funders |
| COST STRUCTURE | Description of the most expensive elements of the organization and costs that vary with consumer volume |
| FUNDING | Overview of the organization’s funding sources, including committed funding, grants, contracts, and consumer payments |
Check out this free PDF template to create your own nonprofit ecosystem blueprint: https://drive.google.com/file/d/1mL7Y2UI-Axr50HB95T2imbid9TC5gc1O/view?usp=sharing
This is a presentation: https://prezi.com/wwlfmc-poqfn/nonprofit-ecosystem-blueprint/#
Creating a nonprofit ecosystem blueprint can help you communicate your organization’s vision and strategy to stakeholders and ensure that you have a clear path forward for success. 
: Make sure the name you choose is not already in use by another organization in California by checking the California Secretary of State’s database:
: If the name you’ve chosen is available, you can reserve it with the California Secretary of State by filing a name reservation request. This will prevent someone else from using the same name while you’re completing the other steps in creating your nonprofit. The fee for reserving a name in California is currently $10.00.

File the Articles of Incorporation with the California Secretary of State
: To officially create your Nonprofit Public Benefit Corporation in California, you’ll need to file Articles of Incorporation with the California Secretary of State. The Articles of Incorporation must include specific information about your nonprofit, including its name, purpose, and the names and addresses of the incorporators. You can find the form for the Articles of Incorporation on the California Secretary of State’s website:
https://www.sos.ca.gov/business-programs/business-entities/forms/
Once you’ve completed the Articles of Incorporation and submitted them along with the required fee to the California Secretary of State, your Nonprofit Public Benefit Corporation will be officially recognized in California.
The next steps are:
: Your nonprofit will need an EIN, also known as an Employer Identification Number, in order to open a bank account, file taxes, and engage in other financial transactions. You can obtain an EIN from the IRS for free by completing Form SS-4: https://www.irs.gov/forms-pubs/about-form-ss-4 or online at https://sa.www4.irs.gov/modiein/individual/index.jsp
: Once you have obtained an EIN, you can open a bank account for your nonprofit. You’ll need to provide the bank with your nonprofit’s name, EIN, and formation documents, as well as the names and addresses of the individuals who will have signing authority on the account.
: To be recognized as a tax-exempt nonprofit by the IRS, you’ll need to file for tax-exempt status. The type of form you’ll need to file will depend on the type of nonprofit you’re forming, but the most common form for a 501(c)(3) organization is Form 1023:
: If your nonprofit is exempt from federal income tax, you may also be exempt from paying the annual franchise tax fee in California. To claim this exemption, you’ll need to file for tax-exempt status with the California Franchise Tax Board. The fee for filing for tax-exempt status with the California Franchise Tax Board is $25.00. You can find more information on the process of obtaining tax-exempt status in California, including the required forms and fees, on the California Franchise Tax Board website: Note: Charitable organizations that are exempt from federal income tax under section 501(c)(3) of the Internal Revenue Code and that have annual gross receipts that are normally less than or equal to $50,000
are exempt from the $800 state tax minimum, but you must file an exemption detailed above.
Step 2 in creating a nonprofit organization in California involves establishing the governance structure of your nonprofit. This includes creating bylaws and electing a board of directors. Here are the steps involved in step 2:
: Bylaws are the internal rules and regulations that govern the operation of your nonprofit. They outline the responsibilities of the board of directors, the duties of the officers, and the procedures for conducting meetings, voting, and making decisions. You can find sample bylaws for nonprofits online or work with an attorney to draft custom bylaws for your organization.
: The board of directors is the governing body of your nonprofit. It is responsible for setting policies, making decisions, and overseeing the operations of the organization. The size of the board, the qualifications for serving on the board, and the terms of office for directors are all outlined in the bylaws.
: After the bylaws have been adopted and the board of directors has been elected, the board should hold an organizational meeting to adopt policies, elect officers, and make any other decisions necessary to begin the operations of the nonprofit.I can provide you with a step-by-step explanation of filing annual reports for a nonprofit in California:
It is important to note that the annual report is a critical document for maintaining a nonprofit’s good standing with the state. Filing the report on time and with accurate information is essential to preserving the organization’s tax-exempt status. More info here: https://calnonprofits.org/resources/nonprofit-compliance-checklist and here: https://www.irs.gov/pub/irs-pdf/p4221pc.pdf
Filing your first tax return as a nonprofit can be a complex process, but with the right preparation and guidance, it can be manageable. Here is a step-by-step guide to help you file your first tax return as a nonprofit:
By following these steps, you can successfully file your first tax return as a nonprofit and maintain your tax-exempt status. It’s important to note that the specific requirements and procedures may vary depending on the specifics of your organization, so it’s always a good idea to consult with a professional or an attorney to ensure that you are meeting all the necessary requirements.
The Community Foundation of Nevada County
https://www.nevcofoundation.org/
is a nonprofit organization that supports community organizations, schools, and individuals in the Nevada County area of California. 


Sierra Small Business Development Center’s webinars! https://www.sierrasbdc.com/webinars/ Sierra SBDC offers a variety of free online webinars that cover topics such as business planning, social media marketing, and financial management. These webinars are designed to help small business owners and entrepreneurs develop the knowledge and skills they need to succeed. With expert instructors and a wealth of practical insights, Sierra SBDC’s webinars are a great way to stay up-to-date with the latest best practices and trends. Visit their website to see the upcoming schedule and register for a webinar today! 

https://calnonprofits.org/
: The California Association of Nonprofits provides advocacy, resources, and training to help nonprofits succeed in California.
https://ncg.org/
: Northern California Grantmakers provides resources and support to help nonprofits in Northern California.
https://www.philanthropyca.org/
: Philanthropy California provides resources and support to help nonprofits and foundations in California.
https://www.lawfoundation.org/
: The Law Project of Silicon Valley provides legal services and support to help nonprofits and other community organizations.
https://www.cvnl.org/
: The Center for Volunteer & Nonprofit Leadership provides training, resources, and support to help nonprofits in Northern California.
https://svcn.org/
: The Silicon Valley Council of Nonprofits provides advocacy, resources, and support to help nonprofits in the Silicon Valley region.
https://cnmsocal.org/
: The Center for Nonprofit Management provides training, resources, and support to help individuals and organizations start and manage nonprofits in Southern California. They offer a variety of resources and services, including in-person training, consulting, and online resources.These are just a few examples of nonprofits that offer resources and support to help people start and run nonprofits in California. The specific resources and services offered may vary, but these organizations can be a helpful starting point for those seeking support in California.
https://candid.org/
: Candid (formerly known as GuideStar and Foundation Center) is a nationwide nonprofit that provides resources and tools to help individuals and organizations start and manage nonprofits. They offer a variety of training and support programs, including webinars, in-person workshops, and a library of online resources.
https://www.score.org/
: SCORE is a national nonprofit that provides mentoring and resources to help small businesses and nonprofits succeed. They offer free workshops, mentoring, and online resources to help people start and grow nonprofits.
https://www.nonprofitready.org/
: Nonprofit Ready is an online platform that provides free training and resources to help individuals and organizations build and strengthen their nonprofits. They offer courses on topics such as fundraising, board governance, and financial management.
https://taprootfoundation.org/
: Taproot Foundation is a nonprofit organization that connects skilled volunteers with other nonprofits in need of pro bono services. From website design to marketing strategy, Taproot volunteers offer their expertise to help organizations make a bigger impact. Whether you’re a professional looking to give back or a nonprofit in need of support, Taproot Foundation is a fantastic resource. Visit their website to learn more and get involved! 

https://www.hurwitassociates.com/
:Hurwit & Associates is a leading law firm that specializes in nonprofit law, and their Q&A page is a great resource for anyone looking to start a nonprofit foundation. The page covers a wide range of topics, including incorporation, tax-exempt status, fundraising, and governance.The Q&A format is user-friendly and provides clear, concise answers to some of the most common questions about starting up a nonprofit foundation. Whether you’re just getting started or looking to refine your existing foundation, Hurwit & Associates’ Q&A page is a valuable resource to have on hand. 

https://www.nten.org/
: The Nonprofit Technology Network provides resources, training, and support to help nonprofits use technology effectively. They offer a variety of resources and tools, including webinars, online courses, and an annual conference.
https://www.councilofnonprofits.org/
: The National Council of Nonprofits is a nationwide nonprofit that provides advocacy, education, and resources to help nonprofits thrive. They offer a variety of resources and guides on topics such as starting a nonprofit, fundraising, and board governance.
https://independentsector.org/
: Independent Sector is a national nonprofit that provides advocacy, resources, and support to help nonprofits succeed. They offer a variety of resources and tools, including research, policy analysis, and webinars.
https://boardsource.org/
: BoardSource is a national nonprofit that provides training, resources, and support to help nonprofit boards and board members. They offer a variety of resources and tools, including online courses, publications, and consulting services.
https://nff.org/
: The Nonprofit Finance Fund provides financing, consulting, and support to help nonprofits achieve financial sustainability. They offer a variety of financial products and services, including loans, lines of credit, and financial management consulting.
https://www.unitedway.org/
: United Way is a national nonprofit that provides resources and support to help individuals and organizations create positive community change. They offer a variety of programs and initiatives, including fundraising campaigns, community engagement programs, and advocacy efforts.The types of support and resources provided by these nonprofits vary, and not all of the support may be free. Some nonprofits may offer free resources and services, while others may charge a fee for certain programs or services.
For example, some of the resources and training offered by Foundation Center, Nonprofit Ready, and TechSoup are free of charge. Others, such as consulting services or in-depth training programs, may have a fee associated with them.
It’s important to research each nonprofit and the specific resources or programs they offer to determine if there are any associated costs. Some nonprofits may offer scholarships or other forms of financial assistance to help cover the costs of their programs or services.
In general, many nonprofits that offer support to help people start and run nonprofits are committed to providing accessible resources and services to help strengthen the nonprofit sector, so it’s worth exploring the available options to find the best fit for your organization and budget.
https://www.canva.com/design/DAEBTDbDsFc/IJ698pBYbkcK4rbGdb3Lkw/view#1
https://learning.candid.org/resources/knowledge-base/starting-a-nonprofit/
https://www.score.org/philadelphia/resource/article/nonprofit-resources
]]>
: A resource for finding volunteer opportunities in your local community. People are looking for ways to give back to their community and make a positive impact, some may consider checking out their local volunteer center. These organizations provide a wealth of resources and opportunities for volunteers, including information on local volunteer opportunities, resources for volunteer management and coordination, and training and support for volunteers. To find your local volunteer center, simply search online for “local volunteer center” followed by the name of your city or region.
: Free access from your local library.This is not an exhaustive list, nor is it sorted in any particular order. Although, the ones at the top are more generally useful to the nonprofit. Many of them use techsoup.org to verify nonprofit eligibility.
: A nonprofit digital consultancy with resources and expertise available for free. Whole Whale is a nonprofit digital consultancy that provides a range of resources and expertise to organizations looking to maximize their impact through technology. From website design and development to data analysis and strategy, Whole Whale provides nonprofits with the tools and support they need to succeed in the digital age. And the best part? Their resources and expertise are available for free. To learn more about Whole Whale and how they can help your nonprofit, visit https://wholewhale.com/.
: An email marketing platform with a free plan for nonprofits. Mailchimp offers a range of features including email design templates, automation, and analytics. Nonprofits can send up to 12,000 emails to 2,000 subscribers per month for free. Check it out at: https://mailchimp.com/
: A comprehensive marketing, sales, and customer service platform with a free nonprofit plan. Hubspot offers a range of features including website builder, email marketing, and a CRM. Nonprofits can access all the tools for free, with no time limits or restrictions. Learn more at: https://www.hubspot.com/
: A social media management tool with a free plan for nonprofits. Buffer allows nonprofits to schedule, publish, and analyze posts on multiple social media platforms from one place. Nonprofits can access the basic plan for free, including support for three social media profiles. Get started at: https://buffer.com/
: An AI-powered tool for transcribing and recording meetings, available for free to nonprofits. Otter.ai uses AI to transcribe and organize audio and video recordings in real-time. Nonprofits can access 600 minutes of transcription per month for free. Find out more at: https://otter.ai/
: A fundraising platform that is free for nonprofits to use. Givelively offers a range of features including online fundraising pages, donation processing, and donor management. Nonprofits can use the platform for free, with no transaction fees or hidden costs. Get started at: https://www.givelively.org/
: A platform for organizing volunteer events and campaigns, available for free to nonprofits. Mobilize makes it easy for nonprofits to recruit, manage, and mobilize volunteers. Nonprofits can use the platform for free, with no limits on the number of volunteers or events. Sign up at: https://mobilize.us/
: A professional networking platform with a free nonprofit account. LinkedIn is a platform designed for professional networking, connecting millions of professionals from around the world. Nonprofits can take advantage of LinkedIn’s free nonprofit account, which provides access to a wealth of resources and tools to help organizations build their online presence and connect with potential supporters, partners, and collaborators. To learn more about the free nonprofit account offered by LinkedIn, visit https://business.linkedin.com/non-profits.
: A project management tool with a free plan for nonprofits.ClickUp is a comprehensive project management tool that can help organizations of all sizes streamline their workflows and collaborate more effectively. The tool is available for free to nonprofits, offering a range of features and tools to help organizations stay organized and on track, including task management, project tracking, and team collaboration. To learn more about ClickUp and how it can help your nonprofit, visit https://clickup.com/.
: A website design and development platform that offers a free plan for nonprofits. With Webflow, nonprofits can create beautiful, functional websites without having to write code. Nonprofits can take advantage of Webflow’s intuitive design tools, extensive design library, and customizable templates to create a website that meets their unique needs. To get started with Webflow, visit https://webflow.com/
: A code editor and development environment that is available for free to nonprofits. Codesandbox provides a collaborative environment for developers to create and test their code, making it easier for nonprofits to build and maintain their websites and applications. To access Codesandbox, go to https://codesandbox.io/
: A screen and camera recording tool with a free plan for nonprofits. Loom is a screen and camera recording tool that makes it easy to capture and share video content with others. The tool is available for free to nonprofits, providing organizations with a convenient and affordable way to create and share videos for a variety of purposes, including fundraising, marketing, and community engagement. To learn more about Loom and how it can help your nonprofit, visit https://www.loom.com/.
https://www.charitynavigator.org/You don’t pay taxes on communication services if you are certain type of nonprofit.
ewaste drives
https://www.idealist.org/en/fundraising-resources/free-or-low-cost-services
]]>Preparation:
Steps:
More Reading:
Note: This guide assumes that you have already signed up for a Gmail account and Cloudflare account.
Email security is important to protect your organization from phishing attacks and email fraud. There are several email security features that you can enable for your custom domain, including DNSSEC, SPF, DKIM, and DMARC. DNSSEC is a security protocol that authenticates DNS data and can help prevent DNS spoofing attacks. SPF is a security protocol that helps to prevent email spoofing by verifying that email messages come from authorized senders. DKIM is a security protocol that uses digital signatures to verify the authenticity of email messages. DMARC is a security protocol that helps to prevent email spoofing by verifying the alignment of SPF and DKIM policies. Enabling these email security features for your custom domain can help to protect you from email fraud and phishing attacks. As well as make sure that your legitimate email is not marked as spam.

Sign up for a free gmail.com account. Google has the best deliverability, and spam filters in my experience. I’d recommend signing up for cloudflare.com as well. They have the lowest cost domain registration as well. $8/year. They have a really good free account for everything else. They can help you set up the below domain, and email settings:
https://help.17hats.com/en/articles/865530-how-to-ensure-emails-do-not-end-up-in-spam
]]>
The new Broadband Map website maintained by the Federal Communications Commission (FCC) is an online tool that allows users to search and compare broadband internet availability and speeds at their specific address. The website provides a wealth of information related to broadband connectivity, including information on broadband providers, types of service available, and connection speeds. Be sure to dispute any carrier that is on this map, but can’t provide you service. Be sure to check that out: https://broadbandmap.fcc.gov/home
https://www.nevadacountyca.gov/CivicAlerts.aspx?AID=6430
Great news for residents of Nevada County, California! The county is set to streamline compliance with the California Environmental Quality Act (CEQA) to remove barriers and accelerate broadband development, with the final environmental impact report set to be presented before the Board of Supervisors on 28 February. The countywide report, available from 10 February, aims to speed up the granting of federal and state funds to individual fibre projects. The county said construction of the latter could start as early as spring 2023.
For those interested in accessing the programmatic FEIR, it can be found on the Nevada County Community Development Agency’s website at https://www.nevadacountyca.gov/513/Projects-Supporting-Documents. The PDF report can be directly accessed at https://www.nevadacountyca.gov/DocumentCenter/View/47183/Broadband-Program-Final-Environmental-Impact-Report.
To stay informed on the latest broadband news, residents can sign up for the Broadband in Nevada County Newsletter at https://www.mynevadacounty.com/broadband. For any questions, concerns, or opportunities to bring service to undeserved areas, connect with the county via email at [email protected]. 

The FCC launched a new program called the Affordable Connectivity Program (ACP) on December 31, 2021. The ACP is a new $14.2 billion program that is part of the Consolidated Appropriations Act of 2021. It is designed to provide low-income households with affordable broadband internet service and connected devices, such as laptops or tablets.
The ACP replaces the Emergency Broadband Benefit program that was launched earlier in 2021. It expands the scope of the Emergency Broadband Benefit program by providing a more comprehensive set of benefits to eligible households. Specifically, the ACP provides eligible households with a $30 monthly discount on broadband service and up to $100 off a connected device, such as a laptop or tablet. The program also covers the cost of installation and provides ongoing technical support to help ensure that households are able to take advantage of the benefits provided by the program.
Eligibility for the ACP is based on income and participation in certain assistance programs, such as Medicaid or the Supplemental Nutrition Assistance Program (SNAP). Eligible households can enroll in the program through participating broadband providers or directly through the ACP website.
The goal of the ACP is to provide affordable and reliable broadband internet access to low-income households, thereby helping to bridge the digital divide and promote greater economic opportunity and social equity. The program is expected to provide critical support to millions of households across the United States and help to ensure that they have access to the tools and resources needed to participate fully in the digital economy.
TREELINK Fixed Wireless – Looking for affordable internet? Check out Treelink’s distributed mesh fixed wireless! 
They offer a $0 plan with ACP eligibility. Sign up at http://treelink.us/ to enjoy internet connectivity. Treelink uses Althea blockchain technology to make internet available to residents near Nevada City. The service area uses ADI (AT&T Dedicated Internet), and Comcast as exit nodes. 

AT&T DSL – Get connected to the internet with DSL ATT! 
With ACP eligibility, you can get their $0 plan and enjoy reliable internet connectivity. Check out their offerings at https://www.att.com/help/affordable-connectivity-program/. 
PCSFORPEOPLE LTE Cellular – Get affordable internet and technology options from @pcsforpeople! 
They offer mobile hotspot-based internet service using the
T-Mobile network, with unlimited 4G LTE and up to 23GB/month of high-speed prioritized data. After 23GB, heavy data users may experience slower speeds due to data deprioritization. Plus, you can snag a laptop for just $10
www.pcsforpeople.org.
List is sorted by relative speed, and type.
Pros:
Cons:
| Provider | Service Area | Notes | Signup Link |
|---|---|---|---|
| AT&T ABF | Metro | Shared: Best option if available. | N/A |
| AT&T ADI/MIS | Most places | Dedicated: Very expensive. | N/A |
| Vast Networks | Coverage map | Middle-mile project funded by ARRA, can be better price than ADI. Not sure about last mile. | https://vastnetworks.com/ |
| Race Communications | Hwy 174 to Airport in Grass Valley | Goes down often, well priced. Speeds are much slower than advertised. | https://www.race.com/ |
| Newtown Fiber | Newtown Rd. | N/A | |
| Nevada County Fiber | Banner Mountain | Accepts ACP. | https://www.nevcofiber.com/ |
| Northern Sierra BBP | Buck Mountain Road, Oak Drive, Arianna Court, Sunset View Court, and Mountain Park | The Northern Sierra Broadband Project (Not built yet) | N/A |
| Spiral Fiber | North of Nevada City limits | (Not built yet) | https://www.spiral.com/ |
| Plumas Sierra | Truckee | https://www.plumassierratelecom.com/ |
Pros:
Cons:
| Provider | Service Area | Notes | Signup Link |
|---|---|---|---|
| Comcast (Xfinity) | Grass Valley, Nevada City, Penn Valley areas | https://www.xfinity.com/ | |
| Comcast Business | Same as above | https://business.comcast.com/ | |
| SuddenLink | Alta Sierra, parts of south county, Truckee areas | https://www.suddenlink.com/ |
Pros:
Cons:
| Provider | Service Area | Notes | Signup Link |
|---|---|---|---|
| Treelink | Outside of Nevada City | Althea Distributed mesh. Uses ADI (AT&T Dedicated Internet) and Comcast as exit nodes. | https://treelink.us/ |
| Digital Path | Western Nevada County up to 5-Mile House | No data limits. | https://digitalpath.net/ |
| Smarter Broadband | Some parts of Western Nevada County | https://www.smarterbroadband.net/ | |
| Succeend.net | Lake Wildwood? | https://www.succeed.net/ | |
| Exwire | Truckee? | https://www.exwire.com/ | |
| Colfax.net | Colfax & parts of Hwy 174 area to Grass Valley | https://www.colfax.net/ | |
| GoSkyWest | Lime Kiln, McCourntney, Wolf Rd., and more | https://goskywest.com/ |
Pros:
Cons:
| Provider | Service Area | Notes | Signup Link |
|---|---|---|---|
| Starlink | Current round is sold out in our area. RV edition also sold out in our area. | https://www.starlink.com/ |
Pros:
Cons:
| Provider | Service Area | Notes | Signup Link |
|---|---|---|---|
| AT&T | Not available yet in our area | N/A | |
| T-Mobile | Not available yet in our area | N/A | |
| Verizon | Not available yet in our area | N/A |
Pros:
Cons:
| Provider | Service Area | Notes | Signup Link |
|---|---|---|---|
| Verizon | Hotspot | https://www.verizon.com/ | |
| AT&T | Hotspot | https://www.att.com/ | |
| T-Mobile | Hotspot | https://www.t-mobile.com/ |
Pros:
Cons:
| Provider | Service Area | Notes | Signup Link |
|---|---|---|---|
| AT&T Internet | Grass Valley, Nevada City, Penn Valley, Truckee | Digital Pair Gain from a fiber connected terminal. ACP eligible. | N/A |
Pros:
Cons:
| Provider | Service Area | Notes | Signup Link |
|---|---|---|---|
| Viasat | Also known as Exede or Wildblue. Viasat-2 satellite launched in 2017. Viasat-3 satellites in development. | https://www.viasat.com/internet | |
| HughesNet | https://www.hughesnet.com/ | ||
| Skycasters | VSAT services for enterprise and government customers. | https://www.skycasters.com/ |
As you can see, https://www.nevadacountyca.gov/1460/Local-Broadband-Providers-Coverage-Maps, needs some updating.
California coverage map: https://www.broadbandmap.ca.gov/
Federal coverage map: https://broadbandmap.fcc.gov/.
(Hopefully, this should be more accurate by the end of Summer 2020: https://www.benton.org/blog/congress-tells-fcc-fix-broadband-maps-now)
Many in Nevada County live outside the city centers. Combined with the varied terrain, and heavy forests. This makes finding a reliable and fast internet connection sometimes exceedingly difficult.
Broadband internet is currently defined by the FCC as 20Mbps down and 3Mbps up with latency of less than 100ms. More recently it has been mentioned by California as 25Mbps down and 25Mbps up with latency suitable for real time interaction.
Only Fiber and Cable offer upload speeds that high. Fixed wireless, and occasionally 4G LTE Cellular can offer adequate download speeds. If possible, Fiber and Cable are the top choices for speed and reliability. There are many areas in Nevada County that do not have any internet options or can only access internet over unreliable high latency satellite, cellular or wireless connections. This is a huge issue. Part of the problem is that many ISPs (Internet Service Providers) are misreporting areas served. Or, reporting that they serve the whole block if they serve a single house within the block. Also, many ISPs try to block new companies or municipalities from serving these misreported areas. As well as cause problems for new ISPs getting grants.
https://gizmodo.com/new-report-suggests-fcc-massively-overstated-gigabit-co-1845842681
There are currently many grants, and bills in the works to expand broadband into rural areas like Nevada County. Much of this is overseen by The California Public Utilites Commision (CPUC): https://www.cpuc.ca.gov/Communications/
Using the California Coverage Map, you can see which areas are supposedly served, and what speeds you should get. You can also see which areas are eligible for two of these grant programs; the California Advanced Services Fund (CASF) Infrastructure Grant, and the Connect America Fund Phase II. The CASF has a local presence through the Sierra Business Council called the Gold Country Broadband Consortium. Nevada County has a page with some of the projects they have worked on regarding to broadband
here: https://www.mynevadacounty.com/1433/The-Countys-Role.
The rural digital opportunity fund is also in the works. There are may be some more grants coming with this bill too:
https://www.engadget.com/house-approves-100-billion-broadband-funding-010021883.html
More recently there have been a bunch of reverse auctions by the FCC to disburse grant funds. The newest round of rural broadband grant winners interactive map: https://experience.arcgis.com/experience/0b324cabf7b94d9ca34caa9361122d94/
Some info from: https://www.nevadacountyconnected.com/wp-content/uploads/2019/05/NevadaCounty-InternetAccess-June2019.pdf
Here is a spreadsheet of the above data: https://docs.google.com/spreadsheets/d/1-zEAGucrrkgLL9jWyW8w2XvtHmrJuvMNb9PwUQsrHAU/edit?usp=sharing
Also check out this http://www.nevadacountyconnected.com/broadband-pricing.
More reading: https://thesungazette.com/article/news/2020/05/06/rural-residents-are-left-disconnected/
http://www.internetforallnow.org/
asfi sheheen http://netequity.net