Skip to content

Instantly share code, notes, and snippets.

@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:
$Keep = 3
$Today = (Get-Date).DayOfWeek
# Cleanup if Monday
If ( $Today -eq "Monday" ) {
Write-Host "Running TSM cleanup."
& tsm maintenance cleanup
}
<?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;
@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
@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 / Get-PublicFolderOwners.ps1
Last active August 29, 2015 14:09
PoSh One-Liner to Export Top-Level Public Folders and Owners to CSV
Get-PublicFolder -Recurse | Where-Object { $PSItem.ParentPath -eq "\" } | Get-PublicFolderClientPermission | Where-Object { $PSItem.AccessRights -contains "Owner" } | Export-CSV .\PF_Owners.csv -NoTypeInformation
<?php
if ( ( $_GET["var1"] != '' ) || ( $_GET["var2"] != '' ) || ( $_GET["var3"] != '' ) ) {
if ( $_GET["var1"] != '' ) {
$meta_query[] = array( 'key' => 'meta_value1', 'value' => $_GET["var1"], 'compare' => '=' );
}
if ( $_GET["var2"] != '' ) {
$meta_query[] = array( 'key' => 'meta_value2', 'value' => $_GET["var2"], 'compare' => '=' );
@edingc
edingc / bootstrap_ansible.sh
Created January 24, 2014 16:46
CentOS shell script to automatically enable EPEL repository, update the system and install Ansible for configuration management. Useful to bootstrap a system in preparation for Ansible configuration.
#!/bin/bash
# Download and install EPEL repository.
/usr/bin/wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
/usr/bin/yum -y install epel-release-6*.rpm
# Fully update the system and install Ansible
/usr/bin/yum -y update
/usr/bin/yum -y install ansible
@edingc
edingc / diskpart
Last active January 4, 2016 03:39
Recovery console diskpart commands to get Server 2012/2012R2 to start following GhettoVCB/BazaarVCB restores.
diskpart
list vol
sel vol 2
attributes volume clear hidden readonly nodefaultdriveletter shadowcopy
sel vol 3
attributes volume clear hidden readonly nodefaultdriveletter shadowcopy
exit
recovery\startrep.exe
@edingc
edingc / mindstorms-nxt-pkginfo
Created September 19, 2012 12:00
Munki PKGINFO for Lego Mindstorms NXT 2.1
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>autoremove</key>
<false/>
<key>catalogs</key>
<array>
<string>production</string>
</array>