Coolify out of disk space

Coolify is an open-source & self-hostable Heroku / Netlify alternative (and even more).

I’ve been using Coolify to self-host a lot of my sites, including this one. But it’s not been without its problems.

I’ve noticed a lot of flakiness, including databases disappearing and taking down services seemingly at random. At one point I was unable to log in to any services, including Coolify itself.

Coolify uses a lot of disk space, and when you run out of space things stop working.


Coolify no space left on device, write

I noticed recently that my Ghost blog couldn’t connect to the database, and assumed it was just some general flakiness.

Then while trying to build another Node.js project I received this error:

[13:09:49.288] #8 12.84 npm ERR! code ENOSPC
[13:09:49.290] #8 12.84 npm ERR! syscall write
[13:09:49.293] #8 12.84 npm ERR! errno -28
[13:09:49.298] #8 12.84 npm ERR! nospc ENOSPC: no space left on device, write
[13:09:49.303] #8 12.84 npm ERR! nospc There appears to be insufficient space on your system to finish.
[13:09:49.306] #8 12.84 npm ERR! nospc Clear up some disk space and try again.

I had already resized the Coolify disk and filesystem up to 70gb and it was full again! What’s going on?


Cleanup storage in Coolify

There’s an easy way to clean up storage under ServersCleanup Storage.

The coolify Servers panel, with an arrow pointing to the Cleanup Storage button.

I hadn’t noticed this button before, but clicking that cleared up 50gb of storage space on my Coolify server and everything started working again.

I don’t know for certain, but I suspect under the hood this is running a docker prune operation to clean up old containers. If you’re unable to log into Coolify and you can’t resize your disk, that might be the next option.

If this doesn’t help, you’ll have to search through, or ask for help on Discord.

Homemade pesto, the new bike, book recommendations and bne.social – a blog

Tonight for dinner I made pesto pasta. It was made all the more delicious by the fact I grew the basil myself, in my own little urban garden, and made pesto from scratch.

My little garden has grown a lot since spring. With the new tower next door finally being built I don’t think I’m going to get any sun at all over winter. So I’m not sure how everything will go over the newly imposed seasons. But it’s best to remain in the moment and admire the basil, parsley, spinach, and multitude of chillis I’ve managed to grow.

A chilli plant. There are white flowers and little green chillis starting to grow.
My chilli plants have started to flower, and this one has little fruits forming.

So dinner was great and I feel very accomplished even though the pasta was store-bought.

Today was any other day. It’s January 26th and I made the decision to work today and take tomorrow off. Part tokenistic, part wanted the long weekend, and partly because I have a bunch of work on my plate at the moment and wanted a chance to get it done in peace.

But let’s not talk about work.

I wanted to write a little retro because it feels like I haven’t been up to much, but I know I have and wanna get it all down.


Time for a new bike

In big news I broke my bike. Snapped the frame nearly in two.

I faffed around for months before finally getting myself a bike fit and starting the process of building a bike that’s gonna last me the next ten years. Unfortunately we’re in a bit of a supply chain crisis at the moment, so looking at months lead time with no bike I picked myself up a cheaper single-speed to get me by.

It’s been an absolute treat.

Truth be told now I have my single speed I’m not entirely sure what I want from my next bike. I know being a heavier guy I’m gonna destroy this one, which is why I want to build something more solid.

But I’m really loving the simplicity of the single-speed system, as well as how powerful it makes me feel climbing hills in entirely the wrong gear. It’s really good exercise. Follow me on Strava if you’re so inclined.


Reading is what?

Over the new year break I had a week to myself and I was driving myself up the wall. Not because of boredom, but with panic that I couldn’t work out what to do with myself. So I picked up a book.

A few, actually. I’ve been really enjoying reading again. This year I’ve gone through:

  • Tom Ballard’s I Millenial – I don’t even know how to summarise this one, other than to say it’s a neat summary of what led to our current day political clusterfuck through a socialist lens. It was a surprise, a joy, and led nicely into the next:
  • The Big Switch by Saul Griffith. It’s a pretty plainly laid out argument that Australia can take action on climate change right now with current technology by replacing all our fossil powered machines with electric ones, putting solar on our roofs, using electric cars to power our houses at night, and save huge amounts of money in the long run. Obviously there’s nuances, but the point is to go all in on the technologies we currently have, while we develop the solutions to the harder climate problems. And the government is listening.
  • I also picked up Stephen Fry’s Mythos which was interesting because I’d never studied greek mythology before, and it was an okay introduction to it. I found it a bit of a slow going, something about milllenia-old stories not having all the hooks of a modern page-turner. But it was interesting connecting the dots on concepts that trace back all the way back.

