Skip to content

Instantly share code, notes, and snippets.

@wbob
wbob / .bash_shopware
Created October 29, 2017 17:18
shopware download shell aliases
# 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; }
@wbob
wbob / pre-commit
Created November 3, 2017 16:49
shopware pre-commit hook for the forgetful
#!/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 / README.md
Created January 25, 2019 10:00
shopware-media-cleanup

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 / dev-dump-no-pii-data.sh
Last active March 23, 2020 11:46
shopware-dev-db-dump
#!/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 / expressions.json
Last active July 18, 2019 08:35
gdpr-dump-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')"