Debuginfo

思考とアウトプット

$HOME/notesというITエンジニアなら誰でもホームディレクリ以下にある自分用のnote/docとかを共有するサービスを作ってみた

$HOME/notes

f:id:shoheik:20130609155025p:plain

このサービスを作った出発地点は,

"最近、グーグルで調べるのがしんどくなってきたなぁ。知りたい情報は数行なのにたどり着くまでえらく時間がかかるなぁ、もっと的を得たものってないのかな。そもそも$HOME/notesってディレクトリに自分用のノートがあるよね。これ共有できないかな?"

といった感じです。最悪自分専用のサービスで, ブラウザがあれば家でも会社でも見れるし、生産性あがりますね:D 捗る!:)

使い方

1. 検索

ログインなしで検索できます。Linuxとか入れると検索されせます。

f:id:shoheik:20130609155343p:plain

検索対象は、Know, How, Exampleの三つです。@twitter_id もしくは@github_idでそのユーザのKnowhowが取り出せます。

f:id:shoheik:20130609155237p:plain

2. Knohowの投稿

githubかtwitterのIDでログインします。そして、"Share your knowhow"ボタンをおして、入力します。Know, How, Exampleの三つのカテゴリで入れます。それぞれ文字制限あります。ポイントは的を得た入力を促すことです。それにより、あとで検索しやすいと考えました。

f:id:shoheik:20130609155423p:plain

3. APIの利用

JSONで検索結果を返すのでコマンドを作れます。例として、Perlで書いたコードがgithubにあります。vimスクリプト書ける人はうまくVimにIntegrateできるんだろうな。私にはできない>_<

$ ./script/notes 
Usage:
        # Get indices of search in know
        $ notes -query <key>  
        $ notes -query <key> -how # search in know and how

        # Get content of knowhow by the index
         $ notes -id <id> 

    Options:
        -help            brief help message
        -query           search query
        -know            flag to search in know(on by default)
        -how             flag to search in how
        -example         flag to seach in example
        -id              knowhow index which you can obtain the query

$ ./script/notes  -query linux
6 : The way to see memory usage with #linux command
7 : change space with newline on #linux
17 : Find the files which has a string, 'xxx',  on #linux
18 : Replace text1 to text2 on #linux
19 : Get the common columns in two files on #linux
20 : How to check #linux performance
21 : How to obtain the number of files within XX days last modified #linux
22 : How to see binary with #linux command
24 : How to use RCS on #linux

$ ./script/notes  -id 24
KNOW:
==============
How to use RCS on #linux

HOW:
==============
See the below example

EXAPLE:
==============
$ ci -u file # check in without lock
$ co -l file # check out with lock
$ rcs -u file # Forcefully unlock file and send email to the owner
$ co -p1.1 file > /tmp/file # dump ver1.1 to /tmp/file
$ rcsdiff -r1.1 file # show diff from current version
$ rcsdiff -r1.1 -r1.2 # diff of versions
$ rlog file # see the history of the chagnes

4. ライセンス

MIT licenseです。導入まで色々入れて面倒かもしれませんが、ご自由に使ってください。https://github.com/shoheik/Homenotesにソースあります。

開発雑記

全文検索はmroongaを利用しました。DBIX::Skinnyからmroonga使えましたよ:) バックエンドはMojoliciousとMooで基本書いてます。フロントはbackbone.jsを利用しました。これがすごい時間かかりました-_-;;

参考(自分のブログのリンクです)