I think e-ink

After getting excited about it I put in an order for a Kobo reader from JB. The only ones in stock were all the way down on the Gold Coast so I scooted to the train just in time for them to call me to say there’s an error and they don’t have it after all.

A Kobo ereader on the couch showing Tim Richards Heading South book in black & white. there's a bright pink cable coming out the side.

So I sat with the thought and eventually talked myself out of the cheaper device and into the Kobo Elipsa, which finally arrived the other day. And honestly it’s pretty great.

I’ve got three books on the go:

  • Pictured is Heading South by Tim Richards. It’s a travel journal along the second-longest rail journey in Australia, from Queensland to Western Australia. (Fun* fact, the longest is from Queensland to the Northern Territory just due to the inefficient route, but that’s not as exciting)
  • At Tae’s recommendation I’m reading Richard Osman’s Thursday Murder Club. It’s funny, very easy to read, and I can’t wait to find out whodunnit.
  • I’ve also picked up the latest episode of Meanjin on a whim. I don’t know if it’s my usual style but I’ve been enjoying the short essays and different perspectives, and wanted to see how to transfer an ebook onto the Kobo 😆

The Kobo itself is great. I didn’t think I’d use the notetaking nearly as much as I have been, but it’s very slick. I’ve found myself making little checklists and notes that I’d ordinarily add to my phone, as well as keeping my workday organised. Maybe it’s a write-off!


Then there’s the social network

Josh and I have been running bne.social for coming up on a year now. I haven’t written about it yet even though I’ve been meaning to because I don’t know quite how to sum it up.

It’s basically like Twitter without the nazis and the queerphobia, and it’s run by volunteers around the world rather than being owned by one single billionaire idiot. It’s not without its problems but most people agree it’s a Nice Place where the interactions are genuine and it’s not filled with Brands.

I’d encourage you to hop over and make an account and hang out with us! We’re going to organise a meetup or Brisbane folks at some point, so don’t miss out.

A cartoon of a mastodon in a summer hat at South Bank as an ibis swoops in to steal a chip.

Yeah that’s about it I suppose

I dunno, things are good. There’s more I could write about; my perfection of the banana-blueberry smoothie, the way I’ve optimised the lighting in my apartment to keep my indoor plants alive, the absolute classic CDs I picked up at the lifeline bookfest.

But for now I wanna go read some more The Thursday Murder Club and go to sleep, cos tomorrow the long weekend starts and I have a bike ride to do!

Happy new year

It’s 2023.

I like new years. I used to think of it as a sort of atheist christmas. But I think these days I appreciate the opportunity for reflection and realignment.

I haven’t had a lot of energy for introspection lately, which is a nice way of saying I am worn down and tired to my bones. Lately things haven’t been working for me, so the new year is a welcome mental reset. I have resolved to reflect more and be kinder to myself, and taking the first week of the year off work is a nice start.

Other than that I’m entering the year with a few little plans:

  1. I want to go on a holiday. I was hoping to do that over the break, but domestic tourism is hectic and most things are booked out and too expensive.
  2. After my old bike broke in 2022, I want to get my new bike built. Get back into an exercise routine, and take it on trips.
  3. I want to save money and pay down my mortgage.
  4. I want to work out what to do with myself.
  5. And I want to try to blog more.

I think that’s a reasonable place to start.

A self hoster’s guide to port forwarding and SSH tunnels

Self hosting with NAT and port forwarding and dynamic DNS is kinda fragile. I’ve been using a very cheap cloud-hosted nginx VPS to forward traffic to my self-hosted servers and it works nicely.

But tonight I set up a ssh tunnel that punches out from my server skipping the NAT, forwarding, and DNS stuff entirely. It’ll dial home from anywhere there’s network so I could even take my server to the park and it should work over 5g.

I just think that’s neat.

I’ve tried to explain a bit of my thinking, and a loose guide for how to set this up yourself. These instructions are for someone who’s vaguely familiar with nginx and ssh.

  1. How it usually works
  2. A more resilient port forwarding over ssh
  3. How to set up an nginx proxy to forward to your self hosted server
  4. How to forward ports to your self-hosted server over SSH
  5. How to set up a persistent SSH tunnel/port forward with systemd
  6. My observations using SSH tunneling

How it usually works

A typical port forwarding scenario opens ports on each device. When all the right ports are open, traffic flows all the way through from the internet to my self hosted server.

A traditional port forwarding scenario requires dyndns to upate the dynamic IP, as well as forwarding of ports through each device until it reaches the self-hosted server.

In my example, I have a nginx server on a cheap VPS in the cloud that handles forwarding. That VPS looks up my home IP address using a dynamic DNS service, then forwards traffic on port 80 to that IP. In turn my router is configured to forward traffic from port 80 on to the self hosted server on my network.

It works well, but that’s a lot of configuration:

  1. Firstly I need direct access to the ‘net from my ISP, whereas today most ISPs put you behind a carrier grade NAT by default.
  2. If my IP changes, there’s an outage while we wait for the DNS to update.
  3. If my router gets factory reset or replaced with a new one, I need to configure port forwarding again.
  4. Similarly, the router is in charge of assigning IPs on my LAN, so I need to ensure my self hosted server has a static IP.

A more resilient port forwarding over SSH

We can cut out all the router and dynamic DNS config by reversing the flow of traffic. Instead of opening ports to allow traffic into my network, I can configure my self-hosted server to connect out to the nginx server and open a port over SSH

You could also use a VPN, but I chose SSH because it works with zero config.

A self-hosted server creates a ssh tunnel to the remote server and routes traffic that way, without DynDNS or router configuration.

In this diagram, the self-hosted server makes a connection to the nginx server in the cloud via SSH. That ssh connection creates a tunnel that opens port 8080 on the nginx server, which forwards traffic to port 80 on the self hosted server. Nginx is then configured to forward traffic to http://localhost:8080, rather than port 80 on my router.

So the router doesn’t require any configuration, the cloud-hosted VPS server only needs to be configured once, and the dynamic dns server isn’t needed because the self-hosted server can create a direct tunnel to itself from wherever it is.

The huge benefit of this zero-config approach is I can move my self-hosted server to another network entirely and it will dial back into the nginx server and continue to work as normal.


How to set up a nginx server to forward to a self-hosted server

Putting an nginx server in front of your self-hosted stuff is a good idea because it reduces your exposure to scary internet risks slightly, and can also be used as a caching layer to cut down on bandwidth use.

In these examples, I’m forwarding traffic to localhost:8080 and 443 and will set up a SSH tunnel to forward that traffic later.

There are two ways to set up forwarding:

As a regular nginx caching proxy:

This is a good option when you want to utilise caching. However you’ll need to set up your letsencrypt certificates on the server.

server {
  server_name myserver.au
  location / {
    proxy_pass http://localhost:8080/;
    proxy_buffering off;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Port $server_port;
  }
}

As a socket forwarding proxy

This option doesn’t proxy http traffic, it just forwards packets directly.

stream {
        server{
                listen 110.1.1.58:443;
                proxy_pass localhost:8080;

        }
        server {
                listen 110.1.1.58:80;
                proxy_pass localhost:8443;
        }
}

This method is easier for something like Coolify that deals with virtualhosts and ssl for you, but the downside is that there’s no caching, we can’t add an x-forwarded-for header, and it eats up an entire IP address. You can’t mix a socket forward with a regular proxy-pass.


How to forward ports to your self hosted server

First, generate SSH keys on your self-hosted server, and allow logins from your self hosted server to your nginx server. DigitalOcean has a guide to setting up ssh keys.

You can verify this is working by running ssh root@myNginxServer.au on your self hosted server and seeing it log in automatically without a password.

Then test your port forwarding with the following command:

ssh root@myNginxServer.au -R 8080:127.0.0.1:80 -R 8443:127.0.0.1:443

The -R argument opens port 8080 on the remote server, and forwards all traffic to port 80 on the local server. I’ve included two forwards in this command, for both http and https. The 127.0.0.1 address binds traffic to localhost, so only the local machine can forward traffic on these ports, but you could open it to the whole world with 0.0.0.0.


How to set up a persistent SSH tunnel/port forward with systemd

Then, create a systemd service to maintain the tunnel.

I borrowed these instructions from Jay Ta’ala’s notes and customised them to suit:

sudo vim /etc/systemd/system/ssh-tunnel-persistent.service

And paste:

[Unit]
Description=Expose local ports 80/443 on remote port 8080/8443
After=network.target
 
[Service]
Restart=on-failure
RestartSec=5
ExecStart=/usr/bin/ssh -NTC -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -R 8080:127.0.0.1:80 -R 8443:127.0.0.1:443 root@myNginxServer.au
 
[Install]
WantedBy=multi-user.target

You can then start the systemd service/ssh tunnel with:

# reload changes from disk after you edited them
sudo systemctl daemon-reload

# enable the service on system boot
sudo systemctl enable ssh-tunnel-persistent.service 

# start the tunnel
sudo systemctl start ssh-tunnel-persistent.service

My observations using SSH tunneling

If all is working, those steps should now be forwarding traffic to your self hosted server.

Initially this was difficult to set up because the vagueness of the docs for whether to use -L or -R, but once it was running it seems fine.

The systemd service works well for maintaining the connection and restarting it when it drops. I can reboot my nginx proxy and see the tunnel reestablish shortly afterward. My high level understanding is that when the tunnel breaks after ServerAliveInterval=60 seconds, the ssh command will realise the connection has dropped and terminate, then systemd restarts the service ad infinitum.

You can adjust the ssh command to suit. There’s probably not much point enabling compression because the traffic is likely to already be compressed. But you could tweak the timeouts to your preference.

Gaia, West Village, Brisbane Festival 2022

A twilight shot of a grassy square, an old gentrified factory building in the background, and a giant illuminated planet earth suspended in the air. South America and Africa are visible. There are people admiring underneath.

I went to West Village to check out the artwork Gaia for Brisbane Festival, by artist Luke Jerram.

An intimate encounter with our home planet.

Gaia acts as a mirror, a journey of discovery, and a warning. The viewer may experience a new perspective, a sense that societies of the Earth are all interconnected as well as the realisation that we have a responsibility to one another, to preserve, to protect.

It wasn’t much to look at during the day, so I went to do my shopping while the sun set. At dusk it was illuminated against the sunset sky and just incredible to look at. I spent ages checking it out from all angles, trying to get the best photo along with everyone else.

Measuring 7 metres in diameter, Gaia is the second in a series of three awe-inspiring large-scale installations by Luke Jerram at West Village. 

Here is your chance to see the Earth as if from space; an incredibly beautiful and precious place. An ecosystem we urgently need to look after — our only home.

The Brisbane Festival program lists three separate planets that are rotated out throughout the festival.

I missed seeing the moon at the beginning of the festival, but tomorrow the giant Earth will be swapped out for a simulacrum of Mars.

Created in partnership with the Natural Environment Research Council (NERC), Bluedot and The UK Association for Science and Discovery Centres. With supporting partners Culture Liverpool and Liverpool Cathedral.

I logged on to Flickr for the first time in years to upload this photo, but my account is limited because I need to pay.

But one of the last photos I uploaded caught my eye. Taken on December 22, 2017, the construction of the controversial West Village complex where the installation now sits. What a change.

A concrete building site. A two story historic factory sits in front of three massive, blocky towers under construction.

My gear: how I vlog

People often (once) ask me what I use to create my videos. It’s been a bunch of different stuff over the years, but I think I’ve settled on a good setup.

TLDR: I reckon a good camera and a tripod/selfie stick is pretty much all ya need.

Sony ZV-1 Camera

This thing is amazing and I wish it existed when I started. It’s essentially the latest in Sony’s RX100 compact point & shoot line, but tailored for video. So it’s a massive sensor, zoom lens, integrated stereo mic and 4k recording in a tiny 300 gram package.

This isn’t the perfect camera. The stabilisation isn’t very good and the highest level crops in and makes the image less sharp, so I generally turn it off and take care with the framing. It also caps out at 30fps, so none of that sweet slow mo b-roll. Finally it records in h264 rather than h265, which is fine but the video takes up at least double the space.

But the image quality is stellar and I love it and I’m very happy.

Tripod/selfie stick

It’s easy to giggle at the sheer vanity of a selfie stick, but I am a vlogger after all!

The ones I’ve found the most utility from are essentially mini tripods. They combine a tripod base, telescopic pole, and standard screw thread (1/4-20 UNC) so I can mount pretty much anything from a microphone, my phone, camera or GoPro and stick it in place.

I’ve taken some variation of these around the world, from the windy cliffs of Lisbon to the window in Iceland trying to catch a glimpse of the northern lights.

The BK15 on the left is much more sturdy than the BK10 on the right. These days it’s my mic mount

I’m on my second one now, the Benro BK15 Selfie Stick & Mini Tripod w/Bluetooth Remote. I don’t use the remote, ever. But the stick is sturdy, doesn’t move from wherever you stuck it.

The BK10 started to flex on me after a few years, but the BK15 is the next generation and feels a lot more solid.

Pixel 6 (phone cam)

I was a big believer in using my phone to vlog. I can whip my phone out of my pocket and be recording in seconds. But the quality isn’t there.

I bought into the Apple hype and trialled a 12 Pro Max and it produced such god-awful video that I never released the vlog, destroyed the evidence*, and returned the iPhone for a refund.

I ended up getting the Pixel 6 which apparently uses some form of software HDR while recording video, but I wish I could turn it off because often the sky is blown out to a deep blue colour while the rest of the picture is heavily compressed and mushy looking. The stabilisation is super janky, and I’ve seen the stock standard stabe warp the image. AND I’ve noticed dropped frames in videos at 60fps. If you’re interested you can see all of this in action on my Australian Christmas video which is shot entirely on the Pixel 6.

I’m being hard on the video because it’s a selling point and it’s truly not good enough. I’ve had much better results out of Filmic Pro because it doesn’t use all the Pixel magic, but that’s slower and requires a lot more care to get a good shot.

But I digress! I use my phone from time to time when I don’t have my camera on hand. It’s not amazing quality, but it does alright.

GoPros for B-Roll

I also used a couple of GoPros, the Hero 7 is currently my main wide angle/action/time lapse camera. You can see it in action a fair bit on my Macleay Island video. I have a chest strap which I use on the bike, as well as a standard 1/4-20 UNC mount that I can use on the tripod. The built in mic is not great at all, so I mostly use it for b-roll and time lapses.

I also have a GoPro HERO5 Session which is a tiny baby, but only barely does 4k so I mostly use that for time lapses as well.

The GoPro Session 5 and Hero 7. The 7 is inside an Ulanzi cage on a small handle.

In the pic you can see the Ulanzi cage which holds the microphone adapter for the GoPro. I originally wanted to use this as a handheld vlog cam, and it might still be good for that on hikes and things because of the incredible stabilisation. But I haven’t really found myself using it and I wish the GoPro just came with a damn 3.5mm jack.

Other gear

  • Zhiyun Crane – I picked this up second hand on ebay but I hardly used it because it’s big and chunky and super slow to set up. But I used it recently at Botanica and I think I’m getting a feel for it. It’s great to stabilise the ZV1 when there’s a lot of movement, but I think it’s a special occasions kind of thing.
  • Zoom H1n – this is an excellent microphone. I’ve mostly been using it as my video conferencing WFH mic lately, but it’s a fantastic stereo mic which I use to capture ambience and sound floor for my videos. Or at least, that’s the intention, it runs flat really quickly on rechargeable batteries so I haven’t used it as much as I’d like.
  • Rode VideoMicro – a little shotgun mic I can mount on my camera. It’s good for talking-to-camera vlog style shots because it isolates my voice. But it’s only mono and I haven’t worked out the best way to integrate it with my workflow. Most of the time the built in ZV1 mic is more versatile.
  • DJI Mini 3 Pro – This is a new addition. There was one shot I desperately wanted to get in my Gympie vlog which was an epic drone shot of the Mary Valley Rattler crossing Deep Creek. I didn’t get that shot, but I did get the Mini 3 when it was released shortly after. I’m excited to play with it more.
Imagine this, except as a sweeping panoramic drone shot. “Gympie Mary Valley Heritage Steam Train” by Thirumurugan P is licensed under CC BY-ND 2.0.

Davinci Resolve video editor

I switched to Mac in 2017 in part because video editing on Linux is an absolute nightmare.

I started out with iMovie which I used for all of my vlogs up until 2020. My first real full Davinci vid was last year’s Brisbane Festival roundup, which took a VERY long time to pull together while I learned how stuff works. Quite ambitious.

But I think I’ve gotten a lot better and faster at it.

Davinci Resolve edit window showing the media pool, effects, inspector, timeline, and a proto of me giggling at the noodle markets.

There’s not a lot of other software I use, but in the past I’ve used Krisp to recover bad audio, and I’m generally a fan of youtube-dl to rip old youtube vids of mine, ffmpeg to occasionally perform some repairs on a video, or Handbrake for tweaking the encoding. I also use rev.com for better or worse when I’m in a hurry and don’t feel like doing my own captions.

