2011年4月29日 星期五

LEAF Kernel 2.6 Initrd.lrp 異動摘要

解開 initrd:
mv initrd.lrp initrd.gz
gzip -d initrd.gz
mkdir initrd
cd initrd
cpio -i < ../initrd

dd if=../img bs=1120 skip=1|zcat |cpio -i
封裝 initrd:
find . | cpio -c -o | gzip -9 > ../initrd.lrp

2011年3月2日 星期三

查詢 Linux 相關版本資訊

32/64 bit版本:
1.getconf LONG_BIT
64 或 32

2.file /bin/ls
64bit=>/bin/ls: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
32bit=>/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), stripped

3.uname -a
結果為 x86_64 則為 64-bit否則為 32-bit.


Linux 版本:
1.lsb_release -a
2.cat /etc/redhat-release

2011年2月22日 星期二

刪除 Proxmox VE Cluster 設定

確認所有node皆移除cluster
pveca -d ID

master 及各個node 執行以下指令:
1.停止 cluster sync 服務
/etc/init.d/pvemirror stop

2.停止 tunnel service 服務
/etc/init.d/pvetunnel stop

3.刪除 cluster 設定檔
rm /etc/pve/cluster.cfg
rm -rf /etc/pve/master

4.刪除相關的ssh設定內容
rm /root/.ssh/known_hosts

2011年1月25日 星期二

PHP CURL .htpasswd 認證筆記

<?php
$url = '127.0.0.1/phpmyadmin';
$userid = 'admin';
$userpassword = 'admin';

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERPWD, "$userid:$userpassword");

$output = curl_exec($ch);
curl_close($ch);
echo $output;
?>

2010年12月21日 星期二

LEAF新增模組至initrd.lrp(Kernel 2.4)筆記

mv initrd.lrp initrd.gz
gunzip initrd.gz
mount -o loop initrd /mnt
cp <module.o> /mnt/boot/lib/modules
e3 /mnt/boot/etc/modules
umount /mnt
gzip initrd
mv initrd.gz initrd.lrp

2010年12月6日 星期一

VirtualBox Guest OS 管理摘要

Linux 中開機自動執行 VirtualBox Guest OS
在 /etc/.rc.local 加入
su - vboxuser -c "VBoxHeadless -s 'vm_name' -v off" &

使用VBoxHeadless 啟動的 Guest OS 無法使用 VirtualBOX程式中的大部份功能,必須使用 VBoxManage controlvm來改變 Guest OS的狀態
1.開啟Guest OS遠端桌面
VBoxManage controlvm vm_name vrdp on vrdpport vm_port

2.關閉Guest OS遠端桌面
VBoxManage controlvm vm_name vrdp off

2010年11月25日 星期四

Linux kernel driver module 編譯摘要-unresolved symbol synchronize_irq

重新編譯好的 kernel driver module,但載入時出現
insmod: unresolved symbol synchronize_irq

原因可能是目前的 kernel 不支援 multi-processing

在不重新編譯kerenl情況下,make menuconfig 作以下設定
Processor type and features --->
[ ] Symmetric multi-processing support <--- 取消支援