Skip to content

Instantly share code, notes, and snippets.


Hypernode Support hn-support

View GitHub Profile
hn-support /
Created Jun 1, 2017
Cleanup scripts for hacked magento shops
# Find files that contain suspicious php code
grep -RE 'preg_replace\(|eval\(|base64_decode\(' --include='*.php' . | cut -d: -f 1 | sort -u | while read line ; do echo $line | cat - $line | less ; done
View whitelist-development-exception.conf
# You can whitelist request that should be exempt from the development
# basic auth.
# It's possible to whitelist request based on their IP address, range,
# User-Agent, or by the requested URL.
# Please note though, that google and bing bots will always remain
# blocked on development nodes!
# Both IP addresses and IP ranges can be whitelisted here.
geo $development_exceptions_ip {
default "Development restricted area";
hn-support /
Last active Dec 26, 2020
Debug script to log all cron output to a logfile
# This script is a debug utility for cronjobs as explained in:
# -
# It logs all output and timing to a log file
# To use it, download the script, add the executable bit and put it in your cronjob:
# */5 * * * * /data/web/bin/debug-cron php -f /data/web/public/cron.php
TIMESTAMP="$( date '+%Y%m%d%H%M' )"
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
hn-support / env.php
Last active Oct 1, 2020
magento2 configuration
View env.php
return array (
'backend' => array (
'frontName' => 'webshop_admin',
'crypt' => array (
'key' => '355fb68f9e21189d170c1d759616cd58',
'db' => array (
hn-support /
Last active Sep 23, 2020
A threaded cache warmer in python
#!/usr/bin/env python
Warm the caches of your website by crawling each page defined in sitemap.xml.
To use, download this file and make it executable. Then run:
./ --threads 4 --file /data/web/public/sitemap.xml -v
import argparse
import multiprocessing.pool as mpool
import os.path
import re
hn-support /
Created Jan 11, 2017
A cache warmer in bash using curl
if [ "$#" -ne 1 ] || [ "x$1" == "x" ] ; then
echo "Usage: $0 <sitemap.xml>"
exit 0;
if [ ! -f "$1" ]; then
echo "Sitemap file $1 not found! Exit!"
exit 1
hn-support /
Last active Jun 10, 2020
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:
After use, check your base-urls by issuing:
n98-magerun sys:store:config:base-url:list
This script requires n98-magerun.
#!/usr/bin/env python
""" Hypernode searchd cron watchdog
This script checks the pid of the searchd daemon and restarts it when the service is not running
It works for both Magento 1 and Magento 2 and for both live and staging.
To run it, add it to the crontab of your hypernode.
For Magento 1:
* * * * * flock -n ~/.searchd_live /data/web/ --environment live --version 1 (live)
hn-support / server.shopware
Last active Jan 28, 2020
Shopware Nginx configuration
View server.shopware
## Author: Benjamin Cremer
## Shopware nginx rules.
## Heavily Inspired by
## Designed to be included in any server {} block.
## Please note that you need a PHP-FPM upstream configured in the http context, and its name set in the $fpm_upstream variable.
# don't log favicon hits
location = /favicon.ico {
log_not_found off;