Honorary mention Pixel 2 XL (retired, 2018-2021)

This was my primary vlog cam for pretty much the entire time I was overseas. This was an awesome little unit. It couldn’t do much, but it was my first 4k camera and it’s what started everything!

One little gadget I used to take everywhere was the Windblocker. That thing saved my audio on countless occasions and if you’re vlogging with a phone I can’t recommend it enough.

After three and a half years, this thing was so battered around that I upgraded to the Pixel 6 on release day and gave this one away for free on Gumtree to a gentleman who seemed to really appreciate it.

A Pixel 2 XL on a bright background. It's showing the welcome screen after being factory reset. There are cracks all over the screen.

That’s about it

What’s your video set up look like? Is there anything I’m missing? Shoot me an email!

Remote work from the gay pub

Friday lunch at the Wickham, Brisbane’s local gay pub, is one of my favourite new traditions.

I’ve been intending to go on Fridays because it’s a great spot, there’s plenty of places to work, and it helps keep the lights on at a place that’s important to me. This is where I’ve met a lot of my friends, done a lot of growing as a person, and really it’s a nice spot to be.

It’s been wet, and I’ve had other commitments so I’ve only been twice in the past month but each time it’s been great.

Last night my friend R arrived after work and we stuck around for a few drinks which turned into a bottle of wine back at my place, where he stayed on the couch for the night (he lives on an island, it’s a trek).

For a person who “doesn’t drink” I have a low grade hangover this morning. Coffee is brewing now.

This is part of how I’ve been getting a bit more experimental with how I’m approaching remote work in a pandemic world. There’s a bunch of picnic shelters down by the river that I’ve been working at from time to time, and the local coffee shop has pretty good outdoor seating. Depending on my meeting load it’s not always possible to do, but I think it’s important to get out and be a part of the world.

The IPCC have shown us what needs to happen, so why isn’t this the climate election?

I’ve been struggling with the election. How are we avoiding the elephant in the room?

  • ✅ We’ve committed to 1.5 degrees of global heating by 2050
  • 🤔 To hit that we must peak carbon emissions in the next 3 years
  • 👉 Even if we SUCCEED, 99% of coral reefs still die
  • ❌ Labor and the Coalition really don’t have a plan?

This is an emergency.


We can fix this. But we must do it now. We must decarbonise. And we have to GUARANTEE coal and gas workers security, a chance to be part of that transformation.

Labor has some semblance of a plan, but also accepted half a million dollars in donations from fossil fuel interests last year, as well as committed to allowing new oil and gas extraction which would undo everything.

The central message of the IPCC report is clear: despite affordable renewable energy solutions being available now, governments and businesses are failing to act. Global greenhouse gas emissions must peak by 2025 and halve by 2030 to limit warming to 1.5 degrees.

The IPCC said the dramatic reductions in the cost of wind, solar and battery storage technologies over the last decade meant they were already commercially viable and would be the key to decarbonising most of the world’s energy systems.

“It’s now or never”: new IPCC report issues warning to governments to speed up renewables transition – Climate Council

So while I’m buoyed by the possibility of a change in government, we must make this election count. It feels very much like our last chance.

Vote Compass has already told us that more Australians mentioned climate change as their number one issue than any other topic.

So I’ll be voting Greens and preferencing progressive parties to hold whichever govt to that standard. I think it’s the most powerful change I can make right now

If you’re not sure where to start, here’s a guide to parties & candidates in the election who’ve committed to actually doing something. It’s not everything, but imo it’s a good starting point.

Traffic light election guide. Vote climate one. Make climate the winner.

The other important thing to remember is even if your local member is an asshole, you can still vote for change in the senate


I lay awake some nights catatonic with the thought of what’s coming for us, and fuck, what’s already here.

But there is hope. We have a path forward in the IPCC report, we have most of the technology we need, and we just need to make it happen NOW. No more excuses.

Here’s the best summary I’ve found on what comes next ❤️


Update: climate won 😭

I think Scott Ludlam, former Green put it best:

'holy shitballs', tweeted at 9:37 on election night.

The Liberals were wiped out by a wave of Greens and climate-focused independents. There’s a lot of analysis, but ultimately this is a really hopeful result.

On election night the ABC ran this graphic, saying the number 1 concern for voters was climate change. Just makes you wonder why, in the face of it all, it was completely missing in the media campaign.

