メイン

2008年07月01日

Mysql DB を別マシンのMysqlに移行するには?

新しいマシンにmysqlとmysql-serverを導入する。

  yum -y install mysql

でmysqlのクライアントを導入する。

  yum -y install mysql-server

でmysqlのサーバを導入する。

元マシンからDBのファイルをコピーする

scp -r /var/lib/mysql 192.168.1.200:~

  サブフォルダを含めてコピー

とかすると新しいマシン(192.168.1.200)にコピーしてくれます。
他にもftpで転送しても問題ありません。

2008年04月03日

ddの使い方

USB接続のHDをLinuxマシンに接続すしてLinuxマシン上のHDスペースにバックアップするには。

dd bs=512 if=/dev/sda of=/var/bkup

のように使用します。

ヒント:

USBのHDをLinuxに接続すると

 tail /var/log/messages

で調べると /dev/XXX のXXXを調べられます。

バックアップ先 (of= xxxxx)は、適当に作成する。

bs=512は、

  fdisk /dev/xxx

でバックアップするHDの情報を調べます。

fdisk /dev/hda

とか入力すると、、、

Disk /dev/hda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

とかってでてくるので、
512のところを参考にします。
















Google







 


















2007年11月10日

livna Fedora8

livnaリポジトリを追加するには、

rpm -ivh http://rpm.livna.org/livna-release-8.rpm

とすると、mplayerなどのソフトがyumでインストールできるようになります。

(参考)http://rpm.livna.org/rlowiki/UsingLivna

Google
 

Fedora8 公開 2007.11.8

ついにFedora8が公開されました。 ダウンロードは次から可能です。

インストールDVDの入手先   

     http://fedoraproject.org/get-fedora

ISOをDVDに焼く         

     DVDDecrypterを使うと良い。
     (ISOメニューから Writeを選ぶとISOからDVDが焼ける)

Google
 

2007年10月31日

fedora7 firefoxでadobe flashを使うには yum

1.yumレポジトリのインストール

rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm


2. flashのインストール

yum -y install flash-plugin


以上で導入できます。

また、.tgzや.rpmをダウンロードしてインストールすることもできるようです。

Fedora7 ThinkPadのTrackPointのスクロールを有効に

Fedora7 ThinkPadのTrackPointのスクロールを有効にするには、

/etc/X11/xorg.conf

を以下を参考に編集します。

<以下マウスの部分を抜粋>

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "PS/2"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "yes"
Option "Emulate3Timeout" "50"
Option "EmulateWheel" "yes"
Option "EmulateWheelButton" "2"
Option "EmulateInertia" "50"
EndSection

ちなみに、私は、ThinkPad X22を使っています。
過去、FedoraCore6 FedoraCore5 FedoraCore4でも同じように
トラックポイントでスクロールできました。

2007年10月19日

プロセスの中身を見るツール

strace

yum install strace でインストールできる。

gdb

  yum install gdb でインストールできる。

これらのツールを使うとプログラムがどのように動いているか確認できる。

2007年10月09日

livna FC5 test

yumコマンドを使ってもインストールできないパッケージが数多くあります。

例えば、動画を見るためのソフトで xine や mplayerなどです。

/etc/yum.repos.d/

にこれらのパッケージを持っているリポジトリを追加しておく必要があります。

yumするときは、ここもチェックしてねということです。

FedoraCore4 FedoraCore5は、このlivnaリポジトリを導入するのは簡単になっています。

http://rpm.livna.org/configuration.html

で確認できます。

<やり方> FedoraCore5の場合

rpm -ivh http://rpm.livna.org/livna-release-5.rpm

としてlivna-release-5パッケージを導入するだけです。

<導入確認>

どんなファイルがインストールされているか確認してみましょう。

rpm -ql livna-release-5
/etc/pki/rpm-gpg/RPM-GPG-KEY-livna
/etc/yum.repos.d/livna-devel.repo
/etc/yum.repos.d/livna-testing.repo
/etc/yum.repos.d/livna.repo

gpg-keyがインストールされ、.repoファイルが/etc/yum.repos.d/にコピーされます。

livna FC5 test

yumコマンドを使ってもインストールできないパッケージが数多くあります。

例えば、動画を見るためのソフトで xine や mplayerなどです。





2007年10月02日

/proc で実行されているプログラムを特定するには?

/procは、起動中のプロセスの情報を仮想ディレクトリとして

ファイルシステム上に見せてくれています。

例えば、

ls -l /proc/1

とするとinitプロセス(プロセスID 1)について教えてくれます。

出力結果の中に

  exe -> /sbin/init

と書いてあります。つまり、/sbin/initが実行されていることがわかるのです。


面白いのは、[ ] (square brackets)で囲まれているプロセスに対しては、exe が実行ファイルを
示していないところです。

これらの実態はどこにあるのでしょう。

2007年10月01日

ps ax の出力の[ ] で囲まれているプロセスとは

ps ax をとると initプロセスに続いてプロセス名が[ ] (square brackets)で囲まれているプロセスが
あります。これらは、どうもkernelが使っているプロセスのようです。

次のような記述がありました。

以下引用 (http://c2.com/cgi/wiki?LinuxOperatingSystem)

Modules do not a MicroKernel make - once a module has been loaded it exists as part of the kernel, with no distinction from other parts of the kernel (except its ability to be unloaded), and if Linux's only modular feature was loadable kernel modules, then it would definitely not be a MicroKernel. However, Linux has kernel threads which act somewhat like MicroKernel servers - the processes in square brackets that appear just after init in your process list, like kflushd, kswapd, khubd, kjournald. Those could be used as evidence that Linux is not monolithic. =) -- TorneWuff

2007年06月22日

vim バックアップ作成しない方法

■vimはバックアップを作成する設定になっています。
 
  vim hoge.txt を何回か編集したら

  hoge.txt~ というバックアップファイルが作成されます。

  これが必要ないときは、以下のとおり設定します。

■vimrcの編集

 gvim を使っていれば、gvimrc に次の記述を追加します。

set nobackup

(※ファイルの最後に追加するといいでしょう)
 
以上でバックアップファイルを自動で作成しなくなります。

2007年02月16日

vim 新規ファイルの拡張子 (勝手にコメント)

vimで新規にファイルを作成するときに名前と拡張子(例:hoge.c)も指定すると、勝手に以下のようなヘッダ情報が付加されます。

この機能を止めるには:

/usr/share/vim/vim64/plugin/templates

にある、ファイルを変更しておきます。

とりあえず、次のようにファイル(例:c-file-header)を別名にします。

   mv c-file-header c-file-header.bk

これで、拡張子をつけて新規にファイルを作成しても、ヘッダ情報を自動で付加しなくなります。

<コメント>
このような機能は、どこかのワープロソフトを思わせますね。まさか、VIMで同じ思いをいだくとは、、、、。

<付加されるヘッダ情報(例)>
/*
* =====================================================================================
*
* Filename: hoge.c
*
* Description:
*
* Version: 1.0
* Created: 02/16/2007 04:47:25 AM JST
* Revision: none
* Compiler: gcc
*
* Author: read README.csupport to learn how to set defaults (),
* Company:
*
* =====================================================================================
*/

2007年01月21日

vim 最大化 最小化

vim を開いた時に最大表示するには、

  :simalt ~x (最大化)

とします。

VIMを開いた時に最大化するには、

  au GUIEnter * simalt ~x

  vimrc(Win) 
  .vimrc(unix系)

に追加します。

ちなみに

  :simalt ~r (元に戻す)

は、サイズをもとにもどします。

<宣伝> コンピュータ教室を開催しています。

福岡市早良区四箇田 毎週日曜日(5PM-7PM)。

内容はWin、Unix、電子回路とかいろいろ。興味のあるものを学びます。
操作を覚えるだけではなく、理解し楽しむことを目標にします。


2007年01月13日

find

<findの使い方例>

現在の階層以下2レベルで、ディレクトリで5分以内に更新があったものを見つけます。

<コマンド>

find ./ -maxdepth 2 -type d -cmin -5

<意味>
-maxdepth 最大の深さ
-type d directory
-cmin change minute
-5 5分まで

2007年01月12日

vim

vimのビープ音を消すには。

<設定>
VIMを起動します。
次のコマンドを実行します。

  :set vb t_bv=

コロンでコマンドを入力開始
vb visual beepの略
t_bv=
でOFFにします。

<自動的に設定する>
Unix系のOSの場合は、ホームディレクトリにある

  .vimrc   (ドットvimrc)

というファイルに上記のコマンドを記述しておきます。

Windowsの場合は、vimをインストールしたディレクトリ内にある

  vimrc (ドットなし)

に記述します。

2006年12月06日

BASH tcsh シェル

Unix系のOSには、コマンドを処理してくれるプログラムのことをシェルと呼びます。

コマンドライン インタープリタ (command line interpreter)とも呼ばれます。
つまり、コマンドを解釈して実行してくれる、プログラムということです。

シェルには、大きく分けて、Bシェル系とCシェル系があります。

Cシェル(csh)は、Bill Joyにより書かれたものです。
Bシェルは、Steve Bourneによって書かれたとあります。

自分のシェルは、

  echo $SHELL

で確認できます。

BASHでは、タブを2回押すとそのディレクトリのファイルやコマンドの候補を表示してくれるので便利です。

シェルを切り替えるには単純に、

 bash

 tcsh

のように起動します。

いつも使っている環境と違うシェルが設定してある場合は、自分の慣れているシェルを起動すると良いでしょう。

2006年11月30日

日本語キーボードに変更する

FedoraCore4,5,6とかで、

/etc/sysconfig/keyboardで変更できる。

KEYTABLE="jp106"

のようにすると、日本語キーボードを使用することになる。

2006年11月29日

nmap

ローカルネットワーク上でどのホストが稼動しているか調べるには。

  nmap -sT 192.168.1.0/24

とします。稼働中のホストと、開いているポートを知らせてくれます。

yumでのパッケージ検索


yum list \*devel

とすると、develで終わるパッケージリストを表示してくれます。

また

yum search {言葉}

とすると
{言葉}を含むパッケージの説明をリストにします。

2006年11月27日

vim-enhanced と vi

FedoraCore5くらいから、viコマンドで起動するのは、vi-minimamというviになった。 vimと打つのが面倒!

<やりたいこと>
viでvim-enhancedが起動するようにしたい。

<やり方>
vi ~/.bashrc   <-------ホームディレクトリにある、「.bashrc」ファイル

最後の行に

  alias vi='/usr/bin/vim'

を追加します。(vimの実際のパスにします)
これで、端末を起動する度にaliasが設定されるようになります。

端末を閉じて、開くか、次のコマンドを実行します。

  source ~/.bashrc <------------今起動中のbashでこのスクリプトを実行

いずれにしても、viでvimが起動するようになります。

<コメント>
どんなVIMがインストールされているかを調べるには、
  
  rpm -qa | grep vim

とすると調べることができます。

どんなファイルでそのパッケージが構成されているかを調べるには、

   rpm -ql vim-enhanced

です。

2006年11月26日

dhcpd

dhcpdの設定

MACアドレスに対してIPアドレスを割り振りたい。

<設定> /etc/dhcpd.conf <-----これは/usr/share/doc/dhcp-xxxx/dhcp.conf.sampleをコピーする
option time-offset -18000; #Eastern Standard Time
となっているのを

option time-offset 32400; #JST

とする。(GMTに対しての差を秒であらわしている)

host hogehogehoge{
hardware ethernet xx:xx:xx:xx:xx:xx:xx
fixed-address 192.168.1.x
}

などとするとよい。

FireFoxに追加できるもの Add-ons (アドオンズ)


Extensions
Themes
SearchEngines
Plugins
のようにカテゴリーに分かれている。

例えば、

https://addons.mozilla.org/firefox/search-engines/

にを開くとWebster とかWikipediaなどが追加できる。

ここで追加すると、右上の検索窓にメニューとして追加される。

2006年11月11日

リモートデスクトップ 接続

LinuxからWindows xp professionalにアクセスする。

<Windows側>
マイコンピュータのプロパティ リモートタブで「リモートデスクトップ」を有効にする。

<Linux側(FedoraCore5 FedoraCore6)>
yum -y install rdesktop
でインストールします。

rdesktop
で起動します。
接続先に相手のIPアドレスを入力します。

※Windowsから接続するのに比べ制約はあります。

2006年11月10日

yum ミラー

yumでインストールするときに遅い時があります。
接続先のミラーサーバから早いものを自動的に選んでダウンロードしてくれるプラグインがあります。

yum -y install yum-fastestmirror

でインストールします。

2006年10月31日

namedの公開

ブロードバンドルータを通してnamedを公開するときは、UDP 53を開く必要がある。

ブロードバンドのNTPT(ローカルサーバ)の設定で、UDP 53にアクセスがきたら、ローカルマシンに転送するような設定にしておく。

FreeBSDでは、自マシン以外からのアクセスを許可する必要があるので注意が必要です。

2006年10月28日

FedoraCore FTP経由でインストール

boot:

と出たところで、

linux askmethod

と入力して開始すると FTP、HTTPなどでインストール可能のもよう。

サイト名: ftp.hogehoge.jp               (例)
ディレクトリ: /Linux/fedora/core/6/ppc/os/   (例)

と指定します。どうやら、

repodata/

というディレクトリが必要のようですから、このディレクトリがあるところを探して指定する
といいようです。

2006年10月27日

Firefox2.0 起動しない libstdc++.so.5

libstdc++.so.5をインストールする必要がある。

yum provides libstdc++.so.5   (どのパッケージがlibstdc++.so.5を提供してるか調べる)

とすると

compat-libstdc++-33.i386 3.2.3-61 core

となります。

yum -y install compat-libstdc++-33  (comat-libstdc++-33をインストールする)

で導入できます。

念のため、

rpm -ql compat-libstdc++-33     (comat-libstdc++-33に含まれるファイルをリスト)

で確認できます。

2006年10月26日

FedoraCore6 キーボード 日本語入力

普通、「半角/全角」キーで日本語入力の「ON/OFF」ができるのに、できない。

Alt + 「半角/全角」 でとりあえず日本語入力になります。

キーボードが日本語キーボードではなくなっている。

「システム」「管理」「キーボード」で確認すと「日本語」になっています。
一度「英語」とかに切り替えて、また「日本語」に戻すと日本語になるようです。

livna FedoraCore6

rpm -ivh http://rpm.livna.org/livna-release-6.rpm

とすると、mplayerなどのソフトがyumでインストールできるようになります。

(参考)http://rpm.livna.org/rlowiki/UsingLivna










Google







 


















2006年10月25日

yumがうまく動作しない

<ここを確認>
# cd /etc/yum.repos.d/
# ls
fedora-core.repo fedora-legacy.repo
fedora-development.repo fedora-updates-testing.repo
fedora-extras-development.repo fedora-updates.repo
fedora-extras.repo

例えばUpdateするときは、

fedora-core.repo
fedora-extras.repo
fedora-updates.repo

の中の記述を

#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/
baseurl=http://ftp.kddilabs.jp/Linux/packages/fedora/core/$releasever/$basearch/os/
    http://ftp.riken.jp/Linux/fedora/core/$releasever/$basearch/os/
    http://ftp.iij.ad.jp/pub/linux/fedora/core/$releasever/$basearch/os/

#mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-$releasever

のように編集してみてください.
どうも混雑しているときには、ミラーサイトにアクセスできてないようです。
特に、リリースがあってすぐなど。

2006年10月17日

IBM Space Saver keyboard II Scroll FedoraCore5 FedoraCore6

/etc/X11/xorg.conf

に次の様な記述をするとスクロールできるようになります。

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "PS/2"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "yes"
Option "Emulate3Timeout" "50"
Option "EmulateWheel" "yes"
Option "EmulateWheelButton" "2"
Option "EmulateInertia" "50"
EndSection

2006年10月14日

ISOからDVDを作成する FedoraCore5

次の例では、FCのISOからインストールCDを作成しています。

growisofs -Z /dev/dvd=FC-5-i386-DVD.iso

(注意)autofsがONだとエラーが出て書き込めないようです。
    chkconfig autofs off でOFFにできます。
    念のため再起動しておくと良いでしょう。

(マニュアル抜粋)

 ISO9660 volume with Joliet and Rock-Ridge extensions on a DVD: 

(ISO9660の作成)
growisofs -Z /dev/dvd -R -J /some/files


To append more data to same DVD:

(ファイルの追加)
growisofs -M /dev/dvd -R -J /more/files

Make sure to use the same options for both inital burning and following sessions.

To use growisofs to write a pre-mastered ISO-image to a DVD: 

(映画とか)
growisofs -dvd-compat -Z /dev/dvd=image.iso

2006年10月13日

bittorrent ダウンロード FedoraCore5

<ソフト導入>
yum -y install bittorrent-gui

<ソフト起動>
bittorrent

あとは、ダウンロードしたbittorrentファイルをこのソフトで開くと良い。

カーネルのアップデート FedoraCore5

yum -y update kernel

でアップデートされる。

/boot/grub/grub.conf

も確認する必要がある。

ここに新しいカーネルが起動できるような記述が追加される。

カーネルソースのインストール FedoraCore5

yum -y install kernel-devel

とするとインストールされる。

rpm -ql

で確認するとよい。

2006年10月12日

FedoraCore6 リリース

2006年10月17日に公開予定のようです。

http://fedoraproject.org/wiki/Core/Schedule

で確認できます。

2006年10月11日

GNOME コマンド入力でウィンドウを開く

ウィンドウズでは、cmd.exeを開いて端末から

  start . (スタート スペース ドット)

で現在のディレクトリのウィンドウを開くことができます。

同じことをGNOMEで行うには、

  gnome-open . (ドット)
 
とすると、現在のディレクトリのウィンドウを開いてくれます。

2006年09月28日

メールを転送するには

<.forwardというファイルを作成する>

ユーザのホームディレクトリに次のファイルを用意する。

.forward  (ドットフォワード)

この中に転送したいメールアドレスを記述しておく。

 hogehoge@hogehoge.com

これでメール転送される。

2006年09月25日

src.rpmの使いかた 2

<treeをsrc.rpmからインストールする>

(src.rpmのダウンロード)
http://fedora.redhat.com/Download/mirrors.html
例)http://ftp.riken.jp/Linux/fedora/core/5/source/SRPMS/tree-1.5.0-3.2.1.src.rpm

(ディレクトリの準備)
mkdir -p /usr/src/redhat/BUILD
mkdir /usr/src/redhat/RPMS
mkdir /usr/src/redhat/SOURCES
mkdir /usr/src/redhat/SPECS
mkdir /usr/src/redhat/SRPMS

(src.rpmのインストール)
rpm -ivh tree-1.5.0-3.2.1.src.rpm

(rpmのビルド)
rpmbuild -ba /usr/src/redhat/SPECS/tree.spec
(注意:rpmbuild コマンドがない場合は、 yum -y install rpm-buildでインストールする)

(ファイルの確認)
find /usr/src/ -cmin -1
/usr/src/redhat/BUILD
/usr/src/redhat/BUILD/tree-1.5.0
/usr/src/redhat/BUILD/tree-1.5.0/LICENSE
/usr/src/redhat/BUILD/tree-1.5.0/tree.c
/usr/src/redhat/BUILD/tree-1.5.0/README
/usr/src/redhat/BUILD/tree-1.5.0/tree
/usr/src/redhat/BUILD/tree-1.5.0/Makefile.no-strip
/usr/src/redhat/BUILD/tree-1.5.0/Makefile
/usr/src/redhat/BUILD/tree-1.5.0/tree.c.colour
/usr/src/redhat/BUILD/tree-1.5.0/CHANGES
/usr/src/redhat/BUILD/tree-1.5.0/tree.1.carrot
/usr/src/redhat/BUILD/tree-1.5.0/tree.1
/usr/src/redhat/BUILD/tree-1.5.0/tree.o
/usr/src/redhat/BUILD/tree-1.5.0/tree.1.colour
/usr/src/redhat/RPMS/i386
/usr/src/redhat/RPMS/i386/tree-1.5.0-3.2.1.i386.rpm ← <<<<<< RPMファイルが作られている
/usr/src/redhat/SRPMS
/usr/src/redhat/SRPMS/tree-1.5.0-3.2.1.src.rpm

(インストール)
rpm -ivh /usr/src/redhat/RPMS/i386/tree-1.5.0-3.2.1.i386.rpm

Google
 

2006年09月18日

gvim

<目的>
FedoraCore5にgvimをインストールする。

<やり方>
yum -y install vim-X11

<コメント>
Windowsを使うときはgvimを使っているのに、FCを使うときはコマンドからVIMを使っていました。早くからインストールしておけばよかった、、、。

2006年09月17日

パッケージの構成ファイル

<Linux>FedoraCoreなどで、rpmパッケージを構成するファイルを調べるには、次のコマンドを使います。

rpm -ql hogehoge

<FreeBSD> FreeBSDでは、次のようになります。

pkg_info -L hogehoge

2006年08月21日

FedoraCore5 OpenOfficeをインストールするには

アプリケーションメニューから 一番下の「Add/Remove」 メニューから追加できます。

これを開いた画面で、「アプリケーション」を選択し、office/生産性のオプションで

OpenOffice関連にチェックを入れて「適用」をします。

yum install openoffice-writer

とか

yum install openoffice-math

とかでも可能です。

ちなみに、 base(基本) calc(表計算) draw(描画) inmpress(プレゼン) math(数式) writer(ワープロ)
などがあります。

2006年08月12日

nsswitch.conf と nslookup host dig pingの関係

nslookup、host、digコマンドなどで名前解決を行う場合、nsswitch.confの中の順番は関係ない。

これらのコマンドは、そもそもがdnsサーバを使って名前解決を確認するプログラムです。

nsswitch.confの順番が有効なのは、ping telnet、、、などのアプリケーション上での話しです。

<コメント>
いっあーずいぶん悩まされました。こんなことで悩んでるようでは、、、。
nsswitch.confを編集し hostでチェックしと何度も何度もやってた、、、。
何のことはない、hostがnsswitch.confを経由してないだけ、、、。とほほ、、、、。

2006年07月27日

自宅サーバ 構築 FedoraCore5

接続:
光Bフレッツプレミアム

機器:
CTU(ブロードバンドルータをNTTがカスタマイズしたような機器) 基本的にブロードバンドルータと捉えていいようです。(←いろいろと制約あるようです。機器に依存する接続ってありなん?インターネットなのに、、、)

サーバOS: Linux (FedoraCore5)
提供サービス: SSH HTTPD FTPD DNS

設定:
CTUで22、80、21、53UDP/TCPをサーバのIPアドレスへフォワードする

ドメイン取得先: godaddy

ドメイン委譲先のネームサーバ:
ドメインを取得したら、そのドメインを管理するネームサーバのアドレスを通常2つ(プライマリとセカンダリ)を登録する必要がある。

CTUに割り振られているグローバルIPアドレスをポイントさせる。しかし、GODADDYでは、IPアドレスを直接指定できない。そこで、DynDNSに静的IPアドレスとして登録し、そのFQDNを登録するとうまくいく。なぜか、CustomDNSのFQDNでは通らない。

ネームサーバ構築:
登録したドメインの名前解決をできるように、ネームサーバを構築する。
(忍耐力が必要である。慣れれば10分でできるが意味がわからなく写しているだけだと2日くらいかかる。)

ドメインの委譲が完了したら、名前解決が自分のマシンで行われるようになる。(ちょっと感動ものだ。)

2006年06月15日

TOMCAT CLASSPATH

CLASSPATHの設定の注意点

サーブレットやJSPが動かない時は

  jakarta-tomcat-5.0.28/common/lib/jsp-api.jar
  jakarta-tomcat-5.0.28/common/lib/servlet-api.jar

注意)servlet-aip.jarは、-であって_ではない。←気を付けよう!

がCLASSPATHに含まれていることを確認する。


また、他のライブラリをCLASSPATHに追加するときは、

/hoho/hoho/hoho/hogehoge.jar

のようにファイル名も含めて指定する。
展開して、ディレクトリを指定するとうまくいくはず。
  

解像度 FedoraCore5

画面の解像度をあげられない。

デスクトップ → 管理 → ディスプレイ → ハードウェア

これが

unknown monitor

になっていたら、、、、

 Generic LCD

とかを選んで

解像度を適当に選んで ログアウト ログイン すると

解像度を高く設定できるようになる。(かもしれない)

2006年06月11日

FedoraCore5 アップデート版 ISOイメージ

★FedoraCore5は、毎月アップデート版がリリースされる

今までは、リリースの間は、アップデートで対応しないといけなかったですが、この毎月リリースされるイメージを使えば、アップデートしたものを直接インストールできるので便利ですね。

●私もFedoraCore5は使っていますが、クライアントとしてほとんど問題ないですね。実際、どこかの自治体がWindowsなしでFedoraだけで仕事をしているところがあるとか。GUIの違いは結局のところ慣れなんですかね。携帯電話と似たようなものなのかもしれません。

●これが、毎月リリースして改善されるのは喜ばしい限りです。どんどん、FedoraCoreを使っていきましょう!

2006年05月31日

crond 使いかた

<やりたいこと>
Linuxマシンに1分間隔に何かさせたい

<使うもの>
crondを使いましょう。

<設定>
/etc/crontab ← このファイルに毎時、毎日、毎週、毎月に実行するディレクトリが用意されている
↑このファイルを編集します。
(前略)
# 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

0-59 * * * * root run-parts /etc/cron.minutely ←(1)これを追加する


<ディレクトリを作成>
mkdir /etc/cron.minutely ←(2)ディレクトリを作成する


<実行プログラムの用意>
/etc/cron.minutely    ←(3)このなかにプログラムを入れる

のなかに実行したいプログラムを用意します。

<サーバ再起動>
念のために、サーバを再起動しておきます。

/etc/init.d/crond restart ←(4)サーバを再起動する

2006年05月28日

Linux ハードディスク 追加するには FedoraCore

新しいハードディスクを追加するには、、、 (Ultra ATA接続の場合) リボンケーブルのやつ

0、ハードディスクを取り付ける

  マスター/スレーブの設定を確認
  接続先を確認(プライマリ/セカンダリ)

1、パーティションを区切る

  fdisk /dev/hdx (xは、aかbかcかdになります)
  
  Linuxでは、/dev/hda (プライマリマスタ) /dev/hdb (プライマリスレイブ)
        /dev/hdc (セカンダリマスタ) /dev/hdd (セカンダリスレイブ)
  となります。

(※注意 間違えるとデータが消えるので気を付けてください)

  fdiskが起動すると:

  m でメニューが表示されます。
  n でパーティションを作成します
     (新しいディスクであれば、p プライマリ 1 第一パーティションとすればいいでしょう)
    シリンダーのどうのといわれますが、Enterで進めば全部使うことになります。
  p 内容を確認します。
  w パーテションテーブルを書き込みます。

  ここでは、/dev/hdb1を作ったことにしましょう。

2、フォーマットする

  mkfs.ext3 /dev/hd1  ← これで ext3ファイルシステムでフォーマットします

  /dev/hdb の第1パーテションをフォーマットします。
  
  しばらく待っていると完了します。

3、マウントする

  マウント先のディレクトリを作ります。どこでもいいのですが、私は、

  /hdb のように/(ルート)にデバイス名を元に作成してます。

  そして、

    mount /dev/hdb1 /hdb

のようにマウントします。

4、fstabで自動マウントするようにする

  /etc/fstab

  に新たに追加したハードディスクを認識するように記述します。

/dev/hdb1 /hdb ext3 defaults 1 1

のような記述を追加しておくとよいでしょう。

2006年05月09日

j2se 1.4がインストールできない FedoraCore5

次のようにコマンドから入力する

export _POSIX2_VERSION=199209

これで
./j2sdk1.4.2_11.bin

を実行する。

その後、
export _POSIX2_VERSION=200112 (fedora core 5)

で元に戻しておく。

2006年04月05日

FedoraCore4 FedoraCore5などで、RealPlayerを使うには?

http://www.real.com/linux/へ行くと

2つの方法でダウンロードすることができます。

(1)Install instructions
(2)Download RPM Package

のどちらかで入手できます。RPMの場合はそのまま開くとインストール開始します。
途中で、サインされていないと忠告がでます。この場合は信頼できますから、続行します。

「アプリケーション」→「サウンドとビデオ」

からアクセスできます。

<インストールされるもの>

/usr/local/RealPlayer

にインストールされます。

2006年03月27日

新しいHD追加する

FedoraCoreなどで新しいHDを追加するには次のような方法をとります。
(この記述は、ATAPIです)

マザーボードには、4つのドライブがつなげられます。

<呼び方>
マザーボード Linux上
IDE1-Master /dev/hda
IDE1-Slave /dev/hdb
IDE2-Master /dev/hdc
IDE3-Slave /dev/hdd

<手順>
1、HDをスレーブに設定する
2、PCの電源を落としてHDを追加する
3、HDにパーティションを作成する
4、パーティションをフォーマットする
5、マウントする

<パーティション>
fdisk /dev/hdb  << パーテションを作る (※現在のシステムのHDを指定しないように注意)

<フォーマット>
mkfs.ext3 /hdb1 << hdbのパーティション1をext3ファイルシステムでフォーマットする

<マウント>
mount /dev/hdb1 /hogehoge <<新しくできたパーテションを/hogehogeにマウントする

2006年03月25日

vim-7.0b コンパイルしてみる (コンパイルの練習)

bunzip2 vim-7.0b.tar.bz2 <<bz2の展開 tar xvf vim-7.0b.tar <<tarファイルができるので展開 cd vim70b     <<ディレクトリができるので中へ make       <<コンパイルする (※下のコンパイルの前にを参考にしてください) しばらくすると、、、 ./src/vim <<コンパイルされたプログラム cd src ./vim <<起動


※gcc(cコンパイラ)がない場合は yum -y install gcc とするとインストールします。

一足お先に、β版を試すことができます。しかし、なんらかの設定をしないと日本語の入力ができないようですね。この辺は調べないといけません。

vim6.4は、UTF-8とかで入力すると多少問題がありました。例えば、★を入力すると本当は3バイトとるはずのところ2バイトで数えているようで、文字がずれてしまいます。この辺が解消されているといいですね。

<コンパイルの前に>
調べたら、どうも

./configure --with-features=big

としてやると、日本語入力も可能になるようです。残念ながら★などを入力すると2バイトとして換算されているようですね。正式版では改善されていると良いですね。

2006年03月24日

mysql + php 連動 FedoraCore4

<必要なパッケージ>
mysql
mysql-server
php-mysql

<起動>
/etc/init.d/mysql start

<パスワードの設定>
mysqladmin -u root password hogehoge_passwd <<パスワードを設定する
mysqladmin -u root -p reload << リロードする

<サーバに接続>
mysql -u root -p
create database hogeDB;
use hgoeDB
create table hogeTB(name text, tel text);
insert into hogeTB values("hoge","000-0000");
select * from hogeTB;
exit;


<サンプルコード>
print "start...\n";
$id=mysql_connect("localhost", "root", "hgoehoge_passwd");
mysql_select_db("hogeDB");
$sql="select * from hogeTB";

$result = mysql_query($sql,$id);
for($i=0; $i<3; $i++){
mysql_data_seek($result,$i);
$Object=mysql_fetch_object($result);
$name=$Object->name;
print $name."\n";
}
?>



2006年03月23日

nfs

/etc/exporrt に次の記述を追加します。

/hoge_dir 192.168.1.0/24(rw,no_root_squash,sync)

これは、no_root_squashになっていますから、ルート権限を持たせると言う意味です。

記述が済んだら、

/etc/init.d/nfs restart

します。

クライアントからは、

mount hoge_host:/hoge_dir /hoge_dir

でマウントすることができる。

2006年03月22日

livna Fedora 7 FedoraCore6 FedoraCore5 FedoraCore4

yumコマンドを使ってもインストールできないパッケージが数多くあります。

例えば、動画を見るためのソフトで xine や mplayerなどです。

/etc/yum.repos.d/

にこれらのパッケージを持っているリポジトリを追加しておく必要があります。

yumするときは、ここもチェックしてねということです。

FedoraCore4以降はは、このlivnaリポジトリを導入するのは簡単になっています。

http://rpm.livna.org/configuration.html

で確認できます。

<やり方> FedoraCore5の場合

rpm -ivh http://rpm.livna.org/livna-release-5.rpm

としてlivna-release-5パッケージを導入するだけです。

<導入確認>

どんなファイルがインストールされているか確認してみましょう。

