- Don’t hide URL content / display what’s used: chrome://flags/#omnibox-ui-hide-steady-state-url-scheme-and-subdomains
- Don’t take up 2 rows for the title bar; go back to 1: chrome://flags/#top-chrome-md
This file contains hidden or 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
| { | |
| "source": 2, | |
| "revision": 4, | |
| "description": null, | |
| "createdBy": { | |
| "displayName": "JohnLBevan", | |
| "url": "https://app.vssps.visualstudio.com/A21454791-1e23-49e8-a35c-2389fa06a325/_apis/Identities/e2a7ca55-8633-4c52-9d34-8fb1a6f00aef", | |
| "_links": { | |
| "avatar": { | |
| "href": "https://myCompany.visualstudio.com/_apis/GraphProfile/MemberAvatars/aad.MGQxMzkxMjItNjNjNy03MmViLWI3Y2QtM2EwMmRhZWEwYjc4" |
This file contains hidden or 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
| create table dbo.ValidPasswordChars | |
| ( | |
| IdConsecutiveSeedZero int not null identity(0,1) primary key clustered --as the name suggests; don't leave gaps. | |
| , aChar char(1) collate Latin1_General_CS_AS not null | |
| ) | |
| go | |
| --This creates the valid passwords as 0-9, a-z, A-Z. Other characters can easily be added as needed; the table approach has been used to avoid hardcoding valid chars / relying on ascii ranges where the related system may not allow specific values within those ranges | |
| ;with cte(asciiCode) as |
This file contains hidden or 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
| function Convert-XmlToHash { | |
| [CmdletBinding(DefaultParameterSetName = 'XmlDocument')] | |
| Param ( | |
| [Parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = 'XmlDocument')] | |
| [System.Xml.XmlDocument]$XmlDocument | |
| , | |
| [Parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = 'XmlElement')] | |
| [System.Xml.XmlElement]$InputObject | |
| , | |
| [Parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = 'XmlText')] |
This file contains hidden or 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
| function Convert-XmlToHash { | |
| [CmdletBinding(DefaultParameterSetName = 'XmlDocument')] | |
| Param ( | |
| [Parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = 'XmlDocument')] | |
| [System.Xml.XmlDocument]$XmlDocument | |
| , | |
| [Parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = 'XmlElement')] | |
| [System.Xml.XmlElement]$InputObject | |
| , | |
| [Parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = 'XmlText')] |
This file contains hidden or 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
| clear-host | |
| $data = Invoke-RestMethod -Method Get -Uri 'https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes' | |
| $a = $data.SelectNodes('//*[local-name() = ''table''][./@class=''wikitable sortable'']//*[local-name() = ''tbody'']//*[local-name() = ''tr''][./*[local-name() = ''td'']]') | %{ | |
| [pscustomobject]@{ | |
| Name = $_.SelectSingleNode('(./*[local-name() = ''td''][1])[1]').InnerText -replace '^\s+','' -replace '\s+$','' | |
| FullName = $_.SelectSingleNode('(./*[local-name() = ''td''][2])[1]').InnerText -replace '^\s+','' -replace '\s+$','' | |
| Alpha2 = $_.SelectSingleNode('(./*[local-name() = ''td''][4])[1]').InnerText -replace '^\s+','' -replace '\s+$','' | |
| Alpha3 = $_.SelectSingleNode('(./*[local-name() = ''td''][5])[1]').InnerText -replace '^\s+','' -replace '\s+$','' | |
| Num = $_.SelectSingleNode('(./*[local-name() = ''td''][6])[1]').InnerText -replace '^\s+','' -replace '\s+$','' | |
| } |
This file contains hidden or 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
| <# | |
| Since we have a few systems which can't ues .Net or Java libraries; but rather rely on raw | |
| HTTP requests/response behaviour, I needed to find a way to demonstrate how to connect to | |
| O365 services without making use of Microsoft.IdentityModel.Clients.ActiveDirectory.dll | |
| An alternative approach is to use a client secret; however we didn't have access to this / | |
| had to work out a quick solution to progress with PoC work using the information available to us | |
| The below code effectively simulates this call: | |
This file contains hidden or 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
| <# | |
| Since we have a few systems which can't ues .Net or Java libraries; but rather rely on raw | |
| HTTP requests/response behaviour, I needed to find a way to demonstrate how to connect to | |
| O365 services without making use of Microsoft.IdentityModel.Clients.ActiveDirectory.dll | |
| An alternative approach is to use a client secret; however we didn't have access to this / | |
| had to work out a quick solution to progress with PoC work using the information available to us | |
| The below code effectively simulates this call: | |
This file contains hidden or 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
| #requires -Version 2 | |
| #based on Out-Notepad script from http://community.idera.com/powershell/powertips/b/tips/posts/send-text-to-notepad; only amended to allow appending. | |
| function Out-Application { | |
| [CmdletBinding(DefaultParameterSetName = 'ByString')] | |
| Param ( | |
| [Parameter(Mandatory=$true, ValueFromPipeline=$true, ParameterSetName = 'ByString')] | |
| [AllowEmptyString()] | |
| [String]$InputString | |
| , |
This file contains hidden or 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
| [pscustomobject[]]$data = Get-Content 'C:\Program Files (x86)\FileZilla Server\Logs\fzs-2018-08-20.log' | | |
| ?{$_ -match '^\((?<session>\d+)\)\s(?<datetime>\d\d\/\d\d\/\d{4} \d\d:\d\d:\d\d) - (?<user>.+?) \((?<ip>\d+\.\d+\.\d+\.\d+)\)>\s(?<message>.*)$'} | | |
| %{[pscustomobject]@{ | |
| Session = $matches.Session | |
| Ip = $matches.Ip | |
| Server = [System.Net.Dns]::Resolve($matches.Ip).HostName | |
| User = $matches.User | |
| DateTime = [DateTime]::ParseExact($matches.DateTime,'dd/MM/yyyy HH:mm:ss',$null) | |
| Message = $matches.Message | |
| }} |