Skip to content

Instantly share code, notes, and snippets.

@tanfwc
tanfwc / mass_disable_autossl.sh
Created January 14, 2025 02:05
Script to mass exclude sub-domain for cpanel autossl
#!/bin/bash
# Function to exclude subdomains from AutoSSL for a specific user
exclude_autossl_domains() {
USER=$1
# Get the main domain for the user using uapi
DOMAIN=$(uapi --user="$USER" DomainInfo list_domains | awk '/main_domain:/ {print $2}' | tr -d '"')
# Handle case if the domain extraction fails
@tanfwc
tanfwc / quick_gpo_checks.ps1
Last active December 17, 2024 08:41
MSP - Quick Group Policy Checks
#
# Invoke-Expression (New-Object Net.WebClient).DownloadString('https://gist.githubusercontent.com/tanfwc/db05d526475066b9360edac6978d8f81/raw/quick_gpo_checks.ps1')
# Function to check network connectivity to the domain controller
function Test-NetworkConnectivity {
Write-Host "`nTesting network connectivity..." -ForegroundColor Cyan
$DomainController = (nltest /dsgetdc:$env:USERDNSDOMAIN | Select-String "DC:").ToString().Split(":")[1].Trim().TrimStart("\")
$PingResult = Test-Connection -ComputerName $DomainController -Count 2 -Quiet
if ($PingResult) {
Write-Host "Network connectivity to Domain Controller is OK." -ForegroundColor Green
@tanfwc
tanfwc / qiuck_ad_check.ps1
Last active December 17, 2024 04:18
MSP - Quick Domain Controller Checks
#
# Invoke-Expression (New-Object Net.WebClient).DownloadString('https://gist.githubusercontent.com/tanfwc/e55e67e18079765cb630d9dc7b436681/raw/6a61bd2f4d3cb8ccbe7a05c090d59cf4f3490cfe/qiuck_ad_check.ps1')
# Function to test network connectivity to the Domain Controller
function Test-NetworkConnectivity {
Write-Host "`nTesting Network Connectivity..." -ForegroundColor Cyan
$DomainName = $env:USERDNSDOMAIN
if (-not $DomainName) {
Write-Host "This computer is NOT joined to a domain." -ForegroundColor Red
@tanfwc
tanfwc / fortinet_threatfeed.txt
Last active May 3, 2024 04:05
Fortinet Threat Feed
#SingCERT_20240502-C155152
193.42.36.214
91.245.253.72
<#Author : Tan Fang Wai
# Usage : Install and setup Bloomberg
#>
######################
# WVD Variables #
######################
$LocalTempDir = "c:\temp\bloomberg\";
####################################
# Test/Create Temp Directory #
@tanfwc
tanfwc / chromeinstall.ps1
Last active June 3, 2023 12:35
Azure Virtual Desktop Chrome Installation Script
<#Author : Tan Fang Wai
# Usage : Install and setup Chrome
#>
######################
# WVD Variables #
######################
$LocalTempDir = "c:\temp\chrome\";
$ChromeInstaller = "ChromeInstaller.exe";
####################################