Skip to content

Instantly share code, notes, and snippets.

View htuscher's full-sized avatar

Hans Tuscher htuscher

View GitHub Profile
@htuscher
htuscher / ExtbaseForceLanguage.php
Last active August 29, 2023 11:04
TYPO3 Extbase get record with language different than FE or 0
<?php
namespace Onedrop\Common\Service;
/***************************************************************
* Copyright notice
*
* (c) 2015 Hans Höchtl <hhoechtl@1drop.de>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
@htuscher
htuscher / devenv.nix
Created April 25, 2023 08:24
Devenv Permission issues
{ pkgs, lib, config, ... }:
{
certificates = [
"shopware.dev"
];
hosts."shopware.dev" = "127.0.0.1";
packages = [
@htuscher
htuscher / microk8s.md
Last active April 24, 2023 12:01
MicroK8s on Hetzner Cloud

Installation

apt-get install snapd
snap install microk8s --classic --channel=1.18/stable
microk8s enable dns dashboard registry helm3 ingress storage

Dashboard

@htuscher
htuscher / .gitlab-ci.yml
Created August 3, 2017 08:12
Deploying with docker-compose via SSH tunnel in Gitlab CI
deploy:live:
image: 1drop/docker:git
stage: deploy
when: manual
environment:
name: production
url: https://www.somecustomer.de
before_script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
@htuscher
htuscher / keybase.md
Created November 16, 2022 10:29
keybase.md

Keybase proof

I hereby claim:

  • I am hhoechtl on github.
  • I am htuscher (https://keybase.io/htuscher) on keybase.
  • I have a public key ASDRch2Q2qmqSKqz12su02CIzIfFYSn_5x8r_VvngMNXgQo

To claim this, I am signing this object:

@htuscher
htuscher / Dockerfile
Created March 14, 2022 09:52
Keycloak Docker
FROM jboss/keycloak:15.0.2
ENV KEYCLOAK_WELCOME_THEME=mytheme
ENV KEYCLOAK_DEFAULT_THEME=mytheme
COPY theme /opt/jboss/keycloak/themes/mytheme
@htuscher
htuscher / fix_bm_prices.php
Created February 5, 2021 09:10
Fix WooCommerce B2B Market Prices after import on variants
<?php
define('DB_NAME', 'wordpress');
/** MySQL database username */
define('DB_USER', 'dbuser');
/** MySQL database password */
define('DB_PASSWORD', 'dbpassword');
/** MySQL hostname */
define('DB_HOST', 'localhost');
@htuscher
htuscher / post_deploy.sh
Created March 25, 2020 16:02
Shopware 6 post deployment steps
#!/usr/bin/env bash
bin/console cache:clear
bin/console database:migrate --all
bin/console plugin:refresh
# Ensure plugins are installed and active
bin/console plugin:install --activate FroshPlatformMailArchive
bin/console plugin:install --activate FroshPlatformTemplateMail
@htuscher
htuscher / worker.conf
Created January 14, 2021 18:15
The entrypoint of `webdevops/php-nginx:7.4` allows to start a different entrypoint script. The default starts the supervisord but we can switch to a worker.
# Copy this file to /opt/docker/etc/supervisor.d/worker.conf
[group:worker]
programs=queue-worker
priority=25
[program:queue-worker]
command = /app/bin/console messenger:consume default --time-limit=180 -vv
user = application
process_name=%(program_name)s
@htuscher
htuscher / FetchModeHelper.php
Created September 3, 2020 20:00
Doctrine DBAL Fetchmode helper FETCH_KEY_PAIR FETCH_GROUP
<?php declare(strict_types=1);
namespace Shopware\Core\Framework\DataAbstractionLayer\Doctrine;
class FetchModeHelper
{
/**
* User-land implementation of PDO::FETCH_KEY_PAIR
*/
public static function keyPair(array $result): array