@ompugao_ blog

hello this wonderful world

move to octpress

Today, I’ve moved from tdiary on my own server to here, github.

Owning to octpress, It was so a easy work to move my blog.

This tool enables me to create a stylish page in a easy way.

And personally, I highly evaluate the fact that it is written by Ruby (I’m a ruby lover).

What a wonderful world!

how to fix the resolution of my computer? etc…

how to fix the resolution of my computer?

I’ve tried to fix the resolution of my computer with cvt/xrandr command, but xrandr says:

X Error of failed request: BadMatch (invalid parameter attributes)

What should I do…

Bumped into dependency hell.

When I try to install hoogle, cabal returned a dependency error.

…. I can see the future in which I am caught in the tangled dependency hell over some libraries I use.

Cabal developers should implement a system like the rvm’s gemset.

vimperator dump error:Model.db is undefined

Thanks to this page:

Model.db is… - ebith - FriendFeed
http://friendfeed.com/ebith/798d211a/model-db-is-undefined

I deleted hatenaBookmark addon, delete ~/.mozilla/***/hatenabookmark , reinstall hatena, and login to hatena to fix this problem.

[C]error ‘M_PI’ undeclared

M_PI not found.

I’ve already include math.h and ld libmath.so. Why!?

Ans.:

#define _GNU_SOURCE

….( ´_ゝ`) Hmm… I see.

tmux setting

type your password only once

Add the following function to .zshrc.

function savepasswd(){
    local password
    echo -n "password:"
    read -s password ; echo
    tmux bind-key y send-keys "$password"
}

Then,call the function and save your password.

And then, type: C-<your tmux prefix> y.

some vim settings

when you open a file which includes a long line on vim.

  • gk - move to the pseudo uppper line
  • gj - move to the pseudo following line

Hmm…

vim –servername

For the first time I’ve known vim’s server-mode.

usage:

terminal1:

gvim --servername

terminal2:

vim --remote ``some file``

Hmm… Useful…? Maybe.

Finally, I added alias commands to .zshrc.

alias gvims='gvim --servername VIM'
alias vims='vim --servername VIM'
alias vimr='vim --servername VIM --remote'

deploy TV recording environment

I’ll write down how to deploy the TV recording environment on Linux using pt3.

Thanks to all of developers of pt3’s linux driver.

My environment is as follows.

  • uname -a
    • => Linux 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64 GNU/Linux

  • lsb_release -a
    • => No LSB modules are available.

    • => Distributor ID: Debian

    • => Description: Debian GNU/Linux 6.0.6 (squeeze)

    • => Release: 6.0.6

    • => Codename: squeeze

install packages

sudo aptitude install pkg-config subversion git-core libccid libpcsclite-dev pcsc-tools build-essential autoconf automake linux headers-`uname -r` mercurial-common pcscd

install driver

cd ~/src
git clone https://github.com/m-tsudo/pt3.git
cd pt3
make
sudo make install

install recpt1 (a command for recording)

cd ..
hg clone http://hg.honeyplanet.jp/pt1/
cd pt1
edit decoder.h and pt1_dev.h

    diff -r b14397800eae recpt1/decoder.h
    --- a/recpt1/decoder.h  Wed Jun 27 06:56:33 2012 +0900
    +++ b/recpt1/decoder.h  Sat Oct 06 00:12:12 2012 +0900
    @@ -3,6 +3,9 @@
     #define _DECODER_H_

     #include "config.h"
    +#include <inttypes.h>
    +#include <unistd.h>
    +//#include "stdint.h"

     #ifdef HAVE_LIBARIB25

    diff -r b14397800eae recpt1/pt1_dev.h
    --- a/recpt1/pt1_dev.h  Wed Jun 27 06:56:33 2012 +0900
    +++ b/recpt1/pt1_dev.h  Sat Oct 06 00:12:12 2012 +0900
    @@ -3,24 +3,24 @@
     #define _PT1_DEV_H_

     char *bsdev[NUM_BSDEV] = {
    -    "/dev/pt1video1",
    -    "/dev/pt1video0",
    -    "/dev/pt1video5",
    -    "/dev/pt1video4",
    -    "/dev/pt1video9",
    -    "/dev/pt1video8",
    -    "/dev/pt1video13",
    -    "/dev/pt1video12"
    +    "/dev/pt3video1",
    +    "/dev/pt3video0",
    +    "/dev/pt3video5",
    +    "/dev/pt3video4",
    +    "/dev/pt3video9",
    +    "/dev/pt3video8",
    +    "/dev/pt3video13",
    +    "/dev/pt3video12"
     };
     char *isdb_t_dev[NUM_ISDB_T_DEV] = {
    -    "/dev/pt1video2",
    -    "/dev/pt1video3",
    -    "/dev/pt1video6",
    -    "/dev/pt1video7",
    -    "/dev/pt1video10",
    -    "/dev/pt1video11",
    -    "/dev/pt1video14",
    -    "/dev/pt1video15"
    +    "/dev/pt3video2",
    +    "/dev/pt3video3",
    +    "/dev/pt3video6",
    +    "/dev/pt3video7",
    +    "/dev/pt3video10",
    +    "/dev/pt3video11",
    +    "/dev/pt3video14",
    +    "/dev/pt3video15"
     };

     // 変換テーブル(ISDB-T用)

./autogen.sh
./configure --prefix=/usr/local/ #--enable-b25
make && sudo make install

check the operatioin of B-CAS card reader

pcsc_scan
#=> ... 
#=> 0: SCM SCR 3310 NTTCom[Vendor Interface] 00 0
#=> ...
# B-CAS reader works correctly if you get a message noted previously.
#/etc/init.d/pcscd を見ても pcscd が自動起動するかどうかわからないので、もし自動起動しなかったら、
# Do not start from this script
があるところの if ~ fi 全体をコメントアウトしておくでいいはず。
    #if [ $1 = "start" -a -d /sys/fs/cgroup/systemd ]
    #    then
    #     # Do not start from this script
    #     exit 0
    #fi

try to record

recpt1 --b25 --strip 25 30 test.ts
recpt1 25 30 test.ts --device /dev/pt3video*
# then you get a ts file, which includes a low-quality movie.

install recpt1 which includes arib25(decoder)

sudo aptitude install pkg-config
cd ~/src/pt1
hg up -C -r 73 
(or
    wget http://hg.honeyplanet.jp/pt1/rev/c44e16dbb0e2
)
cd arib25
make && sudo make install
#this line generates /usr/local/bin/b25 file.

# And then, configure/compile recpt1 again.
# please check that configure script dump the following line.
""checking for create_arib_std_b25 in -larib25... yes""

install epgrec

install epgdumpr

cd src
#get epgdumppr2.tar.gz from http://www.mda.or.jp/epgrec/index.php?plugin=attach&refer=インストール前の準備&openfile=epgdumpr2.tar.gz
tar axvf epgdumpr2.tar.gz  
cd epgdumpr2
make
sudo cp epgdumpr2 /usr/local/bin/
sudo aptitude install at
sudo vipasswd
### www-dataがnologinの場合は/bin/shにする

install and set up mysql

spare someone the details.

install epgrec

sudo aptitude insatll apache2 libapache2-mod-php5 php5-mysql
cd /var/www
sudo git clone git://git.sourceforge.jp/gitroot/epgrec/epgrec.git
sudo chown www-data:www-data epgrec -R
cd epgrec
sudo chmod 777 cache templates_c video thumbs settings
sudo cp config.php.sample config.php
sudo vi config.php
...
sudo cp do-record.sh.pt1 do-record.sh

# Then access http://localhost/epgrec and continue to set up.
# following this site ↓

epgrecのインストールと設定 - 録画予約システムepgrec

That’s all.

links