Category Archives: Snippets

Enable Twig debug in Symfony2

Posted on in Development, How-Tos, Snippets

To enable the debug tag in Twig, add the following to app/config/config_dev.yml

services:
    twig.extension.debug:
        class: Twig_Extensions_Extension_Debug
            tags:
                - { name: twig.extension }

Afterwards clear the cache and use the debug extension:

{% debug my_var %}

Sources

Shorewall logcheck pattern

Posted on in Linux, Snippets

A logcheck ignore pattern to filter out shorewall REJECT and DROP entries (net is defined as eth0). /etc/logwatch/ignore.d.server/shorewall:

^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ kernel:( \[ *[[:digit:]]+\.[[:digit:]]+\])? Shorewall:net2([a-z0-9]*):(REJECT|DROP)

Test if the regex works for your config:

sed -e 's/[[:space:]]*$//' /var/log/syslog | egrep '^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ kernel:( \[ *[[:digit:]]+\.[[:digit:]]+\])? Shorewall:net2([a-z0-9]*):(REJECT|DROP)'