Here is a National Health Index (NHI) validator and generator that I created. NHIs are healthcare identifiers used in New Zealand.
NHI's uses the letters A-Z without I or O.
NHI's start with three letters and end with four numbers.
The last digit is a checksum.
NHI's are assigned randomly. I believe hospitals have distinct sets ready to be assigned.
Its possible for somebody to have multiple NHIs (first alphabetically is the primary).
The current Id. structure only allows for around 13.8 million NHI's. With a population of around 5 million in 2019 and the possibility of a single person being associated to multiple Id.s, I suspect NHIs in their current form wont be around very long.
A while ago I set up an old webcam / Raspberry Pi to serve as a security camera. Using Motion, its easy to set up a system that will record any movement and can be manually enabled or set to run on a simple schedule such as while I am away at work.
Eventually I made the system a bit smarter to automatically turn on when I leave home and turn off as soon as I get back. Added to that, if anything moves while I am out, I get a message with a photo sent to my phone.
For fun, I also added an AI to my messaging system so if I get bored I can have a chat or ask it to do some pre-programmed tasks (such as shutting down systems on the network, taking a photo or changing its settings).
The heart of the system is written in Python and is set to run as a systemd process. It mostly sleeps and wakes up every so often (~10 seconds) to check for new motion events or messages from telegram.
Network presence detection
It turns out that its not easy to detect the presence of iPhones on a network. In order to save power they can be come rather quiet and uncommunicative to network chatter.
At first I tried to build something in Python but after it became clear it was no small task, I decided to delegate to a subprocess and run a system tool. Next, I went with a script using hping3 and arp tables. This still wasn’t fantastic so at the moment I am just using an nmap ping. From my tests, this seems to work better than hping3 at finding the iPhone but my tests weren’t very scientific.
I set up a database to log network presence and created a small PHP script to graph phones on the network. In the example below, you can see the blue graph for my phone, pink for my girlfriends and green shows when one of us are at home (and the system is turned off).
Initially I build a messaging component using the free Telstra API. This provided an API allowing me to send SMS messages to my phone when the system started up or movement was captured. I ripped this out when Telstra added more limits on the API and put more of a push to their priced model.
After looking for a better way to do push notifications to my phone, I eventually settled on creating a Telegram bot. This allayed my cost aversion, provided the push notification behaviour that I was after and opened up easier two way communication.
I took an old copy of the A.L.I.C.E. AIML bot and plugged it into my Telegram bot. Its hardly going to convince anybody in a Turing test but is still quite a bit of fun to chat to.
Motion provides a very easy to set up frame/video capture process on Linux. It has the ability to trigger actions when motion is detected but I have instead chosen to go with periodically polling its output for events and archiving captures.