Skip to content

Instantly share code, notes, and snippets.

@viz3
viz3 / enc.rb
Created March 7, 2014 23:20
split ts and encode.
#!/usr/bin/env ruby
require 'optparse'
require 'fileutils'
class Runner
def initialize(argv)
@recorded_dir = '/chinachu/recorded'
@encoded_dir = ENV['HOME'] + '/encoded'
@work_dir = ENV['HOME'] + '/tmp'
viz@mba:% ./fastboot flash recovery ~/Downloads/openrecovery-twrp-2.7.0.0-hammerhead.img
sending 'recovery' (13306 KB)...
OKAY [ 0.620s]
writing 'recovery'...
OKAY [ 1.045s]
finished. total time: 1.665s
viz@mba:% ./flash-all.sh [~/work/hammerhead-kot49h]
sending 'bootloader' (2508 KB)...
OKAY [ 0.287s]
writing 'bootloader'...
OKAY [ 0.505s]
finished. total time: 0.792s
rebooting into bootloader...
OKAY [ 0.095s]
finished. total time: 0.095s
sending 'radio' (42049 KB)...
#!/usr/bin/env ruby
Dir.glob('*.m4a') { |f|
File.rename(f, f.sub(/\ 1.m4a$/, '.m4a'))
}
#!/usr/bin/ruby
# coding: utf-8
require 'fileutils'
{
"/Library/Fonts/ヒラギノ明朝 Pro W3.otf" => 'HiraMinPro-W3.otf',
"/Library/Fonts/ヒラギノ明朝 Pro W6.otf" => 'HiraMinPro-W6.otf',
"/Library/Fonts/ヒラギノ角ゴ Pro W3.otf" => 'HiraKakuPro-W3.otf',
"/Library/Fonts/ヒラギノ丸ゴ Pro W4.otf" => 'HiraMaruPro-W4.otf',
"/Library/Fonts/ヒラギノ角ゴ Pro W6.otf" => 'HiraKakuPro-W6.otf',
"/Library/Fonts/ヒラギノ丸ゴ ProN W4.otf" => 'HiraMaruProN-W4.otf',
@viz3
viz3 / set_key_repeat_interval_fast.sh
Created March 3, 2012 14:17
set key repeat interval faster than system preference.
#!/bin/sh
defaults read NSGlobalDomain KeyRepeat
defaults read NSGlobalDomain InitialKeyRepeat
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 10
defaults read NSGlobalDomain KeyRepeat
defaults read NSGlobalDomain InitialKeyRepeat
@viz3
viz3 / gist:1966588
Created March 3, 2012 15:20
./adb pull /system/etc/fallback_fonts.xml fallback_fonts.xml
--- fallback_fonts.xml 2012-01-03 01:36:16.000000000 +0900
+++ fallback_fonts.fixed.xml 2011-12-26 01:19:01.000000000 +0900
@@ -71,6 +71,11 @@
</family>
<family>
<fileset>
+ <file>HiraKakuPro-W3.otf</file>
+ </fileset>
+ </family>
+ <family>
@viz3
viz3 / install_vobcopy.sh
Created June 4, 2012 00:33
install vobcopy
#!/bin/sh
base_dir="$HOME/local"
src_dir="${base_dir}/src"
mkdir -p "$src_dir"
# Install libdvdcss
pushd "$src_dir"
svn co svn://svn.videolan.org/libdvdcss/trunk libdvdcss
cd libdvdcss
@viz3
viz3 / install_cocoa_emacs.sh
Created June 6, 2012 03:19
install cocoa emacs
#!/bin/sh
# http://sakito.jp/emacs/emacs24.html
wget 'ftp://alpha.gnu.org/gnu/emacs/pretest/emacs-24.1-rc.tar.gz'
tar zxvf emacs-24.1-rc.tar.gz
mv emacs-24.1 emacs-24.1-rc
pushd emacs-24.1-rc
./configure --with-ns --without-x
make
make install
@viz3
viz3 / install_elscreen_on_cocoa_emacs.sh
Created June 6, 2012 09:51
install elscreen on cocoa emacs
#!/bin/sh
# Install APEL
# http://git.chise.org/elisp/apel/
wget 'http://kanji.zinbun.kyoto-u.ac.jp/~tomo/lemi/dist/apel/apel-10.8.tar.gz'
tar zxvf apel-10.8.tar.gz
pushd apel-10.8
export EMACS="$HOME/Applications/Emacs.app/Contents/MacOS/Emacs"
make install LISPDIR=~/.emacs.d/lisp VERSION_SPECIFIC_LISPDIR=~/.emacs.d/lisp INFODIR=~/.emacs.d/info
popd