Skip to content

Instantly share code, notes, and snippets.

View irishquinn's full-sized avatar

Chris Quinn irishquinn

View GitHub Profile
#AntiVirus Query
#Author: @r3dQu1nn
#Queries the Registry for AV installed
#Thanks to @i_am_excite and @merrillmatt011 for the help
#Props to @zerosum0x0 for the wmic find!
#Long ass one-liner :)
$powershellcmd = "\$av_list = @(\"BitDefender\", \"Kaspersky\", \"McAfee\", \"Norton\", \"Avast\", \"WebRoot\", \"AVG\", \"ESET\", \"Malware\", \"Windows Defender\");\$av_install = Get-ItemProperty HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*;\$av_install1 = Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*;\$regkey = 'HKLM:\\SOFTWARE\\Microsoft\\Windows Defender\\Signature Updates\\';\$av_loop2 = foreach (\$av1 in \$av_list){foreach (\$key in \$av_install){if (\$key.DisplayName -match \$av1 -eq \$TRUE){% {\"{0}|{1}|{2}\" -f \$key.DisplayName.ToString(), \$key.DisplayVersion.ToString(), \$key.InstallDate.ToString()}}}};\$proc_temp = Get-Process;\$av_loop = foreach (\$av in \$av_list){foreach (\$zz in \$proc_temp){if (\$zz.path -match \$av -eq \$TRUE)
#AntiVirus Query
#Author: @r3dQu1nn
#Queries the Registry for AV installed
#Thanks to @i_am_excite and @merrillmatt011 for the help
#Props to @zerosum0x0 for the wmic find!
#Long ass one-liner :)
$powershellcmd = "\$av_list = @(\"BitDefender\", \"Kaspersky\", \"McAfee\", \"Norton\", \"Avast\", \"WebRoot\", \"AVG\", \"ESET\", \"Malware\", \"Windows Defender\");\$av_install = Get-ItemProperty HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*;\$av_install1 = Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*;\$regkey = 'HKLM:\\SOFTWARE\\Microsoft\\Windows Defender\\Signature Updates\\';\$av_loop2 = foreach (\$av1 in \$av_list){foreach (\$key in \$av_install){if (\$key.DisplayName -match \$av1 -eq \$TRUE){% {\"{0}|{1}|{2}\" -f \$key.DisplayName.ToString(), \$key.DisplayVersion.ToString(), \$key.InstallDate.ToString()}}}};\$proc_temp = Get-Process;\$av_loop = foreach (\$av in \$av_list){foreach (\$zz in \$proc_temp){if (\$zz.path -match \$av -eq \$TRUE)
@irishquinn
irishquinn / wp-html-minify-functions.php
Created August 6, 2022 04:32
Add to child themes functions.php to minify html
<?php
// html compressor
class WP_HTML_Compression
{
// Settings
protected $compress_css = true;
protected $compress_js = false;
protected $info_comment = true;
protected $remove_comments = true;
@irishquinn
irishquinn / mepr-nua-approve-by-email-domain.php
Created June 18, 2019 18:11 — forked from cartpauj/mepr-nua-approve-by-email-domain.php
Using the New User Approve Plugin + MemberPress to allow filtered domains through
<?php
/*
Plugin Name: MemberPress + New User Approve
Version: 1.0.0
Author: Caseproof, LLC
Author URI: http://caseproof.com
Description: Helps the flow of signups from approved/unapproved domains between the MemberPress and New User Approve plugins
*/
function mepr_get_approved_domains() {
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
swapon -s
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
free -m
@irishquinn
irishquinn / functions.php
Created December 15, 2018 01:20
add current page-template CPT being used in footer
<?php
// add to funtions.php
if ( ! is_admin() ) {
add_action( 'admin_bar_menu', 'show_template' );
function show_template() {
global $template;
print_r( $template );
}
}
@irishquinn
irishquinn / functions.php
Created December 15, 2018 01:18
woocommerce not load scripts/styles on every page
<?php
//Dequeue unnecessary scripts on non-woo pages
add_action('wp_enqueue_scripts', 'exclude_woocommerce_styles', 99);
function exclude_woocommerce_styles()
{
//remove generator meta tag
remove_action('wp_head', array($GLOBALS['woocommerce'], 'generator'));
//check woo exists
@irishquinn
irishquinn / functions.php
Created December 15, 2018 01:16
avada-functions.php performance improvements - remove portfolio and faq cpt
<?php
// add to avada child theme functions.php
//async all js
function add_async_attribute($tag, $handle)
{
if ('my-js-handle' !== $handle)
return $tag;
return str_replace(' src', ' async="async" src', $tag);
}
add_filter('script_loader_tag', 'add_async_attribute', 10, 2);
@irishquinn
irishquinn / .htaccess
Created December 15, 2018 01:12
avada-htaccess-compatible-rules
# Block WordPress xmlrpc.php requests
<Files xmlrpc.php>
order deny,allow
deny from all
allow from 123.123.123.123
</Files>
# START - Disable server signature #
# END - Disable server signature #
<IfModule mod_expires.c>
ExpiresActive On