-
Install Necessary Packages
yum -y install authconfig krb5-workstation pam_krb5 samba-common oddjob-mkhomedir
-
Set DNS Nameservers to Primary Domain Controller and Secondary View config like this
cat /etc/resolv.conf
and make sure the nameservers point at the domain controller IPs. -
Join Domain This will join the domain. It's multi-line for readability. You can copy/paste the whole thing into the terminal and it will work
This file contains 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
REM Delete all Websites | |
%windir%\system32\inetsrv\appcmd list site /xml | %windir%\system32\inetsrv\appcmd delete site /in | |
REM Delete all App Pools | |
%windir%\system32\inetsrv\appcmd list apppool /xml | %windir%\system32\inetsrv\appcmd delete apppool /in | |
REM Export all the Application Pools: | |
%windir%\system32\inetsrv\appcmd list apppool /config /xml > C:\apppools.xml | |
REM Import all the Application Pools: |
This file contains 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
#Check WSL Version | |
wsl -l -v | |
#Set WSL Version to 2 | |
wsl --set-version Ubuntu-22.04 2 |
This file contains 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
## https://devblogs.microsoft.com/powershell/psreadline-2-2-6-enables-predictive-intellisense-by-default ## | |
# Get Configuration | |
Get-PSReadLineOption | |
## Get Intellisense Option | |
(Get-PSReadLineOption).PredictionSource | |
# Command History Path | |
(Get-PSReadLineOption).HistorySavePath |
This file contains 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 a listing of all clusters (CLUS) | |
$clusters = Get-ADComputer -Filter "Name -like 'CLUS'" | |
#Set Domain | |
$DNSServer = (Get-ADDomain).PDCEMulator | |
#Set DNS Zone | |
$DNSZone = "dev.contoso.com" | |
#Iterate through the list of clusters get dns and add the appropriate full control objects (listener, cluster) |
This file contains 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
<? | |
//Include Predis library. See https://github.com/nrk/predis for more info | |
require "Predis/Autoloader.php"; | |
//Connect to Redis | |
Predis\Autoloader::register(); | |
try { | |
$redis = new Predis\Client(); | |
$redis = new Predis\Client(array( | |
"scheme" => "tcp", |
This file contains 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/python | |
import os | |
import sys | |
# Simplified version of: http://www.engadget.com/2016/01/31/comcast-customer-complaint-bot/ aka http://pastebin.com/WMEh802V | |
# Removed the Twitter integration and file system logging | |
# To do: Add variables and math so the speeds are not hard coded and are based off a percent calculation | |
def speedbot(): | |
#Run speedtest-cli (pip install speedtest-cli, assumes it's in your system path) |
This file contains 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
Import-Module WebAdministration | |
# Add Custom Header - Server Level | |
Add-WebConfigurationProperty -PSPath MACHINE/WEBROOT/APPHOST ` | |
-Name . -Filter system.webServer/httpProtocol/customHeaders ` | |
-AtElement @{name = "X-Custom" ; value = 'value' } | |
#Remove Server: Microsoft-IIS/10.0 Header | |
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.webServer/security/requestFiltering" -name "removeServerHeader" -value "True" |
This file contains 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
$configFiles = Get-ChildItem C:\YourDirectory *.config -Recurse | |
foreach ($file in $configFiles) | |
{ | |
$content = [System.IO.File]::ReadAllText($file.FullName).Replace('foo','bar') | |
[System.IO.File]::WriteAllText($file.FullName, $content) | |
} |
This file contains 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
[guid]::NewGuid().toString().ToUpper() |