Skip to content

Instantly share code, notes, and snippets.

View josefglatz's full-sized avatar
👨‍💻

Josef Glatz josefglatz

👨‍💻
View GitHub Profile
@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' => 'your.user@gmail.com',
'defaultMailFromName' => 'My Name',
'transport' => 'smtp',
'transport_smtp_encrypt' => 'tls',
@josefglatz
josefglatz / vhost-anonip-directly-before-logging.conf
Created July 9, 2019 19:05
Apache vHost anonip usage example
# ...
CustomLog "|/usr/local/bin/anonip --output /var/log/apache2/www.website.com-access.log" proxy
# ...
@josefglatz
josefglatz / gitlab-ci_checkTYPO3deprecationsInYourExtensionsSnippet.yml
Last active July 8, 2019 05:26
GitLab CI TYPO3 Deprecations Check with latest version usage of Tuurlijk/typo3scan
checkDeprecations:
stage: test
image: edbizarro/gitlab-ci-pipeline-php:7.2
before_script:
- 'which wget || ( sudo apt-get update -y && sudo apt-get install wget -y )'
- cd $CI_PROJECT_DIR/
- mkdir -p Build/Report/Deprecations
- cd $CI_PROJECT_DIR/app
- curl -s https://api.github.com/repos/Tuurlijk/typo3scan/releases/latest | grep "browser_download_url.*phar" | cut '-d' ':' '-f' '2,3' | tr '-d' '\"' | wget -qi -
- chmod +x typo3scan.phar