Gentoo配置手记(10/08/07)

Number of View: 218

我又开始折腾了-___,-

1. 不小心删除了Python
按Gentoo handbook折腾了一天把系统安装好了,于是我就决定emerge一下Python,结果把Python3也给装上了。想删除Python3结果直接把Python2.6一并咔嚓了。彼时还没有认识到问题的严重性,结果后来发现emerge命令执行之后完全没反应,问题严重了。翻开Portage Introduction:

Portage is completely written in Python and Bash.

Gentoo的Portage系统是依赖于Python的,so don’t ever unmerge Python completely!
问题解决方法就是重新编译安装Python:

# cd
# tar xzf /usr/portage/distfiles/Python-2.6.5.tgz
# cd Python-2.6.5
# ./configure --with-fpectl --infodir=/usr/share/info/ --mandir=/usr/share/man
# make
# make install prefix=/usr
# rm /usr/bin/python 2>/dev/null
# ln -s /usr/bin/python2 /usr/bin/python

Reference: [Gentoo Forums] I unmerged python… ensuing problems….

2. 无线网卡无法识别
首先确定网卡型号及驱动模块是否已加载:

# lspci | grep Wireless
03:00.0 Network controller: Intel Corporation PRO/Wireless 5100 AGN [Shiloh] Network Connection

搜索该网卡对应的内核模块应为iwlagn,完整的网卡型号与驱动模块对应列表可从 Drivers – Linux Wireless 获得。

# lsmod | grep iwlagn
iwlagn                173410  0
iwlcore               174978  1 iwlagn
mac80211              128158  2 iwlagn,iwlcore
cfg80211              119296  3 iwlagn,iwlcore,mac80211

iwlagn已经正确加载,但是无线网卡仍然无法识别(wlan0: device not found)。
原来还有重要的一步没有做: Software Setup – Installing the microcode files。

# emerge -av net-wireless/iwl5000-ucode

之后无线网卡就可以正确识别了。

Refrence: Iwlwifi — Gentoo Linux Wiki

3. udev更新问题(2010-08-07)
昨天运行了一下emerge -uDN,今早启动系统的时候报错:

* Checking root filesystem...
fsck.ext3: No such file or directory while trying to open /dev/sda6
/dev/sda6:
The superblock could not be read or does not describe a correct ext 2 filessytem.
If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or something else,
then the superblock is corrupt, and you might try running e2fsck with an alternate superblock:
      e2fsck -b 8193  

* Filesystem coudn't be fixed :(

这个问题很好解决,只要利用livecd进入chroot(参见Gentoo handbook),downgrade udev到之前的可用版本就OK了。

# emerge "<=sys-fs/udev-149"

Refrence: [Gentoo Forums] Installing Gentoo

  • Share/Bookmark

Setup GDM 2.28 and above

Number of View: 281

gdm自从升级到2.28以后就不能设置主题神马的了,而且gdm的background还是一坨非常恶心的绿色,更杯具的是awesome下不知为啥urxvt设置透明背景用的background居然是这个绿色的图,恶心了我很长时间。上次通过设置rc.lua里一个透明选项搞定的,这次awesome升级以后好像又不管用了,一打开urxvt就把我嚇到了….

去查了ArchWiki的Gnome 2.28 Changes,找到了这个命令:


# gksu -u gdm dbus-launch gnome-appearance-properties

终于改过来了。本来想再不行就degrade到2.20的,嗯,可以不用降级了~

  • Share/Bookmark

Install MoinMoin under ArchLinux

Number of View: 383

MoinMoin is a Python WikiClone, based on PikiPiki. To install it on ArchLinux and run it with apache httpd, follow these steps:

  1. Install MoinMoin and dependencies:
    $ pacman -S moinmoin mod_python
  2. Look into the SHARE directory, usually /usr/share/moin – this is where the templates are located
    • data directory (wiki pages, users, etc.) – only MoinMoin should access this
    • underlay directory (wiki pages) – only MoinMoin should access this
    • htdocs directory with html support files – the web server will need to access this
    • server – MoinMoin example startup files (like moin.cgi for CGI)
    • config – MoinMoin example configuration files (like wikiconfig.py)
  3. Choose a wiki name (Here I choose the default ‘mywiki’) and create a directory for the wiki
     $ mkdir /home/http/mywiki
  4. Copy the files.
    $ cp -R /usr/share/moin/data /home/http/mywiki
    $ cp -R /usr/share/moin/underlay /home/http/mywiki
    $ cp /usr/share/moin/config/wikiconfig.py /home/http/mywiki
  5. Install moin.cgi
    $ mkdir /home/http/mywiki/cgi-bin
    $ cp /usr/share/moin/server/moin.cgi /home/http/mywiki/cgi-bin/
  6. Change permissions
    $ chown -R http:http /home/http/mywiki
    $ chmod -R ug+rwX /home/http/mywiki/
    $ chmod -R o-rwx /home/http/mywiki
  7. Configure moin.cgi: insert this line after the import sentences
    sys.path.insert(0, '..')
  8. Configure Apache.
    $ vim /etc/httpd/conf/httpd.conf

    First, load the mod_python module

    LoadModule python_module /usr/lib/httpd/modules/mod_python.so

    Next, setup Alias and ScriptAlias

    Alias /wiki/ "/usr/share/moin/htdocs/"
    ScriptAlias /mywiki "/home/http/mywiki/cgi-bin/moin.cgi"

    Finally, setup access permissions.

     <Directory /usr/share/moin/htdocs>
        Order deny,allow
        Allow from all
    </Directory>
  9. Configure MoinMoin
    $ vim /home/http/mywiki/wikiconfig.py
    

    Modify these parameters.

    data_dir = '../data/'
    data_underlay_dir = '../underlay/'
    url_prefix = '/wiki'
    

    Uncomment this line.

     url_prefix_static = '/mywiki' + url_prefix_static
    
  10. Restart the apache server
    $ /etc/rc.d/httpd restart
    or
    $ apachectl restart
    
  11. Test the wiki
    Start the browser and access the URL http://127.0.0.1/mywiki/



References

  • Share/Bookmark

迟来的Post

Number of View: 295

都买了两个月了,才第一篇post,lightory同学都懒得催我写了……真是惭愧啊= =

1. 青春美丽疙瘩痘

本姑娘已经很久不长痘了,即使长了也会在一周内被自然规律无情的消灭。可是自从来到北京,我的脸就开始与痘痘大军结下了不解之缘,她们不断的袭来,却不愿在各种护肤品的淫威下撤退T T,以至于某MM认为偶的本来形象就是这个样子,太桑心了,泪奔~

偶怎么也不甘心,于是在水木的beauty版发帖求助,结果只有一位好心的姐妹回复了我的疑问,她说,原因可能是多方面滴,可能是水土不服,可能是熬夜太多,也有可能是枕巾老长时间没洗太脏了(囧,确实很长时间没洗了,回家前狠狠地搓了一通)

回家后,老娘对偶的脸表示了极大的关怀、愤慨和抨击,并表达了誓与顽痘抗争到底的决心。毅然决然地让偶扔掉了洗面奶、爽肤水、保湿霜、睡眠面膜等一系列瓶瓶罐罐(我的荷包啊T_T),换用孩儿面(囧)。每天晚上10点睡觉,早上11点起床,终于,偶的痘痘开始结疤了(撒花~~~祈祷~~~~)

2. 杯具的成绩

未语泪先流啊,课选太多的下场,墙角画圈圈……

3. 曲折的回家路

首先,学校提供的网上订票根本就没有我回家的车次,打击;然后,一直以为火车站是提前5天售票,事实是提前10天就卖学生票的,结果只买到了硬座(幸好有老乡MM)|||;接着,没有预估到上车的严峻形势,进站比较迟,造成了被堵在车厢门口的悲惨后果。同行的MM前方开路,终于在一场大战之后艰难地爬到了偶们的座位上安顿下来。

血淋淋的教训阿!!!

4. 窝在家中

每天睡了吃,吃了折腾电脑,折腾完了再吃,吃了再折腾,折腾完了睡。

这几天折腾了一下conky配置(默认的也太丑了……)废话不多说,上图
conky-screenshot
左边放不下了,所以把mpd部分单独放在了右上角= =|||

首先是参考了一下conky官网的配置示例,显示的信息还是比较全的,就是不够PP

继续找漂漂的screenshot= =,主要参考了以下两个:OpenArch Part1 和ubuntu论坛上的一篇文章(电信抽,暂时找不着了,这篇的conky配置效果是仿windows边栏的),使用了前者的配色方案的创意(这个DodgerBlue的配色和桌面背景真是相得益彰啊)和后者的背景图片(右下角的嵌套环)。

需要注意的方面有以下几点:1. conky使用的配色的名字列表位于/usr/share/X11/rgb.txt,当然也可以用#rrggbb的格式表示(见man conky)。 2. 要画出漂亮的conky,就要有漂亮的字体支持,这里使用的有Poky,Weather,OpenLogos等等。 3. 调整文字布局是用${offset}和${voffset}来实现的,偏移量可以是负值,很灵活~

配置文件见这里。天气预报的脚本使用的是conkyForecast

话说conky现在有Lua Programming API了,前些天看到有人用这个画仿钢弹system界面的风格,很华丽阿~~

  • Share/Bookmark