Skip to content

Instantly share code, notes, and snippets.

View hn-support's full-sized avatar

Hypernode Support hn-support

View GitHub Profile
@hn-support
hn-support / block-version-control-on-apache2.md
Last active January 13, 2018 03:04
block version control directory on apache2
<Directorymatch "^/(.*/)*\.(git|svn)/">
  Order deny,allow
  Deny from all 
</Directorymatch>
@hn-support
hn-support / curl_speedtest.sh
Last active October 9, 2017 12:49
Test urls using curl
#!/bin/bash
# This script is a very basic curl utility to analyze urls.
# To use it, download the file, make it executable, and run:
# ./curl_speedtest.sh https://www.byte.nl
URL="$1"
if [ "x${URL}" == "x" ] || [[ ! "${URL}" =~ "http" ]] ; then
echo "Usage: $0 <url>"
exit 1
# 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

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
@hn-support
hn-support / testtls.php
Last active May 3, 2017 13:05
Verify curl ssl connections with 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));
@hn-support
hn-support / check-enough-space.sh
Last active May 3, 2017 12:47 — forked from gwillem/check-enough-space.sh
Create Hypernode copy of live site
#!/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 / server.robots.md
Last active April 12, 2017 16:08
Robots.txt for multisite magento 1 installations
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 / env.php
Last active March 20, 2017 13:28
Setup redis page cache for magento2
'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 / env.php
Last active March 20, 2017 13:26
Setup redis caching for magento2
'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 / redis-sessions.php
Last active March 20, 2017 13:26
Setup redis sessions for Magento 2
'session' => array(
'save' => 'redis',
'redis' => array(
'host' => 'redismaster',
'port' => '6379',
'password' => '',
'timeout' => '2.5',
'persistent_identifier' => '',
'database' => '2',
'compression_threshold' => '2048',