This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# temporary fix for Cygwin 1.7.32 - 1.7.33+ and bind-utils | |
# rolls windows builtin nslookup into bash function | |
# outputs exactly how bind-utils output so that host calls in other places don't break | |
# source this file, roll your own, or insert into existing shell scripts | |
# quick and dirty, but effective, untested on zsh and ash | |
# Jon Retting @ 10/26/2014 | |
#TEMP host.exe fix for output | |
# check to make sure ip is valid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# open explorer directory relative, absolute or empty for current path | |
open() { | |
local var="$1" | |
[[ -z "$var" ]] && cygstart -x "$(cygpath -wa "$PWD")" | |
if [[ "${var:0:1}" == "/" ]]; then | |
[[ -d "$var" ]] || { echo "bad path"; return 1; } | |
cygstart -x "$(cygpath -wa "$var")" | |
elif [[ "${var:0:3}" == "../" ]]; then | |
[[ -d "$(cd "$var" 2>/dev/null && pwd)" ]] || { echo "bad path"; return 1; } | |
cygstart -x "$(cygpath -wa "$(cd "$var"; pwd)")" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#get file details from windows via wmic wmi formatted call | |
finfo() { | |
[[ -e "$(cygpath -wa "$@")" ]] || { echo "bad-file"; return 1; } | |
echo "$(wmic datafile where name=\""$(echo "$(cygpath -wa "$@")" | sed 's/\\/\\\\/g')"\" get /value)" |\ | |
sed 's/\r//g;s/^M$//;/^$/d' | awk -F"=" '{print $1"=""\033[1m"$2"\033[0m" }' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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")" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Tests http mirrors of cygwin | |
""" | |
import random | |
import time | |
from urllib.request import urlopen | |
import sys | |
__author__ = 'Dmitry Sidorenko' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run-parts: Runs all the scripts found in a directory. | |
# keep going when something fails | |
set +e | |
if [ $# -lt 1 ]; then | |
echo "Usage: run-parts <directory>" | |
exit 1 | |
fi |