Skip to content

Instantly share code, notes, and snippets.

@aimtiaz11
aimtiaz11 / disable-ch-logs.ps1
Last active September 13, 2021 13:24
Powershell script to disable Cloudhub logging
## License: MIT
## Configure Cloudhub and app details below
$Username = '' # anypoint platform username
$Password = 'abc123' # anypoint platform password
$OrgId = '542aaff5-116n-433d-fd76-5a24zqfard19' # Anypoint Org ID
$EnvName = 'DEV' # Cloudhub environment
$AppName = 'example-app' # Application name
##################################################################
@aimtiaz11
aimtiaz11 / read.md
Last active September 13, 2021 12:50
Goovy Timestamp Prase

Groovy Timestamp Parse

Code:

// Task 3: Format Timestamp
println(Date.parse("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", '2021-05-24T11:42:08.875Z').format('yyyyMMddHHmmss'));
println(Date.parse("yyyy-MM-dd'T'HH:mm:ss.SSSX", '2021-05-24T11:42:08.875Z').format('yyyyMMddHHmmss'));
@aimtiaz11
aimtiaz11 / insruction.md
Created April 1, 2021 03:16
Mulesoft - Call SQL Server Stored Procedure from Mule 4 using DB Connector

Mulesoft - Call SQL Server Stored Procedure from Mule 4 using DB Connector

Sample code below:

<db:stored-procedure doc:name="Call Stored procedure - myStoredProc" 
doc:id="73d4a90e-29bf-4be1-8e91-5c61a536fe39" 
config-ref="DB_Connection_Config_Ref">
    <db:sql >{ call myStoredProc (:P_FIRST_NAME, :P_LAST_NAME)  }</db:sql>
 
@aimtiaz11
aimtiaz11 / dw_1.md
Last active May 22, 2021 02:22
Mule DW - practical examples

Dataweave Hack 1 - Append underscore or character to string at particular pos

Mule 3:

%dw 1.0
%output application/json
---
"cafm" splitBy "" map ($ ++ "_" when $$ == 0 otherwise $) reduce ($$ ++ $)
@aimtiaz11
aimtiaz11 / readme.md
Last active February 14, 2021 23:42
Mulesoft - Deploy To Cloudhub via Anypoint CLI

Mulesoft - Deploy To Cloudhub via Anypoint CLI

Use modify to redeploy existing app. Otherwise use deploy.

export ANYPOINT_ENV=UAT2 && anypoint-cli --bearer <<token>> runtime-mgr cloudhub-application modify \
--runtime "4.3.0" \
--workers "1" \
--workerSize "0.1" \
--region "ap-southeast-2" \
@aimtiaz11
aimtiaz11 / 1-deployment.md
Last active November 6, 2020 07:33
Kubernetes Tutorial Notes

Kubernetes Tutorial Notes

Notes taken from Kubernetes.io/docs/tutorials basics training + few personal notes.

Start Minikube: minikube start

Deployments

@aimtiaz11
aimtiaz11 / readme.md
Last active October 7, 2020 23:32
Vim shortcuts

Vim Shortcuts

line

  • 0 - jump to the start of the line
  • $ - jump to the end of the line

file

  • gg - go to the first line of the document
  • G - go to the last line of the document
@aimtiaz11
aimtiaz11 / azure-pipelines.yml
Created September 11, 2020 14:12
Azure DevOps - Execute automated API tests using newman
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
parameters:
@aimtiaz11
aimtiaz11 / util.dwl
Created May 29, 2020 02:51
Dataweave 1.0 - Custom Util functions
%function asString(val) (
(val as :string) when val != null otherwise null
)
%function asNum(val) (
(val as :number) when val != null otherwise null
)
---
{
@aimtiaz11
aimtiaz11 / pre-req-script.js
Created May 15, 2020 08:40
Postman Calculate Date and Timstamp
const moment = require('moment');
pm.globals.set("todaysDate", moment().format("YYYY-MM-DD"));
const TimeZoneUTCOffsetMapping = {
'Australia/Sydney': 11
};
const LocalUTCOffset = 11;