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 people have run into this issue: | |
| Warning: DOMDocumentFragment::appendXML(): Entity: line 1: parser error : CData section too big found in /magento/lib/internal/Magento/Framework/View/TemplateEngine/Xhtml/Template.php on line 60 | |
| https://github.com/magento/magento2/issues/4695 | |
| https://github.com/magento/magento2/issues/8084 | |
| Not saying they figured much out, but other people have been experiencing the issue as well. | |
| The limit comes from the libxml library that PHP uses for XML processing: | |
| http://php.net/manual/en/domdocument.loadxml.php#113676 |
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
| ssh -tq user@host1 "tail -f /var/log/nginx/www.example.com-access.log | grep -i '/mypath.html'" | |
| ssh -tq user@host1 "tail -f /var/log/nginx/www.example.com-access.log | grep -i '/mypath.html'" | |
| ssh -tq user@host1 "tail -f /var/log/nginx/www.example.com-access.log | grep -i '/mypath.html'" | |
| ssh -tq user@host1 "tail -f /var/log/nginx/www.example.com-access.log | grep -i '/mypath.html'" |
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
| # This example uses a GraphQL query meant for a Magento 2 (2.3 Alpha) endpoint | |
| # Take a formatted GraphQL query and convert it to a JSON encoded string | |
| GRAPHQL_QUERY=$( | |
| echo ' | |
| { | |
| products( | |
| search: "Messenger" | |
| filter: { | |
| sku: {like: "24-MB%"} |
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
| # Make a backup of the config | |
| cp -a app/etc/env.php app/etc/env.php.bak | |
| # Create new config file to use for replacement | |
| cp -a app/etc/env.php app/etc/env.php.new | |
| # Edit new config | |
| vi app/etc/env.php.new | |
| # Confirm syntax on file |
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
| # Find the request URI from a PHP-FPM process in a long running MySQL process | |
| # Show MySQL processes to locate the connection you want to investigate | |
| mysql -Be 'SHOW PROCESSLIST;' | |
| # Id User Host db Command Time State Info Rows_sent Rows_examined | |
| # 957890 myuser_prod 127.0.0.1:34452 mydbname_prod Sleep 0 NULL 158 632 | |
| # Find the client port from the mysql process list and save that to a variable |
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
| # To filter network requests to only show requests to a specific domain and exclude urls with specific keywords | |
| domain:www.example.com -static -media | |
| # https://stackoverflow.com/questions/38524801/chrome-dev-tool-any-way-to-exclude-each-call-containing-a-string-with-regex |
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
| export NEW_CRYPT_KEY=$(cat /dev/urandom | env LC_CTYPE=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
| php -r " | |
| \$doc = new DOMDocument(); | |
| \$doc->load('app/etc/local.xml'); | |
| \$xpath = new DOMXPath(\$doc); | |
| \$node = \$xpath->query('/config/global/crypt/key')->item(0); | |
| \$oldtext = \$doc->createTextNode( \$node->textContent); | |
| \$node->nodeValue = '${NEW_CRYPT_KEY}'; | |
| echo 'replacing ' . \$oldtext->wholeText . ' with ' . \$doc->createTextNode( \$node->textContent)->wholeText . \"\n\"; | |
| \$doc->save('app/etc/local.xml'); |
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
| # If local hosts files are routinely used it may be useful to have a script verify if the domain name | |
| # is being overriden locally to a specific IP address, and if that IP should match what is publically | |
| # being listed by public DNS servers. | |
| # This is useful as a sanity check to make sure you have a local hosts file entry in place before running | |
| # some operation, so that it doesn't hit the live site, and instead operates against the expected configured | |
| # destination. | |
| # It can also be used to abort if this operation is unsafe to run against the server when it is responding | |
| # publically, and you only want the script to operate when the server is not live. |
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
| # Show the full list of all recent login sessions | |
| last | |
| # Find the last time users logged into the system | |
| lastlog | |
| # Find the last time users logged into the system from wtmp files | |
| for USER in `getent passwd | awk -F ":" '{print $1}'` | |
| do | |
| last -1 $USER | sed -e '/wtmp/d' -e '/^$/d' |
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
| # Use this to capture packets on the web server side and then analyze in wireshark using | |
| # curl as the HTTP client to log the pre master secret so that the packets can be | |
| # decrypted and analyzed within wireshark | |
| # This will work without exposing the server's private key and works with TLS 1.2 and DH ciphers | |
| # During the handshake both client and server generate a new unique secret used to encrypt all | |
| # communication that happens after the handshake. Curl can log that secret and wireshark can | |
| # reference that log to decrypt packets captured by tcpdump. | |
| # Tested with curl 7.59.0 |