Skip to content

Instantly share code, notes, and snippets.

Byte Support hn-support

Block or report user

Report or block hn-support

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hn-support
hn-support / Example snippet server.shopware
Last active Feb 22, 2019
Example Shopware Nginx rewrites
View Example snippet server.shopware
###General rewrites
location @shopware {
rewrite / /shopware.php;
}
# use shopware.php as index.php
location ~ ^/ {
# rewrite / /shopware.php;
index shopware.php index.php;
@hn-support
hn-support / server.shopware
Last active Feb 22, 2019
Shopware Nginx configuration
View server.shopware
## Author: Benjamin Cremer
## Shopware nginx rules.
## Heavily Inspired by https://github.com/perusio/drupal-with-nginx/
## 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.
## https://github.com/bcremer/shopware-with-nginx
# don't log favicon hits
location = /favicon.ico {
log_not_found off;
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
View searchd-watchdog.py
#!/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/searchd-watchdog.py --environment live --version 1 (live)
@hn-support
hn-support / content-scan.sh
Created Jun 1, 2017
Cleanup scripts for hacked magento shops
View content-scan.sh
#!/bin/bash
# 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 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
@hn-support
hn-support / curl_speedtest.sh
Last active Oct 9, 2017
Test urls using curl
View curl_speedtest.sh
#!/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 Dec 13, 2018
Copy and adjust your base_urls for Magento 2 staging environment on hypernode
View change_magento2_staging_baseurls.py
#!/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 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.
You can’t perform that action at this time.