Skip to content

Instantly share code, notes, and snippets.

Avatar

Hypernode Support hn-support

View GitHub Profile
@hn-support
hn-support / change_magento2_base_urls_to_https.py
Last active Feb 20, 2019
Change all base_urls of your Magento 2 live shop to https on hypernode
View change_magento2_base_urls_to_https.py
#!/usr/bin/env python
"""
Set the base-urls for your Magento 2 installation to support only https.
To use, download the file and make it executable. Then run:
./change_magento2_base_urls_to_https.py
After use, check your base-urls by issuing:
n98-magerun2 sys:store:config:base-url:list
This script requires n98-magerun2.
@hn-support
hn-support / change_magento1_base_urls_to_https.py
Last active Aug 23, 2018
Change all base_urls of your Magento 1 live shop to https on hypernode
View change_magento1_base_urls_to_https.py
#!/usr/bin/env python
"""
Set the base-urls for your Magento 1 installation to support only https.
To use, download the file and make it executable. Then run:
./change_magento1_base_urls_to_https.py
After use, check your base-urls by issuing:
n98-magerun sys:store:config:base-url:list
This script requires n98-magerun.
@hn-support
hn-support / change_magento1_staging_baseurls.py
Last active Jun 10, 2020
Change your base_urls for Magento 1 staging environment on hypernode
View change_magento1_staging_baseurls.py
#!/usr/bin/env python
"""
Set the base-urls for your Magento 1 staging environment by copying and adjusting the base-urls from your production site.
To use, download the file and make it executable. Then run:
./change_magento1_staging_baseurls.py
After use, check your base-urls by issuing:
n98-magerun sys:store:config:base-url:list
This script requires n98-magerun.
@hn-support
hn-support / robots.txt
Created Mar 30, 2017
Magento 2 recommended additions for robots.txt
View robots.txt
User-agent: *
# Directories
Disallow: /app/
Disallow: /bin/
Disallow: /dev/
Disallow: /lib/
Disallow: /phpserver/
Disallow: /pkginfo/
Disallow: /report/
@hn-support
hn-support / env.php
Last active Oct 1, 2020
magento2 configuration
View env.php
<?php
return array (
'backend' => array (
'frontName' => 'webshop_admin',
),
'crypt' => array (
'key' => '355fb68f9e21189d170c1d759616cd58',
),
'db' => array (
@hn-support
hn-support / blocklist.txt
Last active Oct 14, 2020
A curated list of user agents that use lot's of resources but don't cause more conversion or add any value to most of the webshops
View blocklist.txt
360Spider
80legs\.com
ADmantX
Abonti
AcoonBot
Acunetix
AddThis\.com
AhrefsBot
AngloINFO
Antelope
@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 / 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 / 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 / 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',