Skip to content

Instantly share code, notes, and snippets.

View tckz's full-sized avatar
🌵

tckz

🌵
View GitHub Profile
@tckz
tckz / gist:552821
Created August 27, 2010 05:00
ktpassメモ
AESでktpass
ktpass -princ HTTP/somehost.example.com@EXAMPLE.COM -mapuser http-somehost -crypto AES256-SHA1 -ptype KRB5_NT_SRV_HST +rndPass -out somehost.keytab
RC4でktpassして2008 DCに対してkinitするとき
[libdefaults]
default_tkt_enctypes = rc4-hmac
default_tgs_enctypes = rc4-hmac
kinit(v5): Key table entry not found while getting initial credentials
@tckz
tckz / save_as_html.ps1
Created July 27, 2010 10:03
powershellでword文書をhtml一括保存
[reflection.assembly]::LoadWithPartialName("Microsoft.Office.Interop.Word") | out-null
$word = new-object Microsoft.Office.Interop.Word.ApplicationClass
$word.Visible = $true
foreach($arg in $args)
{
foreach($doc in (Get-Item $arg))
{
$fn_doc = $doc.FullName
$word_doc = $word.Documents.Open($fn_doc, $false, $false)
@tckz
tckz / standby.ps1
Created March 31, 2010 04:22
Enter standby state.
[reflection.assembly]::LoadWithPartialName("System.Windows.Forms") | out-null
[System.Windows.Forms.Application]::SetSuspendState([System.Windows.Forms.PowerState]::Suspend, $false, $false);
@tckz
tckz / authorized_keys
Created March 4, 2010 02:49
svn+sshでsvn専用アカウントの authorized_keys
command="svnserve -t -r /path/to/svn/repos --tunnel-user=som@example.com",no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAA~~公開鍵の内容~~+DD2YeMmkOv0bCiL+w== some@example.com
@tckz
tckz / fetch_repos.sh
Created March 4, 2010 02:47
redmineのリポジトリ更新cronジョブ
#!/bin/sh
myname=`basename $0`
pid=$$
(
echo "fetch repos." 1>&2
cd /path/to/redmine/rails_root
env LANG=ja_JP.UTF-8 ruby script/runner "Repository.fetch_changesets" -e production
@tckz
tckz / memo.ps1
Created December 9, 2009 07:35
Powershell+WMIでDNS操作
$dns = gwmi -Class MicrosoftDNS_server -Namespace Root\MicrosoftDNS -ComputerName DCコンピュータ名
$rrs = gwmi -Class MicrosoftDNS_ResourceRecord -Namespace Root\MicrosoftDNS -ComputerName DCコンピュータ名
@tckz
tckz / change_mirror_state.ps1
Created December 8, 2009 09:50
SQLserverのデータベースミラーリングのフェイルオーバー
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | out-null
$server = new-object Microsoft.SqlServer.Management.Smo.Server("プリンシパルサーバ")
$db = $server.Databases["mirrortest"]
$db.ChangeMirroringState([Microsoft.SqlServer.Management.Smo.MirroringOption]::Failover)
@tckz
tckz / buiid.bat
Created September 11, 2009 02:02
OmegaTの訳文ファイル生成をコマンドラインで
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_15
set OMEGAT_HOME=c:\Program Files\OmegaT
cmd /c c:\path\to\ant\bin\ant.bat
pause
@tckz
tckz / approve_update.ps1
Created July 1, 2009 07:12
条件に合致したIUpdateをインストール承認する
param([switch]$nomail)
trap [Exception] {
$t = $error[0].ToString().Trim() + "`n" + $error[0].InvocationInfo.PositionMessage.Trim()
[Diagnostics.EventLog]::WriteEntry("approve_update", $t, "Error", 1)
}
[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null
$update_server = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer()
$update_server.PreferredCulture ="ja"
@tckz
tckz / registry.js
Created June 30, 2009 09:36
jscriptでレジストリ参照(リモート可)
var Registry = function () {
this.initialize.apply(this, arguments);
};
Registry.prototype = {
initialize: function(computer) {
var locator = new ActiveXObject("WbemScripting.SWbemLocator");
var server = locator.ConnectServer(computer, "root\\default");
this.stdregprov = server.Get("StdRegProv");