damien.h

Compile cmemcache on Gentoo

I needed to install cmemcache on a Gentoo box in order to enable Django to work with memcached. But when I tried to compile the cmemcache code, I got such error messages:

‘CmemcacheObject’ has no member named ‘mc_ctxt’

I’m surprised Google didn’t give me many answers. But I came across this post which was very useful. So in the end, here’s how I got cmemcache compiled and installed on Gentoo.

cd ~/code
sudo emerge libmemcache
wget http://gijsbert.org/downloads/cmemcache/libmemcache-1.4.0.rc2.patch
wget http://gijsbert.org/downloads/cmemcache/cmemcache-0.95.tar.bz2
# the patch was made using a folder called reference
mkdir reference
cd reference
tar xjvf ../libmemcache-1.4.0.rc2.tar.bz2
cd ..
patch -p0 < libmemcache-1.4.0.rc2.patch
cd reference/libmemcache-1.4.0.rc2
./configure && make
sudo make install
cd ../../
tar xjvf cmemcache-0.95.tar.bz2
cd cmemcache-0.95
sudo python setup.py install

如何从Ubuntu Gutsy顺利升级到Hardy

前两天终于决定把机器上的Gutsy升级到Hardy了。没有第一时间升级就是因为从Gutsy发布开始已经把全部工作环境搬到了Gutsy上,用了半年的环境要折腾一下是需要一定决心的。况且,从Dapper开始,每次升级都没有成功过,只是因为Ubuntu下没什么重要数据,后来都是重新安装的。好在之前咨询的一些尝鲜的朋友都没什么问题的升级成功,所以决定在备份了/home以后开始升级。
果然,Hardy的升级过程非常顺利。除了若干小问题,升级完成以后重启一下马上就回到了熟悉的工作环境,终于松了一口气。看来Ubuntu经过这么多版本的改进,确实已经相当成熟了。那这次升级值得写一下的就只有碰到的个别问题了。

Firefox 2和Firefox 3共存

Hardy默认安装了Firefox 3,但是很多插件还没法装,所以很多人都希望用回Firefox 2。装Firefox 2本身其实很简单,源里就有firefox-2的包。但是升级前如果用的是firefox 2,就一定要先备份好数据,推荐用FEBE完整备份profile。因为升级后Firefox 3会直接使用升级前Firefox 2默认的profile,这样再装回Firefox 2的话,原来的profile在ff2下也不能用了。所以推荐的做法是升级完成后为ff2和ff3各自新建一个profile,然后把ff2备份数据导入,就恢复原样了。

Sun JVM 1.6在64位Hardy下造成Eclipse经常崩溃

对这个问题已经开出了bug报告,而且据说用了OpenJDK 7同样有问题。目前我用的解决办法是在eclipse.ini里添加以下一行内容:

-XX:CompileCommand=exclude,org/eclipse/core/internal/dtree/DataTreeNode,forwardDeltaWith

这样改完以后都没再崩溃过了。另外还可以改用IBM JDK,据说是没有问题的。

无法注销/重启/关机的问题

这个现象可能只有少数人才能碰到,注销/重启/关机到一半就没反应了,需要重启一下x,然后才会继续下去。问题是出在KeyTouch上。把KeyTouch拆了就好了。这个Bug也已经在修复中了,暂时不用KeyTouch也没什么问题。

其他

其实值得提的基本就这些了^^ 升级以后,本来坏了总无法启动的OOo恢复正常了,有时候莫名死机的问题也没有了。总之,这是一次非常成功的升级。Ubuntu向着完美桌面的目标又进了结实的一步。

Installing Guake on Ubuntu Gutsy (with Compiz Fusion)

I’m a fan of FPS games (like Quake) and always fancy having the Quake style drop-down consoles for the operating system I use. Luckily there are some good ones for Linux. I used to use Tilda but it’s kind of flakey under Ubuntu with Beryl/Compiz.

Lately I switched to Guake, a new FPS style console that’s claimed to “meld the best of them (Yakuake and Tilda) into a single GTK-based application”. Having used it for a while now, I can tell that Guake is really promising, and it plays very nice with Compiz Fusion under my Gutsy amd64.

But the installation of Guake has several glitches to overcome and the home page has few information as of now. So here are my tips about the installation.

1. For Ubuntu Gutsy you need to have the following packages first.

python-dev,libgtk2.0-dev,libx11-dev,python-notify

2. There are two ways to install Guake from source: Download and install the 0.1 package or install from git.

If you download the 0.1 tarball, just follow the usual routine of “./configure && make” and “sudo make install” to get it installed. But before Guake will work, you must perform one additional step.

gconftool-2 –install-schema-file=/usr/local/etc/gconf/schemas/guake.schemas

If you install from git, the steps are

sh autogen.sh./configure && make

sudo make install

The finishing steps also include the above one final step for tarball installation. But somehow the latest git version fails to copy some graphic files during the install. So you have to do that yourself.

sudo cp /path/to/guake/data/pixmaps/* /usr/local/share/pixmaps/guake/

Notes 8在Ubuntu Gutsy下启动崩溃问题和解决

Notes 8在Gutsy下已经运行的不错了,除了用scim不能输入中文。但是今天在一次意外退出以后,Notes每次启动都会提示出错,错误号CLFRJ00010E(毫无意义的出错信息并不是m$专利)。Google以后终于找到这篇文章,经过尝试以后我的解决方法是这样的。

sudo rm ~/lotus/notes/data/~notes.lck
ps -ef | grep lotus

如果看到还有notes进程的话,比如
user 22514 1 0 10:19 ? 00:00:01 /opt/ibm/lotus/notes/taskldr /opt/ibm/lotus/notes/taskldr

pkill -9 taskldr

以上两步就可以让notes重新启动成功了,并不需要清空workspace。

P.S. 2008第一贴,祝各位新年快乐!

Tags: ,

LinkStation改装攻略备忘 补充

今天拿了台新换的linkstation回来,很快又改会原来的状态了。上次写的备忘有些需要补充的地方。

  1. 这次试验了ls2直接连电脑后,在电脑和ls2的c网段不同的情况下刷机。结果是firmware刷新失败!不过不用怕,firmware刷新失败后ls2会进入工程模式(Engineer Mode, EM)。这时候ip会回到默认的192.168.11.150,firmware刷新工具仍旧能搜索到ls2。把电脑设置到和ls2相同c网段,重新刷一次就行了。
  2. 建议在第一次e2fsck检查完Debian分区,重启进系统之后,执行tune2fs -i 0 -c 0 /dev/hda1,禁止系统启动时自动检查硬盘,从而避免出现检测超时无法开机的麻烦情况。
  3. 快速改机档的默认ip直接修改/mnt/hda/etc/network/interfaces,这样就不用重启进入Debian再接上电脑改了

LinkStation改装攻略备忘 svn + 动态域名

有2周多没有更新blog了吧,最近在折腾不少事情,升级了台式机,hack了新买的linkstation HD-H120LAN(以下简称ls2),想打造一个高效的soho环境。工欲善其事必先利其器嘛,好的环境和工具是非常必要的。

Linkstation的改装基本按照计划,初步完工以后这个白色的小家伙跑着Debian连续工作了两个礼拜,120G硬盘塞满了90%,这周三突然挂了,为了不破保不敢拆机,于是今天去送修,基本要换个新的了。虽然除了意外,但是linkstation的改装真的是非常值得做的,改装以后非常超值。为了拿到新机以后再改一次,还是把本次改装经过记录下来备忘吧。

国外玩家对linkstation的改装已经很有造诣了,改装社区2年多前就很热了,所以其实现在对linkstation的改装资源已经很成熟了。我的改装过程基本参照这里这里的两篇文章,用了文章里的Debian快速改装包,装完Debian以后常用的工具都已经预装好了,包括torrentflux, mldonkey, samba, lamp, phpmysqladmin。具体过程参照文章就行了,但是有几点要注意。

  1. 关于第三方改装firmware的说明两篇文章都没有交代清楚,刚接触linkstation改装的同学可能会有点晕。linkstation改装的资料在http://www.nas-central.org都有完整说明。最常用的第三方firmware是openlinkfreelink,两者的区别是openlink只是在原厂firmware基础上打开了telnet,其他原厂功能不变,而freelink是直接把原厂linux替换成了Debian。其实也可以直接按照nascentral上面的攻略来改,但上面两篇文章里改法的好处是用了openlink以后在hda3上装Debian,和原厂linux互不影响,可以随时切换,所以是个合理的选择。
  2. 把ls2直接连到电脑以后,电脑不必修改ip到192.168.11网段firmware刷新工具也能搜到ls2。但是我刷的时候为了保险还是把电脑改到11网段了。也许不用改网段也能刷。
  3. 刷完openlink改装版firmware以后,ls2预设的静态ip就是192.168.11.150。因为我用的linksys wireless-b路由只允许192.168.1网段,改完以后不能直接接上路由,不然ls2是拿不到ip的。必须还是连在电脑上的时候把静态ip改掉。由于openlink只是相当于在原厂firmware基础上把原厂linux的telnet打开,所以刷完以后ls2的使用和原来的一摸一样。可以通过http访问192.168.11.150进原厂管理界面直接改掉ip到192.168.1网段,再接到路由上面就行了。
  4. 以下这步非常重要!上面两篇文章里都没有突出这一步的重要性!我的ls2就是因为reboot之前忘了做这一步出问题的!
    强烈建议在每次reboot进debian之前,执行下面操作检查硬盘,防止重启以后因为硬盘检查超时导致无法进入系统的问题!

    umount /dev/hda3
    e2fsck /dev/hda3
  5. 装完Debian以后第一次启动默认静态ip还是192.168.11.150,所以我需要把ls2再接到电脑上改静态ip到192.168.1网段。
  6. 推荐使用下面的Debian源,不推荐第二篇文章里的netselect-apt,至少在我的情况下netselect-apt自动找的源很慢,还会造成deb包的混乱,最后还得用apt-get -f install来整理。
    deb http://mirror.pacific.net.au/debian/ etch main contrib
    deb-src http://mirror.pacific.net.au/debian/ etch main contrib
    deb http://security.debian.org/ testing/updates main
  7. Debian基本都搞舒服了以后就可以根据自己需要装更多软件了。我装了subversion,把ls2用作home lan上的svn server,用下来速度也很不错,推荐一下。apt-get install subversion就行了。顺便说一下我感觉ls2上用svnserve就行了,没必要用apache配webdav,毕竟不是pc还是要节约一下计算资源。
  8. 动态域名问题。之前是打算装花生壳linux版的,后来才发现在ls2的Debian上运行不了,而且没有提供源码,所以就没戏了。后来用的是3322.org,使用非常简单,不需要客户端,只要用lynx定时ping一下3322的web service url就行了。ls2的Debian默认没有lynx,需要apt-get install lynx一下。把下面的命令存为3322org.sh
    lynx -mime_header -auth=user:pass "http://www.3322.org/dyndns/update?system=dyndns&hostname=myhost.3322.org"

    然后chmod +x 3322org.sh,再写个cron job定时执行这条命令:

    crontab -e

    加上这条cron job,每隔5分钟执行一下3322org.sh并把输出保存到3322.org

    */5 * * * * /home/user/3322org.sh >>/home/user/3322.log

    为了防止log文件无限暴涨,可以再加上这条cron job,每天0点删除log

    0 0 * * * rm /home/user/3322org.log

    完了以后别忘了在路由上设好端口映射,之后就可以用动态域名访问ls2上的所有服务了!

