Category: Sci/Tech

Debugging poor home wifi at the Snell-Pym residence (by )

So, we have a fairly complicated network at home - the Snell-Pym Family Mainframe has a dedicated DSL link with a static IP for hosting various Internet-facing things, as well as providing internal services to the home LAN. The home LAN has the usual mix of desktop computers, the laser printer, and two wireless APs for mobile devices to connect to - one in the house and one in the workshop, because one can't get a good signal to both locations. And there's a separate infrastructure LAN for systems control and monitoring.

Now, we've often had on-and-off poor connectivity on the wifi in the house; this used to happen sporadically, usually for around a day, then just get better. The wifi signal strength would remain good, but packet loss was high (10-20%) so stuff just didn't work very well. TCP is poor at high packet loss; it's OK once a connection is open, but packet loss during the initial SYN/SYNACK/ACK handshake causes it to take a long time to retry on most implementations.

I went looking for interfering networks (we live in a pretty wifi-dense urban area) using an app called "Wifi Analyzer" on my Android phone, and it showed a strange network, always on the same channel as the house wifi (as in, if I changed the channel, it would move too). The network never had a name, and the signal strength was about the same as the house wifi; sometimes a bit stronger, sometimes a bit weaker. Read more »

Redesigning my workspace (by )

So, I work from home - and a lot of my hobbies involve sitting at the same desk, as they're computer-based or electronics-based. My workspace is an outbuilding at the end of my garden, with power and Ethernet connecting it to the house. Half of it is a workshop, and the other half is my computer / electronics lab. The workshop end is pretty good since I made my custom welding bench, but the lab end was just made from furniture I had lying around that fitted in, so has been a compromise for some time. I am forming a plan to fix it!

Read more »

12v DC Power Distribution (by )

What with not needing to spend quite so much of my time driving my family to places these days, I've been catching up on household maintenance, DIY, and vehicle maintenance tasks, and one of those has been to finish a 12v DC power distribution unit (PDU).

Why do I need such a thing? Well, our van has an auxiliary power system - a pair of large lead-acid batteries in the back that are charged from the engine while it's running, which then power internal and external lights, a microwave oven, a mobile amateur VHF/UHF band transceiver, and things like that.

This is useful compared to just running from the vehicle starter battery for three reasons:

  1. While the starter battery is optimised for brief, intense, surges of current to start an engine, the auxiliary battery pack is optimised for energy storage so can store a lot more energy more efficiently.
  2. If I leave things on and run the auxiliary batteries flat, I can still start the engine from the starter battery (and thus recharge the auxiliary batteries).
  3. I can mumble things like "Switching to auxiliary power" and pretend I'm piloting a spaceship.

However, the auxiliary power system was installed in the van's original life as a work crew support vehicle, so it was hardwired to a few appliances and the lights. Somebody who owned it since had attached a set of four "ligher sockets" - perhaps the nastiest 12v accessory socket in common use to a fuse marked as "spare" in the fusebox. But I ripped that out and used the "spare" circuit to run the transceiver instead. On the other hand, where the van had originally had a hot water system for making hot drinks that was removed before it came into our hands, a 50A fused circuit terminated in a large SB50 Anderson connector.

I had nothing that would plug into such a socket, but did want to plug in things such as:

  • Chargers for various kinds of batteries I use
  • USB sockets for charging phones
  • An inverter to run things I don't have DC power supplies for
  • Amateur radio equipment (which usually runs at 12v from 30A Anderson Powerpole connectors)

So the solution was obvious: Make a Thing that plugs into the 50A socket, and then itself has lots of different sockets on so I can plug stuff in. Desirable extra features are:

  • Individually fusing all those outputs, as if most of them pulled 50A in a short circuit (which the upstream circuit can provide) it probably wouldn't end well.
  • Integral voltmeter so I can check the battery status.
  • Usable in other off-grid power situations as well.
  • A commonning point for RF grounds for antennas and ground stakes and stuff for radio gear.

The design

So I settled on the following design:

  • SB50 connector on the end of a few metres of nice flexible 8AWG silicone-insulated cable, to plug into the van.
  • Incoming +ve splits into an eight-way blade fuse box I had lying around
  • Two lighter sockets, for legacy devices.
  • A panel-mounting 12v-fed USB charger, with two outlets (with a power switch, as it draws a tiny idle current even when not in use).
  • A voltmeter, powered through a pushbutton so it's not draining the battery when not in use (I ran this from the same fuse as the USB charger).
  • A set of binding posts, for attaching arbitrary wires or banana plugs (also useful as a power INLET by hooking up my bench PSU in the workshop).
  • Four 30A Powerpole sockets.
  • Four banana plug sockets for RF earthing, joined together, with a switch to join them to the -ve DC power line (I can turn it on to bind RF earth to DC -ve at the box, or turn it off to break a ground loop if it's bound elsewhere - basically, just fiddle with the switch and see which produces less noise in the current situation).
  • Every output has a ceramic 100nF filter capacitor in parallel across it, to try and cut down on power line noise.

Then, as the supporting cast:

  • A set of battery clamps hooked up to another SB50 via a 50A fuse (plus a single Powerpole connector on a 20A fuse in parallel so I can plug small stuff in directly) so I can also run the system away from the van, from an old car battery in my possession, or nicer deep-cycle batteries I might own in future.
  • A powerpole connector with a 5A fuse hooked up to a little 1.2Ah sealed lead acid battery I happened to have lying around, so I can run the system away from the van without lugging a huge battery around at all, for small loads only.

Building it

Electrically, the system is dead simple. But mechanically, fitting it all in the box and making it sturdy enough to survive camping trips was challenging.

  • Cables capable of carrying 50A without a problem are bulky
  • I didn't have panel-mount Powerpole connectors, so needed to improvise.
  • The fuse box I had just had spade terminals for each end of each fuse, without a common busbar.
  • The fuse box was meant for mounting to a bulkhead; I wanted the fuses to be accessible from outside the box, while keeping all the spade terminals inside the box so no live stuff was easily pokable.

I dealt with the latter point by cutting a rectangular hole in the front panel so that fuses could stick up, while the electrical connections where beneath the front panel. Long screws through the front panel went down through the mounting holes on the fuse box that should have mounted it to a bulkhead, and a nut on either side of the mounting flange held the fuse box in place at a fixed distance behind the front panel so the fuses stuck out enough to be easily accessed, while the spade terminals were kept amply away from the front panel. I covered the back of it in insulating tape, just in case.

To common the positive connection in, I crimped a massive ring terminal onto the incoming positive wire (I had to buy a special massive hex crimper to do this!), and bolted it to a strip of thick copper I cut to size. I drilled eight holes in it such that I could pull the insulation off of eight female spade terminals and solder them into the holes, then press the entire strip onto the spade terminals along the top of the fuse box, thereby commoning them. Lots of insulating tape and heat shrink then covered all the live (and directly connected to the 50A incoming circuit) parts.

For the Powerpole connectors, I 3D printed some mounting places with suitably sized rectangles, then used them as a guide to cut slightly larger holes in the metal case. I had PCB-mounting powerpoles connectors, which I soldered the filter caps directly onto the backs of, then soldered the negative lines together to common them. Wires were soldered onto the common negative and individual positive lines, and protected with heat-shrink.

I then poked the connectors into the holes (they were a push fit) and used generous gobs of Sugru to protect them against being pulled out or - worse - pushed in. Since Sugru is slightly flexible, I increased the rigidity of the setup by using a length of thick steel TIG welding wire across the backs of all the connectors, embedded in the sugru (and electrically isolated from everything).

I couldn't easily fit filter caps onto the lighter sockets and the USB charger, as they used crimped spade terminals, so I made a bank of filter capacitors fitted to a screw terminal block on the front panel. I glued it in place with epoxy.

Here's a shot of the interior partway through construction, to give you an idea:

12v PDU internals

I put in 15A fuses for the lighter sockets, a 3A fuse for the USB and voltmeter, 10A for the binding posts, and a range of fuses for the powerpoles - 10A, 10A, 20A and 30A.

Finally, to document what each fuse drives, I put a simple schematic of the circuit on the outside - by drawing lines with a permanent marker from each fuse to its load (going via the switch in the case of the USB outlet).

The finished product

Once all those fiddly details had been addressed, and many many crimp connections made, I was delighted to find that the box would close with only gentle pressure!

I carefully tested it for short circuits with a meter and, none found, gingerly plugged it into my bench PSU through the binding posts on the front and crept the current limit up from zero... it didn't explode!

So, I plugged the small sealed lead-acid battery into a Powerpole socket and tested the internal voltmeter:

Testing the internal voltmeter

It doesn't show so well in the nice sunlight we've been having, but that's registering a healthy 12.79v. And not catching fire or exploding.

Next, I plugged it into the car battery using the big SB50 plug, and checked the voltage with my multimeter on the binding posts:

Big battery and DMM

Also all good. Finally, I plugged a USB voltmeter into a USB outlet and turned on the outlet:

USB 5v works nicely

(And, of course, I checked every outlet with the multimeter to make sure everthing was connected properly and all of my fuses were good).

So, with testing complete, it was time to put it to work. I was due to check the tyre pressures on the van, so I plugged the SB50 into that auxiliary power socket that started this whole adventure, and plugged my tyre compressor thingy into a lighter socket, and did all the tyres - after quickly checking how the auxiliary batteries were doing, as I'd not driven the van in weeks:

Active in the van

The pump actually draws eight amps according to the label on the underneath, so this was a test of the system under non-trivial current. It still didn't catch fire.

Things I'd do differently

  • Use proper powerpole panel mounting outlets. Doing it myself was skanky.
  • Put a handle on the thing. As the surface is so covered in sockets and things, it's not actually easy to hold it. Fine when it's sat on a surface, which is what I designed for, but carrying it around feels ungainly.

What next?

I've already got a 240v AC inverter and various chargers with Powerpole connectors, but I want a few more Powerpole accessories:

  • Lighting strips on hooks, so I can set this up inside a tent and light the tent (while also charging all my batteries). I've ordered some cheap 12v LED light strips; I'll put cables with Powerpole connectors on them.
  • A plugtop 12v mains PSU, so I can run this lot from a wall socket easily (for small loads).
  • A DC-DC 12v battery charger, so I can charge my car battery and my little sealed battery from the van's auxiliary power system (just wiring 12v batteries to each other isn't a good way of charging them...) or, in an emergency, charge the van's starter battery from the auxiliary power system.
  • A portable solar powered 12v battery charger for free, clean, energy.
  • A boost-converter DC power supply for my laptop, so I can run it without the wasteful step of running an inverter to generate 240v AC for my laptop charger to drop back down to 18v DC.

