commands that i use often, but hard to remember lol
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Replace 1G with whatever big you want.
Swapfile can’t have CoW enabled, so we have to disable it
truncate -s 0 /swapfile
chattr +C /swapfile
fallocate -l 1G /swapfile
dd if=/dev/zero of=/swapfile bs=1MB count=1024
chmod 0600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile none swap defaults 0 0" >> /etc/fstab
Replace 1G with whatever big you want. You will also need to replace 1024 in dd by the correct amount
| GB | Count |
|---|---|
| 1G | 1024 |
| 2G | 2048 |
| 4G | 4096 |
| 6G | 6144 |
| 8G | 8192 |
grep -rnw './' -e '<string>'
find . -type f -name "*.<ext>"
ssh -R 9000:localhost:22 user@remote
ssh -p 9000 user@localhost
screen -d -m -S <name> "<command>"
docker compose pull && docker compose down && docker compose up -d
tar -xvf file.tar
tar -xzvf file.tar.gz
tar -xjvf file.tar.bz2
-z for .tar.gz files-j for .tar.bz2 filesNeeds unzip to be installed.
unzip file.zip -d <destination>
java -Xmx1024M -Xms1024M -jar <jar> nogui