r/learnpython • u/hasanaslan • Feb 14 '20
Made a script that will clean your mess after death
Recently, there have been a rumor; a man deletes his friend's chrome history after his friend dead.
So, I decided to make a script that will be my buddy. My buddy will clean my chrome history and private files which I added their paths before. Being a very beginner on python, more or less, I think I achieved this project. You add the directories and set the time. On every startup, you will see your date on the screen for 10 secs. When the time comes and if you haven't set extra time on the program, it will delete your browser history and the paths you added. Also you can hide this paths too using windows superhiding method.
Here is the link: https://github.com/hasanaslan7/loyalbuddy
PS: As I said I consider myself as a beginner. If you have any opinions and arrangements on my code, I would be glad to hear them. Also, I couldn't convert this to an exe file. When I did it, I will share it on the same link.
79
u/thedeathringer0 Feb 14 '20
I make a machine so that ehen my heart stops it burns my house down and has all the speakers start playing all star by smash mouth
11
46
Feb 14 '20
Then you get sleep apnea and your heart momentarily stops in the middle of the night. Before you realize what's happened you're trapped in your burning house and wake to hear the line, "my world's on fire, how bout yours? That's the way I like it and I'll never get bored".
16
u/running_fridge Feb 14 '20
Well technically during sleep apnoea it's only your breathing that stops. Your heart keeps on beating so we good!
2
Feb 14 '20
Oh snap! Bring on that app! Yeah, I was misinformed at some point, so thanks for the correction.
1
u/oblivion-age Feb 15 '20
I think eventually the heart would cease if there is no breathing so you're not completely wrong. What we need is an app to shock you automatically if you stop breathing.
3
Feb 14 '20
If you created that machine and programmed it someone would complain that you hard-coded the song. /s
2
u/oblivion-age Feb 15 '20
Pipe it to elevators and department stores all around the world upon your death.
0
0
Feb 14 '20
[deleted]
4
2
u/NotDesperateEggplant Feb 15 '20
While listening to the best music humanity ever made so its a win win I guess
26
u/cellwall-999 Feb 14 '20
Pack the whole damn thing in tkinter.
You'll love it. Great tool btw.
3
5
u/lovelysad69 Feb 14 '20
i thought tkinter was outdated
6
2
u/cellwall-999 Feb 14 '20
How outdated?
11
u/lovelysad69 Feb 14 '20
looks ugly and archaic etc, pyqt5 is more modern looking
4
u/cellwall-999 Feb 14 '20
I know but I think tkinter works well with micro projects.
5
u/billsil Feb 14 '20
It’s workable, but it takes more code to do a crappier version of what you want. Might as well use a real GUI development tool that’s less work.
1
u/Yakhov Feb 15 '20
what so you think of kivy for mobile apps?
1
u/billsil Feb 15 '20
I personally don't like it. If I'm on a desktop, I want a real desktop program. I don't write code for phones.
1
u/Yakhov Feb 16 '20
I'm sticking to web apps for now. I just didn't realize I could get what I needed from the GPS through a browser. I think I spent more time looking for answers to if that was possible and getting led down the youtube and google rabbit holes of commercialized search bias that I couldn't make that connection. So many tools if you don't pose the search correctly you can spin your wheels for hours trying to figure out the best approach or mod to solve the problem and then it turns out it's already solved and you just didn't hit the right page.
3
Feb 14 '20
[removed] — view removed comment
3
u/billsil Feb 14 '20
If you want to get technical, PyQt is free software, as in source code, not as it price if you don’t want to release your source code.
PySide2 is the best of both worlds. They’re 99.9% the same.
3
u/Mariavagh Feb 14 '20
What if you decide to make a coffee while your computer is starting up... You come back and it just performed a factory reset...
2
u/hasanaslan Feb 14 '20
You should set a week time. İn every startup it shows you your due date. So, don't let it approach less than 2 days
5
u/Lupin_17 Feb 14 '20
There is the cx_freeze package for converting a .py into a .exe
I don't know if it still exists,I used it a year ago...
3
u/hasanaslan Feb 14 '20
I'm using pyinstaller and up to today, it was fine. Just having an issue when trying to compile this script
8
u/atamicbomb Feb 14 '20
Great exercise, and will keep your family out, but I doubt the methods python uses make the data irretrievable. Thought TBH they could just get a warrant for google
19
u/Pineapple-Yetti Feb 14 '20
I figured it was more so your family dont find out your porn habits. Not hiding information from the police.
7
u/hasanaslan Feb 14 '20
Kind of. İf i could reach that level, i wouldn't post it here lol
4
u/a1brit Feb 14 '20
There's a similar small python repo / pypi package called 'secure-delete' that writes random data to disk in place of the file.
3
u/clarknova77 Feb 14 '20
Isn't that what the private browsing tab is for?
Does it still leave traces on your hard drive? I've got nothing to hide from the police. My wife, on the other hand, maybe :D
3
1
u/turningsteel Feb 15 '20
Oh I just have a vat of muriatic acid tied above my workspace with an axe that will cut the rope if I don't login once per day. But this OP's way is good too.
1
2
u/Vitaman02 Feb 14 '20
Maybe make this run with a pacemaker that has wifi access and then when it detects your heart stopping for more than 10 minutes then it should send a ping to a webserver that deletes everything. I feel like I have gone too far with this project. Nice idea, looks interesting, keep it up! :)
2
2
u/Arnz_3 Feb 14 '20
Maybe you can edit it so it deletes your files if you miss your alarm 2 days in a row
2
2
u/LeSUTHU Feb 15 '20
Can someone help me understand what the codex is being used for?
1
u/hasanaslan Feb 16 '20
I am not that good at hiding passwords on python. So, i wanted to store user's password in a simple file that can be read with text editor. But, if someone could find this file, instead of the password they will find meaningless characters. But my script understand this characters. That's why I wrote that function.
1
u/LeSUTHU Feb 16 '20
oh so this is sort of an encryption method so that only the computer can understand it. That's very cool
2
0
Feb 15 '20
[deleted]
1
u/LeSUTHU Feb 16 '20
tbh, I don't think I understand fully but still this helped me get like a slight idea of what it is. Thxs
0
Mar 01 '20
[deleted]
1
u/LeSUTHU Mar 03 '20
Yeah I really get it now. It kinda feels like the Caesar cipher thing. It's really nice and thanks a lot for the thorough explanation.
2
u/B166er_ Feb 15 '20
I was thinking on something similar to this but instead of a date, it would be a simple action that you have to do when you startup. There is a time limit for doing the action, if the action is not done all your files are deleted.
What could that simple action be? Uhmm, maybe opening a file/dir, maybe doing a particular movement with the mouse, maybe typing something in particular.
Edit: It doesn't need to stop on deleting files, maybe it could trigger a bot to post some things on a social network, liberate files from a private repository or whatever.
1
2
37
20
u/jess_611 Feb 14 '20
Can you make it just burn my entire phone?
13
u/o15i17 Feb 14 '20
It's not kinda possible, phone batteries didn't output high voltages to harm phone but maybe maybe somehow we can overload the battery and make it explode but there's no guarantee that it will destroy everything
60
1
u/billsil Feb 15 '20
Just run Waze. What a horrible app, even when it's not actively doing anything on Android. I had installed it the week before and used it once. I was driving, it was ~95 degrees, and I had to cool off my Samsung S6 by repeatedly burning my hand.
3
7
u/PM_me_ur_data_ Feb 14 '20
A cool extension to this that you could make to teach yourself how to work with APIs and webscraping would be to script the program to search local news websites and obituary pages for your name (and other identifying information, if you have a common name) and delete your history if it finds you dead.
3
u/Shadow_Road Feb 14 '20
Have you read Daemon?
1
u/PM_me_ur_data_ Feb 14 '20
Nope, although I just looked it up and it seems as dystopian as I'd expect for someone responding to a comment about a computer checking to see if you're dead or not.
2
1
u/mekkr_ Feb 15 '20
Daemon is fucking fantastic.
1
u/Shadow_Road Feb 15 '20
Freedom is pretty badass too. I wish there was a third book in the series (or more).
1
2
10
u/phillymjs Feb 14 '20
I would like to propose that you rename this project to Shovel Buddy, as that term has been around for a long time.
3
3
2
2
Feb 14 '20
I had to re read the startup time thing three times. I think you should set it so if someone doesn't enter a certain code in 2 minutes the code deletes the files. So if your dead, the next person won't know that code and won't know what changed.
Great idea for a program!
2
u/pwnrzero Feb 14 '20
I'm going to show this to my brother and be like, "BEHOLD! This is what programmers do in their free time. That and DeepCreamPy from a year or two back are the Lord's work.
2
2
2
2
2
1
u/dataBlockerCable Feb 14 '20
I work on a DR-like plan that I update periodically and document for a friend of mine with whom I trust my life and what to do with my assets should I pass. It's not complete because I've found that I have such a vast digital footprint and I have to constantly check to see if the site's behaviour is the same. I don't think there would ever be a script solution but this would definitely help for local machine purposes.
1
u/mitwilsch Feb 14 '20
Password services like LastPass offer a secondary/emergency access, you could send that off to a trusted relative/friend to take care of your accounts (Banks, social media, etc)
1
u/TheOneTrueDataSci Feb 14 '20
Maybe encrypt using asymmetric keys is better, that way you can always restore your data if a fuckup happens
1
u/thewindmage Feb 14 '20
So, I've thought of a potential flaw to account for. What happens if you die before the day you set it to expire, and someone comes along and gets your history before your python buddy has a chance to delete it?
2
u/h6nry Indentation Error: Feb 14 '20
There's a need for Webcam access and user identification here!
1
u/errorseven Feb 15 '20
A kill switch is only good if it can actually verify you are dead. I'd have it grab obituaries of local papers (everything is online these daya) and look for my name, it would also scan every page in case it's an Darwin award type death that was worthy of front page or 3rd page or somewhere. It would only do this if I hadn't checked in with whatever method I chose, in which case I'd prefer to have it backup and encrypt all my data before destroying it in case you know flight was delayed, or some reason that caused undue delay.
1
1
196
u/cj6464 Feb 14 '20
There's a python library that allows you to send text messages. Maybe a good idea for a next step would be to allow it to text you every morning and you have to reply within a day or so.