Skip to content

Instantly share code, notes, and snippets.

@bcho
Created November 4, 2014 12:01
Show Gist options
  • Select an option

  • Save bcho/a3f8ebf653377fc2ddbf to your computer and use it in GitHub Desktop.

Select an option

Save bcho/a3f8ebf653377fc2ddbf to your computer and use it in GitHub Desktop.
trick
#!/bin/bash
# root privilege required.
# Create an empty file:
# Count size base is `B`, so 65536 (B) is 64 MB
dd if=/dev/zero of=/path/to/your/swapfile bs=1024 count=65536
# Enable swap file:
mkswap /path/to/your/swapfile
swapon /path/to/your/swapfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment