Introducing AnonymizeReviewer: Remove Author Metadata from Word Docs Without Losing Edits
When youโre collaborating on a Microsoft Word document, tracked changes and comments are essential tools. However, when it's time to share those files outside your team, another concern often arises: the names behind every comment and edit are embedded directly within the document.
There are times when anonymity is important. Whether youโre simplifying client reviews, preparing materials for a broader audience, or just removing unnecessary distractions, Word doesn't make it easy to cleanly strip names without accepting all changes or removing valuable context.
To solve that problem, I created AnonymizeReviewer, a lightweight Python script that lets you anonymize Word files while preserving everything that matters.
Microsoft Word includes a feature called โRemove personal information on save.โ While helpful in theory, it behaves inconsistently depending on your version and settings. It also doesnโt catch all the places author names can appear.
Here are some of the areas where Word stores author names:
Manually scrubbing each of these is time-consuming and prone to error. Itโs easy to miss something. Thatโs why I built a more dependable solution.
AnonymizeReviewer reads the .docx file as a zip archive, scans its internal XML files, and replaces all instances of the original author name with a placeholder or alternate name of your choosing. It does this without altering the tracked changes or comments themselves.
Key features include:
First, clone the repository and install the Python dependency:
To run in interactive mode with file picker prompts:
To run with arguments:
To batch-process all .docx files in a folder:
Files that already end in โ - Anonymized.docxโ will be skipped automatically to avoid duplication.
This tool originated from a real-world use case. I needed a way to hand off tracked-change documents for client review without exposing internal names. Word did not provide a clean solution, and most online options were either unreliable or required uploading sensitive files.
By targeting the actual structure of a .docx file and addressing all areas where names can be stored, AnonymizeReviewer fills that gap, giving you control over what you share.
The project is available on GitHub at https://github.com/gregvarghese/AnonymizeReviewer
Pull requests and feedback are welcome. If you have ideas for additional features, such as redacting specific comment content or cleaning embedded metadata beyond names, I would love to hear them.
This project is licensed under the MIT License.
The software is provided as is, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement.
How to Extract SSL Certificates from a PFX File on macOS
If youโve ever been handed a .pfx file and told to โjust upload the certificate,โ you know the pain thatโs coming.
PFX (PKCS#12) files bundle your private key, SSL certificate, and any intermediate certificates into one encrypted file. Thatโs great until you actually need to extract those pieces for something like an NGINX server, AWS load balancer, or third-party CDN that wants them all separately.
MacOS has OpenSSL built in, which is all you need. Hereโs a simple shell script I use to generate the cert, private key, and chain in one shot and make them clipboard-ready for easy pasting.
Save the following as extract-ssl-from-pfx.sh:
Make it executable:
Then run it:
Follow the prompts. Youโll end up with three files and the contents ready to paste one by one wherever you need them.
Your private key is sensitive. Please donโt leave it lying around. Store it securely or delete it after use.
This script saves me time every time I deal with certificates. Hopefully, it does the same for you. If you have improvements or tweaks, Iโd love to hear them.
Supercharge Your Laravel Development and Get AI to Understand Your Models
Hey there, Laravel enthusiasts! Today, I'm diving into a nifty trick that'll make getting AI to understand your Laravel model structures a breeze. We'll harness the power of bash scripting and AI to analyze our migrations quickly and efficiently. Let's get started!
As our Laravel projects grow, so does the complexity of our database structures. Migrations pile up, relationships intertwine, and before you know it, you're drowning in a sea ofย Schema::createย andย upย functions. Wouldn't it be great to get a bird's-eye view of our models without manually sifting through dozens of files? What if you could get AI to understand your Laravel project without adding every file to the chat window?
Here's where our dynamic duo comes in a clever bash one-liner and your favorite AI chat tool (like ChatGPT or Claude). We'll use bash to extract the relevant parts of our migrations and then feed that information to an AI for analysis and insights.
Here's the one-liner code to copy and paste:
First, let's break down our bash sorcery to understand what's going on in an easier-to-read format:
Just add | pbcopy to have it copied directly to your clipboard on Mac:
This command does the following:
Please copy the entire output from your terminal and paste it into your AI chat of choice with your preferred prompt. I usually start with this prompt:
Generate a diagram
Here are some additional prompts you can optionally pair with the output to extract valuable insights and improvements:
There you have it, folks! With this simple bash one-liner and the power of AI, you can transform how you analyze and understand your Laravel database structures and output code. Give it a try on your next project, and watch your productivity soar!
Remember, tools like these are meant to augment your skills, not replace them. Always review AI suggestions critically and trust your developer instincts.
How to Take Ownership of Files and Folders Using PowerShell
Ever had to take ownership of a bunch of files and folders? It's a pain, right? Well, not anymore!
Picture this: You've just gotten an external hard drive from a dead computer and need to access the files. But wait! You don't have the correct permissions. I had to do this, and setting the file permissions through Explorer was failing randomly. It appears that the folders all had different permissions, and the propagation was failing.
I've got a PowerShell script that'll save you time. It does two things:
First, here's the script. Don't worry, I'll break it down for you:
Let's break this down a bit:
There you have it, folks! A powerful little script to take control of your files and folders. No more permission headaches, no more "access denied" nightmares โ just pure, unadulterated file access bliss.
Got questions? Hit me up in the comments. And don't forget to share this with your IT buddies โ they'll thank you later!
Happy scripting!
How to add case insensitive where in Laravel
Have you ever found yourself writing the same complex database queries repeatedly? Yeah, me too. It's frustrating, time-consuming, and, let's face it, not the best use of our coding superpowers.
I needed to search some tables for case-insensitive values and discovered that Laravel doesn't have a native function in eloquent, or it's entirely possible that I missed it. Today, we will tackle this problem head-on by diving into the world of Laravel Eloquent macros. If you've never used them, this will be a game-changer for your productivity.
Picture this: You're working on a project where you frequently need to perform case-insensitive searches across multiple columns. Or maybe you're constantly writing complex ordering logic to handle null values. Sound familiar?
If you're nodding your head, you're not alone. This is what I call "Query Repetition Syndrome," and it's a common ailment among Laravel developers.
Enter Eloquent macros - your new secret weapon against repetitive queries. These bad boys allow you to extend Eloquent's query builder with custom methods. It's like giving your Laravel app query superpowers!
Let's break down how to implement this solution step-by-step.
First things first, we need a place to house our macros. Let's create a new service provider:
Open up that freshly minted MacroServiceProvider.php, and let's give it some structure:
Let's tackle that case-insensitive search problem with a whereInLike macro:
While we're at it, let's add a couple more handy macros:
Don't forget to tell Laravel about your new macros. Add this line to your config/app.php:
Now for the fun part - using your new macros:
By implementing these Eloquent macros, we've solved our Query Repetition Syndrome. Instead of writing the same complex queries over and over, we have reusable, eloquent (pun intended) methods that make our code cleaner and more efficient.
But here's the kicker - this is just the beginning. You can create macros for any repetitive query pattern in your projects. The possibilities are endless!
Eloquent macros are like a Swiss Army knife for your database queries. They're powerful and flexible and can save you tons of time and headaches.
Remember, the goal here is to work smarter, not harder. By identifying repetitive patterns in your queries and turning them into macros, you're setting yourself up for cleaner, more maintainable code in the long run.
Now, I'm curious - what repetitive query patterns have you encountered in your Laravel projects? Please drop a comment below to share your macros or share some macro solutions!
Happy coding, and may your queries be ever elegant!
How to Move Files by Partial File Name to New Directory on Mac using a shell script
When it comes to photo editing, efficiency is key. Recently, I faced a challenge where a subject picked out 100 priority photos from a larger batch. Given the sheer number of images, manually sorting them wasn't practical. All pictures from my SLR were named in the DCIM_# format, so I noted the last five numbers of the selected files. To streamline the process, I wrote a shell script that automatically moves the chosen files to a new folder, allowing me to focus on the priority images first. Iโm sharing this script to help others enhance their photo editing workflow.
Create the Shell Script:
Save the Script:
Make the Script Executable:
Run the Script:
Verify the Results:
By following these steps, you can efficiently manage and prioritize your photo editing tasks, saving valuable time and effort. This shell script can be customized and expanded to suit various file management needs, making it a versatile tool in your workflow.
How to Automatically Login into Laravel App in Your Local Dev Environment
I often find myself spinning up Laravel projects for prototypes and idea testing and then letting them sit until I can pick them back up. Logging in whenever I start work gets annoying, and there's no point in manually logging in to my local instance since my account is the admin. Fortunately, there are a few solutions to automate this process in Laravel. I'll delve into the various methods to automatically log in to your Laravel app in your local development environment, enhancing your workflow and boosting productivity.
One approach to automating the login process for the Laravel application is session-based auto-login. This method involves setting up a mechanism that automatically logs in a predefined user whenever the application is accessed in the local development environment.
Each solution below assumes you've seeded or registered a local user account in your database.
You can create a custom route in your Laravel routes file (routes/web.php) that triggers the auto-login functionality.
When you access the /auto-login route in your local development environment, Laravel will automatically log in the specified user, redirecting them to the desired page (in this case, /dashboard).
Another method to automate your Laravel application's login process is leveraging custom middleware designed for auto-login functionality. This approach provides more flexibility and control over the auto-login process, allowing you to define custom logic and conditions for authentication.
Generate a new middleware using the Artisan command make:middleware.
Register the custom middleware in the HTTP kernel (app/Http/Kernel.php) to apply it to the desired routes or groups of routes.
This method allows you to log in automatically as soon as you load the application, and it is the method I use most often. I added a check to ensure that the environment is local.
if ($this->app->environment('local')) {
$user = User::first();
if (isset($user)) {
$this->app['auth']->setUser(User::first());
}
}
If you don't have the user table seeded with a user, the above code will cause an error when running the seeders. I tweaked the code to check for the table's existence to avoid the error when running seeders.
Sometimes, you might want to seed your database with an admin user for testing purposes. Here's how you can do it:
Generate a new seeder class using the Artisan command make:seeder.
Within the generated UserSeeder class, define the logic to create an admin user.
Finally, run the seeder using the Artisan command db:seed.
Following these steps, you can seamlessly integrate auto-login functionality into your Laravel application's local development environment, reducing the time and effort spent on repetitive login tasks. Additionally, seeding your database with an admin user ensures that you have a user account available for testing and development purposes.
How to enable MacFuse/PCloud Drive on Mac Sonoma 14.2.1
I recently upgraded to Mac Sonoma 14.2.1 and MacFuse stopped loading which affected my ability to load PCloud and NTFS drives. I spent a few days trying to troubleshoot everything and in the end it turned out I had to disable Mac System Integrity Protection to get everything to load. I'm sharing in case it helps anyone else.
To disable SIP on your Mac Sonoma for extensions like MacFuse and pCloud Drive:
Note: Disabling SIP poses security risks. Re-enable it once you've installed the necessary extensions. Only disable SIP when necessary and understand the potential risks involved.
How to Delete a Row in Excel Using the Elgato Stream Deck
Recently I was working on a massive Excel Spreadsheet and needed to manually review each entry and clean up rows that were no longer needed. The Elgato Stream Deck came in handy for a quick shortcut so I thought I'd share it in case anyone else can use it.
I took this opportunity to practice creating the first of what I hope are many training videos. This took me around 30 minutes to do from start to finish as I had to learn the video editing software including how to record, how to split and edit, and how to add text overlays. Hopefully the next videos will be faster but it was a fun exercise and I hope someone else finds it useful.
Installing font awesome pro with bun
After recently switching to bun.sh, I was trying to install Font Awesome Pro. It uses a private registry but their docs have not been updated to support non-npm package managers and bun does not yet support .npmrc files.
You can configure a private registry using an organization scope. First, you must get your auth token from your paid Font Awesome account by going to your account page, scrolling down to the Tokens section, and copying the token.
Copy and paste this string, and replace YOUR_TOKEN_HERE with the token you copied above:
Open the terminal and enter these commands:
Paste in the config above with your token and then hit CTRL+X to quit, and Y to save when prompted. Now you should be able to run