Skip to content

Instantly share code, notes, and snippets.

View hymkor's full-sized avatar

HAYAMA_Kaoru hymkor

View GitHub Profile
@hymkor
hymkor / file1.txt
Created September 13, 2014 12:55
EXEファイルのバージョン情報を表示(IronPython) ref: http://qiita.com/zetamatta/items/5ea10add126971ae31a6
<MARKEDONE:~/bin>
✏ showver lua52.dll
5.2.3 5.2.3
@hymkor
hymkor / hostip.cmd
Created September 18, 2014 02:01
ゲストOSからホストOSのIPアドレスを確実に得るにはどうすればいいんだ。みんなの知恵をわけてくれ ref: http://qiita.com/zetamatta/items/73b294ba923f479b9907
::rem:: --[[ vim:set ft=lua:
@lua "%~f0" %1 %2 %3 %4 %5 %6 %7 %8 %9 & exit /b
]]--
function getGateway()
local ipconfig = io.popen("ipconfig","r")
for line in ipconfig:lines() do
local m = line:match("デフォルト.*%s([0-9]+%.[0-9]+%.[0-9]+%.[0-9]+)")
if m then
ipconfig:close()
@hymkor
hymkor / printrune.go
Created October 6, 2014 10:58
文字の Unicode を確認するだけのプログラム
package main
import "fmt"
import "os"
func main() {
for _, arg1 := range os.Args[1:] {
for _, r := range arg1 {
fmt.Printf("[%0X]", r)
}
@hymkor
hymkor / powershell-on.cmd
Created October 7, 2014 00:19
PowerShell スクリプトの実行を許可する
powershell Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
@hymkor
hymkor / powershell-off.cmd
Created October 7, 2014 00:21
PowerShell のスクリプトの実行を禁止する
powershell Set-ExecutionPolicy -Scope CurrentUser Restricted
@hymkor
hymkor / why.cmd
Last active August 29, 2015 14:07
PowerShell をバッチファイルに組み込もうとしたけれども(追記:解決した!) ref: http://qiita.com/zetamatta/items/a9b5201b7d8009fad06b
@more +1 "%~f0" | powershell -Command "-" & exit /b 0
Write-Host 'Step1'
Write-Host 'Step2'
if ( $true ){
Write-Host 'Step3'
Write-Host 'Step4'
} else {
Write-Host 'Step5'
}
Write-Host 'End'
@hymkor
hymkor / file0.txt
Created October 8, 2014 11:24
Git で過去の Commit に一時的に戻り、作業後、また最新のCommitを復活させる ref: http://qiita.com/zetamatta/items/ab1eb6c954b197e53752
$ git branch
* (detached from 5624b10)
master
@hymkor
hymkor / bench1.cmd
Created October 16, 2014 01:06
[Lua] rawset は別に速くなかった ref: http://qiita.com/zetamatta/items/9c2d70c32cfe47e08abe
::rem:: --[[ vim:set ft=lua:
@lua "%~f0" %* & exit /b
]]--
t = {}
for i=1,100000 do
table.insert(t,"x")
end
print(os.clock())
@hymkor
hymkor / unicode.go
Created October 23, 2014 12:42
過去にほとんど同じプログラムを書いてた → https://gist.github.com/zetamatta/071061f9f6ff4171ae28
package main
import "fmt"
import "os"
func main() {
for _, arg := range os.Args[1:] {
for _, ch := range arg {
fmt.Printf("[%X] ", ch)
}
@hymkor
hymkor / chpath.vbs
Last active August 29, 2015 14:08
Windows で vipw っぽく、システムのデフォルト%PATH%を変更する ref: http://qiita.com/zetamatta/items/2919f0a794e6373eb964
Option Explicit
If WScript.Arguments.Count <= 0 Then
Dim shellApp : Set shellApp = CreateObject("Shell.Application")
shellApp.ShellExecute "wscript.exe","""" & WScript.ScriptFullName & """ uac" , "" , "runas"
Set shellApp = Nothing
WScript.Quit
End If
Dim wshShell : Set wshShell=CreateObject("WScript.Shell")
Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim sysEnv : Set sysEnv=wshShell.Environment