Skip to content

Instantly share code, notes, and snippets.

View mh61503891's full-sized avatar
🍣

Masayuki Higashino mh61503891

🍣
View GitHub Profile
# drblpush -i
******************************************************
Hint! When a yes/no option is available, the default value is uppercase, Ex. (y/N), the default is "N", when you press "Enter", it will use "N". If you are not sure which one to choose, you can just press "Enter" key.
******************************************************
Searching the installed packages for DRBL server...This might take several minutes...
Finished searching the installed packages for DRBL server.
******************************************************
------------------------------------------------------
The interactive mode let you supply the information of your DRBL environment.
------------------------------------------------------
@mh61503891
mh61503891 / docx-replace-keywords.rb
Created May 2, 2015 13:20
コマンドラインでdocx内の指定キーワードを置換する
#!/opt/local/bin/ruby2.2
require 'thor'
require 'systemu'
require 'yaml'
require 'tmpdir'
class DOCX
XML_PATH = 'word/document.xml'
@mh61503891
mh61503891 / file0.txt
Last active August 29, 2015 14:21
Chefのノード情報取得ライブラリOhaiの自作プラグイン作成メモ ref: http://qiita.com/61503891/items/d1acaf8ea633e68471b5
$ gem install ohai
@mh61503891
mh61503891 / yachin.rb
Created May 28, 2015 12:41
住居手当の規則をコードに落とし込んだもの
# USAGE: gnuplot -e "set grid; set xtics 10000; plot '<ruby yachin.rb'"
def y(x)
if x <= 23000
return x - 12000
else
x2 = (x - 23000) * 0.5
if x2 > 16000
return 16000 + 11000
else
@mh61503891
mh61503891 / gist:900218
Created April 3, 2011 05:25
Gmail Fetcher
#! ruby
# -*- coding: utf-8 -*-
# CONFIG
IMAP_USER=''
IMAP_PASS=''
# MAIN
require 'net/imap'
require 'parsedate'
FROMS = %w{
@mh61503891
mh61503891 / gist:949497
Created April 30, 2011 07:01
Tree to OPML1.0
-- Readme
-- Tree.app1.6.2でOPML1.0でエクスポートするAppleScript.
-- [注意] GUI Scriptingでゴリ押しなのでTree.appのバージョンが違うと誤作動する可能性がある.
-- [注意] 同名の.opmlファイルが存在する場合は上書きされる.
-- References
-- AppleScript Help - Apple - http://docs.info.apple.com/help/guide.html?path=AppleScript/2.1/jp/
-- AppleScriptの構造を上手に調べる - http://allabout.co.jp/gm/gc/80938/3/
tell application "Tree"
activate
@mh61503891
mh61503891 / gist:1602333
Created January 12, 2012 18:48
OKWebのパートナーサイトからOKWeb本家の印刷用ページにジャンプするブックマークレット
javascript:location.href='http://okwave.jp/print/qa/q' + location.pathname.match(/\d+/) +'.html'
@mh61503891
mh61503891 / tex_to_multibyte_lines.sh
Created January 12, 2012 19:05
TeXソースファイルから全角文字が含まれている行を行番号付きで表示するRubyスクリプト
#!/bin/sh
# Example: $ cat example.txt | this_script
# This script works only for ruby 1.9.x
ruby1.9 -e 'while l=gets;puts "#{$stdin.lineno} #{l}" if l !~ /\A\s*%/&&!l.each_char.select{|c|c.bytesize!=1}.empty?;end'
@mh61503891
mh61503891 / mp4_to_m4a.sh
Created January 13, 2012 05:12
OSXでMP4動画からAAC音声抽出するShellスクリプト
#!/bin/sh
# == References
#
# * OSXでMP4動画からAAC音声抽出
# http://d.hatena.ne.jp/ikki_j/20080304/1204629353
# > H.264+AACなMP4動画から再コンパイルなしでAAC音声のみを抽出する方法。
#
# * EvalVid - A Video Quality Evaluation Tool-set Pre-compiled binaries (static)
# http://www2.tkn.tu-berlin.de/research/evalvid/fw.html#bin
@mh61503891
mh61503891 / gist:1628031
Created January 17, 2012 18:37
DummynetをDebian6でビルドできるようにするためのパッチ
--- ipfw3/dummynet2/Makefile.orig 2012-01-18 02:51:29.000000000 +0900
+++ ipfw3/dummynet2/Makefile 2012-01-18 02:51:42.000000000 +0900
@@ -55,8 +55,8 @@
ipfw-cflags += -D_BSD_SOURCE
ipfw-cflags += -DKERNEL_MODULE # build linux kernel module
# the two header trees for empty and override files
-ipfw-cflags += -I $(M)/include_e
-ipfw-cflags += -I $(M)/include
+ipfw-cflags += -I$(M)/include_e
+ipfw-cflags += -I$(M)/include