Skip to content

Instantly share code, notes, and snippets.

@wbob
wbob / expressions.json
Last active Jul 18, 2019
gdpr-dump-json
View expressions.json
{
"s_articles_vote": {
"email": "CONCAT(LEFT(MD5(CONCAT(@seed, `email`)), LENGTH(`email`)), '@localhost')",
"name": "LEFT(MD5(CONCAT(@seed, `name`)), LENGTH(`name`))"
},
"s_articles_notification": {
"mail": "CONCAT(LEFT(MD5(CONCAT(@seed, `mail`)), LENGTH(`mail`)), '@localhost')"
},
"s_campaigns_mailaddresses": {
"email": "CONCAT(LEFT(MD5(CONCAT(@seed, `email`)), LENGTH(`email`)), '@localhost')"
@wbob
wbob / dev-dump-no-pii-data.sh
Last active Mar 23, 2020
shopware-dev-db-dump
View dev-dump-no-pii-data.sh
#!/bin/bash
#
# dump db without contents of specific tables
if test -z "$1" || test -z "$2"; then
echo "usage: script.sh <user> <dbname>"
exit 1
fi
user="$1"
@wbob
wbob / README.md
Created Jan 25, 2019
shopware-media-cleanup
View README.md

Requirements

Tested with bash 4.3 on ubuntu trusty/xenial.

Description

Cleanup Shopware media/image/ directory of misplaced files. By default only folders exceeding the 3 directory levels are scanned.

  • copy the script to your home folder
  • navigate to a shoproot and into media/image/
@wbob
wbob / pre-commit
Created Nov 3, 2017
shopware pre-commit hook for the forgetful
View pre-commit
#!/usr/bin/env bash
#
# some sanity checks for shopware
#
# install: move to .git/hooks/pre-commit and chmod +x the file
# colors for output
nocolor='\033[0m'
green='\033[0;32m'
orange='\033[0;33m'
@wbob
wbob / .bash_shopware
Created Oct 29, 2017
shopware download shell aliases
View .bash_shopware
# shopware downloaders, "jq" package required
alias sw-getlatest="echo '# get latest install release'; curl -s 'http://update-api.shopware.com/v1/releases/install' | jq '.[0].uri' | xargs -I{} wget --quiet --show-progress {}"
alias sw-getupdate="echo '# get latest update of stable branch'; curl -s 'http://update-api.shopware.com/v1/release/update?shopware_version=5&channel=stable' | jq '.uri' | xargs wget --quiet --show-progress"
sw-getrelease() { echo "# get specific release"; if [ -z "$*" ]; then echo "# no version given. usage 'sw-getrelease <version>'"; return 0; fi; VER="$1"; curl -s http://update-api.shopware.com/v1/releases/install | jq '.[] | select(.version=='\"$VER\"') | .uri' | xargs wget --quiet --show-progress; }