•
We Need Apocalypse-Proof Software
By Alireza Alavi • 9 minutes read •
Table of Contents
- Preface
- How do we address this as software engineers?
- We must take an offline-first and local-first approach to our critical, not inherently online software
- We must make robust software that can work for years without needing to update
- We must make more software that are meant to help in situations like these
- Our software must contain offline documentation
- We should write efficient software that run great on low end systems
- Some software for apocalypse
Preface
After experiencing war, numerous revolution attempts and mass protests, and numerous extended internet blackouts, I have experienced how it is to live in situations where there is no internet and no connectivity (among other things).
In my country, Iran, we are currently going through a full internet blackout due to mass protests. Today, I wanted to start working on one of my projects (using Clojure and kit-clj), And right from the start, trying to start my dev server with clj -M:dev:nrepl I get faced by these errors:
```
Unable to fetch /home/alireza/.gitlibs/_repos/https/github.com/cognitect-labs/test-runner
fatal: unable to access 'https://github.com/cognitect-labs/test-runner.git/': Could not resolve host: github.com
```So I can't work on my project when there is no internet. Which is pretty sad (it could still be run if I commented out some of the startup dependencies, but still).
Yesterday, I tried to connect my sister's Samsung phone to my NAS(network attached storage) to listen to music, and the file manager tried to download the FTP functionality from the galaxy store, although she had connected to the NAS before.
While my FOSS file manager "Material Files" already has FTP functionality built-in and it takes only 20MB of space on my phone.
You can see this pattern a lot. Software that are not online in nature, needing an internet connection.
Depending on where you live on the blue-ish globe, You might experience outages quite often, like we Iranians do. And it's not only about governmental outages. Many countries or places on the world simply don't have internet. You might be on vacation with no internet, maybe your internet subscription has ended, you might be in a cafe and you don't want to connect to the public internet, or maybe the zombies have broken loose and chewed your internet cable!
Its simple. You shouldn't need to be online for doing something inherently offline. We don't need to be constantly online.
Many of our software are built on top of the assumption of good, stable, high speed connectivity, up to date hardware and the ability to babysit, update and fix the software constantly.
In bad situations like this, you don't have any of this. You might go months without being connected to the internet, you might have to use decades old hardware, and the software should be reliable enough so you don't have to constantly babysit it.
In fact, creating software and hardware for "the apocalypse" or more realistically, "Civilizational collapse" has been a focus of many smart people over the years.
For example, the plan9 operating system or collapseOS are operating systems that are either specifically built for this scenario or fit very well with it. So these aren't just my schizophrenic thoughts, these are very much real experiences.
And this isn't just about the collapse of civilizations, wars, outages etc. (which are very likely).
Even disregarding these matters, we need to create software for worst case scenario, the same way good automotive manufacturers do (or used to do).
You can rely on a good car in pretty dire situations, pushing it much further from it's normal and rated usage, and it will be mostly fine.
How do we address this as software engineers?
We must take an offline-first and local-first approach to our critical, not inherently online software
It doesn't get worse than opening your text editor or image editor program and it not working because you are not connected to the internet.
If the nature of your software isn't online, make sure it doesn't require to be.
We must make robust software that can work for years without needing to update
This is a whole topic on how to make robust software, but in general:
- we have to release our software tested and verified, to sensible degree.
- we must use stable technology for our software development.
- we must create high quality software.
Can we start formally verifying every piece of software we write?
No. That is not feasible, because the cost would be too high, and some software isn't just that critical to justify the cost. But, we must verify and test our software, to the degree that is sensible for its criticality, to deliver stable and robust software. Software that works even when things go wrong. Not software that is glued together and falls apart as soon as it faces the most minor inconvenience.
We must make more software that are meant to help in situations like these
Bringing offline functionality for critical tasks will really help us in situations like these, like Kiwix, Zeal, and many others do.
Our software must contain offline documentation
In Neovim, you can do :help or for example :help netrw or any part or module of nvim and you will get pretty good documentation right there. Those .txt files are the official documentation of Neovim. That's what you see on the website too. This is great practice.
Most good plugins also add their manuals there.
The same goes for Emacs. I think Emacs is even stronger in that since how the codes are the documents.
Most good software will have man pages which you can use. There is a lot of information that you can get from a good manpage. We should write good manpages, or other forms of easily accessible offline documentation for our software.
For example, the fennel programming language provides it's whole tutorial in the manpages with man fennel-tutorial.
We should write efficient software that run great on low end systems
Do I need to dive further in this or did the recent global RAM shortage gave us the lesson we needed to learn?
We can't just keep bloating our software and expecting users to throw more hardware at it.
Some software for apocalypse
This can probably serve as a checklist for future events.
Note that circumventing governmental censorships is a topic of it's own, which will not be covered in this post. Here we are mostly trying to survive in the situation with what we have, and circumventing it is a pretty complex task that we won't cover in this post.
But make sure you are also always prepared for that case too. To be realistic, there will probably be governmental censorship in any critical situation as we saw during COVID-19 or other dire situations around the world.
Documentation and knowledge
- Zeal
- Some other solutions for downloading documents not available in zeal.
- Just downloading the HTML sources.(HTMX, babashka, kit-clj, reitit, Vue.js) how?
arch-wiki-docs- If you use Linux, the arch wiki is going to come in really handy.
Download this package on arch withpacman -Syu arch-wiki-docs. Then, you can probably see the document files in/usr/share/doc/arch-wiki/enand open them in your browser.
- If you use Linux, the arch wiki is going to come in really handy.
- Kiwix
- Kiwix is an offline browser for Wikipedia and many other Wikimedia wikis.
manpages- Learning to use
manpages on Linux really helped me to keep working and understanding my software even without internet.
manpages are very powerful and good software always have good manpages.
- Learning to use
infotool- Lesser known than
man,infois another tool for reading Info documentation.
By just typinginfoyou will get a list of documentation. Info documentation tends to be more comprehensive and verbose than man pages, It has many documents, And covers almost all GNU projects.
- Lesser known than
- Downloading documentation of needed libraries that aren't available elsewhere
- Most software and libraries have website documentation. You can clone the documentation from it's repository
- If they have a single page doc, save that as HTML with your browser's "save page as", and "print"
- or use something like HTTrack (
sudo pacman -S httrack) to copy whole websites. - Make sure you have a simple http server like
http-server(npm install -g http-server) to help you serve and view static website easily.
- Offline dictionary
- For your native language and languages you use the most or are learning.
File sharing
- Torrenting
- Transmission (Linux, Windows, Mac)
- LibreTorrent (Android)
- Localsend
- Has andriod, ios, linux, windows, mac and web clients. Also keep the installation files to share them.
- Onionshare
- Share files over Tor network.
- Keep an exFAT USB drive handy, to share files if you couldn't use other solutions. I use exFAT since both windows and Linux computers can use it.
Software package repositories
- Host your most needed and used packages on a mirror. You can use a heavy and feature rich tool like "nexus repository" from Sonatype, or just
wgetyour needed packages somewhere and setup a simple mirror.
Collaboration
- TODO: How to use Git offline? Offline merge requests?
Communication
- Briar
- P2P communication can come in very handy.
- Currently only has stable Android and iOS applications.
- In my experience, the P2P communication over the internet doesn't work when there is an internet blackout. I think P2P traffic is entirely block by firewalls, filtering and censorship systems.
- LAN Messenger
- Honestly an underrated tool. It is unfortunately unmaintained but it is very useful and I've seen it vastly used in organizations and teams.
- Jami
- P2P communication by GNU.
- Cross platform (Mobile and desktop).
- Matrix1
- Kind of complex to setup, fully encrypted, great for use with friends, family and organizations.
- Zulip1
- Focused on organizational communication, can keep your team going even in these situations.
- Deltachat1
- Very simple to use, fully encrypted, great for communication with friends and family. Simple server setup. High security.
- Movim1
- Self hosted chat and social network powered by the powerful XMPP protocol.
Navigation
- OsmAnd with offline maps
- Organic Maps with offline maps
Honorable mentions
- Handy Offline speech to text
- A USB stick with TailsOS I don't think any OS gets more private and secure than TailOS. For sensitive work, always carry a TailsOS stick with yourself.
- A USB stick with some live OS Why? Because you don't always have your computer nearby. But you can always carry a tiny USB storage with yourself. You can find a computer in most places but it's hard to find a secure computer with good and stable OS and software installed on it. So you bring the OS and software.
I choose MX Linux, or Linux Mint. They are lightweight, simple and very stable. You can even setup persistent storage for it so you can keep your work.
Discuss this post on hackernews