Tag: data-management
-
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.
-
Quick Tip: Looping a command in bash
in Dev StuffDiscover how to monitor disk space usage efficiently while running slow programs to prevent sudden command failures. Use `watch -n10 bash -c “df -h | ack disk1s5″` for real-time updates, where `disk1s5` represents the desired partition. Run `df` to find the correct device file.
-
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.
-
WordPress Post Meta and JSON
in WordPressLearn about the challenges of storing JSON strings in WordPress post meta. Discover how WordPress’s `wp_unslash()` function can unintentionally interfere with the data. Find out how to safely store JSON by using `wp_slash()` to double-encode it, ensuring data integrity when unslashing.
-
More Fake Flash Fun
in GearLike last time, I’ve come into ownership of a suspicious flash drive that holds a secret: It’s actually a micro SD card and reader… and completely broken 🙂