Skip to content

Instantly share code, notes, and snippets.

@jnikolak
jnikolak / gist:bec426c82537aaa335acb12a089c9f73
Last active February 26, 2018 18:56
Networking Topology
#!/bin/bash
#### Thank you once again Jamie Bainbridge for helping me with the script.
#### Requirements: yum install -y "graphviz eog" ; copy script into file and then execute, e.g: ./scriptname.sh
#### I've noticed it doesn't work too well in the new Fedora, but tested with Rhel 7
#set -x
echo "" > first.dot
InitPath=$(pwd)
EndPath="sos_commands/networking"
@jnikolak
jnikolak / gist:edc96f167ecd1b275bce34b17556f5fd
Last active November 24, 2016 00:55
compare satellite packages
#!/bin/bash
# first version currently only supports 6.2.2 until i can think of a way
# to only show package update from Satellite, to filter out rhel packages
sequence=$(yum history list all)
printf "$sequence\n"
read -p "Type the ID you want to compare from: in this format: 5 26 " ids
checker="https://gist.githubusercontent.com/jnikolak/7c66ce9f76fde37aa2eb51623bfd56c7/raw/6dd77476cb242dc64c1e5f6dee0d16c377246197/gistfile1.txt"
pkgoutput="packages.out"
apache-commons-collections-3.2.1-22.el7_2.noarch
apache-commons-daemon-1.0.13-6.el7.x86_64
apache-commons-dbcp-1.4-17.el7.noarch
apache-commons-logging-1.1.2-7.el7.noarch
apache-commons-pool-1.6-9.el7.noarch
apr-1.4.8-3.el7.x86_64
apr-util-1.5.2-6.el7.x86_64
atk-2.14.0-1.el7.x86_64
audit-2.4.1-5.el7.x86_64
audit-libs-2.4.1-5.el7.x86_64
@jnikolak
jnikolak / netperf.pp
Last active October 17, 2017 05:56
easynetworkperformance
# This needs the package puppet which can be installed with:
#Rhel 7 = rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm;yum install -y puppet
#rhel 6 = requires 4 repositories
#rhel-6-server-rpms -> subscription-manager repos --enable rhel-6-server-rpms
#puppetlabs-products -> rpm -ivh rpm -ivh https://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm
#puppetlabs-deps -> enable the repository;Change 0 to 1
#rhel-6-server-optional-rpms -> subscription-manager repos --enable rhel-6-server-optional-rpms
# Once these repos are available, yum install puppet
# About netperf: This script will apply recommended Tunings on Your Server.
@jnikolak
jnikolak / gist:eedbfe85896e1bcb885d31876e1cf07b
Last active November 7, 2016 11:26
automate hammer satellite 6.1 or 6.2
#!/bin/bash
#set -x
if [ -d /etc/foreman-installer ];then
password=$(grep admin_password /etc/foreman-installer/scenarios.d/satellite-answers.yaml| egrep -v pulp | awk '{print $2}')
else
password=$(grep admin_password /etc/katello-installer/answers.katello-installer.yaml| egrep -v pulp | awk '{print $2}')
fi
if [ -f ~/.hammer/cli_config.yml ];then
mv ~/.hammer/cli_config.yml /tmp/cli_config.yml
@jnikolak
jnikolak / gist:b09d4a20f5150c65e05a8fe3421b160f
Last active May 29, 2018 00:47
automated script to setup provisioning
#!/bin/bash
#set -x
if [ -d /etc/foreman-installer ];then
password=$(grep admin_password /etc/foreman-installer/scenarios.d/satellite-answers.yaml| egrep -v pulp | awk '{print $2}')
else
password=$(grep admin_password /etc/katello-installer/answers.katello-installer.yaml| egrep -v pulp | awk '{print $2}')
fi
if [ -f ~/.hammer/cli_config.yml ];then
mv ~/.hammer/cli_config.yml /tmp/cli_config.yml
@jnikolak
jnikolak / gist:48a2f148cd845061cbc8df0b0ab2dede
Last active November 3, 2016 07:42
Create Static Network Configuration
#!/bin/bash
set -x
### TODO DETERMINE HOW MANY INTERFACE ACTIVE AND WHICH ONE YOU WOULD LIKE TO CONFIGURE
curipaddr=$(ip link | egrep -v "lo|link" | awk -F ': ' '{print $2}')
curgateway=$(ip r s table all | egrep 'default v' | awk '{print $3}')
curdns=$(dig $(hostname -f) | egrep SERVER | awk -F '(' '{print $2}'| sed 's/)//')
#oldName=$(grep DEVICE /etc/sysconfig/network-scripts/ifcfg-ens3 | awk -F '"' '{print $2}')
#!/bin/bash
set -x
#oldName=$(grep DEVICE /etc/sysconfig/network-scripts/ifcfg-ens3 | awk -F '"' '{print $2}')
intName=$(ip link | egrep -v "lo|link" | awk -F ': ' '{print $2}')
ifcfgfile="/etc/sysconfig/network-scripts/ifcfg-$intName"
mv /etc/sysconfig/network-scripts/ifcfg-$intName /etc/sysconfig/network-scripts/ifcfg-$intName.bak
touch $ifcfgfile
for i in "DEVICE=$intName" "ONBOOT=yes"
#!/bin/bash
set -x
mkdir -p /var/www/html/pub/sat-import/
for i in $(ls /source/sat-6-isos--rhel-7-server-x86_64*)
do
mkdir /mnt/iso
mount -o loop $i /mnt/iso
cp -ruv /mnt/iso/* /var/www/html/pub/sat-import/
sleep 10
@jnikolak
jnikolak / gist:5c0eba5453a7d4912b4a700399a59040
Last active November 7, 2016 15:46
Install Satellite from Disconnected
#!/bin/bash
set -x # Comment this out for faster implementation.
#**************************************************************
## Version 0.1"
### Author: Jon Nikolakakis
#### change variable $dom if you don't want the domain china.com
##### This script will install and set up your hostname, then install Satellite of your choosing.
###### The goal is to do it quickly and without much interaction.
####### The installer requires that you have downloaded the disconnected satellite iso,