Skip to content

Instantly share code, notes, and snippets.

View josefglatz's full-sized avatar
👨‍💻

Josef Glatz josefglatz

👨‍💻
View GitHub Profile
[BUGFIX] for Mittwald to support PHP 7.3 FPM
to prevent errors like >IDNA_CHECK_BIDI...<
the guzzle version is fixed to 6.5.4 instead
of version 6.5.5 with the command
composer req guzzlehttp/guzzle:6.5.4 --update-with-all-dependencies
Changelogs summary:
- symfony/polyfill-intl-normalizer removed (installed version was v1.18.0)
@josefglatz
josefglatz / PHP strtotime relative cheatsheet.md
Last active June 29, 2020 05:23
I use that mainly for TYPO3 extension georgringer/news Time Restriction fields and TypoScript configuration

PHP strtotime relative cheatsheet

Example for ext:news timeRestrictionHigh archive Page: show only news older than 3 years relative to last day of year

To get always the 31 december 3 years ago (actual 8.7.2020, you want 31.12.2017)

-3 years 31 december

@josefglatz
josefglatz / sudoers personal Cheatsheet.txt
Last active September 7, 2020 04:57
codekitchen/dinghy related sudoers configuration
# based on https://github.com/codekitchen/dinghy/blob/master/cli/dinghy/unfs.rb#L30 https://github.com/codekitchen/dinghy/blob/master/cli/dinghy/unfs.rb#L35
Cmnd_Alias DINGHY_NFS = /usr/local/bin/dinghy nfs *
%admin ALL=(root) NOPASSWD: DINGHY_NFS
<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
// Override configuration of LocalConfiguration
$customChanges = [
'GFX' => [
'TTFdpi' => '96',
'colorspace' => 'RGB',
@josefglatz
josefglatz / Graylog 3 setup GELF UDP and TCP.sh
Created June 15, 2020 10:20
Setup graylog general inputs for e.g. docker containers
#!/bin/bash
IP_ADDRESS=localhost
GRAYLOG3_URL="http://${IP_ADDRESS}:9000"
GRAYLOG3_INPUT_GELF_TCP='
{
"global": "true",
"title": "Gelf TCP",
"configuration": {
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_NFSD = /sbin/nfsd restart
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /usr/bin/sed -E -e /*/ d -ibak /etc/exports
Cmnd_Alias VAGRANT_HOSTSUPDATER_ADD = /bin/sh -c echo "*" >> /etc/hosts
Cmnd_Alias VAGRANT_HOSTSUPDATER_REMOVE = /usr/bin/sed -i -e /*/ d /etc/hosts
Cmnd_Alias VAGRANT_HOSTMANAGER_UPDATE = /bin/cp /Users/jglatz/.vagrant.d/tmp/hosts.local /etc/hosts
Cmnd_Alias ADMIN_TOOLS_HTOP = /usr/local/bin/htop
# additional user specification
@josefglatz
josefglatz / TYPO3versionnumber.sh
Created June 1, 2020 17:17
Get TYPO3 version from TYPO3 CLI binary
# show version and applicationContext
./web/bin/typo3 | head -1
# Extract version only
./bin/typo3 | head -1 | grep -P '[0-9]+(\.[0-9]+)?([^\s]+)' -o
@josefglatz
josefglatz / Makefile_Snippet_TYPO3_backend_restriction
Last active May 27, 2020 04:02
The TYPO3 backend get's an additional .htaccess linked in /typo3 to add further access restrictions (e.g. based on IP ranges) in this snippet
# a) set env var initially to false
DEVELOPMENT_ENVIRONMENT_ACTIVE = FALSE
# b) set env var to true if env var CI_PROJECT_DIR is not set at all or is empty (The name of the variable is given by GitLab CI)
ifeq ($(CI_PROJECT_DIR),)
DEVELOPMENT_ENVIRONMENT_ACTIVE = TRUE
endif
# In an local environment the value will be TRUE now. So we can use this in IF queries in our Makefile
# ...
@josefglatz
josefglatz / ErrorPages.yaml
Last active December 28, 2020 23:28 — forked from bmack/LocalPageErrorHandler.php
Local Error Handler for TYPO3 (works also if your TYPO3 website is behind a basic auth)
errorHandling:
-
errorCode: '404'
errorContentSource: 't3://page?uid=316'
errorHandler: PHP
errorPhpClassFQCN: B13\AnyProject\PageErrorHandler\LocalPageErrorHandler
@josefglatz
josefglatz / AdditionalConfiguration_TemplateForMailSetting.php
Last active January 23, 2020 05:24
TYPO3 MAIL settings for Gmail / G-Suite TLS connection
<?php
declare(strict_types=1);
// Override configuration of LocalConfiguration
$customChanges = [
'MAIL' => [
'defaultMailFromAddress' => '[email protected]',
'defaultMailFromName' => 'My Name',
'transport' => 'smtp',
'transport_smtp_encrypt' => 'tls',