Skip to content

Instantly share code, notes, and snippets.

@adler
Created July 20, 2010 13:34
Show Gist options
  • Save adler/482959 to your computer and use it in GitHub Desktop.
Save adler/482959 to your computer and use it in GitHub Desktop.
# get half of number of bytes of total memory
SHMMAX=$(free | perl -ane 'printf "%1.0f\n", ($F[1] * 512 ) if m/Mem:/')
grep -q kernel.shmmax /etc/sysctl.conf || echo "kernel.shmmax = $SHMMAX" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment