Skip to content

Instantly share code, notes, and snippets.

View rkaldung's full-sized avatar
🎯
Removing dust from the grey market

Roy Kaldung rkaldung

🎯
Removing dust from the grey market
View GitHub Profile
$user = "John.Doe"
$pass = "VerySecret"
$uri = "https://FQDNotrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST"
$headers = @{}
$headers.Add("Accept", "application/json")
$headers.Add("Content-Type", "application/json")
# Parameter see https://github.com/znuny/Znuny/blob/dev/Kernel/GenericInterface/Operation/Ticket/TicketUpdate.pm#L68
$UpdateData = @{
$user = "John.Doe"
$pass = "VerySecret"
$uri = "https://FQDN/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST"
$headers = @{}
$headers.Add("Accept", "application/json")
$headers.Add("Content-Type", "application/json")
# Create Ticket
# Parameter see https://github.com/znuny/Znuny/blob/dev/Kernel/GenericInterface/Operation/Ticket/TicketCreate.pm#L69
@rkaldung
rkaldung / CI Definition Computer
Last active August 25, 2021 11:21
Using the GenericInterface to set ConfigItems expired after a certain date
---
- Key: Vendor
Name: Vendor
Searchable: 1
Input:
Type: Text
Size: 50
MaxLength: 50
# Example for CI attribute syntax check for text and textarea fields
#RegEx: ^ABC.*
@rkaldung
rkaldung / Apple_mobile_device_types.txt
Created February 5, 2021 20:39 — forked from adamawolf/Apple_mobile_device_types.txt
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
iPhone5,1 : iPhone 5 (GSM)
@rkaldung
rkaldung / elastica-autocomplete.php
Created November 23, 2013 08:19
Autocomplete w/ Elasticsearch && Elastica
/**
* $q query term
* 'field' => 'suggest'> Suggest is the fieldname used during indexing
* see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html
*/
$elasticaClient = new \Elastica\Client();
$elasticaIndex = $elasticaClient->getIndex('myindex');
$search = new \Elastica\Search($elasticaClient);
$suggest = new \Elastica\Suggest\Term();
$suggest->addTerm('suggest', ['text' => $q, 'completion' => ['field' => 'suggest']]);
@rkaldung
rkaldung / Postfix: sender-dependent SASL authentication.md
Created June 12, 2018 21:07 — forked from zmwangx/Postfix: sender-dependent SASL authentication.md
Postfix: sender-dependent SASL authentication — relay to multiple SMTP hosts, or relay to the same host but authenticate as different users (e.g., two Gmail accounts)

This is a sequel to "Postfix: relay to authenticated SMTP".

I would like to send mail from two different Gmail accounts using Postfix. Here is the relevant section in the Postfix documentation: Configuring Sender-Dependent SASL authentication.

As a concrete example, here's how to set up two Gmail accounts (only relevant sections of the config files are listed below):

/etc/postfix/main.cf:
    # sender-dependent sasl authentication
    smtp_sender_dependent_authentication = yes

sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay

@rkaldung
rkaldung / open-xchange-nginx.conf
Created February 20, 2018 12:43 — forked from stbuehler/open-xchange-nginx.conf
Open-Xchange nginx config
# route balancing only in commercial edition...
#map $cookie_JESSIONID $route_cookie1 {
# ~.+\.(?P<route>\w+)$ $route;
#}
#map $cookie_jsessionid $route_cookie2 {
# ~.+\.(?P<route>\w+)$ $route;
#}
#map $request_uri $route_uri1 {
# ~JSESSIONID=.+\.(?P<route>\w+)$ $route;
#}
Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.
Results
=======
- core
- INVALID_HASH
@rkaldung
rkaldung / pre-commit
Last active December 14, 2015 08:39
git pre-commit hook with php lint and code style fix
#!/bin/sh
#
# adjust php-cs-fixer configuration if needed, see http://cs.sensiolabs.org/
# Redirect output to stderr.
exec 1>&2
for f in $(git diff --cached --name-only --diff-filter=AMC | grep -e '\.php$')
do
php -l "${f}" || exit 1
global
log logstash local0 #Change logstash to your naming
log-send-hostname
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
maxconn 4000
defaults