Skip to content

Instantly share code, notes, and snippets.

@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/
@t2psyto
t2psyto / gist:6622913
Created September 19, 2013 12:46
Twitter / yubais: 携帯料金なんて本体価格と月額通信料と本体割引と月々割と乗り換 ...
携帯料金なんて本体価格と月額通信料と本体割引と月々割と乗り換えと新規と機種変価格がカオスに絡み合ってるからな...おや、こんなところに累積料金をわかりやすく可視化するツールがあるぞ
http://yubais.net/line_payment/ 
https://twitter.com
@t2psyto
t2psyto / fluidsynth
Created September 20, 2013 18:20
Fluidsynth config for reducing CPU power. on RaspberryPi.
sudo fluidsynth -C0 -R0 -l -a alsa -m alsa_seq -o audio.alsa.device=hw:0 -r 44100 -o audio.output-channels=1 -o audio.periods=12 /usr/share/sounds/sf2/FluidR3_GM.sf2
@t2psyto
t2psyto / deploy_nc242.sh
Created January 6, 2014 08:25
shell script for deploy NetCommons-2.4.2.0 to Sakura internet.
mkdir ~/temp
cd ~/temp
wget -c "http://www.netcommons.org/%E3%83%80%E3%82%A6%E3%83%B3%E3%83%AD%E3%83%BC%E3%83%89/%E3%82%B3%E3%82%A2%E3%83%91%E3%83%83%E3%82%B1%E3%83%BC%E3%82%B8/?action=cabinet_action_main_download&block_id=93&room_id=1&cabinet_id=1&file_id=2467&upload_id=5296" -O netcommons-2.4.20.tar.gz
tar xzvf netcommons-2.4.20.tar.gz html NetCommons-2.4.2.0/html
mkdir ~/www/nc2/
mv NetCommons-2.4.2.0/html/* ~/www/nc2/
rm -rf NetCommons-2.4.2.0
@t2psyto
t2psyto / gist:8555778
Created January 22, 2014 09:18
emacs-jedi 起動するとエラーになる… emacs24.3(gnupack)
deferred error : (error make client process failed: cannot assign requested address, :name, epc con 3, :buffer, *epc con 3*, :host, localhost, :service, 0, :nowait, nil)
@t2psyto
t2psyto / get_flashobj_from_ie.py
Created January 27, 2014 08:04
IE から flash object のウィンドウハンドルと座標を取得
def searchChildWindows(currentHwnd, wantedText="",wantedClass="", wantedFunction=""):
results = []
childWindows = []
try:
win32gui.EnumChildWindows(currentHwnd,
_windowEnumerationHandler,
childWindows)
except win32gui.error:
# This seems to mean that the control *cannot* have child windows,
# i.e. not a container.
@t2psyto
t2psyto / automate_ie_flash.py
Last active January 4, 2016 18:39
IEで開いたflashページで、win32apiをたたいてflashのウィンドウハンドラにクリックを送る。
# -*- coding: cp932 -*-
import win32gui, win32ui, win32con
import time, random
import webbrowser
## flashplayerのwmodeをwindowにする。→ hwnd が取得できるようになる。
# ref: http://stackoverflow.com/questions/534474/changing-arbitrary-flash-objects-wmode-to-transparent
def set_flash_wmode(driver, waitsec=0.2):
setwmode = """(function(){
var embed = document.getElementsByTagName('embed');
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.ie.css" />
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
<script src="http://www.mapquestapi.com/sdk/leaflet/v1.0/mq-map.js?key=Fmjtd%7Cluur2d08lu%2Cra%3Do5-9a829f"></script>
@t2psyto
t2psyto / graphtest5.py
Created August 5, 2014 07:19
matplotlibでwindowパフォーマンスログのCSVからグラフ描画する。
# -*- coding: cp932 -*-
import datetime as DT
import os, csv, re
# np.nan as NaN
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import dates
from matplotlib.dates import date2num