title: I want to have a swap size equal to the machine RAM (memory)
body: <p>I already wrote some of the code:</p>
  
  <pre><code>echo " &gt; Get MemTotal"
  export MEM_TOTAL=`echo "scale=0; ($(awk '/MemTotal/ { print $2 }' /proc/meminfo) / 1000) + 1" | bc 2&gt;/dev/null`
  
  echo " &gt; Set new swap memory"
  sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=${MEM_TOTAL}M count=1024
  sudo /sbin/mkswap /var/swap.1
  sudo /sbin/swapon /var/swap.1
  </code></pre>
  
  <p>I am just unsure about where to put the <code>${MEM_TOTAL}</code> variable. Everything else has been tested and works.</p>
  
  <p>So in other words, am I doing this right, if my goal is to have a swap equal to the size of my memory?</p>