Skip to content

Instantly share code, notes, and snippets.

@Vitre
Last active November 22, 2015 17:23
Show Gist options
  • Save Vitre/bdf9637fdeefd89ce33c to your computer and use it in GitHub Desktop.
Save Vitre/bdf9637fdeefd89ce33c to your computer and use it in GitHub Desktop.
Apache source permission fix
sudo find . -type f -exec chmod 644 {} \; && sudo find . -type d -exec chmod 755 {} \;
sudo chmod -R 777 ./
chmod g=,o=rx /home/*
# chmod revert
git diff --numstat | awk '{if ($1 == "0" && $2 == "0") print $3}' | xargs git checkout HEAD
git diff --summary | grep --color 'mode change 100755 => 100644' | cut -d' ' -f7- | xargs -d'\n' chmod +x
git diff --summary | grep --color 'mode change 100644 => 100755' | cut -d' ' -f7- | xargs -d'\n' chmod -x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment