Skip to content

Instantly share code, notes, and snippets.

@gbraccialli
Last active August 29, 2015 14:19
Show Gist options
  • Save gbraccialli/05c5c358dd5e7f6287ea to your computer and use it in GitHub Desktop.
Save gbraccialli/05c5c358dd5e7f6287ea to your computer and use it in GitHub Desktop.
selinux_hugepage
#!/bin/bash
#install and configure ntp
yes | yum install ntp ntpdate
chkconfig ntpd on
ntpdate pool.ntp.org
service ntpd start
#disable iptables
chkconfig iptables off
service iptables stop
#disable selinux
setenforce 0
sed -i 's/enforcing/disabled/g' /etc/selinux/config
#increase ulimits
printf ' - nofile 32768\n - nproc 65536\n' >> /etc/security/limits.conf
#disable THP
printf '\n# Disable Transparent HugePages\n' >> /etc/rc.local
printf 'if test -f /sys/kernel/mm/transparent_hugepage/enabled; then\n' >> /etc/rc.local
printf 'echo never > /sys/kernel/mm/transparent_hugepage/enabled\n' >> /etc/rc.local
printf 'fi\n' >> /etc/rc.local
printf 'if test -f /sys/kernel/mm/transparent_hugepage/defrag; then\n' >> /etc/rc.local
printf 'echo never > /sys/kernel/mm/transparent_hugepage/defrag\n' >> /etc/rc.local
printf 'fi\n' >> /etc/rc.local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment