Skip to content

Instantly share code, notes, and snippets.

@alastori
alastori / provision-puppetserver-el7-yum.sh
Last active November 8, 2017 13:56
Bash script to install Puppet via puppetlabs.com YUM public repository in Enterprise Linux 7.x
#!/bin/bash
#Bash script to install Puppet Server via puppetlabs.com YUM public repository in Enterprise Linux 7.x
#Run this script as root
set -e # stop script execution on any error
echo "Installing Puppet Server..."
#Install Puppet YUM repository
@alastori
alastori / provision-perl-5-rpm.sh
Created July 10, 2017 15:16
Bash script to provision Perl 5 via local RPMs in Enterprise Linux 7.x
#!/bin/bash
#Bash script to provision Perl 5 via local RPMs in Enterprise Linux 7.x
#Copy the perl-5*.rpm files into the $PACKAGES_DIR and run this script as root
#You can find the binaries at https://rpmfind.net/linux/RPM/centos
#Modify these variables as you wish
DIR_TO_UNPACK=/tmp/packages
PACKAGES_DIR=/home/vagrant/packages #This folder already contains RPMs
ZIP_BUNDLE=perl-5*.zip #ZIP package containing perl*.rpm files
@alastori
alastori / provision-mysql-commercial-56-el7-rpm-repo-tar-gz.sh
Created July 8, 2017 22:30
Bash script to provision MySQL 5.6 Commercial via local RPMs (mysql-commercial-5.6.*.el7.x86_64.repo.tar.gz) in Enterprise Linux 7.x
#!/bin/bash
#Bash script to provision MySQL 5.6 Commercial via local RPMs (mysql-commercial-5.6.*.el7.x86_64.repo.tar.gz) in Enterprise Linux 7.x
#Copy the TAR with mysql* RPMs into the $PACKAGES_DIR and run this script as root
#You can find the commercial binaries in http://support.oracle.com (preferable) or http://edelivery.oracle.com
#Modify these variables as you wish
DIR_TO_UNPACK=/tmp/packages
PACKAGES_DIR=/home/vagrant/packages #This folder already contains RPMs
MYSQL_PWD="Root#123"
@alastori
alastori / provision-MySQL-advanced-56-el7-rpm-zip.sh
Last active July 8, 2017 22:29
Bash script to provision MySQL 5.6 Commercial via local RPMs (MySQL-advanced-5.6*.rpm) in Enterprise Linux 7.x
#!/bin/bash
#Bash script to provision MySQL 5.6 Commercial via local RPMs (MySQL-advanced-5.6*.rpm) in Enterprise Linux 7.x
#Copy the ZIP file with mysql* RPMs into the $PACKAGES_DIR and run this script as root
#You can find the commercial binaries in http://support.oracle.com (preferable) or http://edelivery.oracle.com
#Modify these variables as you wish
DIR_TO_UNPACK=/tmp/packages
PACKAGES_DIR=/home/vagrant/packages #This folder already contains RPMs
MYSQL_PWD="Root#123"
@alastori
alastori / provision-memagent-mysql57-el7.sh
Last active July 5, 2017 16:35
Bash script to install MySQL Enterprise Monitor Agent 3.x in Enterprise Linux 7.x with MySQL 5.7
#!/bin/bash
#Bash script to install MySQL Enterprise Monitor Agent 3.x in Enterprise Linux 7.x with MySQL 5.7
#Copy the MEM Agent executable binary (mysqlmonitoragent*.bin) into the $PACKAGES_DIR and run this script as root
#You can find the binaries in http://support.oracle.com (preferable) or http://edelivery.oracle.com
#Modify these variables as you wish
DIR_TO_INSTALL=/home/vagrant/mysql/enterprise/agent #/opt/mysql/enterprise/agent
PACKAGES_DIR=/home/vagrant/packages #This folder already contains the Executable Binaries
MEM_SERVICE_HOST=172.28.128.250
@alastori
alastori / my57-template.cnf
Last active January 10, 2020 18:05
my.cnf para MySQL 5.7 Enterprise
# my.cnf para MySQL 5.7 Enterprise
#########################################################
[client]
user=oracle
port=3306
socket=/databases/mysql/bases/mysql.socket
#########################################################
[mysql]
reconnect
show_warnings
@alastori
alastori / create-dirs.bat
Created December 2, 2016 20:00
Windows Batch file to create a bunch of folders based on a list in a text file
@@ECHO OFF
for /f "tokens=*" %%a in (folders.txt) do (
echo "%%a"
if not exist "%%a" md "%%a"
)
echo "Folder contents..."
DIR /b
@alastori
alastori / provision-mysqlutilities-el7-yum.sh
Last active November 4, 2016 16:27
Script to install MySQL Utilities via mysql.com YUM public repository in Enterprise Linux 7.x
#!/bin/bash
#Bash script to install MySQL Utilities via mysql.com YUM public repository in Enterprise Linux 7.x
#MySQL yum repository from http://dev.mysql.com/downloads/repo/yum/ must already be installed
#Run this script as root
set -e # stop script execution on any error
#Next lines install MySQL Utilities from RPM file
echo "Installing MySQL Utilities..."
@alastori
alastori / provision-mysql-yum-repo-el7.sh
Last active November 4, 2016 16:25
This script download and install MySQL public YUM repository in Enterprise Linux 7.x
#!/bin/bash
#Bash script to provision MySQL public YUM repository in Enterprise Linux 7.x
#Check if $REPO_RPM_URL is updated at http://dev.mysql.com/downloads/repo/yum/
#Modify these variables as you wish
DIR_TO_DOWNLOAD=/opt/mysql/packages
REPO_RPM_URL=http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
set -e # stop script execution on any error
@alastori
alastori / update-ssh-rsa-key.sh
Created October 24, 2016 01:02
This script updates ssh_host_rsa_key with a new one generated by ssh-keygen
#!/bin/bash
#This script updates ssh_host_rsa_key with a new one generated by ssh-keygen
#Run it as root
echo "Old ssh rsa key:"
ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub
echo -e 'y\n'|ssh-keygen -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key
echo "New ssh rsa key:"
ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub