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 / 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
@hn-support
hn-support / change_magento2_staging_baseurls.py
Last active May 20, 2021 17:15
Copy and adjust your base_urls for Magento 2 staging environment on hypernode
#!/usr/bin/env python
"""
Set the base-urls for your Magento 2 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_magento2_staging_baseurls.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_magento2_base_urls_to_https.py
Last active February 20, 2019 10:13
Change all base_urls of your Magento 2 live shop to https on hypernode
#!/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 March 29, 2021 09:59
Change all base_urls of your Magento 1 live shop to https on hypernode
#!/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 June 10, 2020 19:01
Change your base_urls for Magento 1 staging environment on hypernode
#!/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 March 30, 2017 12:00
Magento 2 recommended additions for 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 November 4, 2022 22:23
magento2 configuration
<?php
return array (
'backend' => array (
'frontName' => 'webshop_admin',
),
'crypt' => array (
'key' => '355fb68f9e21189d170c1d759616cd58',
),
'db' => array (
@hn-support
hn-support / blocklist.txt
Last active September 25, 2023 09:52
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
360Spider
80legs\.com
ADmantX
Abonti
AcoonBot
Acunetix
AddThis\.com
AhrefsBot
AngloINFO
Antelope
@hn-support
hn-support / iopsmon.sh
Created March 13, 2017 12:25
Monitor I/O heavy SQL queries and PHP requests on Hypernode
#!/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 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