string(6) "foobar"
string(6) "barfoo"
# Setup local directory with braintree example and libraries | |
git clone git@github.com:braintree/braintree_php_example.git | |
cd braintree_php_example | |
composer install | |
# Create and define configuration options | |
echo ' | |
BT_ENVIRONMENT=sandbox | |
BT_MERCHANT_ID=xxxxxxxxxxxx | |
BT_PUBLIC_KEY=xxxxxxxxxxxx |
-- When products are added/removed from a category this table stores all the relation data | |
select * from catalog_category_product where product_id = '24526'; | |
-- The index that is used for presenting products in a category on the frontend | |
select * from catalog_category_product_index where product_id = '24526'; | |
-- The change log table used for Magento EE partial index functionality | |
select * from catalog_category_product_index_cl where product_id = '24526' and version_id > (select version_id from enterprise_mview_metadata where changelog_name = 'catalog_category_product_index_cl'); | |
# You can find the current list of casks on github, and the one for vagrant here: | |
# https://github.com/Homebrew/homebrew-cask/blob/master/Casks/vagrant.rb | |
# From there you may be able to load the history of that file and lookup previous versions of | |
# the cask which would be related to previous versions of vagrant as indicated in the cask definition file. | |
# If the github history of the file fails you can search through recent commit history and find a commit prior | |
# to the version change you are trying to avoid and get the commit hash before the change and use it to locate | |
# a previous version of the cask file. | |
# current (master branch) casks: |
# Consider filtering the varnishlog output | |
# https://feryn.eu/blog/varnishlog-measure-varnish-cache-performance/ | |
varnishlog -i "RespHeader,Req*" -X "RespHeader:(x|X)-" -I "timestamp:Resp" -x reqprotocol,reqacct -g request | |
# Capture the log output from varnishlog and look for BereqHeader | |
# -n name is how you can specify a specific named instance of varnish | |
# remove -n if you just want to access the default instance | |
varnishlog -n stage |
I recently had the following problem:
We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like
ssh -L 3306:localhost:3306 remotehost
#!/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 |
# clear the entire cache | |
varnishadm "ban req.url ~ /" | |
# monitor varnish stats | |
varnishstat -n prod | |
# monitor varnish log with multiple patterns | |
varnishlog | grep 'eqURL\|Age:\|VCL_call\|TTL\|Expires:\|Cache-Control:' | |
# Use a query with varnishlog to watch requests from a specific IP |
/* | |
# Get size of a specific database into a bash variable for use in estimating mysqldump size for pv status bar | |
DATABASE_NAME="example_db_name" | |
DATABASE_SIZE=$(mysql --batch -sN -e "SELECT CONCAT(ROUND(sum( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 0), 'g') as size FROM information_schema.TABLES WHERE table_schema = '${DATABASE_NAME}' GROUP BY table_schema;") | |
echo "${DATABASE_SIZE}" | |
*/ | |
/* find the largest tables on the server */ | |
SELECT CONCAT(table_schema, '.', table_name) 'db.table', | |
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, |
#!/bin/bash | |
set -euo pipefail | |
FRONT_URL="${FRONT_URL:-https://app.exampleproject.test/}" | |
echo "==> [$(date +%H:%M:%S)] waiting on readiness" | |
ELAPSED_SECONDS=0 | |
while : ; do | |
ELAPSED_SECONDS=$(echo ${ELAPSED_SECONDS}+2 | bc) | |
RESPONSE_CODE=$(curl -sI "${FRONT_URL}" 2>/dev/null | head -n1 | awk '{print $2}') |