This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html><head><title>Find String</title></head><body> | |
<?php | |
// Most hosting services will have a time limit on how long a php script can run, typically 30 seconds. | |
// On large sites with a lot of files this sript may not be able to find and check all files within the time limit. | |
// If you get a time out error you can try overideing the default time limits by removeing the // in the front of these two lines. | |
// ini_set('max_execution_time', '0'); | |
// ini_set('set_time_limit', '0'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Search for eval(base64_decode) | |
find . -name \*.php -exec grep -l "eval(base64_decode" {} \; | |
#Look for world writable files | |
find . -type d -perm -o=w | |
#last logins + ip addresses from where the user logged in | |
last -i | grep youruser | |
last -if /var/log/wtmp.1 | grep youruser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* lookforbadguys.php 2011-09-27 | |
Copyright (C)2011 Karen Chun, Steven Whitney. | |
Initially published by http://25yearsofprogramming.com. | |
This program is free software; you can redistribute it and/or | |
modify it under the terms of the GNU General Public License (GPL) | |
Version 3 as published by the Free Software Foundation. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat access.log | awk '{print $1}' | sort | uniq -c | sort -n | tail | |
# in awk $1 is first column | |
# in uniq -c asks each output line to be preceded with the count of the number of times | |
# the line occurred in the input, followed by a single space. | |
# See http://wiki.dreamhost.com/VPS_Troubleshooting | |
# You need to be @ /home/user/logs/domain/http |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//to add html to tagline in Wordpress adjust the tagline generation in header.php | |
//see http://englishmike.net/2008/07/03/wordpress-quick-tips-2-embedding-html-in-blog-titles-and-descriptions/ | |
//working on functions.php filter.. | |
html_entity_decode(get_bloginfo('description')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//DATE_ADD to add and DATE_SUB to substract. Do not forget to backup DAY and YEAR can be used as well | |
//Adjust table prefix when needed | |
//Also see http://wordpress.org/support/topic/possible-to-change-publishing-dates-of-all-posts-in-one-shot?replies=3 | |
UPDATE wp_posts | |
SET post_date = DATE_ADD( post_date, INTERVAL 12 MONTH ), | |
post_date_gmt = DATE_ADD( post_date_gmt, INTERVAL 12 MONTH ), | |
post_modified = DATE_ADD( post_modified, INTERVAL 12 MONTH ), | |
post_modified_gmt = DATE_ADD( post_modified_gmt, INTERVAL 12 MONTH ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
port dependents "port-name to check for ports depending on it" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql -u user -p -h host.com database-name < dump.sql //importing | |
mysqldump -u user -p(password) -h hostname database-name > filename.sql // exporting or backing up database | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://wordpress.org/latest.tar.gz | |
tar -xzvf latest.tar.gz | |
mv wordpress/* . | |
rmdir wordpress | |
//After all this the rest can be done from the browser as long as the database has been created | |
//PHP >=5.3 https://github.com/wp-cli/wp-cli - awesome free tool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//useful when PHP is running as Apache Module | |
find . -type d -print0 | xargs -0 chmod 0775 # For directories | |
find . -type f -print0 | xargs -0 chmod 0664 # For files |