Skip to content

Instantly share code, notes, and snippets.

Øyvind Kallstad gravejester

Block or report user

Report or block gravejester

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View tokengroups.ps1
function Get-ADUserTokenGroups {
[CmdletBinding()]
param (
[Parameter(Position = 0, ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[Alias('u','User')]
[string] $ADUserName = $env:USERNAME
)
try {
Add-Type -AssemblyName System.DirectoryServices.AccountManagement
View GetCertInfo.sh
DNS_NAME="some.domain.tld"
openssl s_client -connect ${DNS_NAME}:443 -servername ${DNS_NAME} 2>/dev/null </dev/null | openssl x509 -noout -dates -issuer -subject
View Get-CertInfoHttp.ps1
function Get-CertInfoHttp {
[CmdletBinding()]
param (
[Parameter(Position = 0, Mandatory)]
[string] $URL,
[Parameter()]
[switch] $ReturnCertificate
)
View Get-CertInfoTcp.ps1
function Get-CertInfoTcp {
[CmdletBinding()]
param (
[Parameter(Position = 0, Mandatory)]
[string] $ComputerName,
[Parameter(Position = 1)]
[int] $Port = 443,
[Parameter()]
View AzureAuth4.sh
#!/bin/bash
SP_NAME=$1
SP_PW=$2
SP_TENANT=$3
# Authenticate to Azure
if [ -z "$SP_NAME" ] || [ -z "$SP_PW" ] || [ -z "$SP_TENANT" ]
then
LOGIN_RESULT=$(az login)
View AzureAuth3.bat
@echo off
IF [%1]==[] (
IF [%2]==[] (
IF [%3]==[] (
az login
)
)
) ELSE (
az login --username %1 --password %2 --tenant %3 --service-principal
)
View AzureAuth2.ps1
[System.Diagnostics.CodeAnalysis.SuppressMessage('AvoidUsingPlainTextForPassword', '', Target='ProcessParameter')]
[CmdletBinding()]
param (
[Parameter()]
[Alias('SPName','Username','un')]
[string] $ServicePrincipalName,
[Parameter()]
[Alias('SPPassword','Password','pw')]
[string] $ServicePrincipalPassword,
View AzureAuth.ps1
[CmdletBinding(DefaultParameterSetName = 'Credential')]
param (
[Parameter(ParameterSetName = 'Credential')]
[System.Management.Automation.PSCredential] $Credential,
[Parameter(ParameterSetName = 'ClearText')]
[string] $ApplicationId,
[Parameter(ParameterSetName = 'ClearText')]
[string] $Password,
View vscode-textmate
adm cmd:
install node for windows
- node v6.10.3
- npm 3.10.10
cd c:\..\..\EditorSyntax
npm init
View Update-AzureRmTag.ps1
function Update-AzureRmTag {
[CmdletBinding()]
param (
[Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName, Position = 0)]
[string[]] $ResourceId,
[Parameter()]
[hashtable] $Tags = [hashtable]::new()
)
You can’t perform that action at this time.