Preparing for Apocalypse (by )

Even before global warming became painfully obvious over the past few years, there's a long history of people preparing for some kind of collapse of civilisation. I grew up in the last throes of the Cold War, and the threat of nuclear annihilation hung over us; and because of that, my mother and I lived with a relatively casual dependency on civilisation, growing most of our own food on an allotment, our house was heated by burning wood, and so on.

The full-on collapse of civilisation is very unlikely. More likely are temporary breakdowns that last for days, or months at most; and much more likely are failures of just one or two of the things we rely on other people for.

Why bother?

"Preparing for the worst" means thinking about all the infrastructure we depend on, and deciding how we'd cope without it or find a substitute we could manage with. Preparing for the worst doesn't mean you're only preparing for the worst; it also means you're preparing for all the little things that could individually go wrong - or in combinations. Preparing for the unlikely worst is the most efficient way to prepare for all the likely but annoying things that could go wrong!

Even if you're very lucky and no infrastructure ever fails you, preparing for it still has some benefit. Being aware of the infrastructure we use and how it works means we're better placed to use that infrastructure well when it's working - and it makes us better able to understand and take part in discussions about the development of that infrastructure. It would be nice if, in planning debates about cellular network towers or power stations or flood management systems, people were more aware of how these things actually help them!

Also, preparing for infrastructure failure is a good exercise to hone your problem-solving skills. When I take my Scouts out on a navigation hike or a camping expedition, it's also a fun social activity for them, as well as developing their teamwork skills. Any group that plans and practices together for infrastructure failure will gain similar benefits.

After all, as a scout leader, I am doing exactly this: teaching young people to look after themselves on camps, make shelters from natural materials, cook on open fires, and so on. Although I hope it will be of use to them in the tiny chance that they need to go out and live in nature, I am mainly doing it because those problem-solving skills and self-sufficiency mindset will serve them well when they leave home and need to figure out how to use a washing machine.

And finally, having an awesome off-grid survival setup means you'll have a great time on camping holidays. And those holidays are also good practice in off-grid survival...

How much time and money is worth spending on it, though? And with many exciting things you could buy or do, how do you spend your budget wisely? There's a certain stereotype of "The Prepper" who tricks out their offroad vehicle with guns and exotic radio gear, driven by fantasies of hunting for food in the forests then living a Mad Max-inspired life of nomadic road combat by day. There is the usual human desire to buy cool toys, and a darker impulse too: if you feel constrained by the rules of modern society, you can start to fantasise about the breakdown of that infrastructure, so that you can finally be "free" (to commit rape, murder, theft, ...).