rpm -ql livna-release-5
/etc/pki/rpm-gpg/RPM-GPG-KEY-livna
/etc/yum.repos.d/livna-devel.repo
/etc/yum.repos.d/livna-testing.repo
/etc/yum.repos.d/livna.repo

gpg-keyがインストールされ、.repoファイルが/etc/yum.repos.d/にコピーされます。

2006年03月21日

FedoraCore5 リリース 2006年3月20日

ついにFedoraCore5がリリースされました。

このブログも早速FC5で書いています。

一言でいうなら、FC4からさらにもう一歩クライアントOSに近づいていることです。

まず、GUIのスピードが速くなっています。FC4ではウィンドウズと比べると遅いなと感じることが良くありました。FC5では、かなりの部分が改善されています。

日本語入力が進化しています。IME的な小さなウィンドウが右下に開き入力モードを設定できるようになっています。FC4では「あ」とかしな出てこなかったのでわかり難かった。

メニューの構成は少し変わっている部分もありますが、メニューの整理のやり方は、視点によっていろいろだと思うので変わっても気にしないことだと思います。

しかし、こうして日本語を入力していて、Windowsとそう変わらない使用感を持てるのは驚きです。

あ、そうそう、Windowsの後変換もできるみたいですね。F5からF10までが使えます。いいですね。なれたキーストロークにあわせているところなんか。

ぜひ、知識あるひとは、これを使いましょう!もっと自由で素晴らしい環境でコンピュータが使えるとうれしいですね。

2006年03月20日

Webサーバのログ Apache (httpd)

FC4ごろのhttpd.confのログの形式は、4つ定義されています。
combined
common
referer
agent

これらは、Global Environmentで定義されています。
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent


ログのとりかたを指定するときに次のように定義します。
CustomLog {ログファイルのパス} {使用するフォーマット}

※ AWStats を導入して VirtualHost を指定するときには注意が必要です。
FC4あたりのhttpd.confのVirtualHostではCustomLogがcommonになっています。

メインサーバでは、combinedが使われていますからそのまま問題無くAWStatsに解析させることができますが、VirtualHostの場合は、設定例を参考にするときにcommonをcombinedに変更する必要があります。

<プロセス>
AWStatsを導入後テストしてみると、メインサーバのログは問題無く解析してくれるが、VirtualHostのログは解析中にエラーがでる。

試しに、他のバーチャルホストサーバからログを持ってきてみて試してみると同じくエラーが出る。しかし、今回は、メッセージが出る。combinedという言葉が使われている。

メインサーバとバーチャルホストのログを比較する。明らかに書式が異なっている。ということは、どこかで、ログのフォーマットを指定しているはず。

ウェブサーバの本を開いてみるとある。LogFormatというディレクティブがある。なるほど。LogFormatで直接指定するのではなくて、ある程度きまったフォーマットは事前に定義しているわけだ。

<アップデート>
perl awstats.pl -update -config=fren2.momox.net
<確認>
/awstats/awstats.pl?month=03&year=2006&output=main&config=hogehoge&framename=index
kgj
momox

2006年03月19日

FedoraCore5 リリース

digg.comによると、2、3日早めにリリースされているとか書いてある。

ftp://mirror.switch.ch/mirror/fedora/linux/core/5/i386/iso/FC-5-i386-DVD.iso
ftp://mirror.switch.ch/mirror/fedora/linux/core/5/x86_64/iso/FC-5-x86_64-DVD.iso

ダウンロードを試みてみたけど、かなり遅いので止めました。

http://forums.fedoraforum.org/showthread.php?t=98805に
リリースしたとか書いてあります。

3月20日とアナウンスされていたはずだけど。
今日が日本時間の3月19日(日曜日)

まあ、あと数日すればダウンロードできるようになるのでしょうけど、はやくためしてみたい!

2006年03月18日

X(エックス)とはなにか? Linux上のGUIを提供。

GNU/Linux上では、GNOMEやKDEなどが使われます。これらは、ウィンドウマネージャと呼ばれています。このウィンドウマネージャが利用するのがXです。Xは、GUIの基礎の部分を提供しているのです。GUIの本質の部分を実装しています。実際の見えかたは、ウィンドウマネージャで決まります。

Xとはなにか

digg.comには、Linux関連の情報が豊富にあります。
日本のサイトのように、「今はこれを知らないと!」みたいな「あおり」はありません。
のんびりとじっくりとやっている感じがしますね。

そのうち日本語にして、部分的に抽出しようと思っています。

/proc ディレクトリとは (引用)

/procディレクトリという、ある意味不思議なディレクトリがあります。

この中には、システムで動いているプロセスに関する情報などが含まれています。
良い記事を見付けたので次に引用しておきます。

http://digg.com/linux_unix/page2からたどって
http://www.linuxforums.org から引用

Understanding /proc discuss PDF Print E-mail
Contributed by Andy Kissner in Misc
03-09-06
Page 3 of 3

Each time a new process is created, an entry in /proc is created. The name of the directory entry corresponds to the process identification number (PID) of the created process, so, for example, a process with a PID of 8695 will have a corresponding directory entry of /proc/8695/.

nside /proc/8695/ (replace 8695 with a real PID on your system), you'll see something like:

auxv exe mem root statm
cmdline fd/ mounts seccomp status
cwd loginuid oom_adj smaps task/
environ maps oom_score stat wchan

Note: The entries ending in “/” are directories.

As you can see, a lot of data about each process is stored. Let's go through the basics:

cmdline - This contains information about the actual command line invoked to start this process. This is a down and dirty way to find out what this process is actually doing.

The best way to access this info is by using a tool such as 'strings' which will display any printable information from a binary file:

$ strings cmdline
/opt/OpenOffice.org/program/soffice.bin
private:factory/swriter

cwd - This is a symlink to the working directory from which the process was started. For example, I started OpenOffice.org (PID 8695) in my home directory, so cwd points to /home/akissner.

environ - This file contains the environment of the process, sorted in to key=value pairs. There is no particular order, so for a human readable output, you would want to do something like:

$ strings environ | sort | less

This will sort the output alphabetically, sorted by the key.

exe - 'exe' is another symlink, this time to the actual binary itself. So if you wanted to run another copy of the process, you could do:

$ /proc/8695/exe

fd/ - This is a tricky one. It is a subdirectory of symbolic links to open file descriptors in use by the program. /proc/XXXX/fd/ will always contain, at the very least, the links 0, 1, 2. These correspond to STDIN, STDOUT, and STDERR, respectively.

Using this, you can see what files a program is manipulating. This is one way that you can find out where a browser keeps its cache, or a text editor keeps its temporary files.

loginuid - A little background is required before I can explain this one. This isn't completely technically correct, but it's good enough for a Cliff Notes summary.

Each process is represented in the kernel as a structure of type "task". This task structure keeps track of a lot of information about a process, including the PID, the UID of the user who started it, its children, and countless other things. One such attribute is the field "loginuid". The loginuid shows which account a user gained access to the system with. The /proc/XXXX/loginuid shows this value.

maps - 'maps' is one of the most complicated things inside of the /proc filesystem. Suffice it to say that one must have a basic grounding in the inner workings of the kernel and memory management to fully appreciate the information inside of /proc/XXXX/maps.

08048000-080a1000 r-xp 00000000 08:06 35310321 /opt/OpenOffice.org/program/soffice.bin
080a1000-080a6000 rw-p 00058000 08:06 35310321 /opt/OpenOffice.org/program/soffice.bin
080a6000-084b6000 rw-p 080a6000 00:00 0 [heap]
b0e2d000-b0e3d000 rwxp b0e2d000 00:00 0
b0e4d000-b0e81000 r--p 00000000 08:06 86555296 /opt/OpenOffice.org/help/en/picture.db
b0e81000-b0ec4000 rw-p b0e81000 00:00 0
b0ec4000-b0f34000 rwxp b0ec4000 00:00 0
b0f42000-b0f62000 rwxp b0f42000 00:00 0
b0f62000-b0f7d000 r--s 00000000 00:07 20971555 /SYSV00000000 (deleted)
b0f7d000-b0f98000 r--s 00000000 00:07 21004324 /SYSV00000000 (deleted)
b0f98000-b0fb3000 r--s 00000000 00:07 20971555 /SYSV00000000 (deleted)
b0fb3000-b0fce000 r--s 00000000 00:07 20971555 /SYSV00000000 (deleted)
b0fce000-b0fe9000 r--s 00000000 00:07 20971555 /SYSV00000000 (deleted)
b0fe9000-b1004000 r--s 00000000 00:07 20971555 /SYSV00000000 (deleted)
b1004000-b101f000 r--s 00000000 00:07 20971555 /SYSV00000000 (deleted)
b101f000-b103a000 r--s 00000000 00:07 20971555 /SYSV00000000 (deleted)
b103a000-b1055000 r--s 00000000 00:07 20971555 /SYSV00000000 (deleted)
b1055000-b1070000 r--s 00000000 00:07 20971555 /SYSV00000000 (deleted)
b1070000-b108b000 r--s 00000000 00:07 20971555 /SYSV00000000 (deleted)
b108b000-b10a6000 r--s 00000000 00:07 20971555 /SYSV00000000 (deleted)

Shown above is a sample listing for my OpenOffice.org process (PID 8695). As you can see, OpenOffice.org uses a lot of memory!

The first column lists, in hexadecimal, the address range for the mapped memory. The next column lists the permissions on that section of memory. This can either be r, w, x, p, or s, which is read, write, execute, private, and shared, respectively. The third column is the offset, and the fourth column lists the device where the memory is mapped from. The device column is split into major:minor, where major is the corresponding major device number (this has to do with which driver is assigned to which device) and minor number (which has to do with the number of devices a driver is representing). Using information from /proc/devices, you can decipher the device being used. The next column is the inode number of the file from which the memory is being mapped. Last is the pathname of the file.

mem - This cannot be used directly from the command line for anything. You can call the open() and read() system calls on it to read the pages of a process's memory, but most people will go their whole life without ever needing to to this.

mounts - In most cases, this is the same thing as /proc/mounts, which displays mounted filesystem information.

oom_* - These files control the system's behavior if it meets an Out of Memory (OOM) condition. Generally, you won't need to mess with this. The oom_adj file can be used to make a process unkillable during OOM.

root - This is a symlink to the process's root directory. Normally, this will be '/'. But if, for example, a process were started inside a 'chroot jail', then /proc/XXXX/root might point to "/foo/jail".

seccomp - Changing the value in this file from '0' to '1' will send the process in to "seccomp" mode. Seccomp is a sandbox mechanism for the kernel, which restricts a certain process from executing most system calls. This is a security feature, which you will probably never use.

smaps - This file provides detailed memory consumption information for a process.

stat - Like the name suggestions, /proc/XXXX/stat contains information about a process's status. In fact, modern versions of ps (namely those coming from the 'procps' package) use /proc/XXXX/stat for their information. The output is not formatted, and looks like this:

8695 (soffice.bin) S 8666 3234 3180 1025 3224
8396864 68 0 8 0 27 31 0 0 16 0 1 0 51495018 134680576 8844
4294967295 134512640 134875180 3216856352 4154390430 582 0
0 4096 2076206327 0 0 0 33 1 0 0

The best place for information on these fields is the proc(5) manpage.

statm - This file gives memory status information. This file gives information in page-sized blocks. The columns are size (total), rss (resident set size), shared pages, text (the executable code), library code, data/stack size, and dirty pages. The last column is no longer used in the 2.6 kernel series.

status - This file contains the information given in stat and statm, but in a much more human-friendly form. Each row is labeled, and the names are for the most part self-explanatory.

task - task is a directory, containing a directory (with the same name as the PID) that contains all the information inside /proc/XXXX (except for task/). It's a bit of a pointless directory, in my opinion.

wchan - The WCHAN data for a process is the kernel function where the process is currently blocking.

That covers things for this first installment in a multi-part series on understanding the /proc filesystem. Part 2 will cover using /proc to find information about the devices attached to your system.

2006年03月16日

オープンソースソフトウェアの歴史

http://www.netc.org/openoptions/background/history.html (英文)

にうまくまとめてあります。私も1ヶ月程度Open Source Softwareについて調べて、とあるオープンソースソフトウェアの講義のテキストを用意しました。なかなか断片的な情報が多く全体をつなげるにはコンピュータの歴史を調べる必要もありました。ここに書いてあるようなことを最終的には描くことができました。この視点は間違っていないようですね。調べるとこれに行き着くようです。

中心人物は、Richard Stallman, Eric S Raymond, と Linus Trovaldsです。
Richard Stallman GNU/Hurd Freesoftware
Linus Trovalds Linux
Eric S. Raymond Open Source Software

GNU/Hurd ---> GNU/Linux


以下は、そのサイトからの引用です。

This brief history illustrates the origins and major events in open source.
school computer with open source software

* Overview
* Expensive, esoteric computers
* The rise of proprietary software
* Proprietary UNIX
* The debate on the fringes
* Linux
* The Internet and the Bazaar
* Netscape's big move
* The Open Source Initiative
* Dot-coms and anti-Microsoft
* The current storm


Overview

To promote the values of free software, Richard Stallman created the GNU General Public License (GPL) and founded the Free Software Foundation (FSF). The GPL is infectious: any software created with free software must also be free software. Stallman calls this "copyleft" because it preserves the rights of the user not the creator.
The GPL is a political manifesto as well as a software license.

The idea of unfettered, infectious software was too radical for most software companies. "The GPL is a political manifesto as well as a software license... This political dialogue has put some people off." (Perens, in Dibona, p. 181) Stallman and the FSF aren't hostile to businesses that "respect the users' freedom." (Stallman, in Dibona, p. 61) But most companies couldn't imagine how to build a business model on free software.

The success of Linux and the growth of the Internet focused more attention on free software. Some proponents redefined a more moderate view to appeal to the business world. This became open source.

[back to top]
Expensive, esoteric computers (c1950-1980)

Computer science originally meant large mainframe computers. Most software had accessible source code. It was not uncommon to receive a printed copy of a program, which had to be entered line by line. (Modern programmable calculators continue this tradition.) Software was widely shared, and programmers collaborated regardless of employer. Programmers enjoying tinkering with software and learning. The product and the process were inseparable. This was very similar to the open source model, but nobody called it that.

[back to top]
The rise of proprietary software (Mid 1970's)

As computers became less expensive and more accessible, non-technical office workers and home users wanted them. In targeting these growing markets, software companies built their business models on control of their source code. Most users don't want or need access to source code, and executives and investors wanted their companies to control key assets (e.g. intellectual property). Companies sold the compiled binary as proprietary software, and kept the source code secret. In other words, they sold the product and kept the process.

[back to top]
Proprietary UNIX (Late 1970's - Mid 1980's)

The most important software on a computer is the operating system. The most powerful operating system was UNIX. UNIX was originally open source. As the computer market expanded, several companies started selling incompatible, proprietary versions of UNIX. This upset many programmers. Different programmers working for different companies could no longer collaborate as easily. They couldn't tinker and they resented the restrictions on their intellectual curiosity.

[back to top]
The debate on the fringes (1980's)
image

Richard Stallman was troubled by the industry transition to proprietary software. Programmers were paid for their labor but could not control their code. Users could buy a copy of a program but couldn't change or distribute it. Without the source code, a program was a "black box." Complicated user licenses prohibited opening that box. (This is not always a bad thing.) Stallman wanted all users to have true ownership of their computer through free software. Such software is free as in "free speech" (liberty).

Stallman wanted to create and exclusively use free software. He founded a project to create a free, open source operating system. Stallman called his project GNU, a recursive acronym of GNU's Not UNIX. GNU would be fast, reliable, scalable, and interoperable with UNIX. Stallman founded the Free Software Foundation (FSF) to support GNU and similar projects. The Foundation became the center of the free software community.

Stallman was afraid software companies would subvert his cause by copying and selling community-created software. The modern open source model permits this, but free software is supposed remain free. Stallman observed how software companies used restrictive end user licenses to control their products. To protect the idea and practice of free software, Stallman created the GNU Public License (GPL). The GPL is an example of "copyleft" (the opposite of copyright). Whereas most licenses restrict a user from copying or changing software, the GPL prevents anyone from restricting any use of the software.

Stallman developed a series of software tools to build GNU. Stallman's GNU C Compiler (GCC) is widely regarded as "one of the most efficient and robust compilers ever created." (Hasan, 2002) (Apple's OS X includes the GCC, more than a decade later.) The FSF distributed the GCC as part of a toolkit, as both a gift to the programming community and an invitation to join the GNU project.

As a radical idea, free software attracted and repelled many programmers and companies. But the debate was relegated to the fringes of the industry, partly because there were few examples of successful, mainstream free software. The GNU project produced many software components, but no usable kernel. An operating system needs a kernel.

A separate free software project also hoped to produce an operating system. The Berkeley Software Distribution (BSD) was and still is popular with some power users, but lacks the mindshare and markets of Linux.

[back to top]
Linux (Early 1990's)

A Helsinki college student named Linus Torvalds was impatient with the progress on the GNU kernel. Torvalds wanted a free operating system for his own use, so he created Linux using the Free Software Foundation's development tools. Torvalds didn't expect many people to be interested. But by combining the Linux kernel with GNU components, anyone could deploy a UNIX-like operating system. Although it would take years for Linux to mature, power users started deploying "GNU/Linux."
"I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu)..." - Linus Torvalds, 1991 (Torvalds)

Linux was and is a fantastic program. It's faster, more powerful, and scales larger than almost any other operating system. It's also complicated, challenging, and the graphical user interfaces are still maturing. Linux couldn't compete in the desktop market with Microsoft Windows and Apple Macintosh. So it started to spread everywhere else, and continues to spread today. Its success made Torvalds a celebrity. He was less radical in his rhetoric than Stallman. Linux succeeded as simply good code.

[back to top]
The Internet and the bazaar (1997)
"Linux today has millions of users, thousands of developers, and a growing market. ... I'd like to say that... it's all part of the plan for world domination. But honestly this has all taken me a bit by surprise." - Linus Torvalds, 1999 (Torvalds, in Dibona, p. 101)

As the Internet exploded into the mainstream, open source projects like sendmail, bind, and Apache grew in popularity. Today, Apache is the dominant Web server solution, and it runs under Linux (as well as Microsoft Windows and Apple Macintosh). For this and other reasons, the rapid growth of the Internet and the rising popularity of open source software are interdependent. More: "The Internet and open source"

The Internet and "e-business" demanded new, cutting-edge solutions. Linux, Apache, and other open source software could outperform costly proprietary UNIX or Microsoft solutions. This success in the "backend" puzzled people. How could a community-created product be more powerful and reliable than proprietary solutions?

To help explain this phenomenon, programmer Eric Raymond wrote an essay called “The Cathedral & the Bazaar.” In Raymond's so-called cathedral, a leader sets the goals, coerces programmers to participate, uses extrinsic rewards (e.g. money, promotions), and controls the product and its secrets. In the bazaar, a leader shares a vision, invites programmers, rewards their contributions with fame and gratitude, and shares the product as open source. Raymond emphasizes the fame reward, using the theory of gift/reputation culture to explain programmers' eagerness to work hard on code and then give it away.

Raymond's bazaar was clearly inspired by Stallman's copyleft: elevating the principles of community over selfishness. But where copyleft prevents a company from using community-developed resources in a proprietary product, Raymond didn't foreclose on that possibility.

Raymond's bazaar helps explain why a programmer would work hard improving software, then give it away for free. Of course, most educators are generous with their work and ideas, so the bazaar may be less puzzling to them than to companies. More: "The open source community"

[back to top]
Netscape's big move (1998)

Meanwhile, Netscape and Microsoft were battling for market share. The companies sold competing, proprietary Web browsers: Navigator and Explorer. Both also offered Web editing and hosting solutions, and tried to control the evolution of HTML with secret formats and protocols. (Microsoft calls these "extensions.") For a time, there were Explorer and Netscape versions of the same Web pages.

Explorer held a significant but minority market share. So Microsoft changed their business model to focus on Windows, Frontpage, Web server software, and Web hosting. Microsoft bundled (and later integrated) Explorer with its Windows operating system, and offered it as a free download. Netscape had no operating system or office suite products to fall back on, and it would be years before the Justice Department finished investigating Microsoft's alleged anti-trust behavior. To prevent Microsoft from controlling the browser market (and HTML), Netscape chose a surprise strategy: they "open sourced" Navigator. They mentioned Raymond's bazaar as an influence.

Netscape planned to create an open source browser called Mozilla. Soon after Netscape announced the Mozilla project, America Online (AOL) bought Netscape. As an Internet service provider, AOL competed with Microsoft's MSN Internet service. In light of that competition, Raymond wrote an open letter to AOL:

The Mozilla project proceeded from Netscape's understanding that Internet Explorer threatened their server business. If Microsoft were able to establish a monopoly lock on the browser market, they could leverage that into effective control of the HTTP/HTML protocol; from there it would be a short step to effectively crippling any competitor's web servers. (Raymond, 1998)

AOL continued to support the Mozilla project.

[back to top]
The Open Source Initiative (1998)

At the same time, Raymond, Bruce Perens, and other proponents launched a broader strategy. Where Stallman and the Free Software Foundation had argued from principles like user rights, the new Open Source Initiative (OSI) would tout better code and untapped profits. Raymond later wrote:

It seemed clear... that the term "free software" had done our movement tremendous damage... Most of it came from... the strong association of the term "free software" with hostility to intellectual property rights, communism, and other ideas hardly likely to endear themselves to an MIS manager. ... Our success... would depend on replacing the negative FSF stereotypes with positive stereotypes of our own -- pragmatic tales, sweet to managers' and investors' ears, of higher reliability and lower costs and better features. (Raymond, in Dibona p. 212)

[back to top]
Dot-coms and anti-Microsoft (Late 1990's)

While many companies had started with or changed to open source business models, Netscape was the largest and most ambitious conversion yet. Investors were curious about open source. Numerous start-up companies tried to harness the potential of open source in the "dot-com" frenzy. In many cases, these companies launched with inflated IPO's and wild predictions, followed by quarterly deficits and insufficient community support. (Open source projects flourish through volunteer work and momentum, which can be difficult to foster.)

Meanwhile, some businesses and governments were troubled by the implications of Microsoft Window's dominance of the operating system market. Microsoft had seized the market during the transition from elite computing to mainstream use. As the Internet triggered a new transition in computing, some technology decisionmakers were ready to try something different.

While Linux had begun as an alternative to proprietary UNIX, now it seemed the best alternative to Microsoft Windows. The Open Source Initiative had muffled the idea of copyleft and cast themselves as business-friendly revolutionaries. Where Stallman had argued from his principles, the Open Source Initiative had the examples of Linux, Apache, and Mozilla, and the support of Linus Torvalds, AOL/Netscape, and more.

[back to top]
The current storm (Today)
... "Linux" means different things to different people. Wall Street traders interpret it as a synonym for "cash money," while the Internet hippie views it as the modern-day software equivalent of "make love not war." (Williams, 2000)

Clearly, open source software is reaching the mainstream. The debate is stronger than ever, and the ubiquity of the Internet and publicity of key open source projects has changed the scope. Microsoft and its business allies continue to disparage open source, creating a vivid conflict in marketing, the media, and mindshare. Apple builds their OS X on Darwin, a derivation of open source BSD. IBM, Sun, Cisco, Hewlett-Packard, Dell, Oracle, and many more are investing in open source. National governments are considering policies and legislation promoting open source.

Like a silent storm, open source runs much of the Internet and the Web (especially Web servers and gateways). It's making inroads on servers, desktops, mobile devices, everywhere. While Stallman, Torvalds, Raymond, and others are strongly influential in the future of open source, it has become a global phenomenon with an unclear future and uncertain implications.

For more information, see: "Links: History & Philosophy"

オープンソースソフトウェアの歴史

1.http://www.netc.org/openoptions/background/history.html (英文)
2.http://www.softcatala.org/projectes/faif/llibre_ang/faif_12.html (英文)

にうまくまとめてあります。私も1ヶ月程度Open Source Softwareについて調べて、とあるオープンソースソフトウェアの講義のテキストを用意しました。なかなか断片的な情報が多く全体をつなげるにはコンピュータの歴史を調べる必要もありました。ここに書いてあるようなことを最終的には描くことができました。この視点は間違っていないようですね。調べるとこれに行き着くようです。

中心人物は、Richard Stallman, Eric S Raymond, と Linus Trovaldsです。
Richard Stallman GNU/Hurd Freesoftware
Linus Trovalds Linux
Eric S. Raymond Open Source Software

GNU/Hurd ---> GNU/Linux


以下は、そのサイトからの引用です。

This brief history illustrates the origins and major events in open source.
school computer with open source software

* Overview
* Expensive, esoteric computers
* The rise of proprietary software
* Proprietary UNIX
* The debate on the fringes
* Linux
* The Internet and the Bazaar
* Netscape's big move
* The Open Source Initiative
* Dot-coms and anti-Microsoft
* The current storm


Overview

To promote the values of free software, Richard Stallman created the GNU General Public License (GPL) and founded the Free Software Foundation (FSF). The GPL is infectious: any software created with free software must also be free software. Stallman calls this "copyleft" because it preserves the rights of the user not the creator.
The GPL is a political manifesto as well as a software license.

The idea of unfettered, infectious software was too radical for most software companies. "The GPL is a political manifesto as well as a software license... This political dialogue has put some people off." (Perens, in Dibona, p. 181) Stallman and the FSF aren't hostile to businesses that "respect the users' freedom." (Stallman, in Dibona, p. 61) But most companies couldn't imagine how to build a business model on free software.

The success of Linux and the growth of the Internet focused more attention on free software. Some proponents redefined a more moderate view to appeal to the business world. This became open source.

[back to top]
Expensive, esoteric computers (c1950-1980)

Computer science originally meant large mainframe computers. Most software had accessible source code. It was not uncommon to receive a printed copy of a program, which had to be entered line by line. (Modern programmable calculators continue this tradition.) Software was widely shared, and programmers collaborated regardless of employer. Programmers enjoying tinkering with software and learning. The product and the process were inseparable. This was very similar to the open source model, but nobody called it that.

[back to top]
The rise of proprietary software (Mid 1970's)

As computers became less expensive and more accessible, non-technical office workers and home users wanted them. In targeting these growing markets, software companies built their business models on control of their source code. Most users don't want or need access to source code, and executives and investors wanted their companies to control key assets (e.g. intellectual property). Companies sold the compiled binary as proprietary software, and kept the source code secret. In other words, they sold the product and kept the process.

[back to top]
Proprietary UNIX (Late 1970's - Mid 1980's)

The most important software on a computer is the operating system. The most powerful operating system was UNIX. UNIX was originally open source. As the computer market expanded, several companies started selling incompatible, proprietary versions of UNIX. This upset many programmers. Different programmers working for different companies could no longer collaborate as easily. They couldn't tinker and they resented the restrictions on their intellectual curiosity.

[back to top]
The debate on the fringes (1980's)
image

Richard Stallman was troubled by the industry transition to proprietary software. Programmers were paid for their labor but could not control their code. Users could buy a copy of a program but couldn't change or distribute it. Without the source code, a program was a "black box." Complicated user licenses prohibited opening that box. (This is not always a bad thing.) Stallman wanted all users to have true ownership of their computer through free software. Such software is free as in "free speech" (liberty).

Stallman wanted to create and exclusively use free software. He founded a project to create a free, open source operating system. Stallman called his project GNU, a recursive acronym of GNU's Not UNIX. GNU would be fast, reliable, scalable, and interoperable with UNIX. Stallman founded the Free Software Foundation (FSF) to support GNU and similar projects. The Foundation became the center of the free software community.

Stallman was afraid software companies would subvert his cause by copying and selling community-created software. The modern open source model permits this, but free software is supposed remain free. Stallman observed how software companies used restrictive end user licenses to control their products. To protect the idea and practice of free software, Stallman created the GNU Public License (GPL). The GPL is an example of "copyleft" (the opposite of copyright). Whereas most licenses restrict a user from copying or changing software, the GPL prevents anyone from restricting any use of the software.

Stallman developed a series of software tools to build GNU. Stallman's GNU C Compiler (GCC) is widely regarded as "one of the most efficient and robust compilers ever created." (Hasan, 2002) (Apple's OS X includes the GCC, more than a decade later.) The FSF distributed the GCC as part of a toolkit, as both a gift to the programming community and an invitation to join the GNU project.

As a radical idea, free software attracted and repelled many programmers and companies. But the debate was relegated to the fringes of the industry, partly because there were few examples of successful, mainstream free software. The GNU project produced many software components, but no usable kernel. An operating system needs a kernel.

A separate free software project also hoped to produce an operating system. The Berkeley Software Distribution (BSD) was and still is popular with some power users, but lacks the mindshare and markets of Linux.

[back to top]
Linux (Early 1990's)

A Helsinki college student named Linus Torvalds was impatient with the progress on the GNU kernel. Torvalds wanted a free operating system for his own use, so he created Linux using the Free Software Foundation's development tools. Torvalds didn't expect many people to be interested. But by combining the Linux kernel with GNU components, anyone could deploy a UNIX-like operating system. Although it would take years for Linux to mature, power users started deploying "GNU/Linux."
"I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu)..." - Linus Torvalds, 1991 (Torvalds)

Linux was and is a fantastic program. It's faster, more powerful, and scales larger than almost any other operating system. It's also complicated, challenging, and the graphical user interfaces are still maturing. Linux couldn't compete in the desktop market with Microsoft Windows and Apple Macintosh. So it started to spread everywhere else, and continues to spread today. Its success made Torvalds a celebrity. He was less radical in his rhetoric than Stallman. Linux succeeded as simply good code.

[back to top]
The Internet and the bazaar (1997)
"Linux today has millions of users, thousands of developers, and a growing market. ... I'd like to say that... it's all part of the plan for world domination. But honestly this has all taken me a bit by surprise." - Linus Torvalds, 1999 (Torvalds, in Dibona, p. 101)

As the Internet exploded into the mainstream, open source projects like sendmail, bind, and Apache grew in popularity. Today, Apache is the dominant Web server solution, and it runs under Linux (as well as Microsoft Windows and Apple Macintosh). For this and other reasons, the rapid growth of the Internet and the rising popularity of open source software are interdependent. More: "The Internet and open source"

The Internet and "e-business" demanded new, cutting-edge solutions. Linux, Apache, and other open source software could outperform costly proprietary UNIX or Microsoft solutions. This success in the "backend" puzzled people. How could a community-created product be more powerful and reliable than proprietary solutions?

To help explain this phenomenon, programmer Eric Raymond wrote an essay called “The Cathedral & the Bazaar.” In Raymond's so-called cathedral, a leader sets the goals, coerces programmers to participate, uses extrinsic rewards (e.g. money, promotions), and controls the product and its secrets. In the bazaar, a leader shares a vision, invites programmers, rewards their contributions with fame and gratitude, and shares the product as open source. Raymond emphasizes the fame reward, using the theory of gift/reputation culture to explain programmers' eagerness to work hard on code and then give it away.

Raymond's bazaar was clearly inspired by Stallman's copyleft: elevating the principles of community over selfishness. But where copyleft prevents a company from using community-developed resources in a proprietary product, Raymond didn't foreclose on that possibility.

Raymond's bazaar helps explain why a programmer would work hard improving software, then give it away for free. Of course, most educators are generous with their work and ideas, so the bazaar may be less puzzling to them than to companies. More: "The open source community"

[back to top]
Netscape's big move (1998)

Meanwhile, Netscape and Microsoft were battling for market share. The companies sold competing, proprietary Web browsers: Navigator and Explorer. Both also offered Web editing and hosting solutions, and tried to control the evolution of HTML with secret formats and protocols. (Microsoft calls these "extensions.") For a time, there were Explorer and Netscape versions of the same Web pages.

Explorer held a significant but minority market share. So Microsoft changed their business model to focus on Windows, Frontpage, Web server software, and Web hosting. Microsoft bundled (and later integrated) Explorer with its Windows operating system, and offered it as a free download. Netscape had no operating system or office suite products to fall back on, and it would be years before the Justice Department finished investigating Microsoft's alleged anti-trust behavior. To prevent Microsoft from controlling the browser market (and HTML), Netscape chose a surprise strategy: they "open sourced" Navigator. They mentioned Raymond's bazaar as an influence.

Netscape planned to create an open source browser called Mozilla. Soon after Netscape announced the Mozilla project, America Online (AOL) bought Netscape. As an Internet service provider, AOL competed with Microsoft's MSN Internet service. In light of that competition, Raymond wrote an open letter to AOL:

The Mozilla project proceeded from Netscape's understanding that Internet Explorer threatened their server business. If Microsoft were able to establish a monopoly lock on the browser market, they could leverage that into effective control of the HTTP/HTML protocol; from there it would be a short step to effectively crippling any competitor's web servers. (Raymond, 1998)

AOL continued to support the Mozilla project.

[back to top]
The Open Source Initiative (1998)

At the same time, Raymond, Bruce Perens, and other proponents launched a broader strategy. Where Stallman and the Free Software Foundation had argued from principles like user rights, the new Open Source Initiative (OSI) would tout better code and untapped profits. Raymond later wrote:

It seemed clear... that the term "free software" had done our movement tremendous damage... Most of it came from... the strong association of the term "free software" with hostility to intellectual property rights, communism, and other ideas hardly likely to endear themselves to an MIS manager. ... Our success... would depend on replacing the negative FSF stereotypes with positive stereotypes of our own -- pragmatic tales, sweet to managers' and investors' ears, of higher reliability and lower costs and better features. (Raymond, in Dibona p. 212)

[back to top]
Dot-coms and anti-Microsoft (Late 1990's)

While many companies had started with or changed to open source business models, Netscape was the largest and most ambitious conversion yet. Investors were curious about open source. Numerous start-up companies tried to harness the potential of open source in the "dot-com" frenzy. In many cases, these companies launched with inflated IPO's and wild predictions, followed by quarterly deficits and insufficient community support. (Open source projects flourish through volunteer work and momentum, which can be difficult to foster.)

Meanwhile, some businesses and governments were troubled by the implications of Microsoft Window's dominance of the operating system market. Microsoft had seized the market during the transition from elite computing to mainstream use. As the Internet triggered a new transition in computing, some technology decisionmakers were ready to try something different.

While Linux had begun as an alternative to proprietary UNIX, now it seemed the best alternative to Microsoft Windows. The Open Source Initiative had muffled the idea of copyleft and cast themselves as business-friendly revolutionaries. Where Stallman had argued from his principles, the Open Source Initiative had the examples of Linux, Apache, and Mozilla, and the support of Linus Torvalds, AOL/Netscape, and more.

[back to top]
The current storm (Today)
... "Linux" means different things to different people. Wall Street traders interpret it as a synonym for "cash money," while the Internet hippie views it as the modern-day software equivalent of "make love not war." (Williams, 2000)

Clearly, open source software is reaching the mainstream. The debate is stronger than ever, and the ubiquity of the Internet and publicity of key open source projects has changed the scope. Microsoft and its business allies continue to disparage open source, creating a vivid conflict in marketing, the media, and mindshare. Apple builds their OS X on Darwin, a derivation of open source BSD. IBM, Sun, Cisco, Hewlett-Packard, Dell, Oracle, and many more are investing in open source. National governments are considering policies and legislation promoting open source.

Like a silent storm, open source runs much of the Internet and the Web (especially Web servers and gateways). It's making inroads on servers, desktops, mobile devices, everywhere. While Stallman, Torvalds, Raymond, and others are strongly influential in the future of open source, it has become a global phenomenon with an unclear future and uncertain implications.

For more information, see: "Links: History & Philosophy"

2006年03月15日

vim から マニュアルを開く K

vimで編集中の単語をマニュアルで引くことができます。

まず、コマンドで、
man hogehoge
と入力すると、hogehogeについて調べることができます。

vimを使っていて、ある言葉をマニュアルで調べたいときは、Ctrl+zで止めてmanをするか、別ウィンドウを開いてmanをします。

これは結構面倒です。

そこで、vimから直接カーソルのあるところの単語を調べる方法は、

大文字のKを使えばマニュアルを開いてくれます。結構便利です。
例えば、
We use ls command to list what's in a directory.
と言う文があって、lsってなんだっけ?と思ったらすかさず、編集モード(挿入モードではない)状態で、lsにカーソルを合わせて
K
とタイプするとマニュアルが開きます。

活用しましょう。

ファイル名を変換 convmv

FedoraCoreなどのLinuxマシン上で文字化けをしているShift_JISのファイル名を変換するには、

convmv -f sjis -t utf8 hoge* ← これだと画面上に見せてくれる。
convmv --notest -f sjis -t utf8 hoge* ← 変換後のファイル名に変更します。

2006年03月12日

文字コード

よく使われる文字コードには、次のようなものがあります。

Shift_JIS ウィンドウズ
EUC-JP Linux/Unix
UTF-8 FedoraCore4 (GNU/Linux)

最近は、UTF-8に移行しつつあるようですね。ですから、例えばウィンドウズからFedoraCore4にputtyjp.exe(SSHクライアント)で接続する場合は、文字コードをUTFー8にしておくと文字化けしなくなります。少し前は、文字コードの設定はかなり難しかったですが、簡単になってきました。

VIエディタ(vim-enhanced-6.3.086-0.fc4)では、★とか※とかの3バイトの文字の扱いがうまく行われていないようです。

2006年03月11日

複数のユーザを一気に追加する newusers

複数のユーザを一気に追加するには、

newusers ユーザリストファイル

を使います。(忘れやすいので man -k users)

ユーザリストファイルは、/etc/passwdと同様な書式で、
hogehoge:passhoge:503:503::/home/hogehoge:/bin/bash
のようになる。パスワードは、暗号化する前のもです。

PERLスクリプトでこのファイルを作成できる。
open(F,">hogehoge");
for(1..20){
$uname="user$_";
$uid=600+$_;
$gid=$uid;
print F "$uname:$pass:$uid:$gid:/home/$uname:/binbash\n";
}
close(F);

上記のスクリプトを起動し
newusers hogehoge
で追加できる。
結果は、
user1 〜user20が追加されることになる。

2006年03月04日

FedoraCore4 SELinux Postgresql PHP TCP/IP

少しテクニカルな話になりますが、、、。

FedoraCore4からは、SELinuxモジュールが有効になっている。

(知らない人には何のことって感じでしょうが)

 たったこれだけがわかるまでに2日悩みました。Postgresql+PHPでうまくいかないと悩んでいる方、SELinuxのモジュールが有効になってますよ。気をつけましょう。

おいおい、いつの間に勝手にモジュールが入ってるんだよ?余計なことするな!といいたくなりました。ちゃんとニュースをチェックしてないからいけないのだろうけど、もっとストレートにならないものかな〜。その点FreeBSDなんか何にもしてくれないけどやっぱりいいですね。時間をかければ理解できてそれが本当の自分の力になっていく。その分時間はかかりますね。

 それにくらべて、○○をすれば○○となるという、操作本位の知識は、何の力にもならない。うすぺらいものだ。まあ、できないよりはできたほうがいいし、安全なほうが言いに決まっている。でもさ、表面的にクリックしてるだけってなんか寂しいよね。コンピュータの奴隷にでもなった気分だ。

 僕は、両方やっていこうと思う。FedeoraCoreのような肥大化したものもつかいながら、FreeBSDのような骨太なやつもやっていこうと思ってるんだ。

 今日は、FedoraCoreの話でした。

FedoraCore4 + IBM Space Saver Keyboard II [ カテゴリ未分類 ]

使っている人も少ないかもしれないけど、IBMが作っているキーボードにSpace Saver Keyboard IIと言うのがあります。

キーボードのまん中に赤いポッチ(トラックポイント)があり、これが、マウスの変わりをします。つまり、キーボードから手を話さなくてもマウスを動かせるすぐれものなのです。かなりマニアックな代物ですが、、、。あのIBMのノートパソコンとかに付いているやつです。

僕は、これを使いはじめてからマウスはもう使いたくないと感じるほど重宝しています。他のキーボードと使っていてもつい、人差指でマウスを動かそうとしてしまうほどです。

好嫌いがあるかもしれないですが。

さらにマニアックになるのですが、これをFedoraCore4で使おうといろいろと探した結果見付けたものを記録しておきます。

○IBMのSpace Saver Keyboardのスクロールをできるようにするには、

/etc/X11/xorg.confを次を参考に編集します。

Section “InputDevice”
Identifier “Mouse0″
Driver “mouse”
Option “Protocol” “PS/2″ <ここ
Option “Device” “/dev/psaux”
Option “ZAxisMapping” “4 5″
Option “Emulate3Buttons” “on” <ここ
Option “Emulate3Timuout” “50″ <ここ
Option “EmulateWheel” “yes” <ここ
Option “EmulateWheelButton” “2″ <ここ
Option “EmulateInertia” “50″ <ここ
EndSection

あとは再起動する。とうまくいきました。

DVD+-RW Linux

[ Linux ]
2005.10.13

LinuxでDVDーRWを使おう!それもコマンドから。

環境:FedoraCore4+NEC(ND-3540A)

ここのところ数日は、GOOGLEで検索しまくって、やっとDVDーRとかDVD+RWとかが使えるようになったのでした。

とりあえずわかったことを書いておきます。

まず、DVDーRに書き込むためには、

はじめてのときは、 ーZを使う

growisofs -Z /dev/dvd -R -J /path/to/dir/

とすると、dir/のファイルがDVDのルートに書き込まれる。

2回目以降は、 -M (Merge)を使う

growisofs -M /dev/dvd -R -J /path/to/dir/


ディレクトリ名も指定したければ、

growisofs -Z /dev/dvd -R -J -graft-point hogehoge=/path/to/dir/

の形で書き込む。この場合は、hogehoge/がDVDのルート直下にできる。

DVD+RWのフォーマット (-RWも同じ)

dvd+rw-format -force /dev/dvd

でできるようです。-forceは、付けないとうまくいきませんでした。

DVD+RWの書き込み

これは、DVDーRと同じです。

DVDーRで映画を焼き付ける、

RIPができたとして、AUDIO_TS VIDEO_TSが/path/to/hoge/にあるとします。

growisofs -Z /dev/dvd -dvd-video /path/to/hoge/

でちゃんとメニューとかがあるDVDが作れます。dvd-videoを付けないとメニューとかが
なくなってしまいました。

コメント:
簡単にできそうで、わりとできないというか、あまり情報がまとまっていなかったです。当り前に使っている人には、常識的なものなんでしょうけどね。まあ、この情報もまた河って行くのかも知れませんが。とりあえず、現時点は、上のようにするとうまくいくようです。まあ、こんなことやろうと言う人もそう多くはないでしょうが、誰かの役に立つかも知れないとですね。


DVDをコマンドから焼く (Linuxを使って)

DVDをコマンドから焼く (Linuxを使って)
[ Linux ]
DVDのISOイメージがあれば、それを焼くことができます。

growisofs -Z /dev/dvd=image.iso

ここでは、/dev/dvdとなっていますが、自分の環境にあわせます。/var/log/messagesや/var/log/dmesgなどを見て、DVDが何として認識しているのかを確認できます。

私のDVDのバックアップ方法:

1、shrink DVD3.2(Windows用のプログラム)を使いripします。

2、できたファイルをgrowisofsで焼きます。

本当は全部Linuxで行いたいんですが、どうもこのrippingの作業は面倒なようで、windowsを使っています。焼く作業は、ファイルをドラッグしたりするのが面倒だから、コマンド一発!快適です。
昔は、コマンドはめんどうと逆に思っていました。なれるとマウスを物理的に動かすほど重労働はないと思います。マウスも便利なときもあるけど、コマンドも覚えると便利なものです。

どうもマウス一色のボタンだらけの世の中は、うんざりするときがありますね。やりたいことをコマンドで伝えるというのは、本当は当り前のことなんだろうに。

2006年02月13日

WindowsXPなどから FedoraCoreを使うには SSH

昔は、telnetというコマンドでWinからunix系のOSを遠隔操作していました。

最近では、SSHを使うのが一般的です。unix/Linux側でsshd(SSHのサーバソフト)を起動させておいて、Windowsからは、puttyjp.exeというプログラム(SSHクライアントとして)で接続します。

GUIを使うには、puttyjpを起動してsshを選択しホストを入力して接続します。

ちなみにコマンドから接続するには、
puttyjp -ssh hogehoge.hoge
のように指定することも可能です。

puttyjp.exeは↓↓↓からダウンロードできます。
http://hp.vector.co.jp/authors/VA024651/download.html

2006年02月12日

HTML 文字列 折り返してくれない なんで?

<PRE>タグを使うと<BR>を使わなくても改行できるので大変便利です。
しかし、意外なところに落し穴があります。

自分で改行しないと逆に画面右端で、折り返してくれなくなります。

携帯は、自動で画面におさめようとするため自動的に折り返してくれます。

2006年02月11日

FedoraCore4 vim viの関係

VIとVIMは機能がかなり違うので気を付けましょう。

FedoraCore4では/bin/viは、vim-minimalの一部です。viで起動すると、これが起動してしまいます。以前は(FC3とか)は、viコマンドでもvimが起動していたような、、。

次のようにコマンドを入力すると調べることができます。
rpm -qf /bin/vi
vim-minimal-6.3.086-0.fc4 ← なるほどminimalとなってます。

さて、VIMはどうでしょう?

rpm -qf /usr/bin/vim
vim-enhanced-6.4.004-1.1 ←なるほどenhancedとなっています。

失敗談:私は、てっきりFC4からはVIMがインストールされなくなったと思って、RPMもみつからず、仕方がないのでSOURCEからコンパイルしていました。←ちゃんと調べないとね。

でも、ついviとコマンドを使ってしまうので、わたしは、

alias vi='/usr/bin/vim'

と~/.bashrc に記述しています。

2006年02月10日

momox.netでコマンド練習

アクセスのやり方:

1、puttyjp.exeというプログラムをDLしてください。
2、ssh (port番号を指定の番号に変更)を選んで、momox.netへアクセス
3、上記のidとpassでログインしてください。

注意:文字コードは、UTF-8を選択するように。puttyの設定で変更できます。

ソースコードは、エディタを使って書くと良いです。
viエディタを使って書いてください。
viエディタは、最初は、難しいけどなれてくるととても使いやすくなる
エディタです。最初からこれを使ってください。

起動する vi
終了する :q 「コロンq」
文字入力 i
編集モード Esc

などのコマンドを知る必要があります。ネットでviの基礎とかで調べてください。
まずはこれとLinuxの基本コマンドを覚えてください。

2006年02月05日

httpd関連パッケージ FedoraCore4

yumを使うと簡単にパッケージをインストールしたりアンインストールできます。

yum -y remove httpd

とすると簡単に依存関係(dependancy)を解決してくれてhttpd(apache)を削除してくれ大変便利です。
ただし、注意しないといけないのは、

yum -y install httpd

としても元に戻してくれないことです。
httpdでいうと次のようなパッケージを自分でインストールする必要があります。
httpd
httpd-man
mod_perl
mod_python
mod_ssl
php
php-ldap
php-pear
system-config-httpd
webalizer
などです。これらのパッケージは、FedoraCore4のDVDからウェブサーバをインストールすると自動的にインストールされるパッケージです。

しかし、それでもyumは便利ですね。

2006年02月04日

HTML mailto タグ



<A href="mailto:メールアドレス?Subject=件名&body=本文">Mail</A>

でメールを送るリンクを作成できます。











Google







 



















PHP 配列から特定の値を持った要素のキーをさがす

$array = array("blue", "red", "green", "blue", "blue");
print_r(array_keys($array, "blue"));

とすれば

0 3 4

のキーがみつかる。

2006年01月29日

PHP mbstring関数

mb_convert_encodingがない場合は、YUMコマンドを使うと便利!
一発でインストールしてくれる。

[root@fren e]# yum -y install php-mbstring
Setting up Install Process
Setting up repositories
livna 100% |=========================| 951 B 00:00
updates-released 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
base 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 217 kB 00:02
livna : ################################################## 748/748
Added 44 new packages, deleted 69 old in 4.94 seconds
primary.xml.gz 100% |=========================| 397 kB 00:00
updates-re: ################################################## 1158/1158
Added 162 new packages, deleted 184 old in 8.15 seconds
primary.xml.gz 100% |=========================| 1.0 MB 00:05
extras : ################################################## 2976/2976
Added 350 new packages, deleted 145 old in 15.21 seconds
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for php-mbstring to pack into transaction set.
php-mbstring-5.0.4-10.5.i 100% |=========================| 13 kB 00:00
---> Package php-mbstring.i386 0:5.0.4-10.5 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
php-mbstring i386 5.0.4-10.5 updates-released 953 k

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 953 k
Downloading Packages:
(1/1): php-mbstring-5.0.4 100% |=========================| 953 kB 00:00
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: php-mbstring ######################### [1/1]

Installed: php-mbstring.i386 0:5.0.4-10.5
Complete!
[root@fren e]#

PHP(コマンドで使う、パラメタを渡す)

t.php (スクリプト)
print $argv[2]."\n";
print $argc."\n";
?>

php t.php hoge1 hoge2 hoge3 (コマンドから起動)
hoge2
4

このように、$argv[] が使われる。$argv[0] は、phpのスクリプト名を持つ。
$argcは、ファイル名を含む個数を持つ。

2006年01月27日

VIM split Ctrl+w Ctrl+w :q

VIMを使って、ウィンドウ分割しながら編集するには、

vim file_name    画面にファイルが開く

:split 画面を分割する
Ctrl+w Ctrl+w  次の分割ウィンドウへ移動する
:q 現在の分割ウィンドウを閉じる

注意:vim-enhancedとvim-minimalというパッケージがあります
ビジュアルモードなどは、enhancedでないとうまくいきません

2006年01月23日

telnet ssh Windows用のクライアント

PUTTYJP.EXEを検索すると出ますが、次から落とせます。

http://hp.vector.co.jp/authors/VA024651/download/file/puttykjbin-20050503.zip

SJISのファイルをFedoraCore4上でVIで編集する

携帯はSJISで出さないといけないらしい。
通常FedoraCore4で作業しているので、SJISに変換するとVIMで開いたときに文字化けする。

これを何とかするには、次のようにしたらうまくいった。

そこで、テキストエディタにて「~/.vimrc」ファイルに
set encoding=utf8
set fileencodings=iso-2022-jp,sjis,euc-jp
と記述する。

あとはSJISのファイルを開くだけです。

http://www.geocities.jp/code_air_edge/HP/text_editor.html

を参考にしました。

2006年01月09日

vimの設定ファイル タブ設定

ホームディレクトリに .vimrc (ドットvimrc) を作ります。

タブ設定をしたい場合は、
set tabstop=4
としてます。

基礎編

<基礎編1> コンピュータを動かすソフト
コンピュータを動かすには、Windowsや、MacOSといったソフトが必要です。電器店のほとんどで売られているパソコンには、マイクロソフト社のWindowsが入っています。

このようなソフトをオペレーティングシステム(OS)と呼びます。

例えば、自動車は、TOYOTAが製造するもの、NISSANが製造するもの、、、とたくさんあります。しかし、パソコンの世界では、マイクロソフト社のOSが90%以上のパソコンで使われています。これはある意味異常な状態です。

<基礎編2> OSは、他にもあります。

MacOSX (マックオーエス テン) アップルコンピュータ社 有料
FedoraCore (フォエドラ コア) 無料
TurboLinux (ターボリナックス) 有料/無料

などです。

これらのOSは、全て、UnixというOSと非常によく似ています。Unixは、1969年にまにさかのぼる歴史が長いOSで非常に安定していると言われています。

今までは、このOSは、特別な用とに使われてきました。例えば、昔はやっていた「パソコン通信」や「高い処理能力を必要とする」研究などです。普通の人が使えるものではありませんでした。

<基礎編3>
FedoraCoreというOSは、無料で提供されています。

Unixのように大変安定したものです。1、2年前までは、まだまだ問題がおおくお薦めできるものではありませんでした。最近になってかなり安定してきました。普通の人が使えるレベルになってきています。書店に行くと、雑誌の付録などにCDが付いてきます。2000円位で雑誌とCDかDVDが入手できます。

(つづく)

2006年01月03日

src.rpmの使いかた

FedoraCore4になって、、vi エディタでv (visual mode)が使えなくなったと思っていて、 仕方がないから、vimの最新バージョンを探してみると、src.rpmしかなかった。

どうすればインストールできるの?と調べてみたらわかりました。

1. nosrc.rpmの場合、ソースを /usr/src/redhat/SOURCES にコピー
src.rpmの場合はこの手順は不要
2.ソースRPMをインストール
* nosrc.rpmの場合
# rpm -i hogehoge.nosrc.rpm
* src.rpmの場合
# rpm -i hogehoge.src.rpm
3.リビルド
# rpm --rebuild /usr/src/redhat/SPECS/hogehoge.spec
4. /usr/src/redhat/RPMS/i386/
などにRPMが出来る

これだけやって、なんとVIに関しては、VIとVIMとがあって、VIはビジュアルモード使えないだけだった。なあーんだ。コンパイルまでしたのにー。まあ、コンパイルの練習になったからいいか。

2005年12月26日

はじめてのMovableType

自宅サーバに、MovableTypeをインストールしてみてどんな感じかテストをしています。

環境は、FC4です。PERLとかMySQLとかPHPとかがインストールされています。
インターネット接続は、Bフレッツで、ISPは、朝日ネットで固定IPをとっています。
ドメインは、GoDaddy.comで、年間 8ドル程度です。

インストールはいたって簡単です。ただ、設定ファイルを指示どおりに編集する必要があります。
基本的に次のような事を設定します。

1、mt-config.cgiを作ります。(mt-config.cgi-originalからコピーする)
2、CGIPath http://www.hogehoge.com/mt/
3、DBの設定
4、StaticWebPath http://www.hogehoge.com/mt/mt-static/
5、TmpDir
6、PublishCharset

CGIPath に全てコピーし、.cgiファイルに実行権限をあたえる。

mt-check.cgiを実行する。
http://www.hogehoge.com/mt/index.html を開く

※ログイン名:Melody パス:Nelson