some discord bots on a private server, notify me whenever a paper in my scientific field is published.
have another one about whenever senator or a representative trades stock.
useful.
1) Be nice and; have fun
Doxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them
2) All posts must end with a '?'
This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?
3) No spam
Please do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.
4) NSFW is okay, within reason
Just remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either !asklemmyafterdark@lemmy.world or !asklemmynsfw@lemmynsfw.com.
NSFW comments should be restricted to posts tagged [NSFW].
5) This is not a support community.
It is not a place for 'how do I?', type questions.
If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email info@lemmy.world. For other questions check our partnered communities list, or use the search function.
6) No US Politics.
Please don't post about current US Politics. If you need to do this, try !politicaldiscussion@lemmy.world or !askusa@discuss.online
Reminder: The terms of service apply here too.
Logo design credit goes to: tubbadu
some discord bots on a private server, notify me whenever a paper in my scientific field is published.
have another one about whenever senator or a representative trades stock.
useful.
That second one sounds neat. Could also be a great website
I used to work at a place outside the city that only had one bus after work and it was kinda spotty and unreliable. However, there was an online API provided by the bus company that told me where the bus is.
So I wrote a Python script and a Linux alert that would give me a notification when the bus was within range, with enough time to get to the stop on time.
Can this be done for basically... any transit? How do you search for api url or stream feed? Its not anything like RSS is it?
I found a webpage that uses it and found out that it requires no authentication. So I just copied the url and sent a request every 5 seconds just like the webpage did. It gave a csv of busses, their routes and gps locations.
Ya but like how might I try to replicate that for a different transit service?
It depends on the transit service, and how much their IT people suck. I'm pretty sure there have been multiple attempts to make standardized APIs for this sort of thing, but you shouldn't necessarily expect them to be widely used except maybe in Europe.
Do a web search for "[transit service name] API" and start from there.
Edit: My local transit service apparently publishes a GTFS feed, which may be more widespread than I assumed, but I'm honestly kinda surprised they didn't try to roll their own or something stupid like that.
Aha sorry hehe
A few years back me and my dad set up a raspberry pi with a temperature probe to monitor the water temp in a local swimming hole, it reports the temperature every half hour and submits it to a private webpage.
Works really well
That's a rad idea. How are you powering and communicating with it? When I hear "watering hole" I picture a secret swimming spot out in the woods somewhere.
It run off of a 12v motorcycle battery, the whole thing is on a timer, every halfhour, the timer gives the pi power for two minutes, during those two minutes the pi boots up, and runs a bash script to collect and send the data, wait for one min and shutdown the pi.
The pi communicates over wifi with a friendly neighbouring house.
Ingenious setup!
Some more details, the temperature probe is a DS18B20, it connects to the GPIO pins, and communicates over the 1-w protocol which is built into the pi, you get the data digitally in celsius, if it is a negative temperature it is a hassle to deal with so I just made it report 0 as default when it is too close.
The probe can error out, it then reports the temp as 85, since the water never actually gets that high in reality, I solved it by checking if the value returned from the probe is 85 before submitting it, if it is, it will take another measurement, check that for 85, if that is still 85, it will check one final time and then just submit the result, so far this has solved the issue.
Once the data is formated and ready, the pi makes an HTTP request, posting the data using curl, to a simple PHP/MySQL site I hacked together, where a page displays the current temp, a timestamp of when the temp was taken and a small graph showing changes to the temp over the last 24h
Planned improvements:
Use the status field that the pi reports to include wifi signal strength, as trees grows around the device it will reduce the signal strength meaning that measurements are lost, with the signal strength data we can check how bad it is and clear leaves ahead of the problem.
Considered improvements:
Security, as it stands right now, there is zero security to submit data to the database, anyone can just access the submit.php page and it will add an empty entry to the database, or if they figure out the syntax they can just post whatever data they want into the database. I would like to add a simple validation of a static random string that the pi sends along with the rest of the data. I am no real webdev, just an IT guy who hacked this together.
Power monitoring, it would be good to have an idea of of how well charged the battery is, it would require a separate module which would also require power, reducing the battery life as it is. Currently the battery lasts a few months and we have a manual schedule to replace it, it is not a huge problem, but it would be nice to have the data.
I forgot about three more technical aspects of the device...
The bash script it set up to run as a service in systemd, this is to make it run on startup and have some control over it, this is important for the next part.
The one min delay after submitting the data and shutting down the pi, this gives me time to find the command to stop the script before the script shuts down the pi, this is important so you can access the system and service it.
Why shut it down at all, the power will be cut shortly after?
This is to preserve the filesystem and reduce the risk of corruption, consider that the pi will turn on and off 24 times every day, any error caused by improper shutdowns will quickly amplify.
I think a Pi is an overkill for this. If I were to attempt this, i would try getting it done with an ESP8266 module which uses far less power, making the battery last much longer. Bootup and shutdown times would be much less so using coin cells or supercapacitors charged using small solar panels could also be used. If your home is not too far (few km), using LoRa could eliminate dependency on the WiFi. Cool use case, nonetheless!
A Pi is obviously overkill, even a Pi Z w which we ended up using, but they are efficient enough for us, and more importantly, I know the system, and I could relatively quickly get it working using just bash on the Pi.
I was not really interested in learning how to program on a different system just for this.
We did some power analytics on the Pi and disabled a few things, sorry I don't remember it right now.
The unit is placed in a semi public place where teenagers sometimes congregate and we don't want to draw any attention to the device, so solar power is out.
A LoRa unit though could be interesting to implement, sadly my parents house is up a steap hill and there is no line of sight.
I have been thinking of experimenting with Meshtastic and LoRa for off grid coms due to the geopolitical situation here in Europe, might be worth it getting a few units to test out.
Scheduling bill payments through my banks online bill pay. I will pay bills with a credit card when I absolutely have to. I don't use ACH autodraft at all if I can avoid it. Online bill pay is usually free, it helps centralize all my bill payments, and if there's a problem I just call the bank instead of having to mess with the vendor.
It also helps make sure I don't forget to pay a bill, which my ADHD brain would do all the time otherwise.
Automating bill payments had been such a huge change for my life - I was only sporadically able to maintain good habits but now everything just works. Minimal effort, maximum gainz!
But I’d also include
I'm processing orders for an online shop so a lot of what I do is printing different things on different printers (different labels with different sizes etc) so I wrote a few little JS scripts to inject into the Webshop to automate downloading the different labels, and an accompanying AHK script to automatically print the labels to the correct printers. Instead of 10-20 inputs I just press one button now.
I've been playing Factorio with a friend. Our factory was getting large enough that him downloading the map and catching up was getting really slow (even though the factory itself wasn't that big). We ended up setting up a VPN which somehow made that process SIGNIFICANTLY faster. However, I really only wanted the VPN on while we were playing the game. So I ended up writing some automation to detect if I was no longer playing and the VPN was still active and then shut it off automatically. It's a small thing but I'm both proud of it and happy with the results.
Breathing
Monthly backups of containers and volumes, notifications of disruptions, rules for salary to send it to the right places. Arr stack saves a ton of time too
I'm really into IoT automation - wiring up Arduino & ESP devices and programming them - but tbh it's hard to think of much to automate IRL. So I haven't automated anything yet. I want a few ourdoor lights to sense motion more elaborately than just having a motion sensor built in - to light up when approached from opposite directions. Also to add switches indoors where I didn't think to put them when I wired the house. So like, have several ESP32 wall switches tell a room light to turn on or off without running new AC lines through the walls. That would be super useful. Another one is subtle night lighting on stairways for safety, so my eventual cause of death isn't falling downstairs after tripping on a cat.
Seriously, I haven’t automated anything. And life is just fine.