But don't sneer at those people. They are enthusiastic, they're learning things, and they're having fun, and they're driving the prices of useful survival equipment down by buying lots of it so supply steps up to meet demand. Sure, they're also creating a market for poorly-thought-out "tacticool" equipment, but being thoughtful about choosing what gear you buy is something you need to do anyway!

And if they start properly getting into it and hearing about other people's preparations, they'll think a little deeper about their actual survival plans. And the few who are craving The End so that they can make up for their insecurities by threatening those around them with violence - they'll either get turned off the idea by realising that everyone else is setting up to work as a team that will outnumber them greatly, or if not, at least everyone else can figure out who they are and know to avoid them.

Deciding how much time and money it's worth YOU spending on this stuff depends on your personal situation. Factors to include are:

  1. How much time and money do you actually have spare? Actually living your current life is far more important than worrying about possible futures.
  2. What are the likely risks to you? A dweller of a large city is quite unlikely to face a disaster that they can do much about - if they survive it, their choices are to stay put and live on supplies until civilisation can be restored, or flee the city (along with everyone else fleeing the city, which won't be much fun). So stockpiling a few weeks' essential supplies and hoping for the best is probably as good as it gets, unless you can prepare an accessible countryside hideout. HOWEVER, if you live out in the countryside as I once did, flooding, extended power outages, and being snowed in for weeks at end were things that happened fairly frequently and our preparations were routinely tested - and we had the space to grow our own food.
  3. Do you enjoy it? If you like self-sufficiency for its own sake, because it gives you a warm feeling inside, then you might as well indulge that in a way that's potentially very useful.

However, be careful you're not obsessing about the collapse of civilisation - and if you find you are, try to think about why. Fear is a great way of controlling people, and many rather unpleasant movements exploit this by encouraging people to be afraid, then offering them a feeling of security. If the disasters you're concerned about drift into conspiracy theory territory, you're on a dangerous path. And if you find yourself looking forward to the collapse of civilisation because you think you'll be happier without it, you may have anger issues or problems with authority that you should address.

Things to Worry About

There are a number of things we need to live, and things we'd like to have to live well, that we tend to depend on infrastructure for. It's a good idea to make a list and think about how you'd deal with a failure of each, and how long that failure might last.

Food supply

In the short term, you can stockpile food that lasts a long time (dried, tinned, etc). In the long term, you're going to need to be able to grow your own, or hunt (if you have access to an environment with a suitable population of suitable animals to eat, that can sustain the number of other people who will also be trying to hunt in it). Having the tools, starting supplies, and knowledge to grow your own food / farm your own animals will be necessary in the long term.

Water supply

In the short term, you can store water. In the longer term, you need a source of water, and possibly a way to make it safe to drink if it isn't already. Boiling and filtering are good, but chemical toxins are hard to remove without distilling it.

Shelter

You need to get out of the elements to remain healthy, unless you're in a very nice climate. And a place to store your food and other supplies that keeps them out of the elements, keeps rats from eating them, and so on.

Whatever shelter you have, you'll need to have a plan to repair it. That means tools, materials, and expertise in applying the tools.

Heat

Heat isn't strictly essential unless you're in a cold place, but it's very very useful: to cook your food, to stave off hypothermia, to dry your clothes, to sterilise water, and to keep you comfy and happy.

Fire can also be your light source at night, although it's not very convenient for that.

In the short term, bottled gas, candles, and spirit stoves are great. In the long term, you're going to need to be able to obtain firewood and have facilities to safely and conveniently burn it inside your home.

Rocket stoves are a good (and portable) way to turn wood into cooking-grade heat; rocket mass heaters are a good way to turn wood into house-heating warmth.

Medical support

More so in a disaster than usual, humans get injured or sick, and their survival chances are greatly improved by proper medical care. In the short term, you can stockpile medical supplies, but the important thing is the knowledge to use them - bandages can be improvised, if you know how. First aid classes are a good investment. In the long term, you're going to need at least books on topics like delivering babies, setting broken limbs, long-term would care, and minor surgery.

Cleanliness

Humans are very vulnerable to infections. Ways to clean your cooking/eating utensils, wash your hands, cleaning wounds, cleaning yourself and your clothes so you don't get sores that become itchy then get infected, etc. are very important to help us live long healthy lives. In the short term, hot water and soap will do us well, but what if the soap runs out? Being able to distil alcohol to disinfect things might be useful (and it'll be a fuel for lamps and stoves), or a way to make soap. You can get quite far by boiling things in water to sterilise them, but that's not so great for hands and table tops.

Rotting teeth was a big cause of death in the not-so-distant past. What are you going to brush your teeth with?

Security

This is contentious, and depends a lot on your philosophy. In the weeks after a major disruption to civil infrastructure, it's quite likely that gangs will start robbing supplies, and possibly even enslaving people (although making themselves responsible for additional mouths to feed may prove unpalatable).

Defences against them might include:

  • Not being easy to find in the first place.
  • Making your home hard to break into. Think "gang of people with hammers, not worried about attracting attention" rather than the usual home security risks of conventional burglars. Covering your home in massive steel shutters might make them go and find easier targets at first, but later it might make them more interested in what you've got hidden in there.
  • Collaborating with your neighbours to collectively defend your neighbourhood. Such gangs will probably rely on being a few times the size of a typical family, so they can easily overwhelm a family. An entire street of thirty households all willing to defend the street as a whole will probably form quite a deterrent, and you can cooperate to build physical barriers around your entire community - and patrol them in shifts 24/7.
  • And as a last resort, maybe having your own weapons will help. I mention this last despite it being the first thing many may think of. But actual armed combat is a numbers game - no matter how skilled and well-armed you are, you are likely to get hurt. Military battles are between large groups of well-armed people who are trained to work well together, and still, they have high casualty rates. That works in a military context, because if your "side" wins, their losses are acceptable. If you're defending your family, losses are not acceptable, and you can't get new recruits in to replenish your armed forces as you fight off repeated waves of raiders. If your confrontation actually gets as far as combat, then you have really failed in protecting your group because there's now a high chance some of them are going to get injured.

Communications within your group

Within you house / cluster of houses / etc, you can general shout and ring bells to attract attention, organise regular meeting times to discuss the day, and so on.

But getting everyone together in the first place if disaster strikes while everyone's out at work/school, or keeping in touch if you have to send a party out to forage for food, is going to mean some kind of radio.

Mobile phones are, of course, a form of radio - but one that depends on a network of radio towers, with limiting capacity. When bad things happen in a built up area, that network tends to become jammed with people trying to call each other (this affected us in the 2007 floods). That network relies on central control and has limited power distribution, so in an extended disaster, it will fail before long anyway.

VHF/UHF radios are great for local communications; most countries have licence-free "walkie talkies" that can be used over distances of a mile or two (depending on terrain), which are cheap to buy. Amateur radio gives you access to VHF/UHF radios that can reach across tens of miles.

However, you have to be careful: The smarter gangs of raiders will also have radios, and will listen to your communications, and be delighted to hear you discuss your stockpile levels, and to know exactly when your strongest and bravest are leaving on a mission to search for more bandages. Consider developing a system of codes, and strong discipline about never mentioning certain things, and keeping radio communications to the absolute minimum (don't natter because you're bored on watch duty). Smart folks will be able to cobble together direction finding gear and find where you're transmitting from, even if you don't mention your location.

Communications with nearby groups

On VHF and UHF, you'll quickly bump into other groups in your area using radios, who are therefore presumably also reasonably organised. They might be great people to ally with and form a larger, stronger, group - or they may be raiders (or about to turn into raiders). Careful diplomacy to feel them out, and starting by cooperating on some projects without giving them unrestricted access to your home, might be a good start to build trust.

Although you do need to be careful about letting your guard down and being taken advantage of, I can't stress enough that humans are at their best in groups - forming a larger group will significantly increase your chances of survival. You may well want to form a kind of federal structure; small groups with strong internal trust and their own stores, and then a hierarchy of larger groups that have less internal trust but bring more groups together. If you are successful, you will build a new civilisation. If you are not successful, you will build a new autocracy, or waste your life in endless political bickering and then starve because you never got around to actually building that irrigation system because you never agreed what colour it should be.

Radios are delicate electronic devices. You'll need plenty of spares; it would require quite a large group to make the concentration of specialist skills and tools to build and repair them worthwhile.

Long distance communications

If your disaster is regional, then ways to communicate with the outside world will be useful. In large weather disasters, amateur radio folks with HF equipment have been able to guide relief efforts to the areas that need it. Long range comms is useful for:

  • Calling for help
  • Finding out information about the disaster, that will help you to know how long it will last, what subsequent disasters to expect, etc.

And, in the event of a major disaster, it'll help you to communicate with other groups beyond your local VHF/UHF range if you want to establish larger levels in your federation.

I'd say the first priority here is to have receive capability - FM and shortwave radio receivers are cheap, licence-free, and safe to use. Being able to transmit requires more equipment and training and licences, and opens up the risk of leading raiders to your location, and is less useful.

Power supply

If you want lighting at night beyond what fire can provide, or want to power radios, or you want to use computers to manage your stores inventory, or have ebooks full of information on farming and medical practices, then electricity will be useful.

In the very short term, batteries are good. In the slightly longer term, petrol generator sets will serve you until the fuel runs out. In the much longer term, solar / wind / hydroelectric systems with battery backup can be built to last for tens of years if spares are stockpiled.

Transport

Perhaps, to survive long-term in your environment, you'll need to become a nomad. If not, having a means of moving heavy things around your local area is still useful. Being able to bring back a truckload of firewood from a trip to the woods that are ten minutes' drive away, rather than just what you can carry back from the woods that are an hours' walk away, is a great time saver.

Vehicles with engines will require fuel to keep going in the short term, and spare parts and tools and expertise to keep going for more than a few years.

However, wooden carts pulled by animals can be built and maintained with simple tools. If you are worried about a long-term disaster, plan for how to obtain the required animals, and the tools and skills required to build wheels.

Tools

If you depend on technology, you'll need tools to repair/extend/duplicate it. So you'll need the technology of tool-making.

It's possible to build a forge from natural materials, but it's a lot easier to get started with modern tools, even if you have to use them to build their replacements in a decade's time. Blacksmithing will give you the ability to make wrenches, screwdrivers, axes, knives, hoes, ploughs, hammers, hinges, brackets, spoons, cooking pots, and all sorts of other things. If you want to establish any level of technical civilisation going forward over timescales of a few years or more, somebody's going to need to learn blacksmithing, and it might also be a very useful skill for bartering with other groups with.

I'm not sure if it would be practical to maintain a workable welding facility for long after civilisation collapses: my TIG welding setup depends on somebody being able to distil argon gas out of the atmosphere, a signification electricity supply, and supplies of various esoteric elements to make the tungsten electrode and proper filler wire that will produce strong joints. Oxy-acetylene welding is little better. I'm afraid we'll have nothing finer than forge welding on an anvil.

The next level up is to have a metal casting facility, so you can mass-produce cast iron/steel/aluminium things (there'll be lots of scrap metal around to melt if civilisation collapses). If you've got that, you can also consider building yourself a basic lathe, at which point repairing and manufacturing precision machinery (such as steam engines, or even internal combustion engines) becomes practical.

The most comprehensive resource I know of for this is the "Gingery books", which explain how to build a lathe and other precision machine tools from the basics. The lathe is the cornerstone of it all, as it's a precision tool (meaning: able to make things precisely) that doesn't require any precision tools to build. But starting from scratch is quite difficult; it's a good idea to obtain a lathe while civilisation still functions, because building a spare lathe is a lot easier when you have a lathe to start with to cut the leadscrew on. However, it is possible to start from nothing (after all, our ancestors managed it). And once you've got a lathe, everything else is possible.

Morale

Meeting everyone's physicals needs is all well and good, but a post-apocalyptic world is no picnic. The comforts everyone was used to are gone, and quite possibly, many people you liked or loved are dead, possibly after having agonizingly died in front of you. After the initial shock of everything has worn off, you and your group are going to have some rocky psychological ground to cover.

You will probably all be relatively busy a lot of the time - without washing machines and dishwasher and ready-made food, a large amount of time will be spent cooking and cleaning and gathering firewood and so on. Having something to do will help people cope, but it will also allow people to avoid thinking about the things they've seen or their new situation, saving up trouble for later. So in free time, or over meals, it will be important to give people a chance to discuss their feelings, and to openly discuss the possibilities for the future of the group and form plans together, so they feel a sense of hope that things will improve.

Develop a rota for all the tasks required to maintain your little outpost of civilisation; this will ensure everyone is kept equally busy, which will help to prevent people from sliding into depression, and will help to avoid resentment from any perception that some people aren't pulling their weight. Ensure there's free time for people to be alone or to form into small groups as they wish, as well as time when everyone is brought together (eg, mealtimes) to establish a sense of community.

If possible, have a supply of board games, fiction books, etc. for people who enjoy those sorts of things. Make sure you have a good stock of condoms.

Protection against Whatever The Heck Went Down

The disasters you anticipate happening may demand extra tools and supplies to deal with them. If being snowed into your home is an issue, then snow shovels and grit to put down to make roads driveable would be worth storing. If it's a plague you're worried about, suitably rated breathing masks and gloves might be wise. If you're concerned about nuclear explosions, there's a lot of specialist things you need to know about that I shan't go into here (although it's perhaps the disaster I know the most about preparing for, as it was a big concern in my childhood).

