Skip to content

Instantly share code, notes, and snippets.

@ev3rywh3re
ev3rywh3re / gist:2587766
Created May 3, 2012 18:10
Linux: grep command line notes
## Search for scary PHP stuff.
grep "((eval.*(base64_decode|gzinflate))|r57|c99|sh(3(ll|11)))" ./ -roE --include=*.php*
@ev3rywh3re
ev3rywh3re / gist:2587742
Created May 3, 2012 18:07
Linux: find command notes
## find hidden directories
find . -name '.*' -type d -print
## Change permissions recursively using FIND:
find /var/www/html/ -print -exec chmod <permissions> {} \;
find /var/www/html/ -print -exec chown <owner.group> {} \;
## For seLinux you should know wtf chcon does and modify appropriately.
@ev3rywh3re
ev3rywh3re / wp-fix-bad-win-latin-garbage.sql
Created May 3, 2012 17:52
WordPress: fix bad windows-latin garbage in database
update wp_posts
set post_content = replace(post_content,'’','\'');
update wp_posts
set post_content = replace(post_content,'…','...');
update wp_posts
set post_content = replace(post_content,'–','-');
update wp_posts
set post_content= replace(post_content,'“','"');
update wp_posts
set post_content= replace(post_content,'”','"');