Skip to content

Instantly share code, notes, and snippets.

View ryancbutler's full-sized avatar

Ryan Butler ryancbutler

View GitHub Profile
@ryancbutler
ryancbutler / main.tf
Created July 6, 2022 13:56
Citrix ADC license example
terraform {
required_version = ">= 1.0.0"
required_providers {
citrixadc = {
source = "citrix/citrixadc"
version = "1.17.0"
}
}
}
@ryancbutler
ryancbutler / man.tf
Created July 5, 2022 16:10
ADC with Terraform
terraform {
required_version = ">= 1.0.0"
required_providers {
vsphere = {
source = "hashicorp/vsphere"
version = "~> 2.0.2"
}
random = {
source = "hashicorp/random"
version = ">= 3.1.0"
#Grabs MaxClients from HTTPD.CONF
export MAXCLIENTS=$(grep "^MaxClients" /etc/httpd.conf | awk '{print $2}')
nsapimgr_wr.sh -ys maxclientForHttpdInternalService=$MAXCLIENTS
touch /nsconfig/rc.netscaler
chmod a+x /nsconfig/rc.netscaler
echo "nsapimgr_wr.sh -ys maxclientForHttpdInternalService=$MAXCLIENTS" >> /nsconfig/rc.netscaler
@ryancbutler
ryancbutler / prunegit.ps1
Created October 14, 2021 14:49
Prune Windows Git Branches
git remote update origin --prune; git branch -vv | Select-String -Pattern ": gone]" | % { $_.toString().Trim().Split(" ")[0]} | % {git branch -D $_}
$url = "http://192.168.2.250/vmwaretools/VMware%20Tools64-NOVMCHECk.msi"
$filename = "VMwareTools64-NOVMCHECk.msi"
#Update VM Tools
#$UnattendedArgs = '/S /v /qn REBOOT=R'
$filepath = "$($env:SystemRoot)\temp"
Invoke-WebRequest -Uri $url -OutFile "$filepath\$filename" -UseBasicParsing
$DataStamp = get-date -Format yyyyMMddTHHmmss
https://owncloud.ryancbutler.com/index.php/s/S7WAzo8E5EsrnYS/download
<?xml version="1.0" encoding="UTF-8"?>
<!--
AWS Instance Types
This configuration file describes the AWS instance types.
AWS instance types are documented by Amazon, but they are not available through the API, so XenDesktop services
are unable to discover them dynamically at run time. This configuration file stores the descriptions in such a way
that they can be ammended manually.
#!/usr/bin/bash
nscli -U 127.0.0.1:nsroot:nsroot enable ns feature responder
nscli -U 127.0.0.1:nsroot:nsroot add responder action respondwith403 respondwith '"\"HTTP/1.1 403 Forbidden\r\n\r\n\""'
nscli -U 127.0.0.1:nsroot:nsroot add responder policy ctx267027 '"HTTP.REQ.URL.DECODE_USING_TEXT_MODE.CONTAINS(\"/vpns/\") && (!CLIENT.SSLVPN.IS_SSLVPN || HTTP.REQ.URL.DECODE_USING_TEXT_MODE.CONTAINS(\"/../\"))"' respondwith403
nscli -U 127.0.0.1:nsroot:nsroot bind responder global ctx267027 1 END -type REQ_OVERRIDE
#Requires -Version 3.0
# Configure a Windows host for remote management with Ansible
# -----------------------------------------------------------
#
# This script checks the current WinRM (PS Remoting) configuration and makes
# the necessary changes to allow Ansible to connect, authenticate and
# execute PowerShell commands.
#
# All events are logged to the Windows EventLog, useful for unattended runs.
$download = Invoke-WebRequest -UseBasicParsing -Uri ("https://www.citrix.com/downloads/workspace-app/windows/workspace-app-for-windows-latest.html") -SessionVariable websession
$href = $download.Links|Where-Object {$_.rel -like "*CitrixWorkspaceApp.exe*"}
$DLurl = "https:" + $href.rel
Invoke-WebRequest -Uri ($DLurl) -WebSession $websession -UseBasicParsing -OutFile "C:\temp\CitrixWorkspaceApp.exe" -Verbose
$version = $download.RawContent | Select-String '(?<=.*<p>Version:&nbsp;).+?(?=<\/p>.*)' -AllMatches | ForEach-Object { $_.Matches.Value } | Select-Object -Unique