Skip to content

Instantly share code, notes, and snippets.

@jrenggli
jrenggli / vrpt-extractor.json
Last active August 4, 2023 09:55
Graylog2 Extractor for VRPT/Syslog format (used by ZyXEL devices)
{
"extractors": [
{
"condition_type": "none",
"condition_value": "",
"converters": [],
"cursor_strategy": "copy",
"extractor_config": {
"regex_value": "cat=\"(.*?)\""
},
@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 / homebrew-permissions.sh
Last active April 3, 2022 23:32
Fix homebrew permissions
sudo chown -R $(whoami) /usr/local/Cellar
sudo chown -R $(whoami) /usr/local/Homebrew
sudo chown -R $(whoami) /usr/local/var/homebrew
sudo chown -R $(whoami) ${HOME}/Library/Caches/Homebrew
sudo chown -R $(whoami) ${HOME}/Library/Logs/Homebrew
sudo chown -R $(whoami) /usr/local/etc
sudo chown -R $(whoami) /usr/local/opt
sudo chown -R $(whoami) /usr/local/bin
sudo chown -R $(whoami) /usr/local/var
sudo chown -R $(whoami) /usr/local/share/man/man1
@jrenggli
jrenggli / updateTerTranslations.sh
Last active November 27, 2020 08:11
Update translation files for all TYPO3 extensions present in the filesystem. Ideally for continuous integration. No database required
#!/usr/bin/env bash
# Fetch translation files for all TYPO3 extensions present in the filesystem
#
# In contrast to the TYPO3 CLI command to retrieve translations, this script
# can be executed without having a DB connection available. This is useful to
# fetch all translations in the build step without any TYPO3 dependencies.
#
# Adjust the variables below if necessary
@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 / homematic_hue_toogle.sh
Last active November 20, 2018 12:47
Toggle Philips Hue Lights with Homematic Script. Credits: https://www.technikkram.net/2017/04/philips-hue-per-homematic-steuern
!Hue Lampe ein-/ausschalten
!------------------------------
!__IP Adresse der Hue Bridge
string ip_address = "192.168.2.172";
!__User ID in der Bridge
string api_key="9YqN4igBFdRpXo8kw3lhzzNIzPXFFSoJSn6488bV";
!__Auswahl der Lampe
string lamp ="1";
@jrenggli
jrenggli / move-flow-resources-to-folder.sh
Created October 2, 2018 12:58
Move Resources to appropriate subfolder in folder structure (Flow Framework)
ls -1 | while read F; do
mkdir -p ${F:0:1}/${F:1:1}/${F:2:1}/${F:3:1}
mv ${F} ${F:0:1}/${F:1:1}/${F:2:1}/${F:3:1}/
done
@jrenggli
jrenggli / typo3-cms-linkhandler-record-link-migration.patch
Last active February 13, 2018 21:29
typo3-cms-linkhandler-record-link-migration.patch
@jrenggli
jrenggli / statuscake_pagespeed_ip.regex
Created January 13, 2017 12:41
Regex for filtering StatusCake Page Speed test traffic. Can be used in Google Analytics (see https://www.statuscake.com/kb/knowledge-base/how-do-i-exclude-statuscake-from-google-analytics/)
^46\.101\.(86\.253|172\.39|227\.232)|128\.199\.(230\.46|252\.83)|139\.(59\.((6\.165|170\.38)|203\.60\.219))|159\.203\.60\.219|178\.62\.47\.83|188\.166\.170\.233|192\.(34\.63\.77|241\.151\.177)|198\.(199\.(91\.(32|244)|126\.66)|211\.104\.10)$