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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'net/ssh' | |
user = "vagrant" | |
pass = "vagrant" | |
host = "192.168.1.120" | |
### | |
# Commands without elevated privileges |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'net/ssh' | |
host = "192.168.1.120" | |
user = "vagrant" | |
pass = "vagrant" | |
sudo_com = %Q{ |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'net/ssh' | |
host = "192.168.1.120" | |
user = "vagrant" | |
pass = "vagrant" | |
commands = %Q{ |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |
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
#!/usr/bin/ruby | |
################## | |
# Copy files | |
################## | |
require 'fileutils' | |
################### | |
# To Generate UUID | |
################### |
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
#!/usr/bin/ruby | |
require 'expect' | |
require 'pty' | |
commands = %Q( | |
/etc/init.d/check_rep status | |
) | |
File.foreach('hosts'){|host| | |
puts host.strip | |
PTY.spawn("ssh -i nso.key #{host}"){|o,i,p| |
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
#!/usr/bin/ruby | |
base_url = `grep baseurl /etc/yum.repos.d/service-centro.repo`.split[2] | |
#install_link = "#{base_url}kube_yamls-1.0-1.x86_64.rpm" | |
#install_link = "#{base_url}mysql_docker_build-1.0-1.x86_64.rpm" | |
install_link = "#{base_url}jboss_docker_build-1.0-1.x86_64.rpm" | |
begin | |
if File.exists?('/centro/target/centro-11.0.war') |
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
#!/usr/bin/ruby | |
require 'open-uri' | |
puts "Downloading RPMs from Artifactory REPO!!!" | |
RPMS = [ "kube_yamls-1.0-1.x86_64.rpm", "mysql_docker_build-1.0-1.x86_64.rpm", "jboss_docker_build-1.0-1.x86_64.rpm", "Percona-Server-client-56-5.6.23-rel72.1.el6.x86_64.rpm", "Percona-Server-server-56-5.6.23-rel72.1.el6.x86_64.rpm", "Percona-Server-shared-56-5.6.23-rel72.1.el6.x86_64.rpm", "percona-xtrabackup-2.2.9-5067.el6.x86_64.rpm" ] | |
RPMS.each{|rpm| | |
open(rpm, 'wb') do |file| | |
puts "Downloading #{rpm}" | |
file << open("https://ccs-artifactory.com/artifactory/repo/#{rpm}").read |
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
#!/usr/bin/ruby | |
# chkconfig: 2345 95 20 | |
# description: This will closely monitor the centro docker containers. | |
# processname: monitor_containers | |
e = `pgrep monitor_cont`.strip.to_i | |
count = 0 | |
IO.popen('ps -ef | grep monitor_containers | grep -v grep').each{|i| | |
count = count.next | |
if count > 1 |
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
def disk_size | |
require 'win32ole' | |
### | |
# This Enables us to download files via the internet | |
### | |
require 'open-uri' | |
disk_size = nil | |
disk_free_space = nil | |
### | |
# Access to gwmi or wmi modules |
NewerOlder