View wget-crawl.sh
This file contains 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 --mirror --convert-links --adjust-extension --page-requisites --no-parent http://domain.com/ |
View database_size.sql
This file contains 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
SELECT table_schema "DB Name", | |
ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" | |
FROM information_schema.tables | |
where table_schema='REPLACE_WITH_DATABASE_NAME' | |
GROUP BY table_schema; |
View Image Optimise Commands
This file contains 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
JPEGS | |
find uploads/ -type f -iname '*.jpg' -exec jpegoptim --strip-all {} + | |
PNG | |
find uploads/ -iname "*.png" -exec pngquant --force --quality=40-100 --skip-if-larger --strip --verbose \{} --output \{} \; |
View Rsync
This file contains 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
rsync -ravzv -e ssh user@externalserver.com:/home/user/test/* --include=".*" /home/user/test |
View Server Log File helpers
This file contains 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
=-+=-+=-+=-+=-+=-+=-+=-+=-+= | |
List all IP's hitting any domain | |
=-+=-+=-+=-+=-+=-+=-+=-+=-+= | |
less /home/*/access-logs/* | awk '{print $1}' | sort | uniq -c | sort -n | |
=-+=-+=-+=-+=-+=-+=-+=-+=-+= | |
List all IP's hitting POSTING to any domain | |
=-+=-+=-+=-+=-+=-+=-+=-+=-+= |
View Gravity Forms Delete Entires.php
This file contains 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
add_action( 'gform_after_submission', 'site_gform_after_submission', 10, 2 ); | |
function site_gform_after_submission ( $entry, $form ) { | |
GFAPI::delete_entry( $entry['id'] ); | |
} |
View .bash_profile
This file contains 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
# add this to your .bash_profile | |
export PATH=$PATH:$HOME/bin | |
_complete_ssh_hosts () | |
{ | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \ | |
cut -f 1 -d ' ' | \ |
View .bash_profile
This file contains 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
_complete_ssh_hosts () | |
{ | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \ | |
cut -f 1 -d ' ' | \ | |
sed -e s/,.*//g | \ | |
grep -v ^# | \ | |
uniq | \ | |
grep -v "\[" ; |
View Tar GZ - Exclude directory
This file contains 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
tar -czvf filename.tar.gz /full/path/to/directory --exclude "/full/path/to/directory/to/exclude/wp-content/uploads" | |
Use this on local /wp-content/uploads: | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule (.*) http://domain.com/wp-content/uploads/$1 | |
</IfModule> |
View Reset Permissions 755 644
This file contains 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
find . -type d -exec chmod 0755 {} \; && find . -type f -exec chmod 0644 {} \; |
NewerOlder