Skip to content

Instantly share code, notes, and snippets.

@etobi
etobi / log2slack
Created November 4, 2014 10:31
Simple shell script to monitor a log file (e.g. TYPO3 syslog) and push it to a slack channel
#!/bin/sh
tail -n 1 -f /var/path/to/file.log | while read line; do
echo $line | grep -v "PATTERN TO IGNORE"
if `test $? -eq 0`; then
cleanLine=`echo $line | tr -d '"'`
payload="payload={\"channel\": \"#channel\", \"username\": \"dev:typo3-sys.log\", \"text\": \"$cleanLine\", \"icon_emoji\": \":interrobang:\"}"
curl -X POST --data-urlencode "$payload" https://TEAM.slack.com/services/hooks/incoming-webhook\?token\=TOKEN
fi
done
@etobi
etobi / Systemlog.php
Created September 30, 2017 15:25
Syslog in Slack posten
<?php
namespace Foo\Bar\Hooks;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class Systemlog
{
private $severityLabel = [
GeneralUtility::SYSLOG_SEVERITY_INFO => 'INFO',
diff --git i/Classes/Domain/Repository/DceRepository.php w/Classes/Domain/Repository/DceRepository.php
index dafb5dd..fa07347 100644
--- i/Classes/Domain/Repository/DceRepository.php
+++ w/Classes/Domain/Repository/DceRepository.php
@@ -166,9 +166,10 @@ class DceRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
*/
protected function processFillingFields(
\ArminVieweg\Dce\Domain\Model\Dce $dce,
- array $fieldList,
+ array $fieldList = null,
@etobi
etobi / gist:7590aee22f9b84b69d73
Last active January 17, 2017 09:00
Monitoring mit Icinga (Nagios) auf Raspberry PI installieren
# aktuelles rasbian installieren
# hostname, password etc setzen
sudo raspi-config
# alles auf aktuellen Stand bringen
sudo apt-get update
sudo apt-get upgrade
# Feste IP konfigurieren
@etobi
etobi / Rezept.md
Last active September 26, 2016 06:22
Schichtfleisch
  • ganzen schweinenacken vom Knochen befreien und in ca 1cm-Scheiben schneiden.
  • Fleisch rubben (MagicDust oder z.B. Gyrosgewürzmischung) und über Nacht in den Kühlschrank stellen
  • DutchOveb mit Bacon auslegen
  • DO auf die Seite stellen und abwechselnd Fleisch, Zwiebeln, Paprika, Kartoffelscheiben, ... aufschichten
  • oben drauf restliches Gemüse verteilen, mit einem guten Schuß BBQ-Soße versehen und mit reichlich Bacon (der oben liegt wird am besten) abdecken
  • ca 2 Std garen; 6 Brikettes unter und 9 auf dem DO
  • dazu: Brot, Reis oder Kartoffeln
#!/usr/bin/ruby
path = "/Users/tobias/fake-mailer"
Dir.mkdir(path) if !File.exists?(path)
File.open("#{path}/#{Time.now.to_i}.eml", "w") do |f|
f.puts ARGV.inspect
$stdin.each_line { |line| f.puts line }
end
sleep(1)

Kräuter-Butter-Basis

  • 1 Packet Butter weich werden lassen (1 Tag bei Zimmertemperatur, oder 2 Minuten Grill)
  • Ich weiß leider nicht, welche frischen Kräuter es so waren, aber ich habe von allen etwas genommen
    • außer vom Rosmarin
    • insgesamt "Eine Hand voll Kräuter"
  • Kräuter hacken
  • eine kleine Knoblauch-Zehe abziehen, sehr fein hacken
  • eine Frühlingszwiebel fein hacken
  • eine halbe Rote Zwiebel in Würfel schneiden
@etobi
etobi / MailService.php
Created April 11, 2013 13:24
extbase mailservice
<?php
class Tx_SoEvents_Service_MailService {
/**
* @var Tx_Extbase_Object_ObjectManager
*/
protected $objectManager;
/**
@etobi
etobi / gist:4658170
Created January 28, 2013 19:13
Caretaker: generate public/private keypair for caretaker_instance
#!/bin/sh
clear
openssl genrsa -out private.pem 2048
openssl rsa -in private.pem -out public.pem -pubout
echo
echo
@etobi
etobi / gist:3301968
Created August 9, 2012 07:26
#lwShirt #TYPO3
## TYPO3 Contribution Cheat Sheet http://wiki.typo3.org/Contribution_Walkthrough_with_CommandLine
## Setting up your environment
git clone --recursive git://git.typo3.org/TYPO3v4/Core.git typo3_src-git
cd typo3_src-git
scp -p -P 29418 <username>@review.typo3.org:hooks/commit-msg .git/hooks/
git submodule update --init
git submodule foreach 'scp -p -P 29418 <username>@review.typo3.org:hooks/commit-msg .git/hooks/'
## Reviewing a Change Request