Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View flinox's full-sized avatar
💭
"I don't want to believe. I want to know" - Carl Sagan

Fernando Lino D.T. Silva flinox

💭
"I don't want to believe. I want to know" - Carl Sagan
View GitHub Profile
@flinox
flinox / operation-used-on-api-by-time.kql
Created March 21, 2024 13:18
KQL - Operações da API usadas em um intervalo de tempo
requests
| extend timestampSP = datetime_utc_to_local(timestamp,'America/Sao_Paulo')
| where timestampSP > datetime("2024-03-19T20:00:00.000Z") and timestampSP < datetime("2024-03-20T10:00:00.000Z")
| where customDimensions["API Name"] == "<api-name>"
| distinct tostring(customDimensions["Operation Name"])
@flinox
flinox / requests-by-api-by-time.kql
Last active March 21, 2024 13:47
KQL - Filtrar Requests por API Name em um intervalo de tempo especifico (UTC to Local)
requests
| extend timestampSP = datetime_utc_to_local(timestamp,'America/Sao_Paulo')
| where timestampSP > datetime("2024-03-20T20:00:00.000Z") and timestampSP < datetime("2024-03-21T09:00:00.000Z")
| summarize TotalRequests = count() by tostring(customDimensions["API Name"])
@flinox
flinox / requests-by-api-by-operation-bytime.kql
Last active March 21, 2024 12:41
KQL - Filtra os últimos requests para uma API e uma Operacao especifica em um intervalo de tempo especifico
union isfuzzy=true
availabilityResults,
requests,
exceptions,
pageViews,
traces,
customEvents,
dependencies
| where timestamp > datetime("2024-03-21T00:26:50.333Z") and timestamp < datetime("2024-03-21T00:56:50.333Z")
| where customDimensions["API Name"] in ("<nome-api>")
requests
| where timestamp > ago(60m)
| summarize TotalRequests = count() by tostring(customDimensions["API Name"])
requests
| where customDimensions["Request Id"] == "<request-id>"
| project customDimensions["Service ID"],timestamp,url,name,operation_Name,success,resultCode,customDimensions["Request Id"],performanceBucket,user_AuthenticatedId,client_IP,customDimensions["Subscription Name"]
@flinox
flinox / produce_message_avro_through_api.sh
Last active December 6, 2020 06:55
Kafka: Produce message in avro format on a kafka topic through confluent REST proxy
-- PRODUCE MESSAGE AVRO
curl --request POST \
--url http://{{hostname_rest_proxy}}:8082/topics/topic-name \
--header 'accept: application/vnd.kafka.v2+json, application/vnd.kafka+json, application/json' \
--header 'content-type: application/vnd.kafka.avro.v2+json' \
--data '{
"value_schema": "{\"namespace\":\"br.com.flinox\",\"name\":\"course\",\"type\":\"record\",\"doc\":\"This schema defines a course\",\"aliases\":[\"class\",\"school\"],\"fields\":[{\"name\":\"course_source\",\"doc\":\"The system source of course\",\"type\":\"string\"},{\"name\":\"course_code\",\"doc\":\"The code of the course\",\"type\":\"int\"},{\"name\":\"course_name\",\"doc\":\"Name of the course\",\"type\":\"string\"},{\"name\":\"course_type\",\"doc\":\"Type of the course\",\"type\":\"string\"}]}",
"records": [
{
"value": {"course_source": "system_A", "course_code": 10, "course_name": "Information Systems", "course_type": "G"}
@flinox
flinox / mdm_purge.py
Last active November 27, 2019 13:02
A python script to to purge inactive records of many different sources from informatica MDM calling the service SIF ExecuteBatchDelete
# ------------------------------------------------------------------------------
# v1.0 - 2019-08-13 - Created by: Fernando Lino Di Tomazzo Silva
# v2.0 - 2019-11-27 - Updated by: Fernando Lino Di Tomazzo Silva
#
# Script para realizar expurgo de registros logicamente inativos das BO's do MDM da INFORMATICA.
# Mais informacoes sobre MDM da INFORMATICA em: https://www.informatica.com/br/products/master-data-management.html
#
# ##### PRE REQS ######
# 1) Ter uma tabela criada que será usada para carregar os ID's dos registros para expurgar, Ex.:
# create table CMX_ORS.TB_PURGE_AUX
@flinox
flinox / Kafka_Informations.md
Last active May 29, 2019 18:25
Why Kafka is so fast ?
@flinox
flinox / docker_without_sudo.sh
Last active May 18, 2019 00:07
Run docker without sudo on Linux
# Run Docker without sudo
sudo gpasswd -a $USER docker
sudo setfacl -m user:$USER:rw /var/run/docker.sock
@flinox
flinox / get_date_from_unix_epoch_value.sql
Created February 25, 2019 20:24
Oracle: Get the date from a unix epoch value
select to_date('19700101','YYYYMMDD') + ( 1 / 24 / 60 / 60 / 1000) * <value_unix_epoch> from dual;