Note that the ansi sql standard defines "timestamp" as equivalent to "timestamp without time zone". However Spark's behavior depends on both the version of spark and the file format
| format \ spark version | <= 2.0.0 | >= 2.0.1 |
|---|
| import ldap | |
| def check_credentials(username, password): | |
| """Verifies credentials for username and password. | |
| Returns None on success or a string describing the error on failure | |
| # Adapt to your needs | |
| """ | |
| LDAP_SERVER = 'ldap://xxx' | |
| # fully qualified AD user name | |
| LDAP_USERNAME = '%[email protected]' % username |
| #!/bin/bash | |
| #Paths are for Centos 7.x | |
| #stop logging services | |
| /sbin/service rsyslog stop | |
| /sbin/service auditd stop | |
| #remove old kernels | |
| /usr/bin/package-cleanup --oldkernels --count=1 |
| val grpcJavaVersion = "1.3.0" | |
| val downloadJGrpc = { | |
| val grpcArtifactId = "protoc-gen-grpc-java" | |
| val jgrpcExeFileName = { | |
| val os = if (scala.util.Properties.isMac) "osx-x86_64" | |
| else if (scala.util.Properties.isWin) "windows-x86_64" | |
| else "linux-x86_64" |
| # env | |
| export KAFKA_HOST="my.kafka.hostname" | |
| export KAFKA_OPTS="-Djava.security.auth.login.config=/etc/kafka/kafka_server_jaas.conf" | |
| # create topics | |
| kafka-topics --create --topic securing-kafka --replication-factor 1 --partitions 3 --zookeeper $KAFKA_HOST:2181 | |
| # producer acl | |
| kafka-acls --authorizer-properties zookeeper.connect=$KAFKA_HOST:2181 --add --allow-principal User:kafkaclient --producer --topic securing-kafka |
| /* Copyright 2003-2005 H. Peter Anvin - All Rights Reserved | |
| * | |
| * Permission is hereby granted, free of charge, to any person | |
| * obtaining a copy of this software and associated documentation | |
| * files (the "Software"), to deal in the Software without | |
| * restriction, including without limitation the rights to use, | |
| * copy, modify, merge, publish, distribute, sublicense, and/or | |
| * sell copies of the Software, and to permit persons to whom | |
| * the Software is furnished to do so, subject to the following | |
| * conditions: |
| #!/bin/sh | |
| # 's_\^\*~_\n_g' is the line delimiter in input file replace with yours | |
| sed 's_\^\*~_\n_g'| wc -l |
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)| #!/usr/bin/env python | |
| # Script to run dynamic dns for docker containers. | |
| # DNS is served by dnsmasq running on the docker0 gateway ip, and dynamically | |
| # updated at containers come and go. | |
| # | |
| # To use from docker, just provide the --dns option: | |
| # docker run --dns <gateway> ... | |
| # The gateway ip you need will be printed when this script is run. |
| var amqp = require('amqplib/callback_api'); | |
| // if the connection is closed or fails to be established at all, we will reconnect | |
| var amqpConn = null; | |
| function start() { | |
| amqp.connect(process.env.CLOUDAMQP_URL + "?heartbeat=60", function(err, conn) { | |
| if (err) { | |
| console.error("[AMQP]", err.message); | |
| return setTimeout(start, 1000); | |
| } |