Skip to content

Instantly share code, notes, and snippets.

Avatar

Hypernode Support hn-support

View GitHub Profile
@hn-support
hn-support / redis-sessions-magento.xml
Last active Dec 9, 2016
Setup redis sessions for Magento 1
View redis-sessions-magento.xml
<session_save>db</session_save>
<redis_session>
<host>redismaster</host>
<port>6379</port>
<password></password>
<timeout>2.5</timeout>
<persistent></persistent>
<db>2</db>
<compression_threshold>2048</compression_threshold>
<compression_lib>gzip</compression_lib>
@hn-support
hn-support / iopsmon.sh
Created Mar 13, 2017
Monitor I/O heavy SQL queries and PHP requests on Hypernode
View iopsmon.sh
#!/bin/bash
# monitors iops per 30 sec interval, and prints current http and sql transactions if iops avg > 100
while true; do
iops=$(iostat xvdf -d 30 2 | tail -2 | head -1 | awk '{print $2}' | cut -d. -f1)
if [[ "$iops" -gt 100 ]]; then
echo "-------------------------------------------------------------------"
echo "IOPS: $iops"
echo
@hn-support
hn-support / redis-sessions.php
Last active Mar 20, 2017
Setup redis sessions for Magento 2
View redis-sessions.php
'session' => array(
'save' => 'redis',
'redis' => array(
'host' => 'redismaster',
'port' => '6379',
'password' => '',
'timeout' => '2.5',
'persistent_identifier' => '',
'database' => '2',
'compression_threshold' => '2048',
@hn-support
hn-support / env.php
Last active Mar 20, 2017
Setup redis caching for magento2
View env.php
'cache' => array(
'frontend' => array(
'default' => array(
'backend' => 'Cm_Cache_Backend_Redis',
'backend_options' => array(
'server' => '127.0.0.1',
'port' => '6379',
),
),
),
@hn-support
hn-support / env.php
Last active Mar 20, 2017
Setup redis page cache for magento2
View env.php
'cache' => array (
'frontend' => array (
'default' => array (
'backend' => 'Cm_Cache_Backend_Redis',
'backend_options' => array (
'server' => '127.0.0.1',
'port' => '6379',
),
),
// Start of snippet
@hn-support
hn-support / server.robots.md
Last active Apr 12, 2017
Robots.txt for multisite magento 1 installations
View server.robots.md
location /robots.txt { return 200 "### Autogenerated robots.txt\n

# Sitemap
Sitemap: https://$http_host/sitemap.xml

# Crawlers Setup
User-agent: *
Crawl-delay: 20
@hn-support
hn-support / check-enough-space.sh
Last active May 3, 2017 — forked from gwillem/check-enough-space.sh
Create Hypernode copy of live site
View check-enough-space.sh
#!/bin/bash
# This script checks if there is enough diskspace available on your hypernode
# to create a basic staging environment as explained in
# - https://support.hypernode.com/knowledgebase/using-a-basic-staging-environment-magento1/
# and
# - https://support.hypernode.com/knowledgebase/using-a-basic-staging-environment-magento2/
# To use it, download or copy the script and make it executable.
# is there enough space?
DBNAME=$(magerun --root-dir=~/public db:info dbname)
@hn-support
hn-support / testtls.php
Last active May 3, 2017
Verify curl ssl connections with php
View testtls.php
<?php
/*
This script tests whether your php installation is able to create TLS connections.
*/
foreach ([6, 7, 8] as $version) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://tlstest.paypal.com/");
curl_setopt($ch, CURLOPT_SSLVERSION, $version);
var_dump(curl_exec($ch));
var_dump(curl_error($ch));
View magento-testing-scenarios.md

Magento testing scenarios

For use after an upgrade to verify the correct working of Magento

SHIP IT

Frontend

General

  • Activate all logs on the server (PHP, MySQL, Magento, mail, etc)
  • Check meta tags in HTML
View server-name-wordlist-mnemonic.txt
# Original blog post: <https://mnx.io/blog/a-proper-server-naming-scheme/>
# Original word list: <http://web.archive.org/web/20091003023412/http://tothink.com/mnemonic/wordlist.txt>
# Sample usage: `curl <gist> | tail --lines +4 | shuf | head --lines 1`
acrobat
africa
alaska
albert
albino
album
alcohol