Skip to content

Instantly share code, notes, and snippets.

View ejbolt's full-sized avatar
💭
Probably finding a horrible solution to something using Bash or C

Evan Bolt ejbolt

💭
Probably finding a horrible solution to something using Bash or C
View GitHub Profile
@ejbolt
ejbolt / centos-config.sh
Last active November 26, 2019 01:26
My personal CentOS configuration scripts: installs elrepo, epel, enables centosplus and PowerTools, sets sudoers to require root password, enables some nano settings, fixes dnf tab completion if system is centos 8. Written on CentOS 8, only somewhat tested on CentOS 7
#!/usr/bin/env bash
if (( EUID != 0 ))
then
echo "Script should be run as root"
exit 1
else
echo "Detected running as root"
fi
@ejbolt
ejbolt / kernelswitch.sh
Created November 24, 2019 19:51
Script to switch kernel on RHEL 7/CentOS 7 using elrepo kernel repositories
#!/usr/bin/env bash
if [[ ! -f /etc/yum.repos.d/elrepo.repo ]]
then
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh https://elrepo.org/linux/kernel/el7/x86_64/RPMS/elrepo-release-7.0-4.el7.elrepo.noarch.rpm
sed '35,47s/enabled=0/enabled=1/' /etc/yum.repos.d/elrepo.repo > /tmp/elrepo.repo
cp /etc/yum.repos.d/elrepo.repo /etc/yum.repos.d/elrepo.repo.bak