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
Ansible version switch | |
# For Ansible 2.6.5 | |
brew uninstall ansible | |
ls /usr/local/Cellar/openssl | |
# switch to openssl version displayed by /usr/local/Cellar/openssl | |
brew switch openssl 1.0.2r | |
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/4dc294072201ea7fe97f9477b9b87f57994af4d3/Formula/ansible.rb | |
# For Latest (2.9) Ansible Version |
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
# Preston referenced: | |
# https://www.percona.com/doc/percona-toolkit/LATEST/pt-query-digest.html | |
pt-query-digest slow.log |
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
# Requirements | |
# yum install libxml2 libxslt | |
set +H # disable history expansion | |
XML_CONTENT=$(cat <<'XML_CONTENT_HD' | |
<?xml version="1.0" encoding="UTF-8"?> | |
<confluence-configuration> | |
<setupStep>complete</setupStep> |
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
HOST="127.0.0.1" | |
USER="username" | |
PASSWD="password_transmitted_in_cleartext_via_ftp" | |
TIMESTAMP_UTF=$(date -u +"%Y%m%dT%H%M%SZ") | |
TIMESTAMP=$(date +"%Y%m%dT%H%M%SZ") | |
FILENAME="${TIMESTAMP}-${TIMESTAMP_UTF}.temp" | |
# Create empty temp file with timestamps in filename |
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://unix.stackexchange.com/questions/222750/sudo-yum-repolist-show-repo-not-in-etc-yum-repo-d | |
yum repolist | |
yum repoinfo ius | |
# Repos are either defined via .repo files in /etc/yum.repos.d or via plugins, which are usually defined via files in /etc/yum/pluginconf.d | |
ls -la /etc/yum.repos.d | |
ls -la /etc/yum/pluginconf.d | |
# If you run yum repolist --noplugins does your repo in question still show up? |
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://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RebootInstance.html | |
# Running mysql commands from app server on private network | |
DATABASE_NAME="my_database_name" | |
mysql -D ${DATABASE_NAME} -e ' | |
CREATE TABLE test_inserts ( | |
id int(11) unsigned NOT NULL AUTO_INCREMENT, | |
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
client_timestamp varchar(255) DEFAULT NULL, |
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
#221G | |
#/var/www/prod/shared/media/catalog/product | |
cd /var/www/prod/ | |
tar -zcvf - ./shared/media/catalog/product/* \ | |
| split --bytes=10GB - ~/prod_shared_media_catalog_product.tar.gz.split- | |
# This creates a list of files | |
# -rw-rw-r--. 1 www-prod www-prod 10000000000 Aug 29 13:32 prod_shared_media_catalog_product.tar.gz.split-aa | |
# -rw-rw-r--. 1 www-prod www-prod 10000000000 Aug 29 13:40 prod_shared_media_catalog_product.tar.gz.split-ab | |
# -rw-rw-r--. 1 www-prod www-prod 10000000000 Aug 29 13:48 prod_shared_media_catalog_product.tar.gz.split-ac |
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
# Set the $unauthorized_admin_ip flag if remote_addr is not on list of authorized IPs | |
map $remote_addr $unauthorized_admin_ip { | |
# All IPs are considered unauthorized by default | |
default 1; | |
"127.0.0.1" 0; | |
} | |
map $request_uri $unauthorized_admin_path { | |
# All paths are considered unauthorized by default and require some other | |
# means of authorization in order for the request to be accepted. |
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
# Run on the web server to see if any matching processes | |
# are running outside of the current release directory. | |
# This does not kill off any processes, just views them. | |
CUR_REL_PATH="/var/www/html/current" | |
PROCESS_MATCH="[b]in/magento" | |
PROCESS_MATCH=" | |
[b]in/magento queue:consumers:start exportProcessor\| | |
[b]in/magento queue:consumers:start product_action_attribute.update\| | |
[b]in/magento queue:consumers:start product_action_attribute.website.update\| | |
[b]in/magento queue:consumers:start codegeneratorProcessor |
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
# You can list a user's public ssh keys by going to an address | |
# https://github.com/mttjohnson.keys | |
GITHUB_USER="mttjohnson" | |
curl https://github.com/${GITHUB_USER}.keys | |
# It is suggested that instead of just curling that end point that it would be better to use the API in any automated fashion | |
# https://developer.github.com/v3/users/keys/#list-public-keys-for-a-user | |
curl https://api.github.com/users/mttjohnson/keys |