Skip to content

Instantly share code, notes, and snippets.

View pauiglesias's full-sized avatar
🏠
Working from home

Pau Iglesias pauiglesias

🏠
Working from home
View GitHub Profile
@pauiglesias
pauiglesias / find-directories-no-775
Created February 11, 2015 17:33
Recursive find directories with no 775 permissions
sudo find . -type d ! -perm 0775 | more
@pauiglesias
pauiglesias / find-files-no-664
Last active August 29, 2015 14:15
Recursive find files with no 664 permissions
sudo find . -type f ! -perm 0664 | more
@pauiglesias
pauiglesias / wordpress-posts-by-term-slug
Created February 11, 2015 15:20
Wordpress posts by term slug
SELECT ID, post_name FROM wp_posts WHERE ID IN (
SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id IN (SELECT term_taxonomy_id FROM wp_term_taxonomy WHERE term_id IN (SELECT term_id FROM wp_terms WHERE slug = "and-here-the-slug"))
) AND post_type = "post" and post_status = "publish" ORDER BY ID DESC
@pauiglesias
pauiglesias / log-paths-php-fpm
Created February 5, 2015 16:02
Log paths of php-fpm in centos
sudo vi /var/log/php-fpm/www-error.log
sudo vi /var/log/php-fpm/error.log
sudo vi /var/log/php-fpm/www-slow.log
@pauiglesias
pauiglesias / memcache-flush
Created February 5, 2015 16:00
memcache flush
echo "flush_all" | nc localhost 11211
@pauiglesias
pauiglesias / wordpress-menu-positions
Created February 5, 2015 15:56
Wordpress positions for Core Menu Items
2 Dashboard
4 Separator
5 Posts
10 Media
15 Links
20 Pages
25 Comments
59 Separator
60 Appearance
65 Plugins
@pauiglesias
pauiglesias / php-grep-detect-short-tags
Created February 5, 2015 15:51
Detect PHP short tags recursively with grep
grep -rn --include=*.php "<?[^p]" *
grep -rn --include=*.php "<?$" *
@pauiglesias
pauiglesias / wordpress-options-theme
Created February 5, 2015 15:50
Wordpress options theme entries
template: twentyeleven
stylesheet: twentyeleven
current_theme: twentyeleven
@pauiglesias
pauiglesias / wordpress-default-post-type-status-comment
Last active August 29, 2015 14:14
Default post_type, post_status and comment_approved values in Wordpress tables
- post_type
post
page
attachment
nav_menu_item
revision
- post_status
publish
future
@pauiglesias
pauiglesias / wordpress-detect-unsanitized-terms
Last active August 29, 2015 14:14
Detect not properly sanitized terms slugs in Wordpress
SELECT * FROM wp_terms WHERE slug <> "" AND slug NOT REGEXP BINARY '^[a-zA-Z0-9\-]+$'