搞定!我的完美ls2 server就这样基本完成了!两个星期来已经用torrentflux消耗了无数带宽,还动不动很bt的用手机访问tf。。。等机器拿回来再搞一遍吧。。。

Running Lotus Notes 8 on Ubuntu Feisty

My struggle of getting Lotus Notes 8 to run on Ubuntu Feisty has finally come to an almost perfect end. I feel awfully guilty if I don’t blog it and share with you.

My journey started with installing Notes, of course. This part of the story has already been covered very well by other folks. I recommend this particular post to follow.

It’s the running Notes part that’s really frustrating. It actually stuck me for weeks. First, whenever I start Notes, the splash will freeze at some point and a ridiculous jvm crash dialog will show, whose height well exceeds my screen’s and I can’t even see the whole message.

After numerous failure and with despair, I started into a failsafe gnome session and…man! It runs in failsafe gnome! That could be a close enough workaround, but I can’t live with failsafe all my life. So here’s the way that finally got Notes to run happily without failsafe.

  1. Start Notes with regular gnome. When the jvm crash dialog shows, select all the text and copy it to a new text file.
  2. Remove the first line, which should be like “JVM terminated. Exit code=160”.
  3. Remove all the carriage returns in the remaining messages. This is actually the startup script to run Notes.
  4. Add these lines at the top of the script.
    export MOZILLA_FIVE_HOME=/usr/lib/xulrunner-1.8.0.1-lwp
    export LD_LIBRARY_PATH=/opt/ibm/lotus/notes:$MOZILLA_FIVE_HOME
  5. If you don’t have a /usr/lib/xulrunner-1.8.0.1-lw directory, you can either install a xulrunner package, or if you have Firefox, use this instead.
    export MOZILLA_FIVE_HOME=/usr/lib/firefox
  6. Then you need to find this line
    /opt/ibm/lotus/notes/framework/rcp/eclipse/plugins/com.ibm.rcp.j2se.linux.x86_1.5.0.SR4-200707311521/jre/bin/notes2w

    And add this line next to it.
    -Dswt.library.path=$LD_LIBRARY_PATH
  7. Finally, save the file as “notes.sh”. To run Notes, simply run the sh file.

Below is the script I use to start Notes. To use it for your own, replace all occurrences of “houyr” with your own account name and it probably will work.

export MOZILLA_FIVE_HOME=/usr/lib/xulrunner-1.8.0.1-lwp
#export MOZILLA_FIVE_HOME=/usr/lib/firefox
export LD_LIBRARY_PATH=/opt/ibm/lotus/notes:$MOZILLA_FIVE_HOME
/opt/ibm/lotus/notes/framework/rcp/eclipse/plugins/com.ibm.rcp.j2se.linux.x86_1.5.0.SR4-200707311521/jre/bin/notes2w -Dswt.library.path=$LD_LIBRARY_PATH -Xmx512m -Xquickstart -Xjit:noResumableTrapHandler -Dosgi.framework.extensions=com.ibm.rcp.core.logger.frameworkhook,com.ibm.cds -Xscmx64m -Xshareclasses:name=xpdplat%g,groupAccess,keep,nonfatal -Drcp.home=/opt/ibm/lotus/notes/framework -Drcp.data=/home/houyr/lotus/notes/data/workspace -Dosgi.splashPath=platform:/base/../shared/eclipse/plugins/com.ibm.notes.branding,platform:/base/../shared/eclipse/plugins/com.ibm.notes.branding.nl1,platform:/base/../shared/eclipse/plugins/com.ibm.notes.branding.nl2,platform:/base/../shared/eclipse/plugins/com.ibm.notes.branding.nl3 -Dcom.ibm.rcp.install.id=1189233555789 -Drcp.install.config=multiuser -Declipse.registry.nulltoken=true -Dautopd.logfile.generations=3 -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeAwareParserConfiguration -Dautopd.instance.area=/home/houyr/lotus/notes/data/workspace/autopd/ -Disa.ignoreESR=true -Djava.util.logging.config.class=com.ibm.rcp.core.internal.logger.boot.LoggerConfig -Dcom.ibm.pvc.webcontainer.port=0 -Disa.ignorePortableCollector=true -Disa.ignoreFeedback=true -Disa.ignoreUpdate=true -Dderby.stream.error.file=/home/houyr/lotus/notes/data/workspace/logs/derby.log -Djava.security.properties=file:/opt/ibm/lotus/notes/framework/rcp/eclipse/plugins/com.ibm.rcp.base_6.1.1.200707311521/rcp.security.properties -Djava.protocol.handler.pkgs=com.ibm.net.ssl.www.protocol -Dosgi.hook.configurators.exclude=org.eclipse.core.runtime.internal.adaptor.EclipseLogHook -Drcp.osgi.install.area=/opt/ibm/lotus/notes/framework/eclipse -Xbootclasspath/a:/opt/ibm/lotus/notes/framework/rcp/eclipse/plugins/com.ibm.rcp.base_6.1.1.200707311521/rcpbootcp.jar -jar /opt/ibm/lotus/notes/framework/rcp/eclipse/plugins/com.ibm.rcp.base_6.1.1.200707311521/launcher.jar -os linux -ws gtk -arch x86 -launcher /opt/ibm/lotus/notes/framework/rcp/eclipse/plugins/com.ibm.rcp.base_6.1.1.200707311521/linux/x86/eclipse -name IBM Lotus Notes -showsplash 600 -exitdata 35801c -nl en_US -dir ltr -personality com.ibm.rcp.platform.personality -product com.ibm.notes.branding.notes -data /home/houyr/lotus/notes/data/workspace -configuration /home/houyr/lotus/notes/data/workspace/.config -plugincustomization /opt/ibm/lotus/notes/framework/rcp/plugin_customization.ini -vm /opt/ibm/lotus/notes/framework/rcp/eclipse/plugins/com.ibm.rcp.j2se.linux.x86_1.5.0.SR4-200707311521/jre/bin/notes2w -vmargs -Xmx512m -Xquickstart -Xjit:noResumableTrapHandler -Dosgi.framework.extensions=com.ibm.rcp.core.logger.frameworkhook,com.ibm.cds -Xscmx64m -Xshareclasses:name=xpdplat%g,groupAccess,keep,nonfatal -Drcp.home=/opt/ibm/lotus/notes/framework -Drcp.data=/home/houyr/lotus/notes/data/workspace -Dosgi.splashPath=platform:/base/../shared/eclipse/plugins/com.ibm.notes.branding,platform:/base/../shared/eclipse/plugins/com.ibm.notes.branding.nl1,platform:/base/../shared/eclipse/plugins/com.ibm.notes.branding.nl2,platform:/base/../shared/eclipse/plugins/com.ibm.notes.branding.nl3 -Dcom.ibm.rcp.install.id=1189233555789 -Drcp.install.config=multiuser -Declipse.registry.nulltoken=true -Dautopd.logfile.generations=3 -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeAwareParserConfiguration -Dautopd.instance.area=/home/houyr/lotus/notes/data/workspace/autopd/ -Disa.ignoreESR=true -Djava.util.logging.config.class=com.ibm.rcp.core.internal.logger.boot.LoggerConfig -Dcom.ibm.pvc.webcontainer.port=0 -Disa.ignorePortableCollector=true -Disa.ignoreFeedback=true -Disa.ignoreUpdate=true -Dderby.stream.error.file=/home/houyr/lotus/notes/data/workspace/logs/derby.log -Djava.security.properties=file:/opt/ibm/lotus/notes/framework/rcp/eclipse/plugins/com.ibm.rcp.base_6.1.1.200707311521/rcp.security.properties -Djava.protocol.handler.pkgs=com.ibm.net.ssl.www.protocol -Dosgi.hook.configurators.exclude=org.eclipse.core.runtime.internal.adaptor.EclipseLogHook -Drcp.osgi.install.area=/opt/ibm/lotus/notes/framework/eclipse -Xbootclasspath/a:/opt/ibm/lotus/notes/framework/rcp/eclipse/plugins/com.ibm.rcp.base_6.1.1.200707311521/rcpbootcp.jar -jar /opt/ibm/lotus/notes/framework/rcp/eclipse/plugins/com.ibm.rcp.base_6.1.1.200707311521/launcher.jar
rm -rf ~/lotus/notes/data/workspace/logs/javacore*.txt
rm -rf ~/lotus/notes/data/workspace/logs/core*.dmp

**Update**

Yeah I got Notes to “run”, technically. But getting it to fully work is another thing. Now I’ve found a new problem. Whenever I create a new memo, or reply or forward a mail, a little dialog called “NSD is running” will show, and Notes freezes. In the console window behind, a lot of error is generated by this nsd.sh, which is actually a dumping script.

Anyone has any insight on this issue?

Browse Happy logo

My tweets

2016年八月
« 八    
1234567
891011121314
15161718192021
22232425262728
293031  

分类目录

Articles

Fancy Stats