Skip to content

Instantly share code, notes, and snippets.

View RafPe's full-sized avatar
🎯
Focusing

Rafal Pieniazek RafPe

🎯
Focusing
View GitHub Profile
$tfsurl = 'https://tfs.someservername:8088/tfs/SomeAwesomeCollection'
$username = 'administrator'
$domain = 'MyCompany'
$password = 'Password1'
# Create URI
$tfs_uri = [System.Uri]::new( $tfsurl )
$folder4Logs = "X:\AdvancedIISLogs"
$LogRotateFreq = "Hourly" # Change to your desired frequency
#Check if we have folder for our logs - if not create one
if(!(Test-Path $folder4Logs))
{
# Create such a directory
New-Item -ItemType Directory -Path X:\ -Name AdvancedIISLogs
}
# Function which allows for quick set/get of app pool property - make sure you have the newest one :)
# available @ https://gist.github.com/RafPe/77d2ff28f7a0014bf0f1
function Invoke-AppPoolSetting
{
<#
.SYNOPSIS
Gets or sets application pool setting
.PARAMETER appPoolName
function Get-RemoteRequiredFunctions
{
<#
.SYNOPSIS
Gets required functions
.PARAMETER functionName
this is object type data coming via pipeline
@RafPe
RafPe / CustomizeMaintanancePage.ps1
Created August 15, 2015 19:18
Customizes variables in format {COUNTRY_locale_Property} i.e. {ES_es-ES_DayOfWeek}
# We load our maintanance page
$maintanancePage = Get-Content -Raw "C:\Users\rafpe\Desktop\index.html"
# we define our countries
$pageCountries= @( @{country="NL";locale=@("nl-NL","en-US")}, `
@{country="BE";locale=@("nl-BE","fr-BE","de-DE","en-US")},`
@{country="FR";locale=@("fr-FR")},`
@{country="DE";locale=@("de-DE")},`
@{country="UK";locale=@("en-GB")},`
@{country="US";locale=@("en-US")}
@RafPe
RafPe / CapitalizeFirstCharacter.ps1
Last active September 1, 2015 11:53
If you need to change first character in proper way
$variableToChange = "all lowercase"
$result = -join ($variableToChange.Substring(0,1).ToUpper() ,$variableToChange.Substring(1,$variableToChange.Length-1 ) )
@RafPe
RafPe / logstash_config_simple.conf
Last active September 28, 2015 18:33
This is simple logstash config file just to get you quickly up and running especially when testing with Docker
input {
tcp {
port => 25826
type => syslog
}
udp {
port => 25826
type => syslog
}
}
@RafPe
RafPe / azure_arm_4vms.ps1
Created September 29, 2015 09:26
Azure ARM deployment creating 4 VMs from which one has static IP address (as we will use it later for DC configuraitons ). There is no availability set and only first VM has public IP address.
#region Setup subscription and script variables
## Get up your credentials (only if using Azure AD )
# credentialSubscription = Get-Credential
# Add-AzureAccount -Credential
## Enable debugging ?
# $DebugPreference ='Continue'
@RafPe
RafPe / AD_cookie_sync.ps1
Created October 23, 2015 11:16
Synchronize AD changes with synchronization cookie and PowerShell
@RafPe
RafPe / elkstack_prep.sh
Last active November 30, 2015 20:09
Bash script to automate required actions for deploying whole docker ELK stack. ( update to http://rafpe.ninja/2015/10/04/docker-compose-elk-automated-setup/ ).Shortened to http://git.io/vBPqC
#!/bin/bash
dir=`pwd`
if [ $# -lt 1 ]; then
echo "Please specify clustername"
exit
fi
sudo mkdir -p ${dir}/elasticsearch/data