Sign in to your XDA account
They say once a coder, always a coder. After switching to tech blogging, I don’t code full-time now, but there’s always a coder in me who finds fun in automating stuff with scripting. Nowadays, major productivity apps seem to demand a monthly payment. This “subscription creep” is annoying, but there’s a better way. I realized that many of these paid features are simple automation tasks in disguise. I built a few custom Python scripts that perfectly handle everything I need.
Here are the exact automation secrets I use to gain better control and stay away from third-party tools for small functionalities.
#…
Sign in to your XDA account
They say once a coder, always a coder. After switching to tech blogging, I don’t code full-time now, but there’s always a coder in me who finds fun in automating stuff with scripting. Nowadays, major productivity apps seem to demand a monthly payment. This “subscription creep” is annoying, but there’s a better way. I realized that many of these paid features are simple automation tasks in disguise. I built a few custom Python scripts that perfectly handle everything I need.
Here are the exact automation secrets I use to gain better control and stay away from third-party tools for small functionalities.
Automated file organizer
File Juggler, who?
I used to be a digital slob. My Downloads folder was a graveyard of unorganized files, and my desktop often looked like a tech scavenger hunt. Every few weeks, I’d waste valuable time manually sorting hundreds of files; moving PDFs to one folder, screenshots to another, and code zips somewhere else. I even paid for an app called File Juggler that promised to do it for me, but I did not want to pay for my laziness.
I wrote a simple Python script that checks my Downloads folders. It automatically categorizes files based on their extension (e.g., .jpg, .pdf, .zip) and moves them into designated, neatly labeled subfolders. My workspaces are now spotless, and I haven’t wasted a minute on file sorting since. This tiny script easily replaced that paid organizing app.
file_organizer.py
import osimport shutilimport sys# --- CONFIGURATION ---TARGET_DIRECTORY = r'C:\Users\patel\Documents\Downloads'FILE_TYPES = { '.jpg': 'Images', '.jpeg': 'Images', '.png': 'Images', '.gif': 'Images', '.webp': 'Images', '.pdf': 'Documents/PDFs', '.doc': 'Documents/Word', '.docx': 'Documents/Word', '.txt': 'Documents/Text', '.rtf': 'Documents/Text', '.odt': 'Documents/Text', '.xlsx': 'Documents/Spreadsheets', '.csv': 'Documents/Spreadsheets', '.pptx': 'Documents/Presentations', '.zip': 'Compressed', '.rar': 'Compressed', '.7z': 'Compressed', '.exe': 'Software/Installers', '.msi': 'Software/Installers', '.dmg': 'Software/Installers', '.app': 'Software/Applications', '.py': 'Code/Python', '.js': 'Code/JavaScript', '.html': 'Code/Web', '.css': 'Code/Web', '.json': 'Code/Data', '.mp3': 'Media/Audio', '.wav': 'Media/Audio', '.mp4': 'Media/Video', '.mov': 'Media/Video', '.avi': 'Media/Video',}OTHER_FOLDER = 'Other'def organize_files(directory_path): try: if not os.path.isdir(directory_path): print(f"Error: Directory not found at '{directory_path}'") return print(f"--- Starting organization in: {directory_path} ---") moved_count = 0 for filename in os.listdir(directory_path): source_path = os.path.join(directory_path, filename) if os.path.isdir(source_path) or filename == os.path.basename(__file__): continue _, file_extension = os.path.splitext(filename) folder_name = FILE_TYPES.get(file_extension.lower(), OTHER_FOLDER) destination_dir = os.path.join(directory_path, folder_name) destination_path = os.path.join(destination_dir, filename) try: os.makedirs(destination_dir, exist_ok=True) if os.path.exists(destination_path): base, ext = os.path.splitext(filename) counter = 1 while True: new_filename = f"{base}_{counter}{ext}" new_destination_path = os.path.join(destination_dir, new_filename) if not os.path.exists(new_destination_path): break counter += 1 print(f" [DUPLICATE] Renaming '{filename}' to '{new_filename}'") destination_path = new_destination_path shutil.move(source_path, destination_path) print(f" [MOVED] '{filename}' -> '{folder_name}'") moved_count += 1 except Exception as e: print(f" [ERROR] Could not move file '{filename}': {e}") print(f"--- Organization complete. {moved_count} files moved. ---") except Exception as e: print(f"An unexpected error occurred: {e}")if __name__ == "__main__": organize_files(TARGET_DIRECTORY)
My major work is for the Downloads folder, and I’ve coded the script to automatically target it. If I ever need to clean another area, I just tweak the TARGET_DIRECTORY path in the script. Since my work is mostly concentrated there, I plan to schedule this script using Task Scheduler so it runs every night, making the whole process completely hands-off.
Advanced renaming script
A Better Finder Rename, who?
If you deal with a lot of media or project files, you know the pain of inconsistent naming conventions. I used to spend hours renaming hundreds of screenshots, lecture recordings, or client assets, struggling to make them uniform. I tried a paid utility as well. Then, I took the matter in my hand and wrote an Advanced Renaming Python Script to automate this task. In fact, I wrote two versions! One version renames files sequentially based on the creation date, and the other renames files in alphabetical order. Now, instead of tedious manual work, I can rename a batch of files instantly with just one command. This flexibility is what matters most; it’s fast, completely free, and saves me huge amounts of time on every new project.
Link monitoring script
UptimeRobot, who?
I used to rely on a popular service to check my site’s uptime and monitor key links. The paid plans felt like too much for what I actually needed. My solution? A tiny Python script that runs like clockwork. I simply list all the URLs I need to watch in a plain text file, urls.txt. The script wakes up and checks them at pre-defined intervals, exactly when I tell it to. It uses the requests library to test the connection. If my site is down or a key link breaks, the script quietly logs the error, time, and issue type into a file called monitor_log.txt. It’s reliable, free, and gives me complete peace of mind without a monthly bill. This self-built watchdog is an essential replacement for UptimeRobot.
link_monitor.py
import requestsimport timeimport sys# --- Configuration ---URL_F = "urls.txt"LOG_F = "monitor_log.txt"INTERVAL = 60 # Check interval in secondsTIMEOUT = 10 # Request timeout in seconds# ---------------------def read_urls(f): """Reads URLs from the file.""" try: with open(f, 'r') as r: return [l.strip() for l in r if l.strip() and not l.strip().startswith('#')] except: print(f"Error: URL file '{f}' not found. Check file name and location.") return []def log_error(url, t, msg, f): """Logs the status message if type is WARNING or DOWN.""" if t in ["WARNING", "DOWN"]: entry = f"[{time.strftime('%Y-%m-%d %H:%M:%S')}] [{t}] {url}: {msg.strip()}\n" try: with open(f, 'a') as a: a.write(entry) except IOError as e: print(f"Log write error: {e}")def check_url(url): """Performs GET and returns (status_type, message).""" try: r = requests.get(url, timeout=TIMEOUT) s = r.status_code l = r.elapsed.total_seconds() m = f" (Status: {s}, Latency: {l:.2f}s)" if 200 return ("UP", " UP" + m) return ("WARNING", " WARNING" + m) except requests.exceptions.RequestException as e: return ("DOWN", f" DOWN (Error: {type(e).__name__})") except Exception as e: return ("DOWN", f" UNKNOWN ERROR ({str(e)})")if __name__ == "__main__": print("="*40 + "\nLink Monitor Running\n" + "="*40) while True: urls = read_urls(URL_F) if not urls: print(f"\nNo URLs in '{URL_F}'. Sleeping...") time.sleep(INTERVAL) continue print("\n" + time.strftime("--- Check at %H:%M:%S ---")) for u in urls: t, m = check_url(u) print(f"-> {u}: {m}") log_error(u, t, m, LOG_F) print(f"\nSleeping for {INTERVAL}s...") try: time.sleep(INTERVAL) except KeyboardInterrupt: print("\nMonitor stopped.") sys.exit(0)
Tiny yet productive scripts
These scripts are tiny, yet they highlight just how powerful scripting is. My productivity isn’t just cheaper; it’s faster and completely customized. The best part is the liberty I have to customize every detail to my needs. I can easily schedule them to run automatically using the Task Scheduler (or cron jobs). Automating these mundane tasks keeps my attention focused on the work that truly matters.