-
Open the Terminal
-
Use
mysqldumpto backup your databases -
Check for MySQL processes with:
ps -ax | grep mysql -
Stop and kill any MySQL processes
-
Analyze MySQL on HomeBrew:
brew remove mysql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Stop dance for OpenResty | |
| # A modification of the Nginx systemd script | |
| # Source: https://www.digitalocean.com/community/tutorials/how-to-use-the-openresty-web-framework-for-nginx-on-ubuntu-16-04 | |
| # ======================= | |
| # | |
| # ExecStop sends SIGSTOP (graceful stop) to the Nginx process. | |
| # If, after 5s (--retry QUIT/5) OpenResty is still running, systemd takes control | |
| # and sends SIGTERM (fast shutdown) to the main process. | |
| # After another 5s (TimeoutStopSec=5), and if OpenResty is alive, systemd sends | |
| # SIGKILL to all the remaining processes in the process group (KillMode=mixed). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # gh-dl-release! It works! | |
| # | |
| # This script downloads an asset from latest or specific Github release of a | |
| # private repo. Feel free to extract more of the variables into command line | |
| # parameters. | |
| # | |
| # PREREQUISITES | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # bash generate random alphanumeric string | |
| # | |
| # bash generate random 32 character alphanumeric string (upper and lowercase) and | |
| NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
| # bash generate random 32 character alphanumeric string (lowercase only) | |
| cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net" | |
| "net/mail" | |
| "net/smtp" | |
| "crypto/tls" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Other 67 hrs 4 mins βββββββββββββββββββββ 83.2% | |
| Go 6 hrs 4 mins βββββββββββββββββββββ 7.5% | |
| Markdown 2 hrs 14 mins βββββββββββββββββββββ 2.8% | |
| sh 1 hr 37 mins βββββββββββββββββββββ 2.0% | |
| JavaScript 43 mins βββββββββββββββββββββ 0.9% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://learning.postman.com/docs/writing-scripts/script-references/postman-sandbox-api-reference/#sending-requests-from-scripts | |
| const url = pm.environment.replaceIn("{{base_url}}/some/api") | |
| const req = { | |
| url: url, | |
| method: 'POST', | |
| header: { | |
| 'Content-Type': 'application/json', | |
| 'X-Foo': 'bar' | |
| }, | |
| body: { |
To remove a submodule you need to:
- Delete the relevant section from the .gitmodules file.
- Stage the .gitmodules changes git add .gitmodules
- Delete the relevant section from .git/config.
- Run git rm --cached path_to_submodule (no trailing slash).
- Run rm -rf .git/modules/path_to_submodule (no trailing slash).
- Commit git commit -m "Removed submodule "
- Delete the now untracked submodule files rm -rf path_to_submodule
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # Backup data from a volume. | |
| # Maintainer: [email protected] | |
| data_volume=$1 | |
| data_dir=$2 | |
| if [[ "${data_volume}" = "" || "${data_dir}" = "" ]]; then | |
| echo "usage: $0 <data_volume> <data_dir>" | |
| exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Install git from source code on CentOS 7, refer to https://github.com/git/git/blob/master/INSTALL | |
| set -e | |
| # Get version from https://github.com/git/git/releases, for example: 2.29.2 | |
| version=$1 | |
| if [[ -z "${version}" ]]; then | |
| echo "usage: $0 <version, 2.29.2> [profile]" | |
| exit 1 |