Tag: scripting

  • Command Timing in ZSH

    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: Bash CLI params

    Quick Tip: Bash CLI params

    Learn a clean and simple way to add CLI params to a bash script by incorporating short, long, space-separated, and equal-separated arguments for ease. Ideal for quick bash script hacks, this method facilitates efficient handling of CLI parameters.

  • Quick Tip: Export WordPress SQL output via WP-CLI

    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

    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

    Converting CSV to SQL

    Learn 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

    Deleting Old Post Revisions in WordPress with WP-CLI

    Working 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.

  • Windows, SFTP, and the Registry

    Windows, SFTP, and the Registry

    Easily 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+

    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…