Skip to content

Instantly share code, notes, and snippets.

@jrenggli
jrenggli / install_puppet.sh
Created January 17, 2015 20:58
Install Puppet on Ubuntu/Debian
#echo "deb http://apt.puppetlabs.com/ wheezy main dependencies" >> /etc/apt/sources.list.d/puppet.list
#echo "deb http://apt.puppetlabs.com/ precise main dependencies" >> /etc/apt/sources.list.d/puppet.list
echo "deb http://apt.puppetlabs.com/ trusty main dependencies" >> /etc/apt/sources.list.d/puppet.list
wget http://apt.puppetlabs.com/pubkey.gpg
gpg --import pubkey.gpg
gpg -a --export 4BD6EC30 | apt-key add -
rm pubkey.gpg
aptitude install -y puppet-common
@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 / Menu.html
Created August 18, 2014 15:47
TYPO3 Neos: hide subItems in menu when node is not active (behaviour similar to expAll = 0 in TYPO3 CMS)
{namespace neos=TYPO3\Neos\ViewHelpers}
{namespace ts=TYPO3\TypoScript\ViewHelpers}
<ul{attributes -> f:format.raw()}>
<f:render section="itemsList" arguments="{items: items}" />
</ul>
<f:section name="itemsList">
<f:for each="{items}" as="item">
<li{ts:render(path:'{item.state}.attributes') -> f:format.raw()}>
@jrenggli
jrenggli / proxy.php
Last active August 29, 2015 14:03
Adjust request headers when using proxy servers (former https.php)
<?php
/*
* Detects a Request through HTTP/HTTPS Proxy and sets the coresponding server variables.
*
* usage:
* in php.ini or .htaccess
* php_value auto_prepend_file /var/www/proxy.php
*
* in pool.d for php-fpm
* php_value[auto_prepend_file] = /var/www/proxy.php
@jrenggli
jrenggli / migrate-markup-redmine-jira.php
Created June 24, 2014 11:34
Adjust markup when migrating data from Redmine to JIRA
<?php
$pattern = Array(
'/<pre>(\s)*<code class="(\S*)">/i',
'/<\/code><\/pre>/i',
'/<pre>/i',
'/<\/pre>/i',
'/@(\S*)@/i',
);
@jrenggli
jrenggli / TYPO3.xml
Created June 10, 2014 04:38
PhpStorm CodeStyle for TYPO3
<?xml version="1.0" encoding="UTF-8"?>
<code_scheme name="TYPO3_jr">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="true" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
@jrenggli
jrenggli / gitmodules_to_sh
Created March 3, 2014 22:26
Create shell commands from gitmodules file
Search: \[submodule ".*/([^\/]*)"\]\n\tpath = (.*)\n\turl = (.*)
Replace: git submodule add $3 $2\ngit commit -m "[TASK] Add puppet module $1"