A TV on the wall showing the Australia Votes coverage with the caption 'Australians said climate change is the no. 1 concern at this election`. The graphic shows 25% of Aussies ranked it number 1, followed by 16% who said economy.

The easiest way to validate email in React

Email validation is one of those things conventional frontend wisdom says to steer clear of, because:

  1. the endless complexity in how email works and
  2. because even if an email looks valid, it might not exist on the remote server.

This is backend territory.

However.

We can hijack the browser’s built-in email validation in <input type="email"> fields to give the user a better experience.


CSS validation

At the simplest, <input type="email"> fields expose :valid and :invalid pseudo selectors.

We can change the style of our inputs when the email is invalid:

input:invalid{
  border-color: red;
}

Nice. Zero lines of Javascript. This is by far the best way to do form validation in the year ${year}.


Plain Javascript email validation

The constraints validation API exposes all of this same built-in browser validation to Javascript.

To check if your email is valid in plain JS:

const emailField = document.querySelector('.myEmailInput');
const isValid = emailField.validity ? !emailField.validity.typeMismatch : true;

This works in all the latest browsers and falls back to true in those that don’t support the API.


React email validation hook

Lol just kidding, you don’t need a hook. Check this out:

const [emailIsValid, setEmailIsValid] = useState(false);

return <input
  type="email"
  onChange={e => setEmailIsValid(e.target.validity ? !e.target.validity.typeMismatch : true)}
  />

We can use the same native JS dom API to check the validity of the field as the user types.

This is by far the fastest way to validate email in react, requires almost no code, and kicks all the responsibility back to the browser to deal with the hard problems.


More form validation

Email validation is hard, and all browsers have slightly different validation functions.

But for all the complexity of email validation, it’s best to trust the browser vendor implementation because it’s the one that’s been tested on the 4+ billion internet users out there.

For further reading, MDN has great docs for validating forms in native CSS and Javascript code.

You should also inspect the e.target.validity object for clues to what else you can validate using native browser functions.

It’s a brave new world, friends.

Brisbane floods

Thursday

I saw a tweet earlier today along the lines of “I don’t like living in interesting times”, and I thought it was amusing. Referring to the alleged Chinese curse which from memory I don’t think is real, but is very clever nonetheless, “may you live in interesting times”.

Sometimes an idea will get stuck in my head, a wordplay usually, and repeat over and over until I put it into the world. Throughout the pandemic my little brainworm is a similar corruption, “you may live in interesting times”.

Among other world disasters, the one a little closer to home right now is the effects of La Niña on East coast Australia. Earlier this year the Bruce Highway was washed away by flooding near Tiaro, and just yesterday a freight train derailed on the north coast line when the track washed away. We’ve had a lot of rain.

Yesterday the ABC made passing reference to the Brisbane River catchment, which put me on edge. My place is in a low lying area and while I think technically it’s above the council’s flood level, I don’t especially want to risk it. I was pretty annoyed that it was mentioned in a single article with no follow up at all, so I suppose we’re probably not going to flood? I’m sure I’d know about it.

It’s been on my mind because I was planning to visit my parents this weekend, the weekend of my birthday. But between the rail catastrophe and breathless news reports advising people not to travel, I’m sort of thinking I’ll stay in after all.

Anyway, I’m doing fine. Just really aware of the emergency fatigue that’s probably got everyone to some degree.

So I’m sitting outside in the dark wearing trakky daks, hanging out with my plants. There’s the white noise of raindrops hitting the leaves in the garden and pattering down onto the courtyard. A streetlight across the road lights up the sheets of rain as they blow past. And occasionally a car will drive by and make the cosiest wet asphalt sound you can imagine.

I do like the rain.

It’s cosy.

Gezellig.

Reminds me of the summer storms in my childhood home, beating down on a tin roof so hard you could barely hear each other talk. Looking out the window at a wall of water while being inside, safe and dry.

We may live in interesting times, but at least there’s comfort in the familiar. I don’t know if I’m going to see my parents tomorrow, I suppose I’ll have to make that call to the QR support line. In the meantime, no point worrying right?


Friday

A screenshot of the message from QR travel: QJ11 Tilt Train 25 Feb is cancelled with no alternate arrangements. Another notification forecasts rain.

The train line is still out. Now the highway is out.

Deep Creek (ironic name, it was a trickle when I was there) has gone over the highway. This kinda blows my mind.

I know Gympie floods, I read as much when I visited last year. All the riverside infrastructure is concrete and brutalist to survive the water going over it.

