Skip to content

Instantly share code, notes, and snippets.

View rdeavila's full-sized avatar

Rodrigo de Avila rdeavila

View GitHub Profile
@rdeavila
rdeavila / nivel-cai.sh
Created July 13, 2023 12:00
Nível do Rio Caí, últimas 24h
#!/usr/bin/env bash
curl -s 'http://sace.cprm.gov.br/cai/dwr/call/plaincall/RelatorioService.gerarRelatorioVerDados.dwr' --data-raw $'callCount=1\nwindowName=\nc0-scriptName=RelatorioService\nc0-methodName=gerarRelatorioVerDados\nc0-id=0\nc0-param0=string:tableRelatorio\nc0-param1=number:24\nc0-param2=number:92\nbatchId=9\npage=%2Fcai%2F\nhttpSessionId=11gkb76odm27z\nscriptSessionId=85279F8CEBB65831D7A7CAC7793AF7E1\n' | html2text | grep '| '
@rdeavila
rdeavila / gist:d56ede74303c06d5651938d0fecf5f17
Created July 13, 2023 01:39
Monitoramento nível do ro caí
curl 'http://sace.cprm.gov.br/cai/dwr/call/plaincall/RelatorioService.gerarRelatorioVerDados.dwr' \
-H 'Accept: */*' \
-H 'Accept-Language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7' \
-H 'Connection: keep-alive' \
-H 'Content-Type: text/plain' \
-H 'Cookie: JSESSIONID=11gkb76odm27z; _ga=GA1.3.533490.1655485445' \
-H 'Origin: http://sace.cprm.gov.br' \
-H 'Referer: http://sace.cprm.gov.br/cai/' \
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36' \
--data-raw $'callCount=1\nwindowName=\nc0-scriptName=RelatorioService\nc0-methodName=gerarRelatorioVerDados\nc0-id=0\nc0-param0=string:tableRelatorio\nc0-param1=number:24\nc0-param2=number:92\nbatchId=9\npage=%2Fcai%2F\nhttpSessionId=11gkb76odm27z\nscriptSessionId=85279F8CEBB65831D7A7CAC7793AF7E1\n' \
@rdeavila
rdeavila / pd-event.sh
Created June 13, 2023 20:03 — forked from alperkokmen/pd-event.sh
Simple script to trigger, acknowledge, and resolve incidents via PagerDuty Integration API.
#!/bin/bash
CONTENT_TYPE="application/json"
DESCRIPTION="bad things™ are happening"
URL="https://events.pagerduty.com/generic/2010-04-15/create_event.json"
if [ $# -ne 3 ]; then
echo "Usage: pd-event.sh [TYPE] [SERVICE KEY] [INCIDENT KEY]"
echo " - TYPE: [t]rigger | [a]cknowledge | [r]esolve"
echo " - SERVICE KEY: unique identifier for service"
#!/bin/bash
apt-get -y update && apt-get -y dist-upgrade
apt-get -y install update-manager-core
sed -i 's/Prompt=lts/Prompt=normal/g' /etc/update-manager/release-upgrades
apt-get -y update && apt-get -y upgrade && apt-get -y dist-upgrade
apt-get -y autoremove && apt-get -y clean && apt-get -y autoclean
### Keybase proof
I hereby claim:
* I am rdeavila on github.
* I am rodrigo (https://keybase.io/rodrigo) on keybase.
* I have a public key ASCYrtcrU6zIhbaEwUdjftM4qxWtmiB9KPek57Us4SXrCQo
To claim this, I am signing this object:
#!/bin/bash
CAMPANHA_ID="1"
ENTREGADOR_ID="teste_benchmark"
PRIVATE_TOKEN="wZrSb..."
curl \
-w "@time_curl.txt" \
-X GET \
-s "http://127.0.0.1:3000/i/v2/campanhas/$CAMPANHA_ID/mensagens?entregador_id=$ENTREGADOR_ID" \
### Keybase proof
I hereby claim:
* I am rdeavila on github.
* I am rodrigo (https://keybase.io/rodrigo) on keybase.
* I have a public key ASA3xr4r_NTINFq6BmGtgLZqZby2zQDWboJuSDtUNmquZAo
To claim this, I am signing this object:
@rdeavila
rdeavila / swap-updates-dependencias.sh
Last active June 3, 2019 16:12
swap, updates e dependências
#!/bin/bash
# Swap
sudo -u root -H fallocate -l 4G /swapfile
sudo -u root -H chmod 600 /swapfile
sudo -u root -H mkswap /swapfile
sudo -u root -H swapon /swapfile
sudo -u root -H echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
sudo -u root -H echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
sudo -u root -H echo 'vm.vfs_cache_pressure=50' | sudo tee -a /etc/sysctl.conf
sudo -u root -H sysctl -p
#!/bin/bash
PARAMETRO_1=${PARAMETRO_1:-não informado}
PARAMETRO_2=${PARAMETRO_2:-não informado}
echo ''
echo "Parâmetro 1: $PARAMETRO_1"
echo "Parâmetro 2: $PARAMETRO_2"
echo ''
exit 0
@rdeavila
rdeavila / teste-email.sh
Last active August 3, 2016 14:48
DE="email" PARA="email" bash <(curl -fsSL http://syo.net.br/lero-mail)
#!/bin/bash
DE=${DE:[email protected]}
PARA=${PARA:[email protected]}
ASSUNTO='Lero por email'
CORPO="Este é o seu LeroMail de hoje:
\"O incentivo ao avanço tecnológico, assim como o consenso sobre a necessidade de qualificação aponta para a
melhoria dos relacionamentos verticais entre as hierarquias. Percebemos, cada vez mais, que o desenvolvimento
contínuo de distintas formas de atuação é uma das consequências de todos os recursos funcionais envolvidos.