Skip to content

Instantly share code, notes, and snippets.

Avatar

the-takeo the-takeo

View GitHub Profile
View GoogleChrome_Enable_Popup_AlwaysPermit.bat
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome" /v "ExternalProtocolDialogShowAlwaysOpenCheckbox" /t "REG_DWORD" /d "1" /f
View ReplaceSSL.bat
REM Powershellで「dir cert:\LocalMachine\My」を実行し、証明書の拇印を取得して下記に設定する。
REM 新しいもの(差し替えるもの)と古いもの(差し替えられるもの)の両方の捺印が必要。
set OldThumbprint="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
set NewThumbprint="YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"
set pfxFileName="ssl.pfx"
certutil -f -p パスワード -importpfx "WebHosting" "%~dp0%pfxFileName%"
cd %windir%\system32\inetsrv
View LineNotify.cs
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
namespace LineNotifyForFamily
{
public static class LineNotify
View SendMail.vbs
Option Explicit
Dim mFrom
Dim mTo
Dim SmtpSvr
mFrom = "From@From.com"
mTo = "To@To.com"
SmtpSvr = "SmtpServer"
View GetDeadLock.bat
SET FLD=%~dp0
SET TXT_DEADLOCK=DeadLock.txt
If not Exist %FLD% mkdir %FLD%
del %FLD%\%TXT_DEADLOCK%
bcp "SELECT * FROM sys.fn_xe_file_target_read_file('C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\DeadLock*.xel', 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\DeadLock*.xem', null, null)" queryout "%FLD%\%TXT_DEADLOCK%" -T -c
View WindowsUpdate.vbs
Option Explicit
Dim updateSession, updateSearcher, update, searchResult, downloader, updatesToDownload, updatesToInstall, installer, installationResult, InputKey, i
If Right((LCase(WScript.FullName)),11) <> "cscript.exe" then
WScript.Echo "このスクリプトはCSCRIPT.EXEを使用して実行して下さい。" & _
vbCRLF & "例: cscript WindowsUpdate.vbs"
WScript.Quit(0)
End if
WScript.Echo "------------------------------"
View SyncMyDNS.vbs
Option Explicit
On Error Resume Next
Const strURL = "http://www.mydns.jp/login.html"
Const strUser = "ユーザー名"
Const strPasswd = "パスワード"
Dim objXML
Dim strXMLDoc
Dim intRet
View SyncMyDNS.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>SyncMyDNS</string>
<key>ProgramArguments</key>
<array>
<string>curl</string>
<string>-l</string>
View FormMover.cs
static class FormMover
{
static double Max = 8;
static double MaxExp = Math.Exp(Max);
static public void WipeUp(Form Frm, int MovingTime, int WaitTimeForMoving, bool Fade)
{
System.Threading.Thread.Sleep(WaitTimeForMoving);
You can’t perform that action at this time.