vi /etc/sysconfig/iptables ---- # samba -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 137 -s 192.168.1.0/24 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 138 -s 192.168.1.0/24 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 139 -s 192.168.1.0/24 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 445 -s 192.168.1.0/24 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 901 -s 192.168.1.0/24 -j ACCEPT ---- service iptables restart
yum -y install samba samba-swat
pdbedit -a -u ユーザー名:ユーザーの追加 pdbedit -x ユーザー名:ユーザーの削除
mkdir /etc/skel/samba vi mkhomedir.sh cat > mkhomedir.sh << 'EOS' #!/bin/bash # /home/ユーザ名/samba ディレクトリを一括作成 for user in `ls /home` do id $user > /dev/null 2>&1 [ $? -eq 0 ] && \ [ ! -d /home/$user/samba ] && \ mkdir /home/$user/samba && \ chown $user:$user /home/$user/samba && \ echo "/home/$user/samba create" done EOS chmod 755 mkhomedir.sh ./mkhomedir.sh
mkdir /home/samba chown nobody:nobody /home/samba
cat > /etc/samba/smb.conf << 'EOS' # Samba config file created using SWAT # from 192.168.1.2 (192.168.1.2) # Date: 2009/08/09 12:53:05 [global] smb ports = 139 debug level = 0 dos charset = CP932 unix charset = UTF-8 display charset = UTF-8 server string = MediaCenter passdb backend = tdbsam load printers = No disable spoolss = Yes ldap ssl = no hosts allow = 192.168.1., 127. printing = bsd cups options = raw print command = lpr -r -P'%p' %s lpq command = lpq -P'%p' lprm command = lprm -P'%p' %j map archive = no create mask = 0664 force create mode = 0600 directory mask = 0775 force directory mode = 0700 [homes] comment = Home Directories path = %H read only = No browseable = No vfs objects = recycle recycle:repository = .recycle recycle:keeptree = no recycle:versions = yes recycle:touch = no recycle:maxsize = 0 recycle:exclude = *.tmp ~$* [printers] comment = All Printers path = /var/spool/samba printable = Yes browseable = No [public] comment = ftp path = /var/ftp read only = No guest ok = Yes vfs objects = recycle recycle:repository = .recycle recycle:keeptree = no recycle:versions = yes recycle:touch = no recycle:maxsize = 0 recycle:exclude = *.tmp ~$* [tv] comment = pt2 path = /var/www/html/epgrec/video read only = No guest ok = Yes vfs objects = recycle recycle:repository = .recycle recycle:keeptree = no recycle:versions = yes recycle:touch = no recycle:maxsize = 0 recycle:exclude = *.tmp ~$* EOS service smb restart chkconfig smb on
cat > /etc/cron.daily/recyclewatch << 'EOS' ---- #!/bin/bash for user in `ls /home/` do if [ -d /home/$user/.recycle ]; then /usr/sbin/tmpwatch -f -a 168 "/home/$user/.recycle/" fi if [ -d /home/$user/samba/.recycle ]; then /usr/sbin/tmpwatch -f -a 168 "/home/$user/samba/.recycle/" fi if [ -d /var/www/html/epgrec/video/.recycle ]; then /usr/sbin/tmpwatch -f -a 168 "/var/www/html/epgrec/video/.recycle/" fi done EOS chmod +x /etc/cron.daily/recyclewatch
yum install samba-swat vi /etc/xinetd.d/swat ---- only_from = 127.0.0.1 192.168.1.0/24 disable = no ---- service xinetd restart
アンテナ - 2分配器 -- ダブル分波器 - TV |- ダブル分波器 - PT2
【3500円以上お買い上げで送料無料】【4300個突破!】【ポイント3倍... 価格:2,590円(税込、送料別) |
lspci 03:0a.0 Multimedia controller: Xilinx Corporation Unknown device 222a (rev 01)
mkdir -p /usr/local/src/pt2 cd /usr/local/src/pt2 yum install mercurial --enablerepo=rpmforge -y hg clone http://hg.honeyplanet.jp/pt1/ pt2 cd pt2/driver/ make ※エラーが出ていないことを確認 make install insmod /lib/modules/`uname -r`/kernel/drivers/video/pt1_drv.ko
ls -l /dev/pt1* crw-rw-rw- 1 root root 253, 0 2月 11 23:56 /dev/pt1video0 crw-rw-rw- 1 root root 253, 1 2月 11 23:56 /dev/pt1video1 crw-rw-rw- 1 root root 253, 2 2月 11 23:56 /dev/pt1video2 crw-rw-rw- 1 root root 253, 3 2月 11 23:56 /dev/pt1video3
cd /usr/local/src/pt2/ hg clone http://hg.honeyplanet.jp/pt1/ pt2-r73 -r 73 cd pt2-r73/arib25 make ※エラーが出ていないことを確認 make install cd ../recpt1 make ※エラーが出ていないことを確認 make install
cd /usr/local/src/pt2/ yum install glib glib-devel perl-Gtk2 --enablerepo=rpmforge -y wget ftp://ftp.kddlabs.co.jp/033/Linux/packages/fedora.archive/releases/8/Everything/x86_64/os/Packages/pcsc-perl-1.4.6-2.fc8.x86_64.rpm wget ftp://ftp.kddlabs.co.jp/033/Linux/packages/fedora.archive/releases/8/Everything/x86_64/os/Packages/pcsc-tools-1.4.10-1.fc8.x86_64.rpm rpm -iivh pcsc-* hash -r mv /usr/share/pcsc/smartcard_list.txt /usr/share/pcsc/smartcard_list.txt.bak cp pt2-r73/b25_docs/smartcard_list.txt /usr/share/pcsc/ service pcscd restart chkconfig pcscd on
pcsc_scan PC/SC device scanner V 1.4.10 (c) 2001-2007, Ludovic Rousseau <ludovic.rousseau@free.fr> Compiled with PC/SC lite version: 1.3.3 Scanning present readers …中略 Possibly identified card (using /usr/share/pcsc/smartcard_list.txt): 3B F0 12 00 FF 91 81 B1 7C 45 1F 03 99 B-CAS ... CTRL+Cで中断
recpt1 --help Usage: recpt1 [--b25 [--round N] [--strip] [--EMM]] [--udp [--addr hostname --port portnumber]] [--device devicefile] channel rectime destfile Remarks: if rectime is '-', records indefinitely. if destfile is '-', stdout is used for output. Options: --b25: Decrypt using BCAS card --round N: Specify round number --strip: Strip null stream --EMM: Instruct EMM operation --udp: Turn on udp broadcasting --addr hostname: Hostname or address to connect --port portnumber: Port number to connect --device devicefile: Specify devicefile to use --help: Show this help --version: Show version --list: Show channel list Available Channels: 13-62: Terrestrial Channels 101ch: NHK BS1 102ch: NHK BS2 103ch: NHK BShi 141ch: BS Nittele 151ch: BS Asahi 161ch: BS-TBS 171ch: BS Japan 181ch: BS Fuji 191ch: WOWOW 200ch: Star Channel 211ch: BS11 Digital 222ch: TwellV CS2-CS24: CS Channels
cd /usr/local/src/pt2/ cat > rectest.sh << 'EOS' #!/bin/sh for ((i=14;i<63;i++)) do echo recording channel $i /usr/local/bin/recpt1 --strip --b25 $i 30 test$i.ts &> /dev/null done EOS chmod 700 rectest.sh ./rectest.sh
cd /usr/local/src/pt2/ wget -O epgdumpr2-utf8.tar.gz "http://www.mda.or.jp/epgrec/index.php?plugin=attach&refer=%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E5%89%8D%E3%81%AE%E6%BA%96%E5%82%99&openfile=epgdumpr2-utf8.tar.gz" tar xvfz epgdumpr2-utf8.tar.gz cd epgdumpr2 make cp epgdump /usr/local/bin
yum install at ※apacheがある場合は削除 vi /etc/at.deny vi /etc/passwd ---- apache:x:48:48:Apache:/var/www:/bin/sh ----
cat > /etc/httpd/conf.d/vhost.conf << 'EOS' ---- NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin root@localhost ServerName 127.0.0.1 ServerAlias 192.168.1.x DocumentRoot /var/www/html ErrorLog logs/error_log CustomLog logs/access_log combined env=!no_log <Directory /> Options -Indexes FollowSymLinks AllowOverride All </Directory> Alias /epgrec /var/www/html/epgrec <Location /epgrec> DirectoryIndex index.php index.html Options -Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from 127.0.0.1 Allow from 192.168.1 </Location> </VirtualHost> ----
yum install ffmpeg --enablerepo=rpmforge -y cd /usr/local/src/pt2/ wget -O epgrec-20100322.tar.gz "http://sourceforge.jp/frs/redir.php?m=globalbase&f=%2Fepgrec%2F46492%2Fepgrec-20100322.tar.gz" tar xvzpf epgrec-20100322.tar.gz -C /var/www/html find . -uid 1000 /var/www/html find /var/www/html -uid 1000 | xargs chown apache. cd /var/www/html/epgrec/ cp config.php.sample config.php cp --archive do-record.sh.pt1 do-record.sh vi config.php ---- $GR_CHANNEL_MAP = array( "GR27" => "27", // NHK "GR26" => "26", // 教育 "GR25" => "25", // 日テレ "GR22" => "22", // 東京 "GR21" => "21", // フジ "GR24" => "24", // テレ朝 "GR23" => "23", // テレ東 "GR20" => "20", // MX TV // "GR18" => "18", // テレ神 // "GR30" => "30", // 千葉 // "GR32" => "32", // テレ玉 // "GR28" => "28", // 大学 ); ---- cd /var/www/html/epgrec cat > .htaccess << 'EOS' Options Indexes EOS
※チューニング vi /etc/my.cnf ---- innodb_buffer_pool_size=64M key_buffer_size=16M ---- service mysqld restart
mkpasswd -l 16 -s 0 > ~/.mysql-pw-epgrec echo "GRANT ALL PRIVILEGES ON *.* TO epgrec@localhost IDENTIFIED BY '`cat ~/.mysql-pw-epgrec`';FLUSH PRIVILEGES;create database epgrec;" | mysql -u root mysql ログインできるか確認 mysql -u epgrec -p`cat ~/.mysql-pw-epgrec` -h localhost epgrec
cat > /etc/cron.d/getepg << 'EOS' SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 29 */2 * * * apache /var/www/html/epgrec/getepg.php EOS chmod 644 /etc/cron.d/getepg
nohup /var/www/html/epgrec/getepg.php &
yum -y --enablerepo=rpmforge install mysql-devel.x86_64 libexif-devel.x86_64 taglib-devel.x86_64 js-devel.x86_64 file.x86_64 zlib-devel.x86_64 expat-devel.x86_64 cd /usr/src/redhat/ wget http://downloads.sourceforge.net/mediatomb/mediatomb-0.12.1.tar.gz tar xvfz mediatomb-0.12.1.tar.gz cp mediatomb-0.12.1/mediatomb.spec SPECS/ mv mediatomb-0.12.1.tar.gz SOURCES/ rm -rf mediatomb-0.12.1 vi SPECS/mediatomb.spec ---- BuildRequires: sqlite-devel, mysql-devel, libexif-devel, taglib-devel, file, js-devel, zlib-devel ---- rpmbuild -ba SPECS/mediatomb.spec rpm -ivh RPMS/x86_64/mediatomb-0.12.1-1.x86_64.rpm
mysql -u epgrec -p`cat ~/.mysql-pw-epgrec` epgrec < /usr/share/mediatomb/mysql.sql
vi /etc/mediatomb.conf ---- MT_INTERFACE="eth0" ---- service mediatomb restart vi /etc/mediatomb/config.xml ---- <storage> <sqlite3 enabled="no"> <database-file>mediatomb.db</database-file> </sqlite3> <mysql enabled="yes"> <host>localhost</host> <username>epgrec</username> <password>パスワード</password> <database>epgrec</database> </mysql> </storage> <protocolInfo extend="yes"/><!-- For PS3 support change to "yes" --> <import hidden-files="no"> <filesystem-charset>UTF-8</filesystem-charset> <metadata-charset>CP932</metadata-charset> <extension-mimetype ignore-unknown="no"> <map from="jpg" to="image/jpeg"/> <map from="jpeg" to="image/jpeg"/> <map from="gif" to="image/gif"/> <map from="png" to="image/png"/> <map from="m4v" to="video/mp4"/> <map from="mp4" to="video/mp4"/> <map from="mpg" to="video/mpeg"/> <map from="mpeg" to="video/mpeg"/> <map from="ts" to="video/mpeg"/> <map from="avi" to="video/divx"/> ---- service mediatomb restart chkconfig mediatomb on
vi /etc/sysconfig/iptables ---- # mediatomb -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 50500 -s 192.168.1.0/24 -j ACCEPT ---- service iptables restart