Skip to content

Instantly share code, notes, and snippets.

@edingc
edingc / gist:c8863e48a6278c60b396
Last active August 29, 2015 14:10
Shutdown computers one at a time and don't continue until confirmed down
Get-Content ComputersToShutdownInOrder.txt | Foreach-Object { Stop-Computer $PSItem -Force; Do { Write-Host "$PSItem still pinging!"; Start-Sleep -s 1 } Until ( ( Test-Connection -Count 1 -Quiet $PSItem ) -eq $False ); Write-Host "$PSItem is down!" }
@edingc
edingc / gist:7dded9cc6508d2a598b4
Created October 16, 2015 22:09
Office 365 SPAM Extract Script
$From = "spamextract@domain.com"
$To = "emailadmins@domain.com"
$SmtpServer = "mail.domain.com"
$HoldingMailbox = "expungedemails@domain.com"
$ErrorActionPreference = "Stop"
Write-Host ""
Write-Host "Office 365 Mail Extract" -ForegroundColor "Green"
Start-Sleep 1
<?php
/**
* Display a custom taxonomy dropdown in admin
* @author Mike Hemberger
* @link http://thestizmedia.com/custom-post-type-filter-admin-custom-taxonomy/
*/
add_action('restrict_manage_posts', 'tsm_filter_post_type_by_taxonomy');
function tsm_filter_post_type_by_taxonomy() {
global $typenow;
$Keep = 3
$Today = (Get-Date).DayOfWeek
# Cleanup if Monday
If ( $Today -eq "Monday" ) {
Write-Host "Running TSM cleanup."
& tsm maintenance cleanup
}
@edingc
edingc / deploy_tpot.yml
Created October 26, 2021 19:49
Single file playbook to deploy T-Pot honeypot software using Ansible.
- hosts: tpots
remote_user: root
gather_facts: yes
vars:
ansible_python_interpreter: /usr/bin/python3
tpot_web_user: "user"
tpot_web_pw: "mypassword"
tasks: