rh01のパーテション設定

/dev/hda1  ------ /boot
/dev/hda2  ------ swap
/dev/hda3  ------ /
/dev/hdd1  ------ /var
/dev/hdd2  ------ /home

/etc/fstab の記述

[root@rh01 root]# cat /etc/fstab
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
LABEL=/home             /home                   ext3    defaults        1 2
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
LABEL=/var              /var                    ext3    defaults        1 2
/dev/hda2               swap                    swap    defaults        0 0
/dev/cdrom              /mnt/cdrom              udf,iso9660  noauto,owner,kudzu,ro 0 0
/dev/fd0                /mnt/floppy             auto    noauto,owner,kudzu 0 0

[heart] KnoweldgeBase トップページに戻る [heart]

OS 起動時のサービスの開始/停止設定

現在の起動時の設定を確認する

[root@rh01 root]# chkconfig --list
kudzu           0:off   1:off   2:off   3:off   4:off   5:off   6:off
syslog          0:off   1:off   2:on    3:on    4:on    5:on    6:off
netfs           0:off   1:off   2:off   3:on    4:on    5:on    6:off
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off
random          0:off   1:off   2:on    3:on    4:on    5:on    6:off
rawdevices      0:off   1:off   2:off   3:on    4:on    5:on    6:off
pcmcia          0:off   1:off   2:off   3:off   4:off   5:off   6:off
( 以下 サービスのリストが続く、サービス名を指定することも可能 ) 

サービスの起動/停止を指定する

[root@rh01 root]# chkconfig --list sendmail
sendmail        0:off   1:off   2:on    3:on    4:on    5:on    6:off

[root@rh01 root]# chkconfig --level 2345 sendmail off

[root@rh01 root]# chkconfig --list sendmail
sendmail        0:off   1:off   2:off   3:off   4:off   5:off   6:off

[heart] KnoweldgeBase トップページに戻る [heart]

サービス中のポートの検査

netstat -ln

例えば http サーバーを起動している場合 80番ポートが LISTEN になっていることを
確認することができる。 WindowsNT 系では netstat -an というコマンドになる。

[root@muna-linux root]# netstat -ln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:32768           0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:32769         0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:32771           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:783           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:6000            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:23              0.0.0.0:*               LISTEN
udp        0      0 0.0.0.0:32768           0.0.0.0:*
udp        0      0 192.168.1.11:137        0.0.0.0:*
udp        0      0 0.0.0.0:137             0.0.0.0:*
udp        0      0 192.168.1.11:138        0.0.0.0:*
udp        0      0 0.0.0.0:138             0.0.0.0:*
udp        0      0 0.0.0.0:854             0.0.0.0:*
udp        0      0 0.0.0.0:111             0.0.0.0:*
udp        0      0 0.0.0.0:631             0.0.0.0:*

Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node Path
unix  2      [ ACC ]     STREAM     LISTENING     4659   /tmp/.gdm_socket
unix  2      [ ACC ]     STREAM     LISTENING     4994   /tmp/.fam_socket
unix  2      [ ACC ]     STREAM     LISTENING     4763   /tmp/ssh-XXJbpVMD/agent.4864
unix  2      [ ACC ]     STREAM     LISTENING     4762   /tmp/.ki2-unix/_0-ja_JP
unix  2      [ ACC ]     STREAM     LISTENING     44   /tmp/orbit-root/linc-1300-0-1c094e15ba75
unix  2      [ ACC ]     STREAM     LISTENING     4911   /tmp/orbit-root/linc-134b-0-1b4d5c157ffa0
unix  2      [ ACC ]     STREAM     LISTENING     4967   /tmp/orbit-root/linc-134f-0-4a45e296a83
unix  2      [ ACC ]     STREAM     LISTENING     4976   /tmp/orbit-root/linc-134d-0-12cfb2a0a12f9
unix  2      [ ACC ]     STREAM     LISTENING     5053   /tmp/orbit-root/linc-1361-0-42262b252d9de
unix  2      [ ACC ]     STREAM     LISTENING     5074   /tmp/orbit-root/linc-135d-0-42262b256a4ff
unix  2      [ ACC ]     STREAM     LISTENING     5118   /tmp/orbit-root/linc-135f-0-30e19c0bd208d
unix  2      [ ACC ]     STREAM     LISTENING     5140   /tmp/orbit-root/linc-1365-0-1ecac24c584
unix  2      [ ACC ]     STREAM     LISTENING     5288   /tmp/orbit-root/linc-1371-0-567910ef54125
unix  2      [ ACC ]     STREAM     LISTENING     5319   /tmp/orbit-root/linc-1369-0-4044d2528d7d
unix  2      [ ACC ]     STREAM     LISTENING     6234    /tmp/orbit-root/linc-13aa-0-3d7824df171fc
unix  2      [ ACC ]     STREAM     LISTENING     4515   /tmp/.font-unix/fs7100
unix  2      [ ACC ]     STREAM     LISTENING     4669   /tmp/.X11-unix/X0
unix  2      [ ACC ]     STREAM     LISTENING     4343   /dev/gpmctl
unix  2      [ ACC ]     STREAM     LISTENING     4899   /tmp/.ICE-unix/4864
unix  2      [ ACC ]     STREAM     LISTENING     4353   /tmp/.iroha_unix/IROHA
unix  2      [ ACC ]     STREAM     LISTENING     4796      /tmp/orbit-root/linc-1349-0-7b1d6a683abe4
[root@muna-linux root]#

[heart] KnoweldgeBase トップページに戻る [heart]

Fedra Core に 東風フォント を導入する

[ Font の実体 ] ( X Font Server を利用している環境 )

Redhat: /usr/share/fonts/
Vine  : /usr/X11R6/lib/X11/fonts

[ xfs の設定ファイル ]

/etc/X11/fs/config

Redhat9 のデータ ----------> filerh9_fonts_list.txt
Fedra core 1 のデータ -----> filefedra_fonts_list.txt

Redhat 9.0 config --------> filefs_config_rh9.txt
Fedra Core 1.0 config ----> filefs_config_fedra.txt

[ Redhat 9.0 で使われている 東風フォント ]

[root@muna-linux /]# ls -l /usr/share/fonts/ja/TrueType/
合計 9700
-rw-r--r--    1 root     root         1548  1月 31  2003 fonts.alias
-rw-r--r--    1 root     root         8313  5月  5 21:33 fonts.cache-1
-rw-r--r--    1 root     root         3823  5月  5 21:34 fonts.dir
-rw-r--r--    1 root     root         3823  5月  5 21:34 fonts.scale
-rw-r--r--    1 root     root      4043488  1月 31  2003 kochi-gothic.ttf
-rw-r--r--    1 root     root        17318  1月 31  2003 kochi-gothic.tti
-rw-r--r--    1 root     root      51972  1月 31  2003 kochi-mincho.ttf
-rw-r--r--    1 root     root        17318  1月 31  2003 kochi-mincho.tti

Kochi Font Archive -----> filekochi.tgz

[東風フォント制作活動終了]
古川さんによって行われていたフリーのアウトラインフォント「東風フォント」 の制作活動が終了となりました。
http://www.on.cs.keio.ac.jp/~yasu/jp_fonts.html
slashdotジャパン「東風フォント製作中止に」: http://slashdot.jp/articles/03/10/22/0811250.shtml?topic=36

[ Fedra Core では 東風フォント の代替フォントが組み込まれている ]

[root@hmuna ja]# ls -l /usr/share/fonts/ja/TrueType/
合計 16444
-rw-r--r--    1 root     root         1548  8月 11  2003 fonts.alias
-rw-r--r--    1 root     root         8343  6月 29 13:26 fonts.cache-1
-rw-r--r--    1 root     root         3465  6月 29 13:26 fonts.dir
-rw-r--r--    1 root     root         3465  6月 29 13:26 fonts.scale
-rw-r--r--    1 root     root      7770652  8月 11  2003 kochi-gothic-subst.ttf
-rw-r--r--    1 root     root        17318  8月 11  2003 kochi-gothic-subst.tti
-rw-r--r--    1 root     root      8967464  8月 11  2003 kochi-mincho-subst.ttf
-rw-r--r--    1 root     root        17318  8月 11  2003 kochi-mincho-subst.tti
[ Fedra に 東風フォント をコピーして関連ファイルをリネーム ]

[root@hmuna wk]# ls -l /usr/share/fonts/ja/TrueType/
合計 32108
-rw-r--r--    1 root     root         1548  7月  7 21:49 fonts.alias
-rw-r--r--    1 root     root         1548  8月 11  2003 fonts.alias_fedraorig
-rw-r--r--    1 root     root         8313  7月  7 21:49 fonts.cache-1
-rw-r--r--    1 root     root         8343  6月 29 13:26 fonts.cache-1_fedraorig
-rw-r--r--    1 root     root         3823  7月  7 21:49 fonts.dir
-rw-r--r--    1 root     root         3465  6月 29 13:26 fonts.dir_fedraorig
-rw-r--r--    1 root     root         3823  7月  7 21:49 fonts.scale
-rw-r--r--    1 root     root         3465  6月 29 13:26 fonts.scale_fedraorig
-rw-r--r--    1 root     root      7770652  8月 11  2003 kochi-gothic-subst.ttf
-rw-r--r--    1 root     root        17318  8月 11  2003 kochi-gothic-subst.tti
-rw-r--r--    1 root     root      4043488  7月  7 21:44 kochi-gothic.ttf
-rw-r--r--    1 root     root        17318  7月  7 21:44 kochi-gothic.tti
-rw-r--r--    1 root     root      8967464  8月 11  2003 kochi-mincho-subst.ttf
-rw-r--r--    1 root     root        17318  8月 11  2003 kochi-mincho-subst.tti
-rw-r--r--    1 root     root      51972  7月  7 21:44 kochi-mincho.ttf
-rw-r--r--    1 root     root        17318  7月  7 21:44 kochi-mincho.tti
 単純にコピーしただけでは 動作しなかったので強引に逆に -subst にリネーム

[root@hmuna TrueType]# mv kochi-gothic-subst.ttf kochi-gothic-subst.ttf_orig
[root@hmuna TrueType]# mv kochi-gothic-subst.tti kochi-gothic-subst.tti_orig
[root@hmuna TrueType]# mv kochi-mincho-subst.ttf kochi-mincho-subst.ttf_orif
[root@hmuna TrueType]# mv kochi-mincho-subst.tti kochi-mincho-subst.tti_orig
[root@hmuna TrueType]# mv kochi-gothic.ttf kochi-gothic-subst.ttf
[root@hmuna TrueType]# mv kochi-gothic.tti kochi-gothic-subst.tti
[root@hmuna TrueType]# mv kochi-mincho.ttf kochi-mincho-subst.ttf
[root@hmuna TrueType]# mv kochi-mincho.tti kochi-mincho-subst.tti
[root@hmuna TrueType]# ls -l 
合計 32108
-rw-r--r--    1 root     root         1548  7月  7 21:49 fonts.alias
-rw-r--r--    1 root     root         1548  8月 11  2003 fonts.alias_fedraorig
-rw-r--r--    1 root     root         8313  7月  7 21:49 fonts.cache-1
-rw-r--r--    1 root     root         8343  6月 29 13:26 fonts.cache-1_fedraorig
-rw-r--r--    1 root     root         3823  7月  7 21:49 fonts.dir
-rw-r--r--    1 root     root         3465  6月 29 13:26 fonts.dir_fedraorig
-rw-r--r--    1 root     root         3823  7月  7 21:49 fonts.scale
-rw-r--r--    1 root     root         3465  6月 29 13:26 fonts.scale_fedraorig
-rw-r--r--    1 root     root      4043488  7月  7 21:44 kochi-gothic-subst.ttf
-rw-r--r--    1 root     root      7770652  8月 11  2003 kochi-gothic-subst.ttf_orig
-rw-r--r--    1 root     root        17318  7月  7 21:44 kochi-gothic-subst.tti
-rw-r--r--    1 root     root        17318  8月 11  2003 kochi-gothic-subst.tti_orig
-rw-r--r--    1 root     root      51972  7月  7 21:44 kochi-mincho-subst.ttf
-rw-r--r--    1 root     root        17318  7月  7 21:44 kochi-mincho-subst.tti
-rw-r--r--    1 root     root      8967464  8月 11  2003 kochi-mincho-subst.ttf_orig
-rw-r--r--    1 root     root        17318  8月 11  2003 kochi-mincho-subst.tti_orig

[heart] KnoweldgeBase トップページに戻る [heart]

Fedra project ミラー

Fedra core 3 のソースコードのインストール

Fedora Core 2まではyumコマンドでカーネルソースをダウンロードできたのだが、Fedora Core 3ではそれが提供されていない。
そのため、FTPサイトなどからカーネルソースをダウンロードして、インストールしなければならない。

# uname -r -m
2.6.9-1.681_FC3smp i686 
# rpm -ihv kernel-2.6.9-1.681_FC3.src.rpm
   1:kernel             ###################################### [100%] 
# rpmbuild -bp --target i686 /usr/src/redhat/SPECS/kernel-2.6.spec
作成中ターゲットプラットフォーム: i686
(省略) 
# mv /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9 /usr/src
# ls /usr/src/linux-2.6.9/
COPYING        Makefile        configs  include  lib      security
CREDITS        README          crypto   init     mm       sound
Documentation  REPORTING-BUGS  drivers  ipc      net      usr
MAINTAINERS    arch            fs       kernel   scripts 

Fedra core の yum によるパッケージのアップデート

yum の設定ファイル /etc/yum.conf → fileyum.conf
yum download サイト一覧 ---------→ http://fedora.redhat.com/download/mirrors.html

  1. yum.conf にダウンロード先を設定する ・・・・ yum.conf の設定
    baseurl=http://ftp.kddlabs.co.jp/pub/Linux/distributions/fedora/core/$releasever/$basearch/os/i
  2. GPG(GNU Privacy Guard )を有効にする  ・・・・ yum.conf の設定
    gpgcheck=1     
  3. rpm --import /usr/share/rhn/PRM-GPG-KEY-fedora を実行しgpgcheck を有効にする
  4. yum を自動実行を設定する
    chkconfig yum on
  5. yum サービスを起動状況を確認する
    service yum status
  6. yum サービスを起動する ・・・・ /etc/cron.daily/yum.cron の設定により午前4時に自動実行される
    service yum start
  7. /etc/cron.daily/yum.cron の中の yum 自動起動の記述
#!/bin/sh

if [ -f /var/lock/subsys/yum ]; then
	/usr/bin/yum -R 10 -e 0 -d 0 -y update yum
	/usr/bin/yum -R 120 -e 0 -d 0 -y update
fi

YUM コマンドの使い方

All of the above commands can take shell-style wildcards (*,?) instead of a package name. Check the yum man page for more details. 上に挙げたコマンドを実行する際、パッケージ名の代わりに、ワイルドカードなどを使うことも可能です。詳しくは、YUM のマニュアルのページを見てください。

[heart] KnoweldgeBase トップページに戻る [heart]

Fedra core 3 で yum を使う方法

# yum install samba 

You have enabled checking of packages via GPG keys. This is a good
thing. However, you do not have any GPG public keys installed. You need to
download the keys for packages you wish to install and install them.
You can do that by running the command:
    rpm --import public.gpg.key
For more information contact your distribution or package provider.
[root@localhost ~]# rpm --import public.gpg.key
エラー: public.gpg.key: import read failed. 
# rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora 
# yum update
Setting up Update Process
Setting up Repo:  base
repomd.xml           100% |=========================| 1.1 kB    00:00
Setting up Repo:  updates-released
repomd.xml           100% |=========================|  951 B    00:00 

DNS レコードの検索

nslookup ドメイン名

DNS サーバーに配信されている ドメイン名のアドレスを検索することができる
通常は トップドメイン[ hmuna.com 等 ] を検索するが、ローカルの Name Server
[ ns1.hmuna.com ]や Web Server [ www.hmuna.com ]などサブドメインを指定
して検索することもできる。 このアドレスが不一致になっている時は DNS レコード
の更新が正しく行われていないので解析と対策が必要。 DNS サービスを複数運用して
いる場合など、片方の更新がエラーになっている可能性がある。 ( DDNS の場合 )

[root@muna-linux root]# nslookup hmuna.com
Note:  nslookup is deprecated and may be removed from future releases.
Consider using the `dig' or `host' programs instead.  Run nslookup with
the `-sil[ent]' option to prevent this message from appearing.
Server:         192.168.1.1
Address:        192.168.1.1#53
                                                                                                                                                                      
Non-authoritative answer:
Name:   hmuna.com
Address: 210.130.99.82
                                                                                                                                                                 
[root@muna-linux root]# nslookup www.hmuna.com
Note:  nslookup is deprecated and may be removed from future releases.
Consider using the `dig' or `host' programs instead.  Run nslookup with
the `-sil[ent]' option to prevent this message from appearing.
Server:         192.168.1.1
Address:        192.168.1.1#53 
                                                                                                                                                                     
Non-authoritative answer:
Name:   www.hmuna.com
Address: 210.130.99.82
                                                                                                                                                                     
[root@muna-linux root]# nslookup ns1.hmuna.com
Note:  nslookup is deprecated and may be removed from future releases.
Consider using the `dig' or `host' programs instead.  Run nslookup with
the `-sil[ent]' option to prevent this message from appearing.
Server:         192.168.1.1
Address:        192.168.1.1#53
                                                                                                                                                                     
Name:   ns1.hmuna.com
Address: 210.130.99.82
                                                                                                                                                             

[heart] KnoweldgeBase トップページに戻る [heart]

パッチの 作成 と 適用

diff コマンドを利用してパッチ情報を作成する
ここでは-u(unified形式)を利用してゆくが-c(context形式)でもかまわない。

diff -u 変更前ファイル 変更後ファイル > patch.txt
(ファイルの順番に注意。最新は2の方なので)

パッチの当て方

patch < patch.txt
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- test       Thu May  8 14:57:14 2003
|+++ test2      Thu May  8 15:02:48 2003
--------------------------
Patching file test using Plan A...
Hunk #1 succeeded at 1.
done

[heart] KnoweldgeBase トップページに戻る [heart]

パッチの適用(2)

diff -c FROM_FILE TO_FILE > PATCH_FILE
diff -c FROM_DIRECTORY TO_DORECTORY > PATCH_FILE
diff -cr FROM_DIRECTORY TO_DORECTORY > PATCH_FILE
diff -crN FROM_DIRECTORY TO_DORECTORY > PATCH_FILE
patch < PATCH_FILE
patch -p0 -d . < PATCH_FILE
patch -p -d . -E < PATCH_FILE

Redhat 8/9 系で telnet を有効にするには

/etc/indetd.d/telnet を編集する

service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
disable = no  ・・・ 初期値としては、"yes"に
}             成っているが"no"に変える

[heart] KnoweldgeBase トップページに戻る [heart]

文字コードセットの変更(UTF8->EUC)

Fedoraでは日本語でセットアップしても文字コードセットがUTF8になってしまうため、TeraTermPro等のターミナルでは、文字化けしちゃいます。
そこで、文字コードセットをUTF8からEUCに変更する方法です。

複数ファイルの文字コードの一括変換

[root@spirit ja_JP_EUC]# for fname in *.hlp; do
> nkf -e $fname > $fname.hlp_E;
> done

複数ファイルの拡張子の一括変換

漢字コードの自動変換

root@mythen:# find . *.txt -exec nkf -w --overwrite {} \;

CD-ROM から isoイメージを作成する方法

[root@spirit ~]# mkisofs -r -l -J -o /home/munakata/sh2a-linux.iso /media/cdrecorder/
INFO:   EUC-JP character encoding detected by locale settings.
        Assuming EUC-JP encoded filenames on source filesystem,
        use -input-charset to override.
Using FS000 for  ./rr_moved/fs (fs)
Using H000 for  ./rr_moved/h (h)
 (snip)
1.77% done, estimate finish Tue Dec  5 08:04:56 2006
3.55% done, estimate finish Tue Dec  5 08:06:48 2006
 (snip)
97.60% done, estimate finish Tue Dec  5 08:05:43 2006
99.37% done, estimate finish Tue Dec  5 08:05:40 2006
Total translation table size: 0
Total rockridge attributes bytes: 1801799
Total directory bytes: 4501504
Path table size(bytes): 20078
Max brk space used f34000
281779 extents written (550 MB)

iso イメージを CD-ROM に焼かずにマウントする方法

mount -t iso9660 -o loop (iso image) /mnt/cdrom

kernel source code の導入

Linuxでrootパスワードを忘れた際の復旧方法

vsftpd で root での ftp を許可する方法

圧縮・解凍コマンド一覧

実行中のシステムの情報を表示する(uname -r -m)

  1. -m, --machine : マシン (ハードウェア) のタイプを表示する。
  2. -n, --nodename : マシンのネットワークノードのホスト名を表示する。
  3. -r, --release : OS のリリースを表示する。
  4. -s, --sysname : OS の名称を表示する。
  5. -v : OS のバージョンを表示する。
  6. -a, --all : 以上の情報すべてを表示する。
  7. --help : 標準出力に使用方法のメッセージを出力して正常終了する。
  8. --version : 標準出力にバージョン情報を出力して正常終了する。

Linux システム稼働状況の取得

Linux には、複数のリソースチェックコマンドが用意されています。

[root@power root]# top -b -n 1
top - 10:14:01 up 17 days, 21:34,  4 users,  load average: 0.00, 0.00, 0.00
Tasks: 146 total,   1 running, 145 sleeping,   0 stopped,   0 zombie
Cpu(s):  6.3% us,  0.6% sy,  0.0% ni, 89.9% id,  3.1% wa,  0.1% hi,  0.0% si
Mem:   1034748k total,   979436k used,    55312k free,   136484k buffers
Swap:  2048248k total,       48k used,  2048200k free,   428548k cached 

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    1 root      16   0  3368  460  392 S  0.0  0.0   0:02.28 init
    2 root      34  19     0    0    0 S  0.0  0.0   0:04.99 ksoftirqd/0
    3 root       5 -10     0    0    0 S  0.0  0.0   0:05.35 events/0
    4 root       6 -10     0    0    0 S  0.0  0.0   0:00.01 khelper

[root@power root]# w
 10:12:42 up 17 days, 21:33,  4 users,  load average: 0.00, 0.00, 0.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
root     :0       -                22Oct05 ?xdm?  16:52   0.39s /usr/bin/gnome-session
root     pts/2    114.8.221.202.ts 10:11    0.00s  0.00s  0.00s w
root     pts/1    114.8.221.202.ts 09:46   23:39   0.00s  0.00s -bash
[root@power root]# uptime
 10:13:20 up 17 days, 21:33,  4 users,  load average: 0.00, 0.00, 0.00
[root@power root]# vmstat
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa
 0  0     48  54672 136364 428548    0    0     8    17    5     9  6  1 90  3

パッケージがどの RPM に含まれているかを確認する方法

プログラムにシンボル情報が付いているかを確認する方法

プログラムが使用しているシステムコールの表示 ( strace コマンド)

プロセスの親子関係を表示するコマンド

Fedra core デバイスドライバー(モジュール)の追加

Linux (UNIX) 環境変数の有功範囲

ロードされたモジュールを確認する

[root@spirit ~]# lsmod
Module                  Size  Used by
i915                   81221  2
parport_pc             24577  1
lp                     12077  0
parport                37129  2 parport_pc,lp
i2c_dev                11329  0
i2c_core               22081  1 i2c_dev
sunrpc                162725  1
iptable_filter          2753  1
ip_tables              16705  3 ipt_REJECT,ipt_state,iptable_filter
button                  6481  0

/dev/ttyS0 (シリアルポート) にアクセスできない

[root@spirit ~]# ls -al /dev/ttyS0
crw-rw----  1 root uucp 4, 64  5月 20 23:04 /dev/ttyS0

[root@spirit ~]# chmod o+rw /dev/ttyS0

[root@spirit ~]# ls -al /dev/ttyS0
crw-rw-rw-  1 root uucp 4, 64  5月 20 23:04 /dev/ttyS0

minicom が文字化けする ( Cent OS )

[root@spirit ~]# LANG=ja_JP.eucJP xterm &

minicom の起動

[root@spirit ~]# minicom -o -s
[root@spirit ~]# minicom -o (セットアップファイル名)

sudo が使えるようにする

[root@spirit ~]# cat /etc/sudoers
 ( snip )   
# User privilege specification
root    ALL=(ALL) ALL
munakata ALL=(ALL) ALL  <---- 追加する

vi

iカーソルの前に入力
aカーソルの後に入力
Iカーソルを行頭に移動し、その直前に入力
Aカーソルを行末に移動し、その直後に入力
oカーソル行の下に空行を作成し入力
Oカーソル行の上に空行を作成し入力
.[Enter]直前のコマンドの中止(UNDO)
u(小文字)直前に実行したコマンドの取り消し ↑と同じかな?(要調査)
U(大文字)カーソル行に行った変更を全て取り消す
0(zero)行頭に移動
$行末に移動
(行末で) 大文字 J改行の削除
:e![Enter]ファイルの読み直し (保存前の変更を全て取り消す)
yyカーソル行をコピー
10yyカーソル行から10行をコピー
a10yyカーソル行から10行を コピーバッファ[a-z]にコピー
p(小文字)カーソル行の下に ペースト
P(大文字)カーソル行の上に ペースト
"aP(大文字)カーソル行の上に バッファー[a-z]をペースト
:%s/置換前/置換後/[Enter]カーソル付近の一文字置換
:%s/置換前/置換後/g[Enter]文書全体の一括置換
B,Es/置換前/置換後/g[Enter]B行目〜E行目までの一括置換
Cカーソルから右を削除して入力モードに遷移
:noh検索によるハイライトを消す
:!(UNIX コマンド)コマンドの実行
:r(ファイル名)カレント行にファイルを読み込む
:r!(UNIX コマンド)コマンド実行結果をカレント行に貼り付ける
mx(x はアルファベット)マーク
‘x(x はアルファベット)ジャンプ
set listchars=tab:>-tab の可視化
set list

rsync によるサーバー間のディレクトリ同期

[root@spirit cron.daily]# cat /etc/cron.daily/mail_daily_image_copy
#!/bin/sh

# stop mail delivery serice
service postfix stop

# backup each Maildir updates files
rsync -avz /home/munakata/Maildir    /opt/backup/mail/munakata_image > /dev/null
rsync -avz /home/public_mail/Maildir /opt/backup/mail/public_image   > /dev/null
rsync -avz /home/stored_mail/Maildir /opt/backup/mail/stored_image   > /dev/nuli

# restart mail delivery serice
service postfix start
#!/bin/sh
# sync server:/home/httpd/html to client:/work/html
while [ -n "$(echo $1 | grep '^-')" ]; do
    options="$options $1"
    shift
done
rsync -auv $options --exclude "*~" server:/home/httpd/html/ /work/html/
[root@backup script]# cat ./peewee_sync.sh
#!/bin/sh
# sync spirit.hmuna.com master peewee data to "backup.hmuna.com" remote copy
while [ -n "$(echo $1 | grep '^-')" ]; do
     optins="$options $1"
     shift
done
rsync -avx --delete -e ssh $options --exclude "*~" spirit.hmuna.com:/home/peewee/ /opt/backup/peewee_backup/

Linux 環境変数の設定

[root@spirit ~]# source /etc/profile    <--- 環境変数の即時有効化
[root@spirit ~]# ls -l /etc/profile.d/
合計 96
-rwxr-xr-x  1 root root  720  8月 23  2005 colorls.csh
-rwxr-xr-x  1 root root  713  8月 23  2005 colorls.sh
-rwxr-xr-x  1 root root  192  2月 22  2005 glib2.csh
-rwxr-xr-x  1 root root  190  2月 22  2005 glib2.sh
-rwxr-xr-x  1 root root   58  3月  8 23:13 gnome-ssh-askpass.csh
-rwxr-xr-x  1 root root   70  3月  8 23:13 gnome-ssh-askpass.sh
-rwxr-xr-x  1 root root  218  3月  9 06:49 krb5.csh
-rwxr-xr-x  1 root root  210  3月  9 06:49 krb5.sh
-rwxr-xr-x  1 root root 2182  3月  9 12:35 lang.csh
-rwxr-xr-x  1 root root 2470  3月  9 12:35 lang.sh
-rwxr-xr-x  1 root root  122  2月 22  2005 less.csh
-rwxr-xr-x  1 root root  108  2月 22  2005 less.sh
-rwxr-xr-x  1 root root   13  8月 22  2005 vim.csh
-rwxr-xr-x  1 root root  181  8月 22  2005 vim.sh
-rwxr-xr-x  1 root root  170  2月 22  2005 which-2.sh
[root@spirit ~]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin: ・・・・・・・
[root@spirit ~]# export
declare -x ANT_HOME="/usr/local/ant-1.6.5"
declare -x CATALINA_BASE="/usr/java/tomcat-5.5.17"
declare -x CATALINA_HOME="/usr/java/tomcat-5.5.17"

LD_LIBRARY_PATHが無効になってしまう問題 ( fedora JP 掲示板 より )

プログラムの実行結果を画面(stdout)に出力しない

意 味BシェルCシェルBAシェル
標準出力をfに書く>f>f>f
標準入力をfから読み込む<f<f<f
標準出力をfに追加する>>f>>f>>f
標準エラー出力をfに書く2>f無し2>f
標準エラー出力をfに追加する2>>f無し2>>f
標準エラー出力を標準出力と同じところに書く2>&1無し2>&1
標準出力,標準エラー出力,ともにfに書く>f 2>&1>&f>f 2>&1
標準出力,標準エラー出力,ともにfに追加する>>f 2>&1>>&f>>f 2>&1
標準出力を強制的にfに書く無し>!f無し
標準出力を強制的にfに追加する無し>>!f無し

正規表現(Regular Expressions)

sed(Streaming Editor)

Log Watch の設定

[root@spirit ~]# chmod 000 /etc/log.d/scripts/services/amavis

[root@spirit ~]# ls -l /etc/log.d/scripts/services/ 
合計 772
-rwxr-xr-x  1 root root  1519  8月 23  2005 afpd
----------  1 root root  7326  8月 23  2005 amavis
-rwxr-xr-x  1 root root   592  8月 23  2005 arpwatch
-rwxr-xr-x  1 root root  3487  8月 23  2005 automount
--------------------- amavis Begin ------------------------ 
sh: /etc/log.d/scripts/services/amavis: Permission denied
---------------------- amavis End -------------------------

24時間以上古いファイルの削除 ⇒ find の -mtime オプションを利用

  1. mtime +0 : 今から24時間以上前のファイル
  2. mtime +1 : 今から48時間以上前のファイル
  3. mtime +2 : 今から72時間以上前のファイル
[root@spirit Maildir]# find /home/headline/Maildir/cur -maxdepth 1 -type f -mtime +0 |/usr/bin/xargs /bin/rm -f

FC5 が selinux の影響で起動できない (HP ProLiant )

文字コードセットを Ja_JP.eucJP に変更後に man ページが表示できない問題の対策 (CentOS 4.3 Final)

[root@spirit]#yum remove man
[root@spirit]#yum remove man-pages.noarch
[root@spirit]#yum remove man-pages-ja.noarch
[root@spirit Downloads]# cd lv451
[root@spirit lv451]# cd build/
[root@spirit build]# ../src/configure
[root@spirit build]# make
[root@spirit build]# make install

[root@spirit build]# lv -V
# lv v.4.51 (Jan.16th,2004)
# All rights reserved. Copyright (C) 1996-2004 by NARITA Tomio
# ABSOLUTELY NO WARRANTY; for details type `lv -h'

