26 ms·
Boyfriend-alert – A light based alert system
- oh_sigh 5y agoThis code looks like it was written in 2004. Why aren't you using react and nodejs?
- ricardobayes 5y agoSimple is beautiful. Some people don't use frameworks for simple stuff. I sometimes create low-tech websites just using html+css with a minimal jquery. The speed is insane compared to usual web 2.0 sites.
- fabioborellini 5y agoI could make it simpler by using 1 scripting language instead of 2. There are almost as many languages as LoC there.
- nkozyra 5y agoI think that's my only point of contention. It's clearly a for fun project but you've already got python there to run the raspi gpio pins why not move the server stuff in there? I'm assuming they learned bare minimum python to get the pi stuff going but that's enough python to run a web server too.
- louissan 5y agonot sure this is a joke or not ... :-) 30MB of dependencies vs a few tens of lines of code? :-)
- politelemon 5y agoIt's a joke, they're just referencing modern trends in web development and a dose of /r/programmerhumor
- iqanq 5y ago
- zinekeller 5y agoI don't know, it seems that most here have been burnt-out of humour. To be fair to them, the burn-out is mainly caused by ignorant managers hearing "Node! React!" and forcing on the developers whether it makes sense or not.
- Zababa 5y agoPoe's law, ironic content can be hard to differentiate from non-ironic content, and a proliferation of ironic content will bring the quality of HN down.
- sundarurfriend 5y agoThere could be other reasons that it's downvoted, even if it's not taken "seriously". The fact that it's a low effort comment that has barely anything to do with the OP, that it's a rehashing of the same old "unpopular opinion" that's not really unpopular here, the fact that it takes a nice little post of a small utility and shifts the tone to something negative just because they have an axe to grind - all of these are other possible options people might downvote this oh-so-ironic comment.
- pjc50 5y agoPoe's law: there's nothing so ironic or sarcastic that someone hasn't actually argued for real somewhere. You just can't tell any more. Besides being in text, HN has an international audience. It's really hard to make jokes land, and you usually need to include an explanation to avoid being downvoted.
- LilBytes 5y agoSarCasM CaSE AnD EmoJis HaVE thEre PlACE.
- conqueso 5y agoOne can never be completely sure through text alone, hence such things as the closing sarcasm tag: </s>
- Cthulhu_ 5y agoNodeJS is last decade; Deno is the one to go for now. But why JS based? Rust is the future, accept no substitutes. It is the perfect language for everything, forever.
- zriha 5y agoThis is amazing hahahaha :) you can also put an upgrade - Wife Alert for us older. :D
- smoyer 5y agoIf it dings occasionally, it means your girlfriend is trying to reach you. If it dings continuously, it means she's breaking up with you. Yes, I'm trying to be a little funny but the point is that (outside perhaps work?), you should probably be a bit more engaged with the people that mean something to you.
- azeirah 5y agoI really wouldn't assume too much about his situation. My girlfriend has autism and when I want her attention I need to ask for it like 5 times over a space of 20 seconds, if I don't ask multiple times she will literally forget I even asked in the first place. Sometimes it literally takes a minute. This isn't because she doesn't care about me, it's just how her brain works. Maybe this is just a better form of communication for him while he's focused on work. Please don't assume ill-intent, it just seems unnecessarily rude.
- beefield 5y agoOut of curiosity, how does your girlfriend react if you just start talking to her without asking attention? (Reason I ask, occasionally I think I might be on the spectrum, and my SO has a habit of just starting to talk to me. Most of the time I miss the beginning, which annoys to no end my SO...)
- azeirah 5y agoIt's just not processed whatsoever sometimes I catch her attention halfway through but I usually just have to start over again...
- deleted 5y ago[deleted]
- jacobmartin 5y agoDifferent from the person you replied to, but my wife is also autistic, and she does the exact same thing (both needing for me to ask for her attention multiple times and not hearing anything for the first little bit if I don't get it). It used to annoy me but then I realized that was a silly thing to be annoyed about, and I just had to change my mode of talking to her.
- noobermin 5y agoI'm happy to see something (anything) in python that doesn't encapsulate everything in a class when it doesn't need to be, even this basic thing.
- susam 5y agoHere is a rudimentary alerting system I could write quickly in shell and execute on my laptop: while true; do echo ok | nc -l 8000; for i in 1 2 3 4; do printf '\a'; sleep 1; done; done While the above command worked fine on macOS with the default /usr/bin/nc, on Debian 11.2, I had to modify the above command as follows to make it work: while true; do echo ok | nc -q 1 -l -p 8000; for i in 1 2 3 4; do printf '\a'; sleep 1; done; done Now anytime someone connects to port 8000 of my system by any means, I will hear 4 beeps! The other party can use whatever client they have to connect to port 8000 of my system, e.g., a web browser, nc HOST 8000, curl HOST:8000, or even, ssh HOST -p 8000, irssi -c HOST -p 8000, etc. If your port 8000 is already occupied, I recommend port 41327 as an alternative for this alerting service. After all, 41327 reads "ALERT" in leetspeak. By the way, visit http://susam.net:8000/ http://susam.net:8000/ right now to send me some beeps! :)
- Villodre 5y agoI bet you're having a fun morning with the beeps :-)
- susam 5y agoIndeed I am! HN readers are a fun group. I am receiving beeps almost every second, so I updated my previous shell script to keep a record of the connections netcat receives. Also, converted the beeping loop to a background job, so that the outer netcat loop does not have to wait for the inner beeping loop to complete before handling the next connection. Notice the '&' before the last 'done' in the improved alerting service below: while true; do (echo ok | nc -q 1 -vlp 8000 2>&1; echo; date -u) | tee -a beeper.log; for i in 1 2 3 4; do printf '\a'; sleep 1; done & done Here is a log of the timestamps of the connections received so far: https://gist.github.com/susam/159c7d92659b3185eb0b0d683998a3b7 https://gist.github.com/susam/159c7d92659b3185eb0b0d683998a3...
- LilBytes 5y agoDDoSaS. Distributed denial of service and sleep. Nice work.
- 5y ago
- 00000000005 5y agoBatman made exactly the same thing for Commissioner Gordon to use… the Bat Signal.
- berkes 5y agoBrings back memories! I've had several such hacky things for my GF (now wife) and vice-versa. `eject` + a post-it on the CD-rom tray 'Hey, look behind you!' `ssh my-machine.local espeak 'dinner is ready'` or `ssh her-machine.home espeak "please pick up the phone! important!"`. With a simple button exposed via a .desktop file.
- charcircuit 5y agoThis seems to be worse than just having your girlfriend send you a DM on Discord. Discord will make a noise and show you a notification. Discord will also show you that you have an unread message where with this it's easy to miss (what's probably a LED) flash 6 times in 5.7 seconds. Being able to attach a message also lets you get some context on what she may need. It might not be that urgent.
- roel_v 5y agoLOL. GF: "Hey, can you come have a look at this shirt I bought?" Parent: "Yeah can you please file a JIRA ticket for that, and appropriately tag its priority? I'll get notifications through my regular workflow channels and this will enable me to respond to your requests in a more timely manner! Thanks!"
- Bad_CRC 5y agoThere is a software for running a house [1] in which you can do meal plan, etc.. (which is nice) but it has also repeating tasks like clean the windows, do the dishes and it was too Work-like for my liking. [1] https://grocy.info/ https://grocy.info/
- Cthulhu_ 5y agoYou're already assuming that A: they use Discord, B: that while he's focused on whatever it is he's doing, he'll pay attention to Discord pings, and C: that someone asked for you to come up with alternative solutions.
- hsbauauvhabzb 5y agoBuilding something to show her you care: priceless
- hackandtrip 5y ago+1. As software engineers I think we should explore more the part of our skills that can create things that are not useful per-se, but creative and funny, such as the best gifts (at least for me) are
- jraph 5y agoSomeone just moving by 1 centimeter in the corridor next to me or coughing in any bedroom (if I don't wear my headset) will do. OH, a bird at the window!! I'm still able to concentrate. By the way, what was I doing already? (more seriously, I can progress and I am able to get things done and recover from interruptions quite easily, but almost never focused at a point I can't notice what is going on around me. Which suits me well actually)
- bryanrasmussen 5y agoI have the same thing, I can easily break out of code and get right back in to where I was, I can even pretty much do it with hours break, unless things are going very badly with the code in which case I cannot handle being interrupted. I wonder if it's my ADHD that does it actually, I can handle quick changes of attention because after all that is what I do, but if things are a problem I need all effort to not switch attention and lose what I am doing.
- jcims 5y agoThose little /ducks/ Amazon iot buttons are fun for this. I wired one up to their connect service to make a voice call. I would let my kids troll me with it or take it to work to clandestinely make calls to myself when it was advantageous to receive one.
- Jaruzel 5y agoI would love to see open source copies of those. Apparently they use NO power unless you press their buttons which means they can last for years.
- jcims 5y ago100%. Plus they could be way cheaper (i think).
- twicetwice 5y agoI got some Aqara buttons and switches from cloudfree.shop, they're closed-source but local network (Zigbee) only—combined with Home Assistant, which is open source, I think this is what you want!
- teekert 5y agoI use a wife alert: She Never picks up her phone, that is until I use Home Assistant to flash the lights and have the Sonos say (via HA's tts): "Pick up the Phone!". Very handy. I know a family where the kitchen table lights turn green when their (temporarily) disabled son needs something and he is upstairs. My mom used to hit the radiator pipes with her wedding ring for that (in the opposite situation).
- oefrha 5y agoI have something like this for myself: a server listens for POSTs on LAN, plays a loud customizable sound on speaker, macOS pops up a persistent alert through a Shortcut, and all iOS devices receive an urgent push notification through Pushover. I can hook arbitrary high priority jobs and watchers to it since it only takes an HTTP request to activate.
- wiredfool 5y agoRemember Growl?
- jstanley 5y agoInterestingly the TLDR is longer than the rest of the README.
- jgrahamc 5y agoAdvanced version: https://blog.jgc.org/2018/12/turning-cheap-police-light-into-iot.html https://blog.jgc.org/2018/12/turning-cheap-police-light-into...
- sdfjkl 5y agoWife just sits opposite me and waves her arm.
- Brajeshwar 5y agoThis is sweet. Now, my wife uses Apple's Find My's "Play Sound" as I'm perpetually on Silent DND and I sometimes do not see her calls (she is in the whitelist and is allowed to use voice calls). I would like to narrate a personal story from the late 80s. I grew up in a multi-family where my uncles own a lot of vehicles, including the left-handed drive Jeeps from the World War era (India uses Right-Hand Drive). Our siblings were raised by our grandmother. After she finishes cooking lunch, she always have the problem of gathering us around to eat. We would have all gone to the locality and the neighbors to play. She was always frustrated and furious about our lack of timing. So, I repurposed a truck's horn so she can just press a switch and blow the horn loud enough for us to hear across the neighbors. I had it on the roof-top for quite a while, even after she passed away the next year. Thinking about it now, I know it was pretty reckless. It was so loud, that other families would remind their kids that -- that is the Food-Time-Horn.
- foxtrottbravo 5y agoWe to this day have a cowbell mounted below the stairs to call everyone when dinner is ready
- Loic 5y agoIn the French countryside where my father is coming from, every house had an external bell for the diner/lunch whatever important call. You quickly learnt to recognize the different tones and ways to ring the bell. My parents had also the bell at the bottom of the stairs... and as a father of 3, I understand all the parents having one!
- Isamu 5y agoYeah we used a cowbell- farm living.
- wrp 5y agoMy grandmother had a kind of wall-mounted metal xylophone at the foot of the stairs to call the family for meals.
- schleck8 5y ago
- mcv 5y agoMy son always has his headphones on these days, which often makes it hard for us to reach him. I wouldn't mind being able to talk directly into his headphones.
- dom96 5y agoThat does sound like a cool app idea.
- jraph 5y agoThe child might refuse to install it though.
- BurningPenguin 5y agoI'd say it depends on the parents. If the relationship is somewhat healthy, there might be a chance. But those who require their kids to be on constant alert may have a problem. Source: I grew up with a parent who got multiple times diagnosed with HPD. I would have never installed something like that. Installing and showing how Discord works was already a major mistake. https://en.wikipedia.org/wiki/Histrionic_personality_disorder https://en.wikipedia.org/wiki/Histrionic_personality_disorde...
- npteljes 5y agoReally made me think. I would have HATED op's idea - that my experience is suddenly interrupted by a parent. So yes it's definitely up to the people and their relationship.
- invalidusernam3 5y agoApple watch has a Walkie-Talkie feature
- f1refly 5y agoFor headphones to work there has to be a communication platform. I reckon it wouldn't be too hard to pick up a computer yourself, join his channel and talk to him. Wildly depends on your sons age though, I guess I wouldn't have been too keen on my mum having access to my teamspeak when I was 15.
- imnoscar 5y agoRyan invented WUPFH because Kelly couldn't reach him. [1] [1] https://theoffice.fandom.com/wiki/WUPHF.com_(Website) https://theoffice.fandom.com/wiki/WUPHF.com_(Website)
- xwdv 5y agoThis seems like a nightmare. If I’m focused on something I don’t really want anyone distracting me, especially not a girlfriend.
- laurent123456 5y agoIt somehow bothers me that the TLDR is much longer than the actual text, but nice little tool anyway.
- eb0la 5y agoSincerely, get an RPi or an Arduino and build a Batsignal with this. You already did the hard part ;-).
- alias_neo 5y agoJudging by the contents of run.py, it's already running on a Pi.
- nanna 5y agoBatsignal?
- WelcomeShorty 5y agohttps://en.wikipedia.org/wiki/Bat-Signal https://en.wikipedia.org/wiki/Bat-Signal
- d0gsg0w00f 5y agoWhen I don't answer my wife just calls me through the Alexa which is the creepiest ring ever. The sound is so foreign and my hackles rise whenever Alexa does anything on its own so it gets my attention instantly.
- erwincoumans 5y agoIndeed, Alexa make an announcement: dinner is ready!
- openknot 5y agoFor those curious about what the ring sounds like, it’s captured in this video (2017, skipped to 1:07): https://youtu.be/h5wmJbhyhC4?t=67 https://youtu.be/h5wmJbhyhC4?t=67
- bjord 5y agoif you think THAT is creepy, you should tell her to try out the drop-in feature
- whalesalad 5y agoI need to teach my German Shepherd how to use curl so she can also use this method.
- glenneroo 5y agoThe run.py script indicates this is running on a Raspberry Pi to read GPIO pins i.e. you could literally just hook up a button to a GPIO pin and train your dog to stomp on the button.
- whalesalad 5y agoIt was meant purely as a joke. Even if I built the most elaborate notification system in the world - she basically runs the show. I did a doggy version of 23andme, she is 30% Siberian Husky and 6% Belgian Malinois so the line is blurred between sweet loving companion and psychotic girlfriend.
- samatman 5y agoWas this meant to be cute, or are you actually just telling the world you have a large, therefore dangerous, sled dog, and you haven't trained her? She "runs the show"? The "psychotic girlfriend" side of untrained large dogs has been known to maul children.
- whalesalad 5y agoThat is quite a conclusion you’ve leapt to. Meant to be cute here. Obviously I run the show, I’m the one who pays the bills and feeds her. But she’s surely not afraid to let you know when she wants something, and doesn’t particularly care if you’re busy with something else. For the record, most sled dogs are not very large and not particularly aggressive.
- crtasm 5y agoI dislike seeing this trope about women being brought into, of all things, a discussion about a dog.
- eric4smith 5y ago
- fareesh 5y agoOn Android I just star the contact and turn on DND mode. Works flawlessly with one exception - WhatsApp calls.
- diogenesjunior 5y agoAre people seriously this tied in to their computers? I'd hate to see myself get to the point where I don't have time for women and need to be beeped in order to pay attention.
- whalesalad 5y agoAre you familiar with the concept of deep work? Sometimes you need a solid block of completely uninterrupted time to keep your cache/working memory hot so that you can see the whole task through. My wife used to interrupt me all the time - even in the middle of a wim hof breath hold. I'm looking at her like, this is the 10,000th time I have done this, and we do it together sometimes, why do you think I can respond to you in this moment?
- diogenesjunior 5y agoI work for a large tech company 10-12 hours a day + 2-4 hours at home and I could never see my girlfriend needing a SOS light to get my attention.
- okokwhatever 5y agoagree
- BurningPenguin 5y agoDoesn't mean he's completely tied to it. He may be only focused on his hobby. That can happen with anything. Woodworking, drawing, reading, whatever. Being on constant alert isn't healthy. Everyone needs some time for themselves to power down a bit.
- joshmanders 5y agoOr maybe people just want to have something special for their loved ones to help THEM feel special to them. I had considered making something for my girlfriend also, because she loves that I'm a nerd and I wanted to use my nerdiness to make her something special, even if it is just a button for her to press that lights up a light on my desk, just so she can tell me she's thinking of me.
- cgufus 5y agoMany many years ago I played a browser-based online game and I used curl and php for scripting the game. I eventually programmed an alert feature that woke me up (OS X: ‘say “Warning you are under attack”’) during the night when I was being attacked. good old times :)
- Someone1234 5y agoApple Watches have a cool Walkie-Talkie concept that could have worked well for this scenario. I call it a concept though because the app as-implemented is unreliable and gets stuck in "Checking availability," "Trying to reconnect" every time you launch it. If you lower your wrist while it is trying to reconnect the app gets suspended and starts again. So imagine standing there for sometimes up to a minute with your wrist extended while the Walkie-Talkie app tries to reconnect, all to hypothetically save time. It isn't workable. Which is a real shame because great concept on paper.
- mikestew 5y agoIt's a feature used once and then disabled. It seemed cool back when we got our Watch 4s, but as pointed out, it seemed like someone's side project that somehow made it into production. Turns out, you could have just called in less time.
- britches11 5y agoIt's also a major battery drain -- probably thanks to the issues you mentioned.
- BeefWellington 5y agoBack in the mid-2000s or so before 2FA was really a thing, I built a small perl script to have my server do audio beeps using the PC speaker based on some activity in the system. The idea was I sat in my office near enough to my servers at home that I could hear audio beeps. I also had patterns of sounds so that each type of activity was a different noise, e.g.: SSH logins would produce one pattern, local login a different set, etc. I've long since lost the script but I've seen a few similar ideas kicking around over the years. Really only applicable to homelabbers I imagine and probably easy enough to throw together again.
- lillesvin 5y agoRemember the dude whose garage port opened and closed seemingly at random because his /toggle endpoint ended up in his browser's "most visited" list: https://news.ycombinator.com/item?id=16964907 https://news.ycombinator.com/item?id=16964907 ? I have a feeling the same thing could happen here.
- dokem 5y agoThat's why you have to use a POST request. GET should be read-only and a browser will not re-issue a POST for things like most-visited, tab restore, pre-fetch, etc.
- lillesvin 5y agoYeah, that's what the guy in the linked post is talking about. Various services (Skype/Teams, Slack, Twitter, etc.) will also send a GET if the URL is shared there. I once saw an accidental hotel booking triggered by Skype because the booking was performed through a GET request with a brazillion parameters.
- deleted 5y ago[deleted]
- itronitron 5y agoThe no-code implementation of this is to plug your workstation into an outlet that is controlled by a wall switch.
- jvanderbot 5y agoI love that technology has become so accessible and powerful that everyone can become that crazy father/inventor of contraptions from 80s movies. Or maybe the art motivated the real. I'd believe that.
- viggity 5y agoI gave my wife a flashlight and she shines it at my screen
- findalex 5y agoI get the living day lights scared out of me at least twice a day (by my gf) while working with headphones on. Light is perfect.
- unexistential 5y agoI built something similar for my girlfriend's birthday a few months ago. A buzzer and a lightbulb connected through a relay to an RPi, which hosts a basic HTTP server. The server is exposed to the Internet through a reverse ssh tunnel to a VPS in the cloud. What has taken me aback is how it regularly receives malicious traffic that I suspect is from bots scanning for vulnerable servers. The hostname is not shared anywhere public. The client app that knows the URL has only been shared to her as an APK. Made me realize there's no such thing as security through obscurity.
- jayshua 5y agoI wonder if having only an IPv6 address would provide enough obscurity to be reasonably secure in this case? Or maybe those allocations are still to publicly guessable?
- asveikau 5y agoYou're saying the malicious requests are hitting the obscure path that only shows up in her apk? Is it running https? Trying to think of how they would have gotten that, eavesdropping would be one way. Otoh if they are hitting your host by randomly probed IP address but don't know the obscure path, that is not surprising at all. There are tons of exposed http ports unknown to their operators, and it is makes total sense that bad actors are trying to discover them.
- unexistential 5y agoNo, thankfully they're hitting paths like /phpmyadmin/index.html which do not exist on the server. Makes sense, it's probably random IP address based probes long you said. I'm not running https but I should, to protect myself from someone MITMing the requests and possibly pwning my Pi.
- NaturalPhallacy 5y agoThis reminded me of the function I added to my .bash_profile that would randomly tell me to buy flowers for my girlfriend for a while. # flowers? function flowers() { let "flowers = $RANDOM % 25"; echo -en "\nI should"; if [[ ${flowers} != 0 ]]; then echo -n " not";fi;echo -e " buy flowers today.\n\n" }
- mortenlarsen 5y agoA former coworker has a wife alert. When her phone connects to the WiFi, the light at his desk turns red. He mumbled something about needing to close a bunch of tabs featuring pink pixels.
- JetAlone 5y agoThe tabs must be shopping websites, he's been looking for a secret present for her.
- akanello 5y agoThis is fun. I made a similar thing with an rpi(sans the sound), when my girlfriend had mild covid and was isolating in the room next door. It's was nice to have an electronic communication method bespoke for her (even if it doesn't communicate that much information).
- sexy_panda 5y agoAs you're already using python for gpios, you could just use flask to get rid of php. This will shrink your dependencies by at least 100MB.