WordPress for Android发布

早上看Google Reader见此新闻,马上拿去我心爱的Google G1去Market看了下,果然,wordpress已经能在Android上写了

这篇BLOG就是我在G1上写的,为Android多了一个功能强大的应用叫好~

gentoo: 配置bootsplash

闲来无聊,就去kde-look上逛逛看看有没有什么好的桌面资源,发现有一个分类是bootsplash,这才想起来一直没配置过bootsplash,所以花了点时间研究了下

bootsplash是形容计算机(操作系统)在启动过程中的图形界面的过程的专业术语,有关bootsplash的详细说明请看这里

在gentoo下,如果你想定制bootsplash,首先需要在内核编译的过程中,选择支持framebuffer,确认内核支持framebuffer后,在系统中安装splashutils:

# emerge splashutils

下载完成后,去寻找一些你喜欢的bootsplash主题,下载主题包,比如我使用的是一个叫natural-gentoo的主题,我们来看一看这个主题包的目录结构:

# tree natural-gentoo/
natural-gentoo/
|-- boot
|   `-- grub
|       `-- gentoo.xpm.gz
|-- etc
|   `-- splash
|       `-- natural-gentoo
|           |-- 1024x600.cfg
|           |-- 1024x768.cfg
|           |-- 1152x864.cfg
|           |-- 1280x1024.cfg
|           |-- 1280x800.cfg
|           |-- 1400x1050.cfg
|           |-- 1440x900.cfg
|           |-- 1600x1200.cfg
|           |-- 1680x1050.cfg
|           |-- 1920x1200.cfg
|           |-- 800x600.cfg
|           `-- images
|               |-- silent-1024x600.jpg
|               |-- silent-1024x768.jpg
|               |-- silent-1152x864.jpg
|               |-- silent-1280x1024.jpg
|               |-- silent-1280x800.jpg
|               |-- silent-1400x1050.jpg
|               |-- silent-1440x900.jpg
|               |-- silent-1600x1200.jpg
|               |-- silent-1680x1050.jpg
|               |-- silent-1920x1200.jpg
|               |-- silent-800x600.jpg
|               |-- verbose-1024x600.jpg
|               |-- verbose-1024x768.jpg
|               |-- verbose-1152x864.jpg
|               |-- verbose-1280x1024.jpg
|               |-- verbose-1280x800.jpg
|               |-- verbose-1400x1050.jpg
|               |-- verbose-1440x900.jpg
|               |-- verbose-1600x1200.jpg
|               |-- verbose-1680x1050.jpg
|               |-- verbose-1920x1200.jpg
|               `-- verbose-800x600.jpg
`-- metadata.xml
 
6 directories, 35 files

可以看到,在一个bootsplash主题包中,boot的grub目录下存放的是grub界面的配套主题,而bootsplash的主题样式与规则存放在/etc/splash目录下,我们在主题包的目录中将这些包复制到系统中去:

# cp -nr ./boot/ /
# cp -nr ./etc/ /

注意cp命令千万别忘了加上命令选项n,意思是仅复制新的文件,忽略已存在的相同文件

现在,我们要生成一个initramfs的splash image文件,语法如下:

splash_geninitramfs --verbose --res NxN --generate /boot/initramfs-bootsplash theme

你所需要修改的只有res命令选项后的分辨率参数以及最后的theme名,我的X61是1024×768的分辨率(分辨率支持的前提是主题包内有相应的分辨率cfg文件),使用的主题包名为natural-gentoo,所以,在/etc目录下,执行:

# splash_geninitramfs --verbose --res 1024x768 --generate /boot/initramfs-bootsplash natural-gentoo/

这时,/boot目录下就会生成一个名为initramfs-bootsplash的splash image文件

很快来到了最后一步,也就是调整你的grub配置,这里直接帖出我的menu.lst,供大家参考:

# This is a sample grub.conf for use with Genkernel, per the Gentoo handbook
# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2
# If you are not using Genkernel and you need help creating this file, you
# should consult the handbook. Alternatively, consult the grub.conf.sample that
# is included with the Grub documentation.
 
default 0
timeout 3
#grub界面使用主题包里的图片
splashimage=(hd0,0)/boot/grub/gentoo.xpm.gz
 
title Gentoo Linux 2.6.32-r2
root (hd0,0)
#注意新加的内核load参数: splash=silent(或者verbose),theme:主题名 console=tty1
kernel /boot/ghosTkernel root=/dev/sda1 video=792 splash=silent,theme:natural-gentoo console=tty1
initrd /boot/initramfs-bootsplash
 
# vim:ft=conf:

来看看我的bootsplash效果吧 :)

参考资料:

1. http://en.gentoo-wiki.com/wiki/Fbsplash

2. http://en.wikipedia.org/wiki/Bootsplash

gentoo: 我的/etc/make.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-O2 -march=i686 -pipe"
CXXFLAGS="-O2 -march=i686 -pipe"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="i686-pc-linux-gnu"
MAKEOPTS="-j3"
 
USE="X acpi -aim alsa bash-completion bluetooth cjk consolekit crypt -cups dbus dri embedded ffmpeg firefox flac gif gimp -gnome -gnome-keyring -gpm -gps gnutls gzip gtk hal hardened -icq ipod -ipv6 jabber jpeg kontact kde lm_sensors lua mp3 mplayer mng msn mysql ncurses networkmanager opengl plasma png -qt3 qt3support qt4 -rdesktop readline -scanner semantic-desktop smp -spell sql ssl svg syslog unicode vim-syntax webkit wifi win32codecs -yahoo"
 
ACCEPT_KEYWORDS="~x86"
#安装某些软件时需要同意其License,否则安装会被Mask
ACCEPT_LICENSE="*"
 
INPUT_DEVICES="evdev"
#指定显卡驱动,避免不必要的驱动在emerge xorg-server时被编译进去
VIDEO_CARDS="intel"
 
#镜像
GENTOO_MIRRORS="http://mirrors.163.com/gentoo"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"

如何订阅SHLUG邮件列表

在此输入您的邮箱地址来订阅上海Linux用户组的邮件列表:

在订阅按钮点击后,google group 会发送一封确认邮件到订阅者的邮箱中,其中有一个指向订阅确认页面的URL链接,必须将链接中的http协议改成https协议方能进入该订阅确认页面。

gentoo: kde4下gtk程序使用qt样式

以往要在kde下使gtk程序看起来与qt程序协调,方法就是安装一个名为gtk-engines-qt的包,然而此包现在在gentoo下被mask了,取而代之的是一个名为kcm_gtk的软件

所以,当你想一如往常的那样装完kde后让gtk程序使用qt主题和样式,需要:

emerge kcm_gtk

之后你可能需要安装一个现有的较美观的主题包:

emerge gtk-engines-qtcurve
emerege qtcurve-qt4

完成后,你就可以在KDE的系统设置->外观中找到GTK Styles and Fonts的选项并进行配置了

gentoo: 配置系统默认编辑器

刚emerge完自己的gentoo,在自己的workspace下建了个新的git项目仓库,准备提交(git commit)第一个文件的时候,报错说找不到编辑器nano

因为我从来不用nano,所以系统在配置初期把nano给unmerge掉了,我要做的就是修改系统的默认编辑器

果然,在/etc/profile中,有这么一行代码:

export EDITOR=${EDITOR:-/bin/nano}

修改为:

export EDITOR=${EDITOR:-/usr/bin/vim}

重启生效,问题解决

Helloworld

1
2
3
4
5
6
#include <stdio.h>
int main(void)
{
    printf("helloworld\n");
    return 0;
}
Return top