I hereby claim:
- I am esl1h on github.
- I am esl1h (https://keybase.io/esl1h) on keybase.
- I have a public key ASACW80CQpL8rhWJiN7fY1Rjy90BWGoH6F7nRnkY0vZ9rQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
function parse_yaml { | |
local prefix=$2 | |
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') | |
sed -ne "s|^\($s\):|\1|" \ | |
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \ | |
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | | |
awk -F$fs '{ | |
indent = length($1)/2; |
@echo | |
set source=C:\ | |
set destination=\\servername\d$ | |
set command=xcopy /c /d /e /f /g /h /i /r /s /y | |
set log=D:\backup_log_file.txt | |
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b) | |
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a%%b) | |
echo # # # Starting files %mydate% at %mytime% >> %log% |
#!/bin/bash | |
: ' | |
DESAFIO: | |
Dado um arquivo de log do apache (acess.log) com diversas linhas semelhantes a abaixo: | |
172.19.0.100 - - [18/Feb/2020:22:35:10 +0000] "GET /index HTTP/1.1" 200 31067 "-" "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)" "172.19.0.2" | |
172.19.0.103 - - [15/Feb/2020:22:32:02 +0000] "GET /index HTTP/1.1" 200 14034 "-" "Mozilla/5.0 (compatible; SemrushBot/6~bl; +http://www.semrush.com/bot.html)" "172.19.0.4" | |
172.19.0.104 - - [16/Feb/2020:22:31:32 +0000] "GET /site HTTP/1.1" 200 36565 "https://command-not-found.com/curl" "Mozilla/5.0+(compatible; UptimeRobot/2.0; http://www.uptimerobot.com/)" "172.19.0.3" | |
172.19.0.105 - - [16/Feb/2020:22:30:10 +0000] "GET /credits HTTP/1.1" 200 31067 "-" "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)" "172.19.0.2" |
[defaults] | |
inventory = ./conf/host | |
local_tmp = ./.tmp | |
roles_path = ./roles | |
remote_user = ec2-user | |
internal_poll_interval = 0.001 | |
interpreter_python = /usr/bin/python | |
forks = 20 | |
callback_whitelist = profile_tasks | |
log_path = ./logs/ansible.log |
# | |
Host * | |
# ForwardAgent no | |
# ForwardX11 no | |
# ForwardX11Trusted yes | |
# PasswordAuthentication yes | |
# HostbasedAuthentication no | |
# GSSAPIAuthentication no | |
# GSSAPIDelegateCredentials no |
#!/bin/sh | |
path="/opt/kafka_2.12-2.2.2/bin" | |
$path/kafka-topics.sh --zookeeper zookeeper.intranet:2181 --list | grep -v "__consumer_offsets" > topic.txt | |
cat topic.txt | while read line | |
do | |
partitions=`$path/kafka-topics.sh --describe --zookeeper zookeeper.intranet:2181 --topic $line | grep PartitionCount | awk '{ print $1,$2 }'` | |
echo $partitions | |
done |