At Alford Park, there’s a massive great flood marker showing where all the historic floods have reached. Pretty scary stuff.

Anyway, it’s just weird because that road bridge is SO high I would never have expected it to go under. At least that’s the decision made for me.

Undearneath the Bruce Highway bridge. It's suuuuper tall. There's old wooden foundations from what I can only assume is the old bridge.

Saturday


Sunday

I hardly slept last night. I kept waking up to check the river wasn’t lapping at my door. It wasn’t, but that just meant it hadn’t happened yet.

Tae lost power. She’s in a low-lying part of the neighbourhood. She came over to charge up all her bits and bobs and we watched TV and chatted for a bit. I fell asleep and slept for what felt like hours.

The rain still hasn’t stopped, so Tae decided to just make a run for it. I got drenched just opening the gate to let her out. I can’t imagine what it would be like riding in that.

The forecast is looking pretty grim, but the flooding is supposed to coincide with high tide tomorrow at about 8.


Monday


Tuesday

By the time I got up the street was already completely cleared. You wouldn’t have known it had flooded if it wasn’t for the people cleaning out the businesses that were inundated.

I was expecting to get out with my shovel picking up trash. But Peter told me the RCC Builders from the construction sites were all out cleaning up the streets in the early hours. I suppose it benefits them not tracking mud everywhere, but it’s such a nice thing to do. I’m very grateful.

The river is down about five steps at the end of my street. Enough to clear water from most of the streets around here.

Looking down a staircase into water and slick brown mud. There's still trees submerged, poking out of the river

I went for a little walk down Duncan Street way. I don’t know what to call that little precinct of West End but it’s the built up area, as opposed to the gritty sort of partially industrial area I live in. There were a lot of pumps running to pull water out of basements, and some that were completely full to the top.

Peter’s was full to the top.

He told me the building manager was here for the ’11 floods, and the painstaking lengths they had to go to to clean out the mud and debris from two levels of basements. I think the mud army can probably help, but it’s going to be days before that water clears.

His lift was out, and the emergency stairs led to deep water, so we had to climb a ladder from the lobby to get to the stairs, to get to his apartment. It’s the penultimate floor, which is ordinarily lovely, but absolutely destroyed me. I’ve been working on my cardio fitness, but apparently there’s still a ways to go.

I had my first hot shower in 2 days, and left a powerbank to charge, just in case. I also guzzled all the water in his jug because, as I realised later, I was super dehydrated from not taking care of myself the previous days.


It’s Tuesday afternoon and I’m surprised to find I still have ice cubes. Most of them are stuck together, swimming in a puddle in the bottom of the ice cream container where I store them. But there’s a few separate blocks. I scoop em out and put them in my glass of warm cola.

Later that afternoon Peter, the ghost of Adam, and I went to a town hall organised by Jonathan Sri and Amy McMahon, council and state representatives, respectively.

There was a free sausage sizzle and people sitting around powerboards charging their devices. Real disaster vibes, but I think folks were largely okay.

Jonno and Amy on the mic, next to a portable loudspeaker.

It was a useful meeting. But the message I got was that while the flood waters are still up and there’s not a lot we can do until they go down. I get the feeling everyone just wants to do something but we can really only wait until we know more.

As I was walking home past the gym I noticed the lights were on.

“Great” I thought, I can go there for a warm shower.

Then I realised the lights were on in my building too.

There were people milling around the street outside one a that was still dark. A lady was gesticulating at the utility closet that had been beeping for two days straight, so I went over and offered to let them charge their stuff at mine. Her kid proudly told me how they’d been using candles and a lantern, it was cute.

There’s a kind of survivor’s guilt in all this, I try not to indulge too much. I lost power for a couple of days, and the basement that I never use got flooded with 30cm of water. That’s nothing, right?

But then I realise I’ve been amped up on stress for the past week, I’ve lost the contents of my fridge and freezer, my backpack and a pair of shoes are ruined because they just couldn’t dry out, I’ve got loads of washing strewn all in the laundry because they asked us to conserve water before the power went out, I have a sunburn and a caffeine withdrawal headache because I regularly forgot to feed or water myself while everything else was going on.

I don’t need to feel guilty because I got my damn power back.


Wednesday

The dishwasher and washing machine are humming away. I appreciate the breeze from the fan. It’s 31 and partly cloudy. Humidity is cloying. But we’ll work things out.