Thread:Manual talk:Chmod/Appropriate command for MediaWiki

As disgusting as it is, some crappy web hosts on shared servers require people to set ugly permissions on all their executables, such as 755 or even 777. Can we suggest a sensible command to set all files to their original permissions in core, or to whatever other permissions one is forced to, without touching stuff that shouldn't be touched? Something like find core -type f ! -perm 644 -exec chmod 644 {} + but a bit less invasive I guess.