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
| rm -rf pub/static/* | |
| touch pub/static/deployed_version.txt | |
| mr config:set dev/js/minify_files 0 | |
| mr config:set dev/css/minify_files 0 | |
| bin/magento cache:flush config | |
| https=off | |
| bin/magento setup:static-content:deploy en_US | |
| https=on | |
| bin/magento setup:static-content:deploy en_US --no-javascript --no-css --no-less --no-images --no-fonts --no-html --no-misc --no-html-minify |
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
| # Defined function for generating random password | |
| genpasswd() { | |
| local l=$1 | |
| [ "$l" == "" ] && l=20 | |
| LC_CTYPE=C tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs | |
| } | |
| NEW_PASSWORD=$(genpasswd 16) | |
| echo $NEW_PASSWORD |
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
| -- Query the database to calculate a recommended innodb_buffer_pool_size | |
| -- and get the currently configured value | |
| -- The rollup as the bottom row gives the total for all DBs on the server, where each other row is recommendations per DB. | |
| SELECT | |
| TABLE_SCHEMA, | |
| CONCAT(CEILING(RIBPS/POWER(1024,pw)),SUBSTR(' KMGT',pw+1,1)) | |
| Recommended_InnoDB_Buffer_Pool_Size, | |
| ( | |
| SELECT CONCAT(CEILING(variable_value/POWER(1024,FLOOR(LOG(variable_value)/LOG(1024)))),SUBSTR(' KMGT',FLOOR(LOG(variable_value)/LOG(1024))+1,1)) |
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
| watch -d -n 5 'curl -s -v --connect-timeout 15 --max-time 30 http://example.com/ > /dev/null' | |
| # Could not resolve hostname | |
| watch -d -n 5 'curl -s -v --connect-timeout 15 --max-time 30 http://asdfasdfasdf.asdf/ > /dev/null' | |
| * Could not resolve host: asdfasdfasdf.asdf | |
| * Closing connection 0 | |
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
| # Commands to use for determining memory usage in linux | |
| # https://github.com/pixelb/ps_mem | |
| ps_mem | |
| top | |
| # https://hisham.hm/htop/ | |
| htop |
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://goaccess.io/ | |
| yum install -y glib2 glib2-devel glibc make geoip geoip-devel ncurses-devel | |
| cd ~/ | |
| wget http://tar.goaccess.io/goaccess-1.1.1.tar.gz | |
| tar -xzvf goaccess-1.1.1.tar.gz | |
| cd goaccess-1.1.1/ | |
| ./configure --enable-geoip --enable-utf8 | |
| make | |
| make install |
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
| # Setup local directory with braintree example and libraries | |
| git clone [email protected]: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 |
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
| # CentoOS 7 - Systemctl | |
| # https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units | |
| # https://www.digitalocean.com/community/tutorials/understanding-systemd-units-and-unit-files | |
| # Enabled user space units | |
| /etc/systemd/system/multi-user.target.wants/varnish.service | |
| # System library of available units | |
| /usr/lib/systemd/system/varnish.service |
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 changes to sshd configuration | |
| vi /etc/ssh/sshd_config | |
| PasswordAuthentication no | |
| # Test configuration changes | |
| sshd -t | |
| # Restart service | |
| service sshd restart |
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
| # 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 |