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
Cleaning a (typical) Hacked Site | |
- Create backup of site | |
- Deactivate any unnecessary plugins. Delete any plugins and themes that are not in use. | |
- Update all plugins and WordPress through WP admin. We'll replace everything later, but this allows any database updates to happen. | |
- Download wordpress.org/latest.zip. | |
- Download fresh copies of every plugin. | |
- If ACF 4.x installed, upload ACF 5.x and go through database updates (if multi-site, have to go through each site as of now). Then delete ACF 4.x and add-on plugins. | |
- Review wp-config.php to make sure there is no malicious code. If not confident, install fresh copy of wp-config.php with correct database information. | |
- Deactivate site by commenting out database info in wp-config.php | |
- Delete all files and folders in root directory except wp-config.php and wp-content/, and possibly any non-WP folders such as emails. |
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
# Simple with recursion and info/progress | |
rsync -havzP --stats remote@host:/your/path ~/Desktop/your/folder | |
#Custom Port | |
rsync -chavzP --stats -e "ssh -p 1999" remote@host:/path/to/files ~/Desktop/local/folder |
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
#!/bin/bash | |
# https://apple.stackexchange.com/a/303400 | |
set -eou pipefail | |
# From https://heyfocus.com/enabling-do-not-disturb-mode and | |
# https://apple.stackexchange.com/questions/145487 | |
if [[ $(defaults -currentHost read ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb) -eq 0 ]]; then |
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
# Can also use --dryrun instead of --recursive to see what would have happened. | |
aws s3 cp s3://yourbucket/theoneyouwant/ ~/Desktop/bucket-backup --recursive |
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
""" | |
The server application uses AWS S3 in various places. | |
This utility provides a common place for interacting | |
with S3 and handles the authentication in a unified manner. | |
""" | |
import os.path | |
import logging |
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
<?php | |
function cf_search_join( $join ) { | |
global $wpdb; | |
if ( is_search() ) { | |
$join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id '; | |
} | |
return $join; | |
} |
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
<!-- Assumes jQuery is loaded which is almost always the case --> | |
<img src="/your/image.jpg" alt="Logo" onload="$.getScript('https://yoursite.com/main.js');"> |
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
var getUrlParameter = function getUrlParameter(sParam) { | |
var sPageURL = window.location.search.substring(1), | |
sURLVariables = sPageURL.split('&'), | |
sParameterName, | |
i; | |
for (i = 0; i < sURLVariables.length; i++) { | |
sParameterName = sURLVariables[i].split('='); | |
if (sParameterName[0] === sParam) { |
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
strings ~/Desktop/filename.pdf | grep FontName |
NewerOlder