This file contains 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
# make many directories | |
cd ~\test | |
for ($i=0; $i -lt 100; $i++) { | |
New-Item $i\00 -type directory | Out-Null | |
New-Item $i\99 -type directory | Out-Null | |
} | |
# create files and tweak modify-date if file number is even. | |
function CreateNewFiles($path) | |
{ |
This file contains 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
Sub findCell2RowCopy() | |
Dim findString As Variant | |
Dim firstAddress As String | |
Dim findResultCell As Range | |
Dim oldSheet As Worksheet | |
Dim destinationSheet As Worksheet | |
Dim destinationRowNumber As Long | |
Set oldSheet = activeSheet | |
destinationRowNumber = 1 |
This file contains 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
@implementation NSArray(ValueAtIndex) | |
- (NSArray *)valueAtIndex:(NSUInteger)index | |
{ | |
NSMutableArray *array = [NSMutableArray array]; | |
for (NSArray *a in self) | |
if (a.count >= index + 1) | |
[array addObject:a[index]]; | |
return [NSArray arrayWithArray:array]; | |
} | |
@end |
This file contains 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
" NeoBundle | |
set nocompatible | |
filetype plugin indent off | |
if has('vim_starting') | |
let g:neobundle#types#git#default_protocol = has('gui_win32') ? 'https' : 'git' | |
set runtimepath+=~/vimfiles/bundle/neobundle.vim/ | |
endif | |
call neobundle#rc(expand('~/vimfiles/bundle/')) | |
let g:neobundle#default_options._ = { 'verbose' : 1, 'focus' : 1 } |
This file contains 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
# Get local wsus object. | |
[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null | |
$WsusServerAdminProxy = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer(); | |
# Decline itanium updates. | |
$ItaniumUpdates = $WsusServerAdminProxy.GetUpdates() | ?{-not $_.IsDeclined -and $_.Title -match "IA64|Itanium" -and $_.Title -notmatch "x86|x64"} | |
If ($ItaniumUpdates) { | |
$ItaniumUpdates | %{$_.Decline()} | |
} |
This file contains 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
host = "192.168.0.1" | |
user = "user" | |
password = "password" | |
batch_path = "C:\Users\user\echo.bat" | |
Const WbemAuthenticationLevelPktPrivacy = 6 | |
Set objWbemLocator = CreateObject("WbemScripting.SWbemLocator") | |
Set objWMIService = objWbemLocator.ConnectServer(host, "root\cimv2", user, password, "", "") | |
objWMIService.Security_.authenticationLevel = WbemAuthenticationLevelPktPrivacy | |
Set objWin32_Process = objWMIService.Get("Win32_Process") |
This file contains 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
$json = @" | |
{ | |
"matcher": | |
[ | |
{ | |
"regexp" : "^re$", | |
"dest" : "dest1" | |
}, | |
{ | |
"regexp" : "^h\\w+eほげ.{3}我$", |
This file contains 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
# http://gallery.technet.microsoft.com/scriptcenter/101ebd1a-effe-4a89-9c38-7673fa4d1687 | |
$domain = [directoryServices.ActiveDirectory.Domain]::GetComputerDomain() | |
$domain.FindAllDomainControllers() |
This file contains 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
Configuration ServerSetup | |
{ | |
param | |
( | |
[string[]] | |
$Node | |
) | |
Node $Node | |
{ |
This file contains 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
#!/usr/bin/env python | |
import logging | |
import urllib2 | |
import hmac | |
import hashlib | |
import base64 | |
import time | |
import datetime | |
import sys |
OlderNewer