Monday, 23 August 2021

AWS - Useful commands

 LINUX Command to connect AWS using KEYS,


export AWS_ACCESS_KEY_ID=AKIAAAAUQG7QC2O4KS6NKGSM; 

export AWS_SECRET_ACCESS_KEY=I1DCBC3nwsRcV8+aoXl0c/PX4iFsTJMr1aZ8EzIDKGSMS;  

aws s3 ls s3://kgsm/active/

s3://kgsm/raw

s3://kgsm/active



WINDOWS Command to connect AWS using KEYS,


setx AWS_ACCESS_KEY_ID AKIAV7UQG7Q7C2O4KS6NKGSM

setx AWS_SECRET_ACCESS_KEY I1DCBC3nwsRcV8+aoXl0c/PX4iFsTJMr1aZ8EzIDKGSMS

setx AWS_DEFAULT_REGION us-east-1

aws s3 ls s3://kgsm/active/


WINDOWS Command to CREATE NEW FOLDER IN AWS and UPLOAD THE FILE


aws s3 cp F:\run.bat s3://kgsm/active/a1/

Tuesday, 17 August 2021

Postgresql : Generate token

 CREATE TABLE adempiere.license_tomato_app

(

    customerid integer,

    name text COLLATE pg_catalog."default",

    location text COLLATE pg_catalog."default",

    key text COLLATE pg_catalog."default" DEFAULT upper(substr(md5((random())::text), 0, 50)),

    plan text COLLATE pg_catalog."default",

    license_start_date timestamp without time zone,

    license_end_date timestamp without time zone,

    last_sync_data_time timestamp without time zone,

    industry_type character varying(50) COLLATE pg_catalog."default",

    business_name character varying(50) COLLATE pg_catalog."default",

    isactive integer DEFAULT 1,

    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,

    updated_at timestamp without time zone,

    created_by integer,

    updated_by integer

)

WITH (

    OIDS = FALSE

)

TABLESPACE pg_default;

Wednesday, 28 July 2021

Getting SELECT to return a constant value even if zero rows match - Postgresql

 SELECT COALESCE(status,'not a valid token') AS status,last_sync_data_time FROM

 (

SELECT 

CASE WHEN CURRENT_TIMESTAMP <= license_end_date THEN 'valid' ELSE 'expired' END AS status, last_sync_data_time

FROM adempiere.license_tomato_app

WHERE key = '7EF3D9B8183D9C7AB90242AF5D011ABE'

union all 

select  null, '1900-01-01 00:00:00' last_sync_data_time where not exists (select 1 from adempiere.license_tomato_app WHERE key = '7EF3D9B8183D9C7AB90242AF5D011ABE')

) t

Tuesday, 6 July 2021

Kiro - Core Features

What is Kiro Kiro is an innovative AI-powered IDE that revolutionizes software development through intelligent assistance and structured wor...