With sufficient disk space, its straight forward. I set up a fake root
directory, extract a minimal i386 FreeBSD system into it. The attached
script is used to start a 32bit chroot-ed environment, either to run
a command or start a shell. I have successfully built a large number
of 32-bit ports on a amd64 bit server this way.
Let me know if you have more questions.
Mark
————– next part ————–
#!/bin/sh -e
# start-i386 [cmd ..]
# from http://www.nabble.com/i386-package-building-on-an-amd64-system-t4441068.html
ROOT=/b/jails/i386
REVISION=”6.2″
BRANCH=”stable”
OSVERSION=602112
UNAME_s=”FreeBSD”
UNAME_m=”i386″
UNAME_p=”i386″
UNAME_r=$REVISION-$BRANCH
UNAME_v=”$UNAME_s $UNAME_r #6: Sun Sep 23 11:41:48 PDT 2007 root at osprey.kermodei.com:/usr/src/sys/i386/compile/OSPREY”
export UNAME_s UNAME_r UNAME_v UNAME_m UNAME_p OSVERSION ROOT
if [ -r $ROOT/dev/zero ]
then
echo dev already mounted
else
mount -t devfs dev $ROOT/dev
fi
ln -sf ld-elf.so.1 $ROOT/libexec/ld-elf32.so.1
echo “libpthread.so.2 libthr.so.2
libpthread.so libthr.so” > ${ROOT}/etc/libmap.conf
cp ${ROOT}/etc/libmap.conf ${ROOT}/etc/libmap32.conf
mkdir -p ${ROOT}/usr/local/bin
cp /usr/local/bin/bsdmake ${ROOT}/usr/local/bin
cp /etc/make.conf ${ROOT}/etc/
cp /etc/resolv.conf ${ROOT}/etc/
cp /etc/hosts ${ROOT}/etc/
HOME=/root
export HOME
if [ $# = 0 ] ; then
exec chroot $ROOT /bin/csh
else
echo “$@” | exec chroot $ROOT /bin/sh
fi
http://lists.freebsd.org/pipermail/freebsd-amd64/2007-November/010466.html
php-excel是一个PHP导出excel文件的类库。导出的是XML文件,用office2003,openoffice3都可以正常打开。
官方网站:
http://code.google.com/p/php-excel/
简单的例子:
<?php
// load library
require ‘php-excel.class.php’;
// create a simple 2-dimensional array
$data = array(
1 => array (‘Name’, ‘呵呵’),
array(‘Schwarz’, ‘Oliver’),
array(‘Test’, ‘Peter’)
);
// generate file (constructor parameters are optional)
$xls = new Excel_XML(‘GB2312′, true, ‘My Test Sheet’);
$xls->addArray($data);
$xls->generateXML(‘my-test’);
?>
Subversion 的 post-commit hook 是個很方便的功能,可以讓你在 commit 程式到 Repository 後,自動去做一些事。其中最有用的就是把 commit log 寄給相關的 developer。
在人人都有 Gmail 且 Gmail 也支援 SMTP 寄信的情況下,透過 Gmail 來寄出 commit log 應該是個好 idea。只不過, 目前的 mailer.py 並不支援 Gmail 的 TLS,所以下面的修改,就是要要將 mailer.py 修改成支援 TLS。
如果你是使用 Debian 或是 Ubuntu,請用 sudo apt-get install subversion-tools 將相關的 Subversion 工具裝到你的系統中。mailer.py 就在 /usr/share/subversion/hook-scripts/mailer 的目錄下。打開 mailer.py 找到 SMTPOutput class 中的 finish() menthod 將他改成(紅色是修改的部分):
def finish(self):
server = smtplib.SMTP(self.cfg.general.smtp_hostname)
if self.cfg.is_set(‘general.smtp_username’):
server.ehlo()
server.starttls()
server.ehlo()
server.login(self.cfg.general.smtp_username,
self.cfg.general.smtp_password)
server.sendmail(self.from_addr, self.to_addrs, self.buffer.getvalue())
server.close()
然後將,mailer.conf 的 [general] section 修改成下面的設定,並且放在你的 (svn repository)/conf 下:
[general]
smtp_hostname = smtp.gmail.com:587
smtp_username = your_gmail_account@gmail.com
smtp_password = your_gmail_password
這樣就成了。
换了笔记本后,发现音量很小,听起来特别吃力,google了下:
设置音量的命令:
mixer -s vol 55 设置音量为55
mixer -s pcm 55 设置pcm为55
mixer -s vol -1 设置音量减1
另外还有遇到只能用耳机,笔记本喇叭没声音的问题。通过设置sysctl来解决:
sysctl -w hw.snd.default_unit=1
最新评论