[root@spirit build]# /usr/bin/makewhatis
[root@spirit build]# which lv
/usr/local/bin/lv
[root@spirit man-pages-ja-20060915]# make config
perl -w script/configure.perl
[INSTALLATION INFORMATION]
(just Return if you accept default)
   Install directory   [/usr/share/man/ja_JP.eucJP] ?: ja   <---- ja に変更する
 
( snip )
[root@spirit man-pages-ja-20060915]# make
[root@spirit man-pages-ja-20060915]# make install
[root@spirit man-1.5p]# ./configure +lang ja
[root@spirit man-1.5p]# make
[root@spirit man-1.5p]# make install
#PAGER          /usr/bin/less -is
PAGER           /usr/local/bin/lv

checkstack.pl で関数のスタック消費量を調べる

Linux カーネルのソースコードに付属する checkstack.pl を使うと、C/C++ のプログラムの関数のスタック消費量を調べることができます。checkstack.pl は objdump -d のディスアセンブルの出力からスタックポインタの操作をパターンマッチしてスタックの消費量を計算しています。

% apt-get source kernel-source-2.6.8
% objdump -d foo.o | perl checkstack.pl

foo.o の部分は ELFバイナリなら実行ファイルでも共有ライブラリでも大丈夫です。ただし、関数名を表示するにはバイナリにシンボル情報が入っている必要があります。strip したバイナリに対しては関数のアドレスのみが表示されるため、あまりうれしくありません。

#include <signal.h>
void *p;
void func() {
    struct sigaction x;
    p = &x;
}
% gcc -c test.c
% objdump -d test.o| checkstack.pl
0x0003 func:                        144

