Software Developer. Computer Geek. INTJ.

Tag Bash

Script to download MySQL database & files from live to development server

This is a script I use on a lot of sites to copy the database (MySQL) and any uploaded files to the development site, and modify the database as required.

Upgrade phpMyAdmin via the command line

This script makes it easy to upgrade phpMyAdmin on one or multiple servers at the same time.

Create a symlink on a remote server when ‘ln’ is disabled

This is a script I used when I wanted to create a symlink on a remote web server, but that web server had the ln command disabled (using cPanel’s Jailshell).

Script to delete and re-create a Linux test user account

I use this script to repeatedly delete and re-create a Linux (Debian/Ubuntu) user account for testing my dotfiles installation script.

Bash General-Purpose Yes/No Prompt Function (“ask”)

This is a general-purpose function to ask Yes/No questions in Bash, either with or without a default answer. It keeps repeating the question until it gets a valid answer.

Detect Cygwin in a shell script

Every now and then you need to work out if a script is running in Cygwin…

Detect pipe/file input in a Bash/shell script

How to detect whether input is from keyboard, a file, or another process. Useful for writing a script that can read from standard input, or prompt the user for input if there is none.

© 2021 Dave James Miller — Powered by WordPress

Theme by Anders NorenUp ↑