Skip to content

Instantly share code, notes, and snippets.

@t2psyto
t2psyto / gist:3787469
Created September 26, 2012 11:30
coffeescript を ロードして実行する wsf
<?xml version="1.0" encoding="Shift_JIS" standalone="yes" ?>
<package>
<job id="Hoge">
<script language="JScript" src="./coffee-script.js"></script>
<script language="jscript">
<![CDATA[
input = "./script.coffee"
var rs = new ActiveXObject("ADODB.Stream");
rs.Type = 2; // adTypeText
@t2psyto
t2psyto / gitlab_curl_post
Created October 4, 2012 15:47
curl POST to gitlab snippets api
$ cat > content.py
# -*- coding: utf-8 -*-
# 日本語
# あめんぼあかいなあいうえお
def hello():
print "hello world!"
if __name__ == "__main__":
hello()
^D
curl.exe -d '{"private_token":"qp6szjqmk8bTyMBrnJo5","title":"test1","file_name":"content1.py","code":"hogehoge\nhoge"}' http://demo.gitlabhq.com/api/v2/projects/rubinius/snippets
@t2psyto
t2psyto / accesspoint.py
Created November 6, 2012 12:15
mac address maintainer for WZR-G144N, AP-50W, WLA2-G54C
# -*- coding: cp932 -*-
import mechanize as mc
import time
import sgmllib
import re
class Stripper(sgmllib.SGMLParser):
def __init__(self):
sgmllib.SGMLParser.__init__(self)
username = "username"
password = "password"
from selenium import webdriver
driver = webdriver.Ie("c:/path/to/IEDriverServer.exe")
#driver.window_handles
driver.get("https://websearch.rakuten.co.jp/login.html?tool_id=1")
driver.find_element_by_name("u").send_keys(username)
driver.find_element_by_name("p").send_keys(password)
#-*- coding: utf-8 -*-
filename = "c:/TEMP/gihyosd_2001-2012_index.html"
from StringIO import StringIO
import gzip
import BeautifulSoup as BS
import urllib2
# workaround for beautifulsoup bug.
# info:
@t2psyto
t2psyto / robocopy_backyup.bat
Created May 30, 2013 06:03
backup script using robocopy with mail notify.
rem パックアップパラメータ バックアップ元/先「SRC → TARGET」
set SRC=\\server\share
set TARGET=D:\backup_data
rem timestamp -> YYMMDDhhmmss
rem 時刻1桁のゼロ埋め ex) " 9:00:00.00" -> "09:00:00.00"
set timetemp=%time: =0%
set timesec=%timetemp::=%
set timestamp=%date:/=%%timesec:~0,6%
@t2psyto
t2psyto / adhoc_folder_redirect
Created June 18, 2013 07:58
デスクトップログオン後にフォルダリダイレクトする。リダイレクト情報を一時的に書き換える。
taskkill /F /IM explorer.exe
set remotehome=\\server\data\username
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Personal" /d "%remotehome%\マイドキュメント" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Desktop" /d "%remotehome%\デスクトップ" /f
start explorer
sleep 1
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Personal" /d "%USERPROFILE%\Documents" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Desktop" /d "%USERPROFILE%\Desktop" /f
@t2psyto
t2psyto / folder_redilect.bat
Created June 27, 2013 07:50
一時的にフォルダリダイレクトをする。リダイレクト先を設定してexplorerを再起動。explorerが起動できたら、リダイレクト先を元に戻しておく。 リダイレクト先を記録するレジストリ項目はexplorerが起動するときに読み込まれる。それ以外のタイミングで変更しても次のexplorer再起動時まで影響しない。
taskkill /F /IM explorer.exe
set remotehome=\\server\profile\username
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Personal" /d "%remotehome%\Documents" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Desktop" /d "%remotehome%\Desktop" /f
start explorer
sleep 1
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Personal" /d "%USERPROFILE%\Documents" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Desktop" /d "%USERPROFILE%\Desktop" /f
@t2psyto
t2psyto / gist:6608467
Created September 18, 2013 12:28
キンコーズが3Dプリントサービスを開始、模型やフィギュアも作成可能に | BUZZAP!(バザップ!)
キンコーズが3Dプリントサービスを開始。オンラインで注文した場合、納品方法は配送もしくは上野店で引き渡し。上野店では平日10時~19時に各種製作サンプルを掲示する。
http://buzzap.jp/news/20130917-kinkos-3d/