Skip to content

Instantly share code, notes, and snippets.

@jrenggli
jrenggli / nginx.conf
Created July 19, 2016 13:07
Increase timeouts in nginx
client_max_body_size 100m;
proxy_connect_timeout 600s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
@jrenggli
jrenggli / body-tag.ts
Created July 8, 2016 07:51
body tag definition for TYPO3. Supports backend_layouts and tx_fluidpages
page.bodyTagCObject = COA
page.bodyTagCObject {
wrap = <body|>
10 = COA
10 {
10 = TEXT
10 {
value = {$plugin.tx_fluidpages.settings.someCustomClassesDependingOnTypoScriptSettings}
insertData = 1
@jrenggli
jrenggli / local.php
Last active April 15, 2016 14:27
Use TYPO3 users (from be_users table) for authentication in Dokuwiki. This uses the authpdo plugin (https://www.dokuwiki.org/plugin:authpdo)
<?php
/**
*
*
* Currently only read only operations are implemented.
*
* Reminder:
* Configure password in configuration manager before switching authtype to `authpdo`.
* Otherwise you locking yourself out of the system.
@jrenggli
jrenggli / docker-top.sh
Created January 28, 2016 17:43
List all running docker containers and their resources used
docker stats `docker inspect --format='{{.Name}}' $(sudo docker ps -aq --no-trunc) | sed -e 's/\///g'`
@jrenggli
jrenggli / AdditionalConfiguration.php
Created December 16, 2015 21:26
pageNotFound_handling for restricted pages in TYPO3
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling'] = 'USER_FUNCTION:EXT:usermytemplate/Classes/Utility/PageNotFoundHandling.php:user_pageNotFound->pageNotFound';
// Custom configuration for multi-language 404 page, see EXT:usermytemplate/Classes/Utility/PageNotFoundHandling.php
// ID of the page to redirect to if page was not found
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling_redirectPageID'] = 123;
// ID of the page to redirect to if current page is access protected
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling_loginPageID'] = 789;
@jrenggli
jrenggli / backup-all-docker-images.sh
Created December 8, 2015 17:56
Backup/Save all Docker Images to a compressed file
docker images | tail -n +2 | grep -v "none" | awk '{printf("%s:%s\n", $1, $2)}' | while read IMAGE; do
echo $IMAGE
filename="${IMAGE//\//-}"
filename="${filename//:/-}.docker-image.gz"
docker save ${IMAGE} | pigz --stdout --best > $filename
done
@jrenggli
jrenggli / vpnsetup.sh
Last active August 29, 2015 14:22 — forked from hwdsl2/.MOVED.md
#!/bin/sh
#
# Amazon EC2 user-data file for automatic configuration of IPsec/L2TP VPN
# on a Ubuntu server instance. Tested with 14.04 (Trusty) AND 12.04 (Precise).
# With minor modifications, this script *can also be used* on dedicated servers
# or any KVM- or XEN-based Virtual Private Server (VPS) from other providers.
#
# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! THIS IS MEANT TO BE RUN WHEN
# YOUR AMAZON EC2 INSTANCE STARTS!
#
@jrenggli
jrenggli / flushImageVariantCache.sh
Created April 14, 2015 08:53
flush cache for ImageVariants in TYPO3 Neos / TYPO3 Flow. Delete all persistent files not managed in table typo3_flow_resource_resource. Use to regenerate all images with ImageMagick / Imagick
cd Data/Persistent/Resources
ls -1 | while read F; do
echo '-'
resourcepointer=$(echo "SELECT resourcepointer FROM typo3_flow_resource_resource WHERE resourcepointer = '${F}';" | mysql 'DBNAME' -u'DBUSER' -p'DBPASSWORD' -s)
if [ -z "${resourcepointer}" ]; then
rm ${F}
fi
done
@jrenggli
jrenggli / ResourceModificationTimeAspect.php
Last active August 29, 2015 14:16
Add timestamp to resource links in TYPO3 Flow. (Thanks to Sascha and Visay)
<?php
namespace WE\BaseBox\Aspects;
/* *
* This script belongs to the TYPO3 Flow package "WE.BaseBox". *
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License, either version 3 *
* of the License, or (at your option) any later version. *
* *
@jrenggli
jrenggli / main.cf
Created January 26, 2015 16:29
mail configuration for development systems: redirect all mails to a distinct mailbox. (Prevent mails being sent to actual recipients)
# File: /etc/postfix/main.cf
...
virtual_alias_maps = regexp:/etc/postfix/virtual
...