Skip to content

Instantly share code, notes, and snippets.


Josef Glatz josefglatz

View GitHub Profile
josefglatz / PHP strtotime relative
Last active Jun 29, 2020
I use that mainly for TYPO3 extension georgringer/news Time Restriction fields and TypoScript configuration
View PHP strtotime relative

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 / sudoers personal Cheatsheet.txt
Last active Jun 22, 2020
codekitchen/dinghy related sudoers configuration
View sudoers personal Cheatsheet.txt
# based on
Cmnd_alias DINGHY_NFS = /usr/local/bin/dinghy nfs *
View Override TYPO3 ext:mail_conf_override settings for mailhog in an specific applicationContext.php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
// Override configuration of LocalConfiguration
$customChanges = [
'GFX' => [
'TTFdpi' => '96',
'colorspace' => 'RGB',
josefglatz / Graylog 3 setup GELF UDP and
Created Jun 15, 2020
Setup graylog general inputs for e.g. docker containers
View Graylog 3 setup GELF UDP and
"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 /
Created Jun 1, 2020
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 / Makefile_Snippet_TYPO3_backend_restriction
Last active May 27, 2020
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
View Makefile_Snippet_TYPO3_backend_restriction
# a) set env var initially to 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),)
# In an local environment the value will be TRUE now. So we can use this in IF queries in our Makefile
# ...
josefglatz / ErrorPages.yaml
Last active Apr 24, 2020 — forked from bmack/LocalPageErrorHandler.php
Local Error Handler for TYPO3 (works also if your TYPO3 website is behind a basic auth)
View ErrorPages.yaml
errorCode: '404'
errorContentSource: 't3://page?uid=316'
errorHandler: PHP
errorPhpClassFQCN: B13\AnyProject\PageErrorHandler\LocalPageErrorHandler
josefglatz / AdditionalConfiguration_TemplateForMailSetting.php
Last active Jan 23, 2020
TYPO3 MAIL settings for Gmail / G-Suite TLS connection
View AdditionalConfiguration_TemplateForMailSetting.php
// Override configuration of LocalConfiguration
$customChanges = [
'MAIL' => [
'defaultMailFromAddress' => '',
'defaultMailFromName' => 'My Name',
'transport' => 'smtp',
'transport_smtp_encrypt' => 'tls',
View vhost-anonip-directly-before-logging.conf
# ...
CustomLog "|/usr/local/bin/anonip --output /var/log/apache2/" proxy
# ...
You can’t perform that action at this time.