General Notes

Even if you are concerned about the likelihood of permanent infrastructural collapse, you probably don't need to be fully set up for completely self-sufficient living at a moment's notice. If you have enough supplies stocked up to last you several months, you can use that time to set up your own infrastructure to manage after that - just as long as you have everything you'll need to build that infrastructure in time.

Also, plan for your resources being damaged. If you have a fantastic off-grid living setup in your house, and the disaster that hits you destroys your house, that's a problem. Think carefully about where things are stored and what the risks to them are. Avoid having everything in one place. Have spares of things, and the knowledge/tools/parts to repair things that get broken. Choose equipment and supplies that are sturdy so they're more likely to survive a disaster, and easy to fix if they do get damaged.

Useful Information Sources

  • https://theprepared.com/ looks pretty good, if a little US-focussed.

Conclusion

All the measures I suggested to prepare for stuff above are potentially useful for common, minor, emergencies. Many of them can actually improve your life when there isn't an emergency, too. Preparing for all of them will then mean you'd be able to manage even if everything went wrong, but that should probably be considered a side benefit rather than your primary goal!

I'll probably update this post with more things to consider as I think of them. Suggestions will be welcome in the comments 🙂

Designing software (by )

One thing that has often annoyed me in my career as a software designer is coming into conflict with people who want me to do the worst possible job that is "just good enough".

This often comes out in statements like:

  • "There isn't time to design it properly, just hack something so we can start demoing it"
  • "We'll have to rewrite it anyway, requirements always change"
  • "Supporting more features than we need right now is a waste, add them when we need them"
  • "Can't we just do something quick and simple?"

Reading between the lines, they seem to think that "more designing" will mean more complicated software with more features, that will take more time to build.

I think the problem comes from how product management thinks of software - they want a feature, they request the engineers add it (ideally specifying the feature well enough that they actually describe what they want), they get that feature. And there's often some discussion about reducing the scope of the feature by removing some criteria to get it implemented sooner. It seems very much like "more features with more acceptance criteria equals more work".

I'd like to dispell that myth.

I assert that better-designed software.will take less time to write, and will be better due to being more flexible rather than through having more features, and through being easier to extend in future when new requirements come up.

There's a paragraph in the Scheme language standard known as the "Prime Clingerism", and it reads thus:

Programming languages should be designed not by piling feature on top of feature, but by removing the weaknesses and restrictions that make additional features appear necessary. Scheme demonstrates that a very small number of rules for forming expressions, with no restrictions on how they are composed, suffice to form a practical and efficient programming language that is flexible enough to support most of the major programming paradigms in use today.

