Skip to content

Instantly share code, notes, and snippets.

@jameswebb68
jameswebb68 / Get-ADtop.ps1
Last active April 7, 2017 16:29
Retrieves gets CPU usage, Memory usage, and OS Disk storage usage details from Active Directory domain joined Windows computers
# Get-ADtop
# @ JMR 2012 All right reserved, not for resale
#
# Retrieves Realtime CPU/MEM/DISK usage details from
# AD Computer Objects via provided BaseDN
# Or from provided ComputerName
# Probes computer names for connectivity before executing
#
# -SampleTime is the amount of time to sample the CPU usage and provide avg
@jameswebb68
jameswebb68 / gist:34ed19ed2b06d99c484b
Last active April 27, 2021 20:16
Synology Active Directory ADS join domain fix (suddenly nas lost connection to domain)
# Your NAS Synology device suddenly lost connection to your Windows Domain Controller, and or intermittent AD connectivity issues.
# Symptoms include but not limited to:
# - Failing to rejoin after removing the account on the Domain.
# - Failing to rejoin without any changes
# - Join attempt results in = "Failed to join the Windows domain. Please check your domain and firewall settings and try again"
# - Synology is joined, but attempting to connect from domain clients results in "There are no logon servers available to service the logon request"
# - This problem happens intermittently, sometimes rebooting the Synology device allows you to rejoin (Not a solution).
# - Sometimes rebooting both Synology device and Domain Controller allows you to rejoin (Not a solution).
# 1st.) *OPTIONAL* Remove the AD Synology device from Avtice Directory Users/Computers.
@jameswebb68
jameswebb68 / gist:8014473
Last active December 31, 2015 16:38
For CYGWIN, check if windows x86_64 64-bit and windows is 7 through 8.1. redundant accurate check
# is Windows NT 6+
check-os-ver() {
local WMIC="$(wmic os get version | grep -oE ^6\.[2-3]{1})" # 6.0 - 6.3
local CYGW="$(uname -s | grep -oE 6\.[2-3]{1})" # 6.0 - 6.3
[[ -n "$WMIC" && -n "$CYGW" && "$WMIC" == "$CYGW" ]]
}
# is 64-bit windows
check-windows-arch() {
local WMIC="$(wmic OS get OSArchitecture /value | grep -o '64-bit')"
local PATH="$(cd -P "$(cygpath -W)"; cd ../Program\ Files\ \(x86\) 2>/dev/null && echo "64-bit")"
@ushkinaz
ushkinaz / cygwin-mirror-speed.py
Last active February 22, 2025 23:45
Tests HTTP mirrors of Cygwin by measuring download times.
#!/usr/bin/env python3
"""
Script to test HTTP mirrors of Cygwin by measuring download times.
Originally written in 2011, modernized in 2025.
"""
from math import floor
from urllib.request import urlopen
import argparse
import sys