Skip to content

Instantly share code, notes, and snippets.

@sjb9774
sjb9774 / elasticsearch.sh
Last active February 25, 2021 21:11
ElasticSearch CURL Commands
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 .
@sjb9774
sjb9774 / decrypt_m2_config_value.sh
Created December 12, 2019 21:56
Decrypt config value from stage/prod server
# get crypt key from remote server
ssh <user>@<server> -C 'grep "'\''key'\''" ~/app/etc/env.php' | awk '{ print $3 }'
# substitute local env.php crypt key with remote crypt key
# on vagrant
mr dev:console
$encryptor = $di->get(\Magento\Framework\Encryption\EncryptorInterface::class);
$encryptor->decrypt('value from remote database core_config_data table goes here');