It has been my experience that this approach applies to all forms of software design, not just programming languages. As a software architect, I see designing a feature as more like Michelangelo making the statue of David (famously, he said that the process of making a statue is just to get a big enough block of stone, and remove all the bits of it that aren't the statue).

Rather than thinking in terms of each acceptance criterion in the specification for the feature as a thing that will have to be done separately (so more ACs means more work), I like to work the other way: what's the simplest piece of software that can do all of these things? Most problems have a "core" that it can be boiled down to, plus some "details". I try to design software that has to meet specific requirements by making the "core" with the fewest assumptions and then adding "details" to tailor it to the exact requirements - which tends to mean I can add more details later to fulfill more requirements.

An example

For instance, many years ago, I worked at a CRM SaaS company. A big part of the app was sending out HTML emails to subsets of a user's customers to offer them some special offer, serving up the images in the email from our HTTP server (and tracking who saw the email by including the email message ID and the recipient ID in the image URL), and tracking what links they clicked by replacing URLs in the email body with URLs hosted by our HTTP server that would log the email message ID and recipient ID then redirect the user.

I was given a feature request: people were occasionally forwarding the emails to their friends, and when they did so, their viewing of the email images and their clicking of links would be logged against the original recipient, as their ID was in all the URLs. Our server would see the same person viewing the email lots of times and clicking the links lots of times. Learning how users responded to these messages was a big priority for our customers (we had extensive reporting systems to analyse this data!), so they were tetchy about this, and desired the ability to put "forward to a friend" forms in the email HTML. The recipient would put their friend's email address into this form and hit a button, and our system would send a fresh copy of the email to their friend, with their own recipient ID - so our user would know the forward had happened, and could see the friends' response separately.

Now, the "simplest" solution would be to add an extra feature to our HTTP server, accepting a form submission to a URL containing the recipient and message IDs, extracting an email address from the form submission in the usual manner, creating a new recipient in the DB with the email address (or finding an existing one), recording a forward from the original recipient ID to the "friend"'s ID, and sending a copy of the email to the "friend" - then responding to the form submission with either a hardcoded thankyou page or responding with custom thankyou-page HTML uploaded by our user, or a redirect to a URL set by the user.

A quick chat with the boss revealed that being able to host custom thankyou pages was a very desirable feature, and as that would involved embedded CSS and images (and maybe javascript), I clearly needed some kind of generic user-uploaded-content HTTP serving infrastructure. So I threw that together, letting customers created websites in the application and upload files, and an HTTP server that would server resources from them with a URL containing the website ID and the path of the file "within" that website - and with the ability to tag URLs with email message and recipient IDs for tracking purposes. We already had an engine to "personalise" HTML message content for a specific recipient, which also handled modifying all the URLs to embed email message and recipient IDs, so I used that again for hosting textual content such as HTML, meaning that if a link came in from an email message with message and recipient IDs, they would be fed into all further URLs returned by the system. To prevent spoofing of the IDs in the URLs, I reused the method we used on the image and redirect server URLs: the URL itself was "signed" with a short cryptographic signature when the software generated it.

But rather than hardcoding the forward-to-a-friend feature into that, I did something that took perhaps ten minutes more programming: I allowed an arbitrary number of named "commands" to be included in a URL. The only named command I implemented was "forward" that would do the forward-to-a-friend logic (finding all form submission fields called "forward-to" and using them as recipient email addresses, so you could make forms that accepted lots of addresses; making it loop over all fields with that name rather than just looking for one was the first assumption I removed to simplify the software while making it more flexible) then proceed with handling the HTTP request in the normal way.

But when a requirement came in to support unsubscribe forms, I just added an "unsubscribe" command, which took all of five minutes. Adding an "update" command handler to let people update their details in the master DB took a little longer, just because I had to list all the supported field names in the documentation and include a more lengthy example. And then, because I'd implemented the recipient and email message IDs in the URLs as optional things from the start, adding a "subscribe" command handler that created a new recipient in the DB from scratch, along with a tweak to the UI to let the user get an anonymous URL for any file in their website took an hour or so - and meant that users could now create subscription forms and generate a URL they could publish. I think I also added a "send" command handler to send a copy of a specific email message to the recipient ID in the tracking context; as the "subscribe" command put the new recipient's ID in the tracking context, a URL with a "subscribe" command followed by a "send-" command would handle a subscription and then send a welcome email to the new subscriber...

I added a few other command types that did various other things in the system, and all was good.

Now, I didn't "set out" to design an "overcomplicated super-flexible" HTTP server system that could do all these things when I was asked to add the forward-to-a-friend system. I just spotted that the following assumptions would be really easy to NOT bake into the core of the implementation:

  • Forward to a friend is always to a single friend; it's easy to create multiple form fields with the same name in an HTML form, and easy to make my server loop over any it finds.
  • Every visit to the new generic HTTP server will have a recipient ID and an email message ID; although forward-to-friends will as they will be linked from an email, it's easy to imagine that we might want to host subscription forms in future. So making the tracking IDs in the email optional (or allowing for other kinds of tracking IDs in future) by making the URL structure by a series of tagged fields (it looked something like http://domain/sss/Rxxx/Eyyy/Wzzz/foo.html for a request for file foo.html in website ID zzz for recipient xxx from email yyy, with sss being the anti-tamper signature) was worth the few minutes' work.
  • Requests to the web server will be forward-to-friend requests or just static resources in support of a response page; it was easy (given we already had an ordered list of tagged components in the URL) to added an ordered list of arbitrary commands (with URL path components like forward, subscribe, etc; any component before the Wzzz/filename part was considered a command or tag, and tags started with an uppercase letter).

The "extra work" required to do things that way rather than the "simple" way was tiny. But it meant that the core of the HTTP server was simple to read and didn't need to change as we extended it with more and more commands (by adding them to a lookup table); it made a powerful system that was easy to extend, easy to understand, and capable of things we didn't have to "add as features" (some or our users did quite creative things by stacking commands!). As the HTTP server core and the commands were small separate modules with a clearly-defined interface, they could be understood individually and were well isolated from each others' implementation details, the benefits of which are well documented.

So please help me fight the assumption that putting thought into designing software means it'll be complicated, more effort to implement, and that "it'll need rewriting anyway so there's no point"! Let me do my job well 🙂

WordPress Themes

Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales
Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales