-
Open the Terminal
-
Use
mysqldump
to 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
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 |
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 python3 from source code on CentOS 7 | |
# Maintainer: K8sCat <[email protected]> | |
set -e | |
if [[ $(id -u) -ne 0 ]]; then | |
echo "require root" | |
exit 1 | |
fi |
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 ( | |
"bufio" | |
"bytes" | |
"flag" | |
"fmt" | |
"io" | |
"os" | |
"regexp" |
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 | |
# while :; do clear; your_command; sleep 2; done | |
# usage: watch.sh "<your_command>" "<sleep_duration>" | |
d=${2:-2} | |
while :; do | |
clear | |
date | |
$1 | |
sleep ${d} |