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
| select-object @{ n = "propertyName"; e = { /* expression $_ */ } } |
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
| # windows 2003 向けのイベントログローテーションタスク | |
| param($logname="[logname]", $backupFolder=(&{Split-Path $MyInvocation.ScriptName})) | |
| $logfiles = Get-WmiObject win32_nteventlogfile -Filter "LogfileName='$logname'" -EnableAllPrivileges | |
| if ($logfiles -eq $null) | |
| { | |
| throw "ログファイル $logname は存在しません。" | |
| } |
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 System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Drawing; | |
| using System.Drawing.Imaging; | |
| namespace TextImage | |
| { |
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
| :: v3.5のwcfクライアントコードを生成する | |
| :: レジストリを検索して %windowsSdkDir% を設定 | |
| call "%VS100COMNTOOLS%VCVarsQueryRegistry.bat" 32bit No64bit | |
| call set path=%windowsSdkDir%bin\NETFX 4.0 Tools;%windowsSdkDir%bin;%path% | |
| :: ※HogeServiceフォルダには余分なファイルが無いこととする | |
| :: ※サービス定義の既定の名前空間を Fuga.Piyo に変換する | |
| svcutil /t:code "$(SolutionDir)etc\ServiceReference\HogeService\*.*" /async /noConfig /targetClientVersion:Version35 /namespace:http://tempuri.org/,Fuga.Piyo /out:HogeServiceProxy.cs /directory:"$(ProjectDir)ServiceProxy" |
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 func() | |
| { | |
| param ( $msgfile, [int]$lev0, [int]$lev1, [string] $from, [string]$to, [datetime] $date) | |
| $base = $spool | Join-Path -ChildPath $lev0 | Join-Path -ChildPath $lev1 | |
| # メッセージ | |
| $base | Join-Path -ChildPath "froz" | Join-Path -ChildPath $msgfile | Copy-Item | |
| # ログ | |
| $base | Join-Path -ChildPath "slog" | Join-Path -ChildPath $msgfile | Copy-Item -Destination "$msgfile.log" |
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
| :: ルートCAを作る | |
| makecert -n "CN=MY CA" -pe -cy authority -r -sv "myca.pvk" "myca.cer" | |
| :: 中間CA | |
| makecert -n "CN=MY 2 CA" -pe -cy authority -iv "myca.pvk" -ic "myca.cer" -sv "my2ca.pvk" "my2ca.cer" | |
| :: 証明書 サーバー : 1.3.6.1.5.5.7.3.1 クライアント : 1.3.6.1.5.5.7.3.2 | |
| makecert -n "CN=対象の名前" -pe -eku 1.3.6.1.5.5.7.3.1 -sky exchange -sy 12 -iv "ca.pvk" -ic "ca.cer" -sv "my.pvk" "my.cer" | |
| :: 作った証明書と秘密鍵は pvk2pfx.exe を使ってインストール用ファイルにする |
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
| HRESULT __stdcall RegisterModule( | |
| DWORD dwServerVersion, | |
| IHttpModuleRegistrationInfo* pModuleInfo, | |
| IHttpServer* pGlobalInfo | |
| ) { | |
| ::OutputDebugString ( TEXT("RegisterModule") ); | |
| HRESULT hr = S_OK; |
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
| public class MyCheckBox : CheckBox | |
| { | |
| protected override void OnInit(EventArgs e) | |
| { | |
| var _ = this.InputAttributes; | |
| base.OnInit(e); | |
| } | |
| } |
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
| private static readonly Char[] CHARS = new Char[] { | |
| 'a','b','c','d','e', | |
| 'f','g','h','i','j', | |
| 'k','l','m','n','o', | |
| 'p','q','r','s','t', | |
| 'u','v','w','x','y', | |
| 'z', | |
| '2','3','4','5','6','7' | |
| }; |
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
| curl http:// -H 'Content-type: application/x-www-form-urlencoded;charset=utf-8' -X POST -d "_method=patch" ... |
OlderNewer