Tag: scripting
-
Command Timing in ZSH
Dive into how you can enhance your ZSH experience by adding a snippet that measures the exact time it takes to process a command, right down to the millisecond! This guide provides a detailed walkthrough of the script, allowing you to integrate it with your .zshrc file.
-
Quick Tip: Export WordPress SQL output via WP-CLI
Learn how to run custom SQL queries on your WordPress database using a small WP-CLI command. The command supports different output formats like table, CSV, JSON, and more. Plus, it includes a dry run option for safety. No need to rely on `wp db query` anymore!
-
Pi-hole, Google Wifi, and Device Names
Using a custom script with `nmap` to find device hostnames on a Google Wifi network. The script outputs to `/etc/pihole/custom.list` with manual MAC to hostname mappings. It can be slow, especially on a Raspberry Pi 1.
-
Converting CSV to SQL
in Dev StuffLearn how to convert CSV files into SQL statements using PHP. Avoid directly inserting data into a live database; follow a safer approach. See a PHP script example for converting CSV files into SQL inserts, with an output demonstration for an “airtravel.csv” sample. Use this script cautiously or as a starting point for similar tasks.
-
Deleting Old Post Revisions in WordPress with WP-CLI
in WordPressWorking with a client’s large database, I crafted a custom WP-CLI command to purge post revisions based on specific criteria, saving backups of those deleted. This script efficiently prunes revisions older than a year and prior to post publication, reducing the overall database size prior to a site migration.
-
Quick Tip: HyperDock as a Service
in MacOSA macOS tool called HyperDock has been causing issues on macOS Catalina, with random stops requiring manual re-enabling. A script has been created to restart the HyperDock Helper automatically using a Login Item. This script monitors and restarts the Helper when it crashes, providing a workaround for the problem.
-
Windows, SFTP, and the Registry
in WindowsEasily handle dynamically generated SFTP IPs and ports by creating a wrapper script in Windows, allowing you to efficiently manage connections with additional data like private keys and proxy information. Register a handler for SFTP URIs with a Windows Registry file to streamline the process of connecting to SFTP directories.
-
Renewing Let’s Encrypt SSL on SABnzbd+
Having a secure way to manage your usenet downloads of the hit movie Big Buck Bunny with SABnzbd+ is great, but one problem/feature of Let’s Encrypt is that the SSL certificates expire only after three months, requiring plenty of renewals. Luckily this can be easily scripted and forgotten. The primary part of renewing the SSL…