This file contains 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
ES_HOST='elasticsearch-host' # for example 127.0.0.1 | |
ES_PORT='elasticsearch-port' # default 9200 | |
# get indices | |
curl $ES_HOST:$ES_PORT/_cat/indices | |
ES_INDEX='index-name' | |
# get first 5 results from empty | |
curl $ES_HOST:$ES_PORT/$ES_INDEX/_search | jq . |
This file contains 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
# Yesterday's and today's access log | |
# Filter to only show place order actions submitting payment requests that fail (400) or not | |
# get a count of the number of events in the logs | |
cat $(find . -regex '.*/www-prod_backend-access\.log-[0-9]+' -print0) www-prod_backend-access.log \ | |
| grep -E 'POST \/rest\/[A-Za-z0-9_]+\/V1\/guest-carts\/[A-Za-z0-9]*\/payment-information HTTP\/[1-2]\.[0-1]" 400' \ | |
| wc -l | |
cat $(find . -regex '.*/www-prod_backend-access\.log-[0-9]+' -print0) www-prod_backend-access.log \ | |
| grep -E 'POST \/rest\/[A-Za-z0-9_]+\/V1\/guest-carts\/[A-Za-z0-9]*\/payment-information HTTP\/[1-2]\.[0-1]" [^4]00' \ | |
| wc -l |
This file contains 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 | |
# stop on errors | |
set -e | |
# turn on debugging if you're running into issues | |
#set -x | |
# Static variables | |
ENVIRONMENT=$1 | |
RED='\033[0;31m' | |
NC='\033[0m' # No Color |
This file contains 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 | |
# This quick and dirty script installs the Source Guardian loader on the web70 VM. | |
# Similar commands should work on other version of PHP -- simply replace the .lin file copied and the .ini file with the correct version. | |
cd /tmp | |
wget https://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz -O ./source-guardian.tgz | |
mkdir source-guardian |
This file contains 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
# Some output format parameters require newer versions of curl | |
# These examples were done with Curl 7.54.0 with HTTP/2 Support | |
# The kind of output you would expect to see with the two functions here (time_url and url_ping) would look like this: | |
[user@683dd22606f5 /]# URL_TO_CHECK="https://venia.magento.com/graphql?query=query+getProductDetailForProductPage..." | |
[user@683dd22606f5 /]# time_url "${URL_TO_CHECK}" |
This file contains 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 | |
set -eu | |
if [ $# -ne 1 ] | |
then | |
echo "Usage: $0 {MySQL-Database-Name}" | |
echo "Drops all tables, views, triggers, routines, and events from a MySQL database" | |
echo "This script expects mysql client credentials to be supplied in a user's .my.cnf" | |
exit 1 |