Skip to content

Instantly share code, notes, and snippets.

find /tmp/*.zip -mtime +30 -type f -delete
XZ_OPT=-9e ionice -c 2 -n 7 nice -n 19 tar Jcvf - /path/to/backup_dir | pv -L 256k >/path/to/backup_`date +%Y%m%d%H%M%S`.tar.xz
map d removeTab
map u restoreTab
@cd01
cd01 / add_font_to_conhost.reg
Last active August 29, 2015 14:20
Add a font to ConHost.exe / cmd.exe と PowerShell で表示するフォントを追加する
Windows Registry Editor Version 5.00
; プログラミングフォント Myrica http://myrica.estable.jp
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont]
"932.0"="Myrica M"
@cd01
cd01 / make_junction_to_jdk_dir.bat
Created May 8, 2015 11:13
ジャンクションを使って、JDK のバージョンの切り替え
IF EXIST "%USERPROFILE%\jdk" RMDIR "%USERPROFILE%\jdk"
MKLINK /J "%USERPROFILE%\jdk" "%PROGRAMFILES%\Java\jdk1.7.0_79"
REM MKLINK /J "%USERPROFILE%\jdk" "%PROGRAMFILES%\Java\jdk1.8.0_45"
REM Require to elevate UAC
if exist %USERPROFILE%\tools\vim\gvim.exe ftype vimfile=%USERPROFILE%\tools\vim\gvim.exe %%1
assoc .scala=vimfile
assoc .txt=vimfile
assoc .go=vimfile
assoc .vim=vimfile
assoc .py=vimfile
assoc .ps1=vimfile
assoc .bat=vimfile
@cd01
cd01 / install_raspbian.sh
Created June 8, 2014 11:22
Install raspbian to SD card
wget http://downloads.raspberrypi.org/raspbian_latest -O ./raspbian.zip
unzip ./raspbian.zip
# To search the path to the SD card mount point
sudo fdisk -l
sudo dd if=2014-01-07-wheezy-raspbian.img of=/dev/sdb bs=1M
@cd01
cd01 / call_static_method_in_powershell.mkd
Last active August 29, 2015 13:57
PowerShell の [hoge]::hogehoge みたいなのが Markdown で表示できない問題。restructuredText なら表示できるみたい。あと,Markdown でも,行末にセミコロン付けると表示される(バッドノウハウっぽいw

raw text

[hoge]::hogehoge
[System.IO.Compression.Zipfile]::ExtractToDirectory("", "")
[System.IO.Compression.Zipfile]::ExtractToDirectory("", "");

START
::Test
[test]

test]::

@cd01
cd01 / itunes4win.go
Created October 27, 2013 06:32
iTunes の Podcast の音声が聞きづらいことが結構あるのでイコライザを "Spoken Word" に設定したり、デッドリンクを削除したりする
package main
import (
"github.com/mattn/go-ole"
"github.com/mattn/go-ole/oleutil"
"fmt"
"strconv"
)
func main() {
@cd01
cd01 / Install-jvgrep.ps1
Last active December 23, 2015 21:49
jvgrep インストール時のメモ
# もしまだ Go言語 をインストールしていなかったら、 cinst golang するか、インストーラをダウンロードしてきて実行
# Go 言語関連の設定
$oldPath = (Get-ItemProperty "HKCU:Environment" "PATH").PATH
if ($oldPath[-1] -ne ";") { $oldPath += ";" }
Set-ItemProperty "HKCU:Environment" "PATH" -value "$($oldPath)$($Env:USERPROFILE)\_go\bin"
setx GOROOT "C:\go"
setx GOPATH (Join-Path $Env:USERPROFILE "_go")
# 環境変数を反映させるために再起動