水曜日, 9月 02, 2009

月曜日, 8月 10, 2009

十七条の憲法 : 現代語訳

ネット上で目にして、ぐっと来た文章。
≪ 十七条の憲法 : 現代語訳 ≫


第1条 お前ら仲良くしろよ
第2条 仏様とお経と坊さんは大切にしろよ
第3条 天皇陛下の詔勅は謹んで受けろ

第4条 役人は礼儀と身分をわきまえろ
第5条 人を裁く奴は賄賂とかに惑わされんなよ
第6条 ならず者は叩け。良いことしろ

第7条 役人はちゃんと自分の仕事をしろ
第8条 役人は朝早く出勤して夜遅く帰れ。きっちり定時なんかに帰るなよ
第9条 信用は大切だぞ

第10条 他人が何か間違ったことをしても、度を過ぎた叱責はよせ。お互いさまだ
第11条 功績や過ちはハッキリさせて、賞罰とかその辺はキッチリさせろよ
第12条 役人は住民から搾取しちゃダメだぞ

第13条 役人ども、お前らは同僚が何やってるかはきっちり知っておけよ
第14条 役人は他の市とかの方が給料高いからって妬んだりすんな
第15条 役人どもは自分の財布のことばっかり考えてないで国のために働け

第16条 国民に何かを課すときは、必ず時期とか空気読んでやれよ
第17条 重要事項は会議して決めろ。一人でコソコソやんなよ

月曜日, 4月 27, 2009

How to install etch on CompactFlash

母艦にDebianEtchをInstall。
tasksel全選択解除。
Network Update:No
Grub Install:Yes

再起動

vi /etc/apt/sources.list
cd行コメントアウト。
下記2行追加。
deb http://cdn.debian.or.jp/debian/ etch main
deb-src http://cdn.debian.or.jp/debian/ etch main

apt-get update
apt-get install ssh dosfstools
wget ftp://ftp.debian.org/debian/pool/main/l/live-helper/live-helper_1.0.4-1_all.deb
dpkg -i live-helper_1.0.4-1_all.deb
apt-get install debootstrap
apt-get -f install

lh_clean
mkdir -p config/chroot_sources
echo "deb http://live.debian.net/debian/ etch main" >config/chroot_sources/live.bootstrap
lh_config
lh_config -b iso -d etch --initramfs casper --tasksel tasksel --bootloader grub --hostname cfboot --packages "apache2 perl bridge-utils" --union-filesystem unionfs

vi config/chroot
適宜編集。


lh_build


fdisk /dev/hdb
n
p
1
1
505
t
0b
n
p
2
506
568
n
p
3
569
3884
a
1
w

# fdisk -l
Disk /dev/sdX: 2063 MB, 2063597568 bytes
64 heads, 62 sectors/track, 1015 cylinders
Units = cylinders of 3968 * 512 = 2031616 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 505 1001889 b W95 FAT32
/dev/hdb2 506 568 124992 83 Linux
/dev/hdb3 * 569 3884 ???????? 83 Linux


mkdosfs -F 32 /dev/hdb1
mkfs.ext3 /dev/hdb2 -L home-rw
mkfs.ext3 /dev/hdb3


mount /dev/hdb3 /mnt/hdb3/
cd /mnt/hdb3
mkdir -p boot/grub
cp /boot/grub/* boot/grub
echo '(hd1) /dev/hdb' > boot/grub/device.map
grub-install --root-directory=/mnt/hdb3 --no-floppy '(hd1)'

vi /mnt/hdb3/boot/grub/menu.lst
適宜編集。

# menu.lst - See: grub(8), info grub, update-grub(8)
default saved
timeout 5
color cyan/blue white/blue
#
title Debian live
kernel /casper/vmlinuz bootkbd=es vga=791 ramdisk_size=100000 boot=casper username=user hostname=debian persistent
initrd /casper/initrd.img
boot

title Debian live nopersistent
kernel /casper/vmlinuz bootkbd=es vga=791 ramdisk_size=100000 boot=casper username=user hostname=debian nopersistent
initrd /casper/initrd.img
boot

title Debian live-failsafe
kernel /casper/vmlinuz bootkbd=es ramdisk_size=100000 boot=casper username=user hostname=debian nopersistent noapic noapm nodma nomce nolapic nosmp vga=normal
initrd /casper/initrd.img
boot

title Memtest
kernel /casper/memtest
boot


mkdir /tmp/iso
mount -o loop binary.iso /tmp/iso
cp -a /tmp/iso/* /mnt/hdb3/
cd /mnt/hdb3
#rm -Rf isolinux(多分存在しない)
umount /dev/hdb3


mkdir /mnt/hdb2
mount /dev/hdb2 /mnt/hdb2
cp -a /home/* /mnt/hdb2/
umount /dev/hdb2

reboot

水曜日, 3月 11, 2009

DebianでConsole接続

blog.shimazu.org参照。

Debian GNU/Linux (Etch) でのシリアルコンソール接続

おそらくサーバ運用における基本のキなんだろうけど、シリアルコンソール接続をはじめて設定してみて、思いのほかてこずったので、メモしておく(DebianマシンにWindows PCからアクセスする想定)。

/etc/inittab の以下を修正。

■修正前
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
■修正後
T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100
#コメントアウトを削除の上、通信速度を変更。

反映のため、以下コマンドを実行。

# init q

/etc/securetty の以下を修正。

■修正前
#ttyS0
■修正後
ttyS0
#コメントアウトを削除

/boot/grub/menu.lst の以下を修正。

■追加
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
terminal --timeout=10 serial console

■kernel部分に「console=ttyS0,115200n8」を追加
title Debian GNU/Linux, kernel 2.6.18-5-686
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-5-686 root=/dev/hda1 ro console=tty0 console=ttyS0,115200n8
initrd /boot/initrd.img-2.6.18-5-686
savedefault
title Debian GNU/Linux, kernel 2.6.18-5-686 (single-user mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-5-686 root=/dev/hda1 ro single console=tty0 console=ttyS0,115200n8
initrd /boot/initrd.img-2.6.18-5-686
savedefault

火曜日, 3月 03, 2009

特定のポートをオープンしているプロセスを調べるには

@ITより
http://www.atmarkit.co.jp/flinux/rensai/linuxtips/664useportps.html

apt-get install lspf

# lsof -i:22
など。

月曜日, 2月 16, 2009

killall on debian

apt-get install psmisc

apt-getの鍵問題。

apt-get update
Get:1 http://ftp.jp.debian.org lenny Release.gpg [386B]
Ign http://ftp.jp.debian.org lenny/main Translation-en_US
Get:2 http://ftp.jp.debian.org lenny Release [63.2kB]
Get:3 http://ftp.jp.debian.org lenny/main Packages [5295kB]
Get:4 http://ftp.jp.debian.org lenny/main Sources [2304kB]
Get:5 http://security.debian.org etch/updates Release.gpg [189B]
Ign http://security.debian.org etch/updates/main Translation-en_US
Ign http://security.debian.org etch/updates/contrib Translation-en_US
Get:6 http://security.debian.org etch/updates Release [37.6kB]
Ign http://security.debian.org etch/updates/main Packages/DiffIndex
Ign http://security.debian.org etch/updates/contrib Packages/DiffIndex
Ign http://security.debian.org etch/updates/main Sources/DiffIndex
Ign http://security.debian.org etch/updates/contrib Sources/DiffIndex
Get:7 http://security.debian.org etch/updates/main Packages [315kB]
Hit http://security.debian.org etch/updates/contrib Packages
Get:8 http://security.debian.org etch/updates/main Sources [50.4kB]
Hit http://security.debian.org etch/updates/contrib Sources
Fetched 8065kB in 9s (862kB/s)
Reading package lists... Done
W: There is no public key available for the following key IDs:
4D270D06F42584E6
W: You may want to run apt-get update to correct these problems

上記のように鍵が・・・と言われる事がある。
その時はすかさず、
apt-get install debian-archive-keyring
これで問題解消。

木曜日, 1月 29, 2009

XORP on debian

vi /etc/apt/sources.list

etch -> testing

apt-get update;apt-get upgrade;apt-get dist-upgrade
reboot

apt-get -s install xorp

maybe need to update dpkg.
you have to download apt_0.7.20.1_i386.deb or higher before update.

apt-get install xorp

echo "xorp:x:root," >> /etc/group

reboot

xorp_rtrmgr &

xorpsh