Skip to content

Instantly share code, notes, and snippets.

@Drewlius
Created May 20, 2026 21:48
Show Gist options
  • Select an option

  • Save Drewlius/08a66f8df836c65b5643a1975918b3d8 to your computer and use it in GitHub Desktop.

Select an option

Save Drewlius/08a66f8df836c65b5643a1975918b3d8 to your computer and use it in GitHub Desktop.
script to disable ZRAM and Swap in one command.
#!/bin/bash
sudo swapoff -a;sudo zramctl --reset /dev/zram0;echo "ensure if a ZRAM line is configured that you remove it now";sleep 10;wait;sudo nano /etc/fstab;sudo systemctl mask --now systemd-zram-setup@zram0.service;sudo touch /etc/systemd/zram-generator.conf;echo "Here you are going to write vm.swappiness=0, save(ctrl+s), and then exit(ctrl+x, Enter)";sleep 10;wait;sudo nano /etc/sysctl.d/99-swappiness.conf;echo "ZRAM is OFF";sleep 3;wait;exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment