Category: Dev Stuff
-
Quick Tip: Bash CLI params
in Dev StuffLearn 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.
-
Nano: The One True Editor
in Dev StuffForget about other console editors. Customize Nano in your `.nanorc` to enhance your editing experience. Utilize features like auto-indent, bold text, history log, mouse support, line numbers, tab size adjustment, and syntax highlighting for a smoother workflow.
-
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!
-
phpMyAdmin and MariaDB with Docker
in Dev StuffLearn how to set up MariaDB and phpMyAdmin using Docker on a MacBook Pro. Start containers, configure settings, and connect to databases easily. Useful commands included for managing containers and performing tasks like importing SQL files. Helpful references provided for your Docker journey.
-
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.
-
Open source ngrok alternative
in Dev StuffLearn about setting up sish, an open-source ngrok alternative, for secure HTTP(S)/WS(S)/TCP tunnels. Follow the steps to create a wildcard subdomain, set up a DigitalOcean droplet, install necessary packages, obtain SSL certificates, and set up sish service with Docker. Finally, create a shortcut program to initiate tunnels locally.
-
Quick Tip: Viewing Headers With Curl
in Dev StuffLearn how to inspect HTTP headers for redirects, cache details, SSL, etc., using `curl` with `-I` switch. Discover how to resolve potential inconsistencies between `HEAD` and `GET` requests by using `-X` switch to override the default method in `curl` commands. Simplify with a combined command: `curl -IXGET http://example.com/`.