| 拡張子 | 説明 |
|---|---|
.key |
秘密鍵や公開鍵を含むファイル。鍵はPEMかDER形式で保存されている。.pemや.derを使うこともある。 |
.pem |
PEM形式の証明書や秘密/公開鍵のファイル。 |
.der |
DER形式の証明書や秘密/公開鍵のファイル。 |
.csr |
証明書署名要求(CSR)ファイル。公開鍵と組織情報を含む |
.crt, .cer, .cert |
証明書ファイル。.csrを署名したもの。.pemや.derを使うこともある。 |
.pfx, .p12 |
秘密鍵 + 証明書。秘密鍵をパスワードで保護できる。Windowsでよく使われる。 |
.jks |
秘密鍵 + 証明書。Javaで使用されるキーストアファイル。 |
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 -RunAsAdministrator | |
| param ( | |
| [Parameter(Mandatory=$true)] | |
| [string] | |
| $IdentityServerHost | |
| ) | |
| $OutputEncoding = "utf-8" | |
| $ErrorActionPreference = "Stop" |
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 Invoke-AsAdmin() { | |
| if($args.count -eq 0){ | |
| Start-Process -Verb runas powershell | |
| } | |
| else { | |
| Start-Process -Verb runas -ArgumentList @('-command', "cd $(Get-Location); $($args -join ' ')") powershell | |
| } | |
| } | |
| Set-Alias -Name sudo -Value Invoke-AsAdmin -Option None |
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 Get-MediaContent { | |
| param ( | |
| [Parameter(Mandatory=$true)] | |
| [string]$Path | |
| ) | |
| if (-not (Test-Path $Path)) { | |
| return $null | |
| } | |
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
| using namespace Sitecore.Data | |
| using namespace Sitecore.Data.Items | |
| using namespace Sitecore.Globalization | |
| using namespace Sitecore.Resources.Media | |
| using namespace Sitecore.Sites | |
| using namespace Sitecore.Security.Accounts | |
| using namespace Sitecore.SecurityModel | |
| using namespace System.IO | |
| function Edit-Item { |
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 Get-TypeInfo { | |
| param ( | |
| [Parameter(Mandatory=$true)][string]$TypeName | |
| ) | |
| $block = if ($TypeName.StartsWith("[") -and $TypeName.EndsWith("]")) { | |
| [ScriptBlock]::Create($TypeName) | |
| } | |
| else { | |
| [ScriptBlock]::Create("[$TypeName]") |
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 Get-HtmlContent($url) | |
| { | |
| Invoke-WebRequest $url ` | |
| | Select-Object -ExpandProperty Content ` | |
| | ForEach-Object {$_.Split([Environment]::NewLine, [StringSplitOptions]::RemoveEmptyEntries)} | |
| } | |
| function Compare-WebResponse($url1, $url2) { | |
| $html1 = Get-HtmlContent $url1 | |
| $html2 = Get-HtmlContent $url2 |
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
| const MUTE_TEXTS = [ | |
| 'FOO', | |
| 'BAR', | |
| 'BAZ', | |
| ]; | |
| const getText = (node) => [...node.childNodes] | |
| .filter(n => n.nodeType === Node.TEXT_NODE) | |
| .reduce((acc, n) => acc += n.nodeValue, ''); | |
| const shouldMute = (node) => MUTE_TEXTS.some(text => getText(node).includes(text)); |
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
| <# | |
| .SYNOPSIS | |
| PowerShell script to rename extension of files in a specified directory. | |
| .EXAMPLE | |
| PS> Rename-Extension -Path . -ExtensionFrom txt -ExtensionTo md -Recurse | |
| .PARAMETER Path | |
| Folder that contains the file to be renamed |
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 Join-LineNumbers { | |
| [CmdletBinding()] | |
| param( | |
| [Parameter(Mandatory=$True, | |
| ValueFromPipeline=$True)] | |
| [string[]]$Lines | |
| ) | |
| begin { | |
| $private:i = 1 |