Simple solutions for complicated problems...

How do I parse all 404's from my weblogs

grep ' 404 ' /var/log/nginx/access.log* | awk '{print $7}' | sort -n | uniq -c | sort -rn > /root/top404.txt

This will find, group, count and sort by count descending for all non compressed log files. Note that the print $7 is the column number delineated by spaces. You may have to experiment with the index number based on log settings.

How do I configure swappiness

You can set swappiness while running: sysctl vm.swappiness=10
To retain the settings when rebooting: vi /etc/sysctl.conf and add or edit; vm.swappiness = 10
To query for the current swappiness setting: cat /proc/sys/vm/swappiness

The setting range is 0 to 100. The higher the number the sooner swap is used preserving RAM. A swappiness setting of zero means that the disk will be avoided unless absolutely necessary (you run out of memory), while a swappiness setting of 100 means that programs will be swapped to disk almost instantly.