Fixing directory permissions with find
Wednesday, September 28th, 2005Screwing directories and files with setgid bit: chmod -R 2775 photos
Fixing file permissions with find: find . -type f -exec chmod 664 {} ‘;’
Screwing directories and files with setgid bit: chmod -R 2775 photos
Fixing file permissions with find: find . -type f -exec chmod 664 {} ‘;’
Diego’s “shell nasty quoting tricks”: print ” ‘ ” ‘ ” ‘ ” ‘
or in more details: perl -e ‘print ” a’ ” ‘ ” ‘b ” ‘
Yes they are – “ are better replaced with $(). The problem is that not all the shells know about it
Add this line to cron.daily/cron.hourly/…
tcpdump -np -i eth0 -s 0 -w /<path>/date +"%Y%m%d-%H%M%S.tcpdump" “<filter>”
${variable#pattern}
If the pattern matches the beginning of the variable’s value, delete the shortest part that matches and return the rest. ${variable##pattern}
If the pattern matches the beginning of the variable’s value, delete the longest part that matches and return the rest. ${variable%pattern}
If the pattern matches the end of the variable’s value, delete the shortest part that matches and return the rest. ${variable%%pattern}
If the pattern matches the end of the variable’s value, delete the longest part that matches and return the rest.
svn add svn status | perl -ne '/\?\s*(.*)/ && print "$1 "'
chmod -R go=u,go-w /directory
Copying user’s permissions to group and others, clearing write permission (all this to merely preserve x for directories without setting it to all other files).
WHY?????? WHY NOT?
Run this on client:
pppd noauth debug nodetach 10.0.0.1:10.0.0.2 pty 'ssh user@server "pppd noauth debug nodetach notty "'
It works, even if the server asks for password, as it uses a direct terminal I/O, not stdin. Note that for noauth option pppd needs to be run as root (otherwise, some authentication options have to be set).
BTW Chris found this link. I think our one-liner is much nicer