Skip to main content

Posts

Showing posts from 2019

AWS Service Catalog Rule Functions - Cloudformation Fn::Contains Example

I came across an YAML Cloudformation template that was failing validation with the following error: Cannot convert the template because of an error:: unknown tag !<!Contains> at line... The !Contains function is part of AWS Service Catalog, and it is meant to give more control and flexibility when creating your company's stacks. The challenge is that the current AWS Service Catalog documentation only provides examples in JSON format, leaving YAML users at their own luck. Fiddling around in different forums, I happened to notice that YAML can recognize the JSON pattern of the Contains function ( 'Fn::Contains' ) So in order to make the YAML code work, I replaced !Contains with 'Fn::Contains' See the examples below: JSON     "Rules": {         "AuroraDBInstanceTypeRule": {             "RuleCondition": {                 "Fn::Equals": [     ...

Hortonworks Installation - Keyserver Connection

Trying to install Hortonworks on Ubuntu 18, I was not able to connect to the keyserver using: apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD to fix this i used the following instead apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 B9733A7A07513CAD This is the successful output: Executing: /tmp/apt-key-gpghome.abd3V0BdXN/gpg.1.sh --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 B9733A7A07513CAD gpg: key B9733A7A07513CAD: public key "Jenkins (HDP Builds) <jenkin@hortonworks.com>" imported gpg: Total number processed: 1 gpg:               imported: 1

SQL Server connection using windows authentication from a different domain

I had to connect to a SQL Server database from my laptop that is not on the same domain as the DB server. I'm using JTDS to connect to the DB, in this case using Talend. On the first few attempts I received this error: The login is from an untrusted domain and cannot be used with Windows authentication After playing with many different parameter combinations,  I finally managed to have a successful connection using the following connection string: jdbc:jtds:sqlserver://<SERVERIP>:<PORT>/<DATABASE>;instance=<INSTANCE>;useNTLMv2=true;domain=<DOMAIN>;user=<LOGIN>;password=<PASSWORD> This is the screenshot of the connection configuration on Talend: And the output of the 'Test connection':

SQL Server Setting Session Information

Oracle has a functionality to set information to an application or user session using  DBMS_APPLICATION_INFO . On Microsoft SQL a similar functionality can be achieved using  dm_exec_requests context_info field. To set that information use: DECLARE @Info BINARY(128) = CAST('XYZ Session' AS BINARY(128)) SET CONTEXT_INFO @Info When querying dm_exec_requests you can see the information you set on the session select CAST(req.context_info AS VARCHAR(128)) as char_context_info, session_id, start_time, status, command FROM sys.dm_exec_requests req XYZ Session,90,2019-02-14 10:03:48.140,running,SELECT