結果は、144バイトになりました。sizeof(struct sigaction) の結果は 140バイトですが、x86_32 用のコードでは gcc はデフォルトでスタックポインタを 16バイトでアライメントして操作しています。サイズによる最適化オプション -Os をつけると 140 になります。

% gcc -c -Os test.c
% objdump -d test.o| checkstack.pl
0x0003 func:                        140
#include <signal.h>
void *p, *q;
void func() {
    struct sigaction x;
    struct sigaction y;
    p = &x;
    q = &y;
}

プログラムを次のように変更して struct sigaction の変数を 2つに増やすと、それぞれ -Os なしは 288バイト、 -Os つきは 280 バイトになります。

#include <signal.h>
void *p, *q;
void func() {
    struct sigaction x;
    struct sigaction y;
    p = &x;
    q = &y;
}

ところで、手元の checkstack.pl はスタックの消費量が 100 バイト以下の関数は無視するようにコードが書かれていました。100バイト以下の関数も表示する場合は以下のラインをコメントアウトします。

                next if ($size < 100);
/^.*[as][du][db]    \$(0x$x{1,8}),\%esp$/

kernel mmap の over_committe の抑止

echo 2 >/prco/sys/vm/overcommit_memory
echo 2 >/prco/sys/vm/overcommit_memory
echo 100 > /proc/sys/vm/overcommit_ratio
アプリケーションの実行

組み込み機器で malloc を使う時の留意点

  1. メモリープールの実装例

Linux デバッグに必要は機能 (京都マイクロコンピュータ 資料より)

http://www.kmckk.co.jp/linux/linux1.html

kmcc_001.JPG
kmcc_002.JPG

IO scheduler の種類と特徴 (kernel2.6.10 から適用されている)

ファイルの連結

[root@spirit ~]# cat maillog.4 maillog.3 maillog.2 maillog.1 maillog > maillog_combined

cron はいつ実行されるか ----> /etc/crontab で実行時間が決められている

[root@spirit ~]# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/ 

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

HEWで sh4-linux-gccのデバッグ情報が読めるか

日立SK 開発事業部 第2開発本部 第3設計部(s2開32)菅野紀顕 の回答

Linux コンソール端末のログインシェルの切替

X-window でのグラフィカルログインが出来ない場合の対策

[root@spirit] aticonfig --initial  --input=/etc/X11/xorg.conf
[root@spirit] startx

Fedora7 で nVidia のドライバーがインストールできない問題

git で kernel をダウンロード

[root@localhost src]# git-clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Initialized empty Git repository in /home/munakata/src/linux-2.6/.git/
remote: Generating pack...
remote: Done counting 552198 objects.
remote: Deltifying 552198 objects...
remote:  100% (552198/552198) done
Indexing 552198 objects...

find と組み合わせた file パーミションの一括操作

[root@spirit peewee]# find . -type f -exec chmod 666 {} \;
[root@spirit peewee]# find . -type d -exec chmod 755 {} \;

SDカード FAT マウント時の umask 値設定

# mount -t vfat -o umask=000 /dev/sd.. /mnt/sd

user 空間へのデータコピー

ユーザ空間へのデータコピーは mm/filemap.c の中にある file_read_actor() でやっています(947 行目当たり)。この中 で、何バイトをコピーしていそうか見て頂くと( 971 行目を使っているか、など)、もしかしたら何かが見えるかもしれま せん。

Linux で RAR f形式のアーカイブを解凍する方法 (= fileunrar

wget http://dag.wieers.com/packages/unrar/unrar-3.6.2-1.el4.rf.i386.rpm
rpm -Uvh unrar-3.6.2-1.el4.rf.i386.rpm
unrar x -kb "archibed_file.rar"

Sylpheed で外部エディターに秀丸を指定する

'c:\Program Files\Hidemaru\Hidemaru.exe' '%s'

SH-Linux の intevent(割り込み番号)と kernel 割り込みの関係

Just to follow. Linux kernel for SuperH always uses the 
following math to convert Intevent Code to IRQ number:

	(intevent >> 5) - 16 = IRQ number

Goda-san's calculation

	(intevent - 0x200) / 0x20

is basically the same as above. ;) You can find this in 
include/asm-sh/irq.h, evt2irq() macro.

SEGV発生箇所の特定方法

ライブラリ内でSEGV が発生した場合を例にして、 SEGV の発生箇所を特定する方法を記述します。

$ less segvtestlib.c
#include <stdio.h>

int test_func(void) {
    int *ptr = NULL;

    *ptr = 1; 

    return 0;
}

$ less segvtest2.c
#include <stdio.h>

extern int test_func(void);
int main() {

    test_func();
    return 0;
}
$ sh4eb-linux-gcc -shared -Wl,-soname,libsegv.so -o libsegv.so.1 segvtestlib.c
$ ln -s libsegv.so.1 libsegv.so
$ sh4eb-linux-gcc segvtest2.c -o segvtest2 -lsegv -L.

添付したカーネルを使用してターゲットボードを立ち上げ、 プログラムを実行してください。

# ./segvtest2
info.si_addr= 0
pc=2957b6d0 pr=0040062c
pid=741
tid=741
name=segvtest2

SEGV の発生したPCや、 SEGV を発生させたpid, tid、 SEGV を発生させたプログラム名を確認してください。

(注意) tid は、スレッドID です。 スレッドを作成された際にスレッドID をログに表示しておくと、 そのスレッドがエラーを吐いたか確認できるかと思います。 この際に、gettid(2) を使いスレッドのIDを表示するのではなく、 syscall(__NR_gettid) を使ってください。 (gettid(2) では、pid の値が帰ってきてしまいます)

なお、syscall(__NR_gettid)を使用するために、 以下のマクロを定義し、ヘッダを読み込んでください。

#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
syscall(__NR_gettid)
# ldd segvtest2
        libsegv.so => ./libsegv.so (0x2957b000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x2958c000)
        libc.so.6 => /lib/libc.so.6 (0x295ad000)
        /lib/ld-linux.so.2 (0x29556000)

前手順で判明したPC より、libsegv.so 内で問題が発生しているのが分かります。

0x2957b6d0 - 0x2957b000 = 0x06d0 ライブラリの上記の位置で問題が発生しています。

・開発機上で以下を実行しライブラリ内の何処で問題  が発生しているかを確認してください。

(nmコマンドが、ターゲットボード上に存在するなら ターゲットボード上で実行しても構わないです)

$ sh4eb-linux-nm ./libsegv.so.1 |sort | less

         w _Jv_RegisterClasses
         w __cxa_finalize@@GLIBC_2.2
         w __deregister_frame_info@@GLIBC_2.2
         w __register_frame_info@@GLIBC_2.2
00000480 T _init
00000580 t __do_global_dtors_aux
00000620 t frame_dummy
000006c0 T test_func
000006e0 t __do_global_ctors_aux
00000720 W __gmon_start__
00000740 T _fini
00000778 r __EH_FRAME_BEGIN__
00000778 r __FRAME_END__
0001077c d __CTOR_LIST__
00010780 d __CTOR_END__
00010784 d __DTOR_LIST__
.....

問題発生箇所が、0x06d0 なので、 test_func の中で問題が発生しているのが分かります。

ubbot による uboot の書き換え ( u-boot 上での作業です。)

  1. nfs で u-boot.binをメモリにロードする。
  2. フラッシュメモリの書き込みたい領域のプロテクトを解除
    protect off プロテクト解除開始アドレス プロテクト解除終了アドレス
  3. フラッシュメモリの書き込みたい領域の領域を初期化
    erase 初期化開始アドレス 初期化終了アドレス
  4. 1 でロードしたu-boot.binイメージをフラッシュに書き込む
    cp ロードアドレス フラッシュ書き込み開始アドレス サイズ(Hex)

途中でリセットすると、起動できなくなるので、注意してください。

マルチメディアコンテンツのヘッダー解析ツール

http://mediainfo.sourceforge.net/ja (日本語) http://mediainfo.sourceforge.net/en (English)

Linux performance tuning parameters

Just FYI, some of these writeback parameters can be tuned from /proc:

damm@rx1 / $ cat /proc/sys/vm/dirty_background_ratio5

Some /proc/sys/ parameters (like the above) will affect performance.

Hi Paul,

 The cause of the problem that we had has been understood.
 Between kernel-2.6.21 and 2.6.22, the following setting is different.

 diff -Nur linux-2.6.21.7/mm/page-writeback.c linux-2.6.22/mm/page-writeback.c
 --- linux-2.6.21.7/mm/page-writeback.c  2007-08-05 01:11:13.000000000 +0900
 +++ linux-2.6.22/mm/page-writeback.c    2007-07-09 08:32:17.000000000 +0900
 @@ -67,12 +67,12 @@
  /*
  * Start background writeback (via pdflush) at this percentage
  */
 -int dirty_background_ratio = 10;
 +int dirty_background_ratio = 5;

  /*
  * The generator of dirty data starts writeback at this percentage
  */
 -int vm_dirty_ratio = 40;
 +int vm_dirty_ratio = 10;

 5% of the main memory is made a threshold, and pdflush is executed.
 Pdflush is executed by exceeding this limen when "File Copy 4096 bufsize 8000 maxblocks"
 is being tested. Therefore, I understood that the score decreased.

 And, kernel-2.6.30 changes this setting again.

 http://www.kernel.org/pub/linux/kernel/v2.6/testing/patch-2.6.30-rc8.bz2

 diff --git a/mm/page-writeback.c b/mm/page-writeback.c
 index 74dc57c..bb553c3 100644
 --- a/mm/page-writeback.c
 +++ b/mm/page-writeback.c
 @@ -66,7 +66,7 @@ static inline long sync_writeback_pages(void)
 /*
  * Start background writeback (via pdflush) at this percentage
 */
 -int dirty_background_ratio = 5;
 +int dirty_background_ratio = 10;

  /*
  * dirty_background_bytes starts at 0 (disabled) so that it is a function of
 @@ -83,7 +83,7 @@ int vm_highmem_is_dirtyable;
  /*
  * The generator of dirty data starts writeback at this percentage
  */
 -int vm_dirty_ratio = 10;
 +int vm_dirty_ratio = 20;
 
 *** Original linux-2.6.27 for R0P7785LC
 File Copy 1024 bufsize 2000 maxblocks          3960.0      58262.6    147.1
 File Copy 256 bufsize 500 maxblocks            1655.0      19330.0    116.8
 File Copy 4096 bufsize 8000 maxblocks          5800.0      10793.1     18.6

 *** linux-2.6.27( changes to dirty_background_ratio=10 and vm_dirty_ratio=20.)
 File Copy 1024 bufsize 2000 maxblocks          3960.0      58957.9    148.9
 File Copy 256 bufsize 500 maxblocks            1655.0      20071.5    121.3
 File Copy 4096 bufsize 8000 maxblocks          5800.0     113057.7    194.9

GRUB の再インストール (Ubuntu)

通常はこれで Grub が再設定されるが、これが Windows との dual boot の場合などでうまく行かない場合には
FreeDOS の iso イメージを焼いてシステムを起動し

fdisk /mbr 1

で一番目のディスクの MBR への書き込みが行われる。 以降は上記 Ubuntu Live CD の手順を実行すればよい。

[Ubuntu] Grubの設定をGUIで

$ sudo apt-get install startupmanager

これを使えば/boot/grub/menu.lstを直接編集せずにGrubの設定を変更出来る。

SH-Debian cross toolchain の導入 (chroot 環境で実行)

  1. 適当なディレクトリに移動
  2. mkdir sid-rootfs
  3. sudo apt-get update
  4. sudo apt-get install debootstrap chroot
  5. sudo debootstrap sid sid-rootfs http://ftp.jp.debian.org/debian/
  6. sudo chroot sid-rootfs
  7. 依存するパッケージのインストール
    dpkg --info gcc-4.3-sh4-linux-gnu_4.3.4-1_i386.deb を実行したときに
    出力される Depends の行が依存するパッケージです。
  8. クロスコンパイラのインストール
  9. 開発は sid-rootfs の中で行う。

GIMP GIF 背景色の透明化

Youtube のファイルの扱い

% MP4Box -raw 2 tronlegacy.mp4
Extracting MPEG-4 AVC-H264 stream to h264
% ls
tronlegacy.mp4  tronlegacy_track2.h264
% mediainfo tronlegacy.mp4
General
Complete name                    : tronlegacy.mp4
Format                           : MPEG-4
Format profile                   : Base Media / Version 2
Codec ID                         : mp42
File size                        : 35.3 MiB
Duration                         : 2mn 20s
Overall bit rate                 : 2 108 Kbps
Encoded date                     : UTC 2010-03-08 01:48:02
Tagged date                      : UTC 2010-03-08 01:48:02
gsst                             : 0
gstd                             : 140851
gssd                             : B4A7D6683HH1286348198852986
gshh                             : v3.lscache3.c.youtube.com

Video
ID                               : 2
Format                           : AVC
Format/Info                      : Advanced Video Codec
Format profile                   : High@L3.1
Format settings, CABAC           : Yes
Format settings, ReFrames        : 3 frames
Codec ID                         : avc1
Codec ID/Info                    : Advanced Video Coding
Duration                         : 2mn 20s
Bit rate mode                    : Variable
Bit rate                         : 1 980 Kbps
Maximum bit rate                 : 12.2 Mbps
Width                            : 1 280 pixels
Height                           : 534 pixels
Display aspect ratio             : 2.35:1
Frame rate mode                  : Constant
Frame rate                       : 23.976 fps
Resolution                       : 8 bits
Colorimetry                      : 4:2:0
Scan type                        : Progressive
Bits/(Pixel*Frame)               : 0.121
Stream size                      : 33.1 MiB (94%)
Title                            : (C) 2007 Google Inc. v08.13.2007.
Encoded date                     : UTC 2010-03-08 01:48:02
Tagged date                      : UTC 2010-03-08 01:48:02

Audio
ID                               : 1
Format                           : AAC
Format/Info                      : Advanced Audio Codec
Format version                   : Version 4
Format profile                   : LC
Format settings, SBR             : No
Codec ID                         : 40
Duration                         : 2mn 20s
Bit rate mode                    : Variable
Bit rate                         : 124 Kbps
Maximum bit rate                 : 220 Kbps
Channel(s)                       : 2 channels
Channel positions                : Front: L R
Sampling rate                    : 44.1 KHz
Stream size                      : 2.08 MiB (6%)
Title                            : (C) 2007 Google Inc. v08.13.2007.
Encoded date                     : UTC 2010-03-08 01:48:02
Tagged date                      : UTC 2010-03-08 01:48:02
% ./youtube-dl -f 18 "http://www.youtube.com/watch?v=TtbrLIwKWWA"
[youtube] Setting language
[youtube] TtbrLIwKWWA: Downloading video webpage
[youtube] TtbrLIwKWWA: Downloading video info webpage
[youtube] TtbrLIwKWWA: Extracting video information
[download] Destination: TtbrLIwKWWA.mp4
[download] 100.0% of 4.25M at  252.82k/s ETA 00:00
# omxvideodectest -d OMX.re.videodecoder -o output.yuv input.264

NautilusSVN (RabbitVCS: Linux CVS GUI cleint)

iPad/iPhone 4のビデオ再生仕様

Live Linux USB Creator (LiLi)

ideapad S10e wlan (BCN4312)ドライバー

$ mkdir hybrid_wl
$ cd hybrid_wl
$ tar xzf <ダウンロードしたパス>/hybrid-portsrc.tar.gz

$ make clean   (初めて実行する際は不要)
$ make
もし b43-fwcutter をインストーしていたら削除
$ sudo apt-get remove b43-fwcutter
ドライバーモジュールをインストール
$ sudo make install
$ sudo echo "blacklist ssb" >> /etc/modprobe.d/blacklist.conf
$ sudo echo "blacklist b43" >> /etc/modprobe.d/blacklist.conf
$ sudo depmod -a 

ここまでで modprobe wl とすればとりあえず利用はできるのだが、もう1ステップおまじない(?)が必要である。 ここでメニューバーの 「システム - システム管理 ー ハードウエアドライバ」で今、作成したドライバの登録を行う。これは modprobe wl 実行後、行ったが自動検索して容易に行えた。画面は次のようなものだ。

Ubuntu : scim-anthyのキーバインドやローマ字キーマップを ATOK/IME 互換に変更

設定方法は,SCIMを起動して右から2番目の[コマンドメニューを表示]をクリックし,更に[SCIMを設定]をクリックします。すると[SCIM入力メソッド設定]が起動するので,左の[Anthy]タブを開きます。[キーバインド]タブの[キーバインドテーマ]をお好みのものにし,さらに[ローマ字入力]タブを開いて[ローマ字テーブル]も変更します。

virtualbox のクローン作成

Magetta (OSS HTML5 authoring tool

Ubuntu 1104 で無線LANが使えなくなっている問題の対策

munakata@muna-E420:~$ lsmod
Module                  Size  Used by
parport_pc             36959  0 
ppdev                  17113  0
binfmt_misc            17565  1 
    ↓            ↓   ↓
munakata@muna-E420:~$ sudo lshw -C network
[sudo] password for munakata: 
  *-network               
       description: Ethernet interface
       product: RTL8111/8168B PCI Express Gigabit Ethernet controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: eth0
       version: 06
       serial: f0:de:f1:65:e5:0a
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full ip=192.168.1.60 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
       resources: irq:40 ioport:5000(size=256) memory:d0404000-d0404fff memory:d0400000-d0403fff
  *-network DISABLED
       description: Wireless interface
       product: RTL8188CE 802.11b/g/n WiFi Adapter
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:08:00.0
       logical name: wlan0
       version: 01
       serial: ec:55:f9:c4:3d:ae
       width: 64 bits
       clock: 33MHz
            ↓
munakata@muna-E420:~$ rfkill list
0: hci0: Bluetooth
	Soft blocked: no
	Hard blocked: no
1: tpacpi_bluetooth_sw: Bluetooth
	Soft blocked: no
	Hard blocked: no
2: phy0: Wireless LAN 
	Soft blocked: yes
	Hard blocked: no
3: acer-wireless: Wireless LAN
	Soft blocked: yes
	Hard blocked: no
munakata@muna-E420:~$ sudo rmmod -f acer-wmi
munakata@muna-E420:~$ rfkill unblock all

Thinkpad E420 トラックパッドの無効化 (ポインターだけで操作したい)

Virtualbix のマウス統合機能の無効化、再有効化

/etc/fstab 設定例

testdisk によるクラッシュしたHDDからのデーター救済手順説明

Ubuntu 起動時にメッセージを出させる

find の実行で 『find: パス名は評価式の前に置かなければいけません』 というエラーが出て検索できない問題

Lenovo E420 で無線LANが使えない問題

munakata@muna-E420:~$ rfkill list
1: tpacpi_bluetooth_sw: Bluetooth
	Soft blocked: yes
	Hard blocked: no

munakata@muna-E420:~$ sudo rmmod -f acer-wmi

munakata@muna-E420:~$ rfkill unblock all

root でも消せないファイルをどうするか

root@mythen:/home/server-admin# ls -la
ls: .gvfs にアクセスできません: 許可がありません
合計 300
drwxr-xr-x 36 server-admin server-admin  4096 2011-12-31 21:56 .
drwxr-xr-x  3 root         root          4096 2011-12-17 10:04 ..
-rw-------  1 server-admin server-admin  7636 2011-12-30 07:18 .ICEauthority
-rw-------  1 server-admin server-admin   103 2011-12-30 07:18 .Xauthority
drwx------  3 server-admin server-admin  4096 2011-12-11 21:44 .adobe
drwx------  3 server-admin server-admin  4096 2011-12-31 22:22 .anthy
(snip)
-rw-rw-r--  1 server-admin server-admin   369 2011-12-17 10:10 .gtk-bookmarks
d?????????  ? ?            ?                ?                ? .gvfs
drwxrwxr-x  4 server-admin server-admin  4096 2011-12-18 08:22 .icedtea

GUI 画像の一括リネーム 一括リサイズ 一括変換が簡単にできる

画像ファイル整理用のperl スクリプト群

vi を使いやすくするため、 半角/全角キーも ESC に割り当てる


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS