Skip to content

Instantly share code, notes, and snippets.

View tsleite's full-sized avatar

tsleite tsleite

View GitHub Profile
@tsleite
tsleite / ubuntu_update.sh
Last active July 12, 2023 18:12
Script for update Ubuntu Server
#!/bin/bash
# Written by Ted LeRoy with help from Google and the Linux community
# Follow or contribute on GitHub here:
# https://github.com/TedLeRoy/ubuntu-update.sh
# Edited and update by tsleite
updates(){
# Defining Colors for text output
red=$( tput setaf 1 );
#!/bin/bash
$PWD="<PASSWORD>"
systemctl stop mysqld
systemctl set-environment MYSQLD_OPTS="--skip-grant-tables --user=mysql"
systemctl restart mysqld
mysql -u root -e " \
flush privileges; \
ALTER USER 'root'@'localhost' IDENTIFIED BY '$PWD'; \
flush privileges; \
# SO: Windows Server 2012, 2012R2, 2016, 2019
# Parando o serviço
c:\zabbix\zabbix_agentd.exe --stop
# Desintalando o serviço
c:\zabbix\zabbix_agentd.exe --uninstall
# Cria diretório backup
mkdir c:\zabbix_backup
# SO: Windows Server 2012, 2012R2, 2016, 2019
# Parando o serviço
c:\zabbix\bin\zabbix_agentd.exe --stop
Write-Host zabbix_agentd has been stopped
# Desinstalando o serviço
c:\zabbix\zabbix_agentd.exe --uninstall
# Instala automaticamente Zabbix Agente no ambiente Windows, utilizando a internet.
# SO: Windows Server 2012, 2012R2, 2016, 2019
# Criado/Modificado: tleite@icloud.com
# links Download
$version428 = "https://www.zabbix.com/downloads/4.2.8/zabbix_agent-4.2.8-windows-amd64.zip"
$version428ssl = "https://www.zabbix.com/downloads/4.2.8/zabbix_agent-4.2.8-windows-amd64-openssl.zip"
$version444 = "https://www.zabbix.com/downloads/4.4.4/zabbix_agent-4.4.4-windows-amd64.zip"
$version444ssl = "https://www.zabbix.com/downloads/4.4.4/zabbix_agent-4.4.4-windows-amd64-openssl.zip"
#!/bin/bash
# Instala Elasticsearch 7 em ambiente Linux
# Permissão
sudo -n true
if [ $? -ne 0 ]
then
echo "$(whoami), Precisa de permissão SUDO"
exit
fi
#!/bin/bash
# Arquivo realiza um backup rápido do sqlite3 do grafana para o diretório /tmp
PATH=/tmp
DB="/var/lib/grafana/grafana.db"
BACKUP="$PATH/grafana.db-$(date +%Y%m%d).bck"
SQLITE=/usr/bin/sqlite3
ZIP=/bin/gzip
 
# Execução 
#!/bin/bash
# Disable IPv6 on Linux
echo "Disabling IPv6..."
echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
echo "Disabling IPv6 on boot..."
cat >> /etc/sysctl.conf << EOF
#disable ipv6 on boot
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
use zabbix;
truncate table history;
truncate table history_log;
truncate table history_str;
truncate table history_text;
truncate table history_uint;
truncate table trends;
truncate table trends_uint;
optimize table history;
optimize table history_log;
#!/bin/bash
##################################################################
# Script: check_sap_availability.sh #
# Author: Wilson Fernandes #
# Contact: Email: wilsonwers@gmail.com #
# Date: 2019-08-15 #
# Description: Monitoramento Disponibilidade SAP #
# Use: check_sap_availability.sh hdbnameserver 00 #
##################################################################