Skip to content

Instantly share code, notes, and snippets.

@aaBoustani
Last active August 15, 2018 16:29
Show Gist options
  • Select an option

  • Save aaBoustani/79f516574d3d199a66e5a8c29039c58b to your computer and use it in GitHub Desktop.

Select an option

Save aaBoustani/79f516574d3d199a66e5a8c29039c58b to your computer and use it in GitHub Desktop.

Terminal

Find original file of a symlink

readlink -f $(which command)
lsof -i :[port]

Change swap size

  1. Make all swap off
    sudo swapoff -a

  2. Resize the swapfile
    sudo dd if=/dev/zero of=/swapfile bs=1M count=1024

  3. Make swapfile usable
    sudo mkswap /swapfile

  4. Make swapon again
    sudo swapon /swapfile

Vim

write with sudo

:w !sudo tee %

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment