Skip to content

Instantly share code, notes, and snippets.

@saxenap
Last active March 3, 2020 01:05
Show Gist options
  • Save saxenap/bacff36fe17960e4d4160a581a4a363d to your computer and use it in GitHub Desktop.
Save saxenap/bacff36fe17960e4d4160a581a4a363d to your computer and use it in GitHub Desktop.
When composer gives you memory trouble on a cheapo box
#!/bin/bash
# rm -rf memory_swap && wget -O memory_swap https://gist.githubusercontent.com/saxenap/bacff36fe17960e4d4160a581a4a363d/raw/ && chmod 777 memory_swap && ./memory_swap
df -h
dd if=/dev/zero of=/swapfile bs=1M count=1024
sudo dd if=/dev/zero of=/swapfile bs=1M count=1024
mkswap /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo 'echo "/swapfile none swap defaults 0 0" >> /etc/fstab' | sudo sh
free -m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment