Skip to content

Instantly share code, notes, and snippets.

@reneeb
reneeb / test.pl
Created January 18, 2024 08:27
html2pdf - Test
#!/usr/bin/perl
use v5.24;
use strict;
use warnings;
use MIME::Base64;
use Encode;
use LWP::UserAgent;
@reneeb
reneeb / ACL.yml
Last active February 16, 2023 07:03
Znuny Adminschulung
---
- ChangeBy: root@localhost
ChangeTime: 2019-01-07 10:42:59
Comment: ACL Reference.
ConfigMatch:
Properties:
# Match properties (current values from the form).
CustomerUser:
UserLogin:
- some login
<?xml version="1.0" encoding="iso-8859-1"?>
<otrs_config version="1.0" init="Application">
<CVS>$Id: EventModule.xml,v 1.12 2008/03/10 12:57:42 mh Exp $</CVS>
<ConfigItem Name="Ticket::EventModulePost###100-AutoPriority" Required="0" Valid="1">
<Description Translatable="1">Set Priority automatically.</Description>
<Group>OTRS-Workshop</Group>
<SubGroup>EventModule</SubGroup>
<Setting>
<Hash>
<Item Key="Module">Kernel::System::Ticket::Event::Priority</Item>
#!/usr/bin/perl
use v5.24;
use DBI;
use Digest::SHA 'sha256_hex';
use File::Basename;
use File::Find::Rule;
use File::MimeInfo;
use Getopt::Long;
<?xml version="1.0" encoding="utf-8" ?>
<otrs_config version="1.0" init="Config">
<ConfigItem Name="Hook::Types" Required="0" Valid="1">
<Description Translatable="1">Define the background color of tickets based on types. (It has to be the html colors)</Description>
<Group>Ticket</Group>
<SubGroup>TicketOverview</SubGroup>
<Setting>
<Hash>
<Item Key="Default">808080</Item>
<Item Key="Incident">00ff00</Item>
reneeb@host:~$ perl -MDateTime -E 'my $month; my $date = DateTime->new(day=> 7, month=>11, year=>2021); $date->month() < 10 ? $month = $date->month() : $month = "0" . $date->month(); say $month'
011
reneeb@host:~$ perl -MDateTime -E 'my $month; my $date = DateTime->new(day=> 7, month=>8, year=>2021); $date->month() < 10 ? $month = $date->month() : $month = "0" . $date->month(); say $month'
08
@reneeb
reneeb / CheckNavigationBarModules.pl
Created June 2, 2021 09:28
Check if all navigation bar modules can be loaded
#!/usr/bin/perl
use strict;
use warnings;
use lib qw(/opt/otrs);
use Kernel::System::ObjectManager;
local $Kernel::OM = Kernel::System::ObjectManager->new;
@reneeb
reneeb / Insomnia.json
Created June 4, 2021 08:08
Requests for OTOBO
{"_type":"export","__export_format":4,"__export_date":"2021-06-04T08:06:12.222Z","__export_source":"insomnia.desktop.app:v2021.2.2","resources":[{"_id":"req_e0440f2249924925a559926ad23352d5","parentId":"fld_77985ae5fa7d4d9a96fb4695beb0ce2c","modified":1622793939326,"created":1622793939326,"url":"http://192.168.123.122/otobo/nph-genericinterface.pl/Webservice/Tickets/Ticket","name":"TicketCreate","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"UserLogin\": \"ta\",\n\t\"Password\": \"ta\",\n\t\"Ticket\" : {\n\t\t\"Queue\": \"Raw\",\n\t\t\"PriorityID\": 3,\n\t\t\"Title\": \"Test\",\n\t\t\"State\": \"open\",\n\t\t\"CustomerUser\": \"tc\"\n\t},\n\t\"Article\": {\n\t\t\"Subject\": \"Article for Test Ticket\",\n\t\t\"From\": \"test@test.de\",\n\t\t\"IsVisibleForCustomer\": 1,\n\t\t\"ContentType\": \"text/plain; charset=utf-8\",\n\t\t\"Body\": \"Wir haben ein Problem Houston!\",\n\t\t\"CommunicationChannelID\": 1,\n\t\t\"To\": \"agent@test.tld\"\n\t}\n}"},"parameters":[],"headers
#!/usr/bin/perl
use v5.10;
use strict;
use warnings;
use lib qw(/opt/otrs /opt/otrs/Kernel/cpan-lib);
use Kernel::Config::Files::ZZZAAuto;
#!/usr/bin/perl
use strict;
use warnings;
use Mojo::Loader qw(data_section);
use OpenAPI::Client;
my $spec = data_section 'main', 'swagger.json';
my $client = OpenAPI::Client->new( $spec );