This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Range de IP's da Azure e Amazon, download from: | |
-- AZURE | |
https://www.microsoft.com/en-us/download/details.aspx?id=41653 | |
-- AMAZON | |
https://docs.aws.amazon.com/pt_br/general/latest/gr/aws-ip-ranges.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mostra espaço utilizado por todas | |
# as partições do Linux o h é de Humano | |
df -kh | |
# T Para mostrar o tipo da partição Ex.: ext4 | |
df -hT | |
# Quanto cada pasta ocupa ( na pasta atual ) | |
du |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl http://KAFKA_BROKER:8081/subjects/TOPIC_NAME-value/versions/latest | jq -r '.schema|fromjson' > TOPIC_NAME-value.avsc | |
# another way | |
curl http://AFKA_BROKER:8081/subjects/TOPIC_NAME-value/versions/latest/schema > TOPIC_NAME-value.avsc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPOST -d"{\"schema\":$(jq tostring TOPIC_NAME-value.avsc)}" http://KAFKA_BROKER:31081/subjects/topic-name-value/versions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- To know what time limit in time to get the state of table on Oracle | |
-- In this case, 60000 seconds, ~ 18 hrs | |
show parameter undo; | |
-- NAME TYPE VALUE | |
------------------------------------ ----------- ------------------------------ | |
-- undo_management string AUTO | |
-- undo_retention integer 60000 | |
SELECT * FROM OWNER.TABLE_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Source: https://www.dba-scripts.com/scripts/diagnostic-and-tuning/troubleshooting/database-activity-log_history/ | |
-- You can adapt the query to your needs, you just have to change the way you format the date to be able to drilldown to the precision you want. | |
-- Oracle PL/SQL | |
select round(avg(LOG_SWITCHES)) LOG_SWITCHES, DAY | |
from ( | |
select to_char(trunc(first_time), 'Day') DAY, TRUNC(FIRST_TIME, 'DDD'), count(*) LOG_SWITCHES | |
from v$log_history | |
group by TRUNC(FIRST_TIME, 'DDD'), to_char(trunc(first_time), 'Day') | |
order by 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- CREATE CONSUMER | |
curl --request POST \ | |
--url http://{{hostname_rest_proxy}}:8082/consumers/consumer-group-x \ | |
--header 'content-type: application/vnd.kafka.v2+json' \ | |
--data '{ | |
"name": "client_x", | |
"format": "avro", | |
"auto.offset.reset": "latest", | |
"auto.commit.enable": "false" | |
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# partitions, how many files to store messages of topics | |
# replication-factor, how many copies of topics must store ( Ex.: number of nodes ) | |
kafka-topics --zookeeper <zookeeper>:2181 --create --topic <topic-name> --partitions 3 --replication-factor 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Select ServerProperty('Collation') |
OlderNewer