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 | |
ps_out=`ps -ef | grep "rclone sync\|bash rclone" | grep -v 'grep'` | |
result=$(echo $ps_out | grep "$1") | |
if [ "$result" = "" ];then | |
# DB Dumps First | |
#for i in $(mysql --batch --skip-column-names -e 'SHOW DATABASES' | egrep -v 'performance_schema|information_schema|mysql|eximstats|leechprotect|cphulkd|modsec|roundcube|logaholicDB_.'); do mysqldump --single-transaction -h localhost --opt $i | gzip -c > /home/_dbbackups/$i.sql.gz; done | |
# Home Folder Dump | |
DATE=$(date +%Y-%m-%d.%H:00) |
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 USER | |
Useful script to programatically add an admin user to Wordpress if you dont have access to the admin, but do have access to the file system | |
***********************/ | |
function wpb_admin_account() | |
{ | |
$user = 'adminusername'; // Your username | |
$pass = 'adminpassword'; // Your password | |
$email = 'info@mydomain.co.uk'; // Your email |
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 | |
# Change directory to /home | |
cd /home | |
# Iterate through all users directories | |
for user in * ; do | |
# For every webapp under the user directory | |
# Count wp-config files to make sure its Wordpess |
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
subject="Email Test" | |
body="Hello World. This is an email test and I am including this paragraph of content to gain extra points if there is a substantial body message included. Thank you." | |
from="$1" | |
to="$2" | |
echo -e "To: Test <$to>\nFrom: Test <$from>\nSubject: $subject\n\n$body\n" | sendmail -f $from -t $to | |
# USAGE # | |
# NOTE: Some servers may need BASH not SH | |
# Directly from this URL: | |
# curl -s https://gist.githubusercontent.com/amityweb/e0d1288a719e3ec2f028ec76b551cd86/raw/ | sh -s from@domain.com to@domain.com |
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
<!doctype html> | |
<html> | |
<head> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<script type="text/javascript"> | |
var spData = null; | |
function doData(json) { | |
spData = json.feed.entry; | |
} | |
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 | |
DATE=$(date +%Y-%m-%d.%I-%M-%S) | |
echo $DATE - $1 |
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 | |
// Replace variables with yours | |
// Run script with "php clone_wp.php" | |
// Requires All in One WP Migration Unlimited stored locally and path updated below - other backup plugins can be used with some teaks to WP CLI commands | |
// Requires All in One Backup file created source website and path and filename copied to that below | |
// iThemes securiy is used on source system to hide the admin URL | |
// WP Migrate DB is installed in source system to do find and replace of some settings, like a new Admin URL | |
// Check WP Config settings at bottom, you probably will want your own or none of these |
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 | |
// Map CSV file to array | |
$rows = array_map('str_getcsv', file('data.csv')); | |
$header = array_shift($rows); | |
$data = array(); | |
foreach ($rows as $row) | |
{ | |
$data[] = array_combine($header, $row); | |
} |
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
-- Thanks to https://github.com/HunterHillegas/OmniFocusMailFlags/blob/master/PushFlaggedMessagesToOmniFocus.applescript | |
-- This AppleScript will send email messages in a specific folder in Mail.app to your Omnifocus 2 inbox | |
-- Only runs if Mail and OF2 are open | |
-- Run the script with /usr/bin/osascript "/path/to/script/send-follow-up-to-omnifocus.scpt" | |
-- I use Lingon to manage my scheduled scripts | |
-- Edit the variables below | |
on run |
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/sh | |
rsync="/usr/bin/rsync" | |
################################ | |
# VARIABLES | |
################################ | |
# General Variables | |
remote_server="yourserver.com" | |
remote_port="22" |
NewerOlder