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 / 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 / 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 / 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
global
log logstash local0 #Change logstash to your naming
log-send-hostname
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
maxconn 4000
defaults
# https://sslcheck.globalsign.com/
# https://www.ssllabs.com/ssltest/analyze.html
# https://wiki.mozilla.org/Security/Server_Side_TLS
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA;
# openssl dhparam -out dhparam.pem 4096
ssl_dhparam /etc/nginx/dhparam.pem;
@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']]);