Skip to content

Instantly share code, notes, and snippets.

@istairbn
istairbn / New-RequestsCacertsFile.ps1
Created June 23, 2022 14:23
For a Windows machine, generates a Cacerts file that can be used by Requests and Python
<#
.SYNOPSIS
Generate a cacerts.crt file. This allows you to use Requests with an SSL Termination proxy your machine already trusts
#>
[CmdletBinding()]
Param(
$Path = "C:\Tools\cacerts.crt"
)
$Output = ""
$Certs = Get-ChildItem -Path Cert:\CurrentUser\Root
@istairbn
istairbn / comodocrtcitrix.sh
Created December 26, 2021 15:11
Adds the Comodo Cert to Citrix Workspace location, so you can use Thomson Reuters applications.
#!bin/bash
# Adds the Comodo Cert to Citrix Workspace location, so you can use Thomson Reuters applications.
curl https://support.comodo.com/index.php?/Knowledgebase/Article/GetAttachment/969/821026 >> /opt/Citrix/ICAClient/keystore/cacerts/Comodo.pem
<#
.SYNOPSIS
CSV_Filter takes a CSV and returns a new one based off a filter
.DESCRIPTION
A simple script to return a filtered CSV. The matching is wildcard (so X will find X AND exhibit)
Please note this is not robust. If you give it a column that doesn't exist, output is empty. It will fail if the input CSV doesn't exist
.PARAMETER Input_CSV
The path to the CSV you want to ingest and filter. You must specify this.
@istairbn
istairbn / Datadog-Installer.ps1
Created January 3, 2018 11:13
PowerShell script to automatically install the latest version of Datadog on a Windows Host
<#
.SYNOPSIS
This PowerShell script is designed to install the latest Datadog agent seamlessly on windows
.PARAMETER APIKey
The API Key for your datadog installation. Contact support if you don't have one!
.PARAMETER Location
Where the MSI should be dropped. Defaults to C:\Windows\temp
@istairbn
istairbn / SSM-Install-Datadog.json
Created January 2, 2018 15:22
AWS SSM Template for Installing Datadog. Uses personal branch of installer to deal with the args issue
{
"schemaVersion":"2.2",
"description":"Installs Datadog.",
"parameters":{
"workingDirectory":{
"type":"String",
"default":"/tmp",
"description":"(Optional) The path to the working directory on your instance.",
"maxChars":4096
},
@istairbn
istairbn / SSM-Install-Instana.json
Created January 2, 2018 15:19
AWS SSM Template for installing Instana on Linux
{
"schemaVersion":"2.2",
"description":"Installs Instana.",
"parameters":{
"workingDirectory":{
"type":"String",
"default":"/tmp",
"description":"(Optional) The path to the working directory on your instance.",
"maxChars":4096
},
@istairbn
istairbn / Generate-XLRSupportPackage.ps1
Last active July 28, 2017 13:15
A PowerShell script to generate a Support Package for XL Release. Since the service needs to be stopped to collect the data before it can be zipped and shipped.
[CmdletBinding()]
<#
.SYNOPSIS
This script builds an XL Release support package. it is designed to be used when you run as a service, since Windows locks certain key files.
.PARAMETER PackageName
The name of the output zip
.PARAMETER TempName
The Name of the temporary file generated (defaults to GetDate)
print("Hello World")
@istairbn
istairbn / JSONOctalPerms.sh
Last active May 16, 2017 10:26
Outputs a JSON file with the relative path as the key and the octal permissions as the value
#!/bin/bash
#If path given as argument, that is used as the starting point. Else it starts from .
if [ -z "$1" ]; then
1="."
fi
echo "{"
SEP=""
find "${1}" | while read DIR
do
stat "${DIR}" -c "$SEP\"%n\":\"%a\""
@istairbn
istairbn / Uninstall-Program.ps1
Created March 22, 2017 13:29
PowerShell funciton to uninstall a list of programs by display name
Function Uninstall-Program{
<#
.SYNOPSIS
Uninstalls Windows Programs using display name
.Parameter DisplayName
String match for the programs to uninstall. Accepts pipeline input
#>
[CmdletBinding()]
Param(