Showing posts with label 工作. Show all posts
Showing posts with label 工作. Show all posts

Monday, July 27, 2009

得到ubuntu的codename

之前一直不知道ubuntu的code name是放在哪里的. 这样就有个麻烦:
* 网上得到的source list当是不同的code name就无法使用.

看了人家的shell脚本才知道: /etc/lsb-release

强的shell:
$ grep 'DISTRIB_CODENAME' /etc/lsb-release | awk -F'=' '{print $2}'

Wednesday, May 13, 2009

freeBSD文档

之前没有注意到. 以为freeBSD的文档会滞后发布版本的.

因为怎么看freeBSD的文档(http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/index.html) 都是长得一样的.

其实细看一下, 至少可以找到一点不同:

Handbook开头第一段正文就有版本信息:
Welcome to FreeBSD! This handbook covers the installation and day to day use of FreeBSD 6.4-RELEASE and FreeBSD 7.2-RELEASE.

这是7.2发布版本的Handbook

旧的版本文档可以从这里得到: http://docs.freebsd.org/doc

freeBSD还有一点做得比gentoo好的, 就是文档和版本一起发布的. 位于/usr/share/doc下.

可能gentoo是没有版本的概念的吧....

使用不同IP去mount NFS空间

NFS服务器是使用IP去区别哪些机器可以mount它export出来的空间的.

现在, 有这样的需要:

1. NFS服务器只export了一个指定的可用的IP, 不方便修改(Boss管的就是烦)

现在需要把此IP迁移到另一台服务器上. 此服务器已经存在一个可用IP

使用这个指定export IP有两种方法:
1. 使用独立的ethernet interface
2. 作为interface的一个别名(alias)

使用上面两种方法绑定IP后, 新的问题:
#mount -t nfs Source:/Path /Target
上面的命令是使用哪个IP的呢?

在不作任何配置前, mount是不会使用新的IP去通信的, 也就是说, mount时会出现:
deny Permission之类的Error

解决方式是修改route表, 强制数据的流向

现服务器默认的route表:

jessinio@pdc:/mnt/Share$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.20.239.0 * 255.255.254.0 U 0 0 0 eth0
localnet * 255.255.254.0 U 0 0 0 eth0
default 10.20.238.1 0.0.0.0 UG 100 0 0 eth0

增加记录:
$sudo route add -host 192.168.18.38 gw 10.20.238.1 dev eth1

其中, eth1就是指定export IP的网卡
192.168.18.38为NFS服务器

意思是说: 所有到192.168.18.38的数据包, 都使用eth1发送.

这是使用多一个网卡去完成的. 当使用同一个网卡时怎么处理?

# route add -host 192.168.18.38 gw 10.20.238.1 dev eth0:0

如上, 只是dev的参数成为了eth0:0(别名), 如下:


jessinio@pdc:/mnt/Share$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:10:5c:fc:66:42
inet addr:10.20.239.95 Bcast:10.20.239.255 Mask:255.255.254.0
inet6 addr: fe80::210:5cff:fefc:6642/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:18501 errors:0 dropped:0 overruns:0 frame:0
TX packets:13880 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2422289 (2.4 MB) TX bytes:2936218 (2.9 MB)

eth0:0 Link encap:Ethernet HWaddr 00:10:5c:fc:66:42
inet addr:10.20.239.194 Bcast:10.20.239.255 Mask:255.255.254.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Tuesday, May 12, 2009

网卡硬件情况查看

前几天玩solaris的时候, 也是被网卡的驱动烦着. 奶奶的今天又被windows下的网卡驱动烦!!

今天安装了一台windows server 2003, 竟然网卡没有驱动! 更不可思议的是主板上明显是RTL牌的网卡.

windows还有不支持RTL芯片的网卡的??

想当初玩linux(Redflag)时, 搞不掂网卡安装了张RTL牌的网卡就OK了. windows还没有RTL的驱动. 我日

对比了一下linux与windows的硬件情况查看, 基本是一样的!!

首先. 在系统没有网卡驱动是什么牌时看不出厂商名的(至少windows是这样的).

在这时候, 只能看只两个ID:
1. vendor ID
2. device ID

下面是windows的ID查看方法:

"我的电脑" => 右键查看硬件的信息:



VEN为vendor的缩写, 因此vendor的ID为10EC
DEV为device的缩写, 因此device的ID为8168

其它信息, 如rev等等这里不提了

linux下的信息获取:

jessinio@niolaptop ~ $ sudo lspci -nn|grep net
02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller [10ec:8168] (rev 01)

得到了vendor ID和device ID之后呢??

来这里search一下就知道是哪芯片了:

http://www.pcidatabase.com

solaris和freeBSD下也是类似的, 只是命令程序不同, freeBSD下是pciconf, solaris是prtconf

至于, 为什么网卡是属于PCI总线下的sub-system, 就要了解计算机的体系了.

PC, 或者说是计算机, 内部有了很多子系统的, 子系统其实也可以称了嵌入系统. wikipedia是这样定义BUS的:
In computer architecture, a bus is a subsystem that transfers data between computer components inside a computer or between computers.

这个URL是关于计算机的总线的:
http://en.wikipedia.org/wiki/Computer_bus

下面说到现在的PC机(或者一般的计算机)都是把网卡连接到PCI BUS上的:

Whereas network cards used to be expansion cards that plug into a computer bus, the low cost and ubiquity of the Ethernet standard means that most newer computers have a network interface built into the motherboard. These either have Ethernet capabilities integrated into the motherboard chipset or implemented via a low cost dedicated Ethernet chip, connected through the PCI (or the newer PCI express) bus.


SUN的work station之类的专有硬件本人没有摸, 不说

计算机的hostname

本人喜欢使用: Name-other 这样的命名.

之前, 在使用的linux下, 也出现过hostname不附合命名不合规定而出过问题. 今天, 也是windows下出现了.

在windows下出现还是相当麻烦的. 首先, 系统是使用中文的, google时只能对中文搜索. 其次, windows的出错提示乱来

hostname的命名规定查了一下:

From RFC 952

A "name" (Net, Host, Gateway, or Domain name) is a text string up
to 24 characters drawn from the alphabet (A-Z), digits (0-9), minus
sign (-), and period (.). Note that periods are only allowed when
they serve to delimit components of "domain style names".

No blank or space characters are permitted as part of a
name. No distinction is made between upper and lower case. The first
character must be an alpha character [Relaxed in RFC 1123] . The last
character must not be a minus sign or period.

From RFC 1035

labels 63 octets or less
names 255 octets or less

[snip] limit the label to 63 octets or less.

To simplify implementations, the total length of a domain name (i.e.,
label octets and label length octets) is restricted to 255 octets or
less.


From RFC 1123

One aspect of host name syntax is hereby changed: the
restriction on the first character is relaxed to allow either a
letter or a digit. Host software MUST support this more liberal
syntax.

Host software MUST handle host names of up to 63 characters and
SHOULD handle host names of up to 255 characters.

发现: Name-Other这种文件没有违反命名规定, 但是在一些软件中使用就会有不同的反映.


为了出现这样后果很难处理(至少要reboot机器), 排查也有难度. 应该注意hostname的命名方法.


只使用letter和digit是最安全的.

Monday, May 11, 2009

gentoo下安装virtualbox

好久没有玩过virtualbox了, 今天想安装一个玩玩, 本人老久前还有保留了一份VDI文件, 希望本次可以继续使用.

本次安装版本: 2.2( virtualbox的更新速度太快了 )

安装好软件后, 就是利用上次得到保留的VDI文件. 其实一直都不明白什么叫VDI. 网上查了一把, 应该与Virtual desktop infrastructure (VDI) 同名不同义(http://en.wikipedia.org/wiki/Virtual_Desktop_Infrastructure)

我想它的意思应该是: virtual disk image
在下面的URL中, 我看到了virtual disk image三个单词 (^_^)
* http://forums.virtualbox.org/viewtopic.php?p=29276#29276

使用virtual disk image文件:
菜单操作:
* File -> "virtual media manager" -> Add
把指定的vdi文件加入去就OK了.

这一步骤等同于: 为电脑增加一个硬盘(当然, 这个硬盘已经早就安装好了操作系统的)

然后, 增加machine:
菜单操作:
* Machine -> New -> Next -> 选择正确的OS类型和内存等等参数 -> Use existing hard disk

这一步骤等同于: 让系统(Machine)使用指定的VDI文件为master disk

但是start Machine的时候, 出错了:

Kernel driver not installed (rc=-1908)

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Re-setup the kernel module by executing

'/etc/init.d/vboxdrv setup

as root. Users of Ubuntu, Fedora or Mandriva should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.

本人记得在ubuntu下, 运行上面的那句话就100% OK的, 那么在gentoo下怎么处理呢?


使用下面的方法:
# modprobe vboxdrv

Sunday, May 10, 2009

freeBSD与gentoo内核源代码的得到

freeBSD与gentoo这两个系统的包管理有相似的处理方式.

常常更新内核, 这就首先要得到内核的源代码, 如下:

1. freeBSD下:

# cp /usr/share/examples/cvsup/standard-supfile /root/
修改此文件内的host参数, 然后:
# cvsup /root/standard-supfile
最新的内核的代码就会在/usr/src下

2. gentoo下:
# emerge gentoo-sources
照样, 在/usr/src下有最新的内核代码.

Saturday, May 9, 2009

系统时间也引发软件安装出错

今天在freeBSD下安装软件时, 报了一个错:
# make install
===> Vulnerability check disabled, database not found
===> Extracting for libtool-1.5.26
=> MD5 Checksum OK for libtool-1.5.26.tar.gz.
=> SHA256 Checksum OK for libtool-1.5.26.tar.gz.
===> Patching for libtool-1.5.26
===> Applying FreeBSD patches for libtool-1.5.26
===> Configuring for libtool-1.5.26
checking for a BSD-compatible install... /usr/bin/install -c -o root -g wheel
checking whether build environment is sane... configure: error: newly created file is older than distributed files!
Check your system clock
===> Script "configure" failed unexpectedly.
Please report the problem to ade@FreeBSD.org [maintainer] and attach the
"/usr/ports/devel/libtool15/work/libtool-1.5.26/config.log" including the
output of the failure of your make command. Also, it might be a good idea to
provide an overview of all packages installed on your system (e.g. an `ls
/var/db/pkg`).
*** Error code 1

Stop in /usr/ports/devel/libtool15.


主要的ERROR信息为:
error: newly created file is older than distributed files!
Check your system clock

调整时间:
ntpdate 202.130.120.114

结果就OK了.


freeBSD在安装软件时还测试文件的create time的?

Thursday, May 7, 2009

SA至少需要是半个network administrator

今天深深地感受到不懂网络的SA当网络问题到来时, 是多么的无助与无力.

只关心着自己的机器, 只会处于被动状态. 就算向信息部反映, 求助也只是浪费大部份时间.

自己应该有整套技术基础.

网络技术的学习迫在眉急, 需要提升到routine中.

同事建议我应该去考个网络技术认证. 想了想, 的确比Linux的认证来得实在, 可以考虑

是ibus输入法还是dbus的问题?

使用ibus有几十天了. 在gentoo下很方便配置. 共体算满意.

但还是有了bug(其实不清楚是ibus的问题还是dbus的问题): 当电脑使用时间比较长时(我的电脑一般都是suspend的), ibus就没法被调用. 甚至使调用它的X窗件程序都无响应.

平时比较忙, 碰到这个问题时, 一般是kill了Xorg-server的. 今天受不了, 就跑到console下(X下使用ibus的程序都会freeze):
# /etc/init.d/dbus restart

呃......重启dbus就好了. 所以, 不清楚是ibus的问题还是dbus的问题.

dbus脚本使用了dbus-daemon程序. 本想查一下dbus-daemon的日志的. 结果没有找到.

看到了start-stop-daemon命令的一个小技巧, 命令行如下:
start-stop-daemon --start --pidfile /var/run/dbus.pid --exec /usr/bin/dbus-daemon -- --system

其中, 我关注"--"参数的用法, 解释如下:
With --start, start-stop-daemon checks for the existence of a specified
process. If such a process exists, start-stop-daemon does nothing, and
exits with error status 1 (0 if --oknodo is specified). If such a
process does not exist, it starts an instance, using either the exe‐
cutable specified by --exec, (or, if specified, by --startas). Any
arguments given after -- on the command line are passed unmodified to
the program being started. If --retry is specified then start-stop-
daemon will check that the process(es) have terminated.

意思是""--""后面的全部东西在不处理的情况下传递给要调用的程序

Sunday, May 3, 2009

gentoo下使用mplayer乱码

使用电脑就奶奶的烦心的就是:
* 想不折腾时它不让你傻傻用, 偏偏是问题!

奶奶的, 今晚我真的是被气死了.

老久没有看过影片了, 今天突然很想看一部<<最终幻想VII>>, 可是mplayer这个鸟东西偏偏是不能显示字幕!

我没有编译这个功能? 我是看着USE在发呆呀:

[ebuild R ] media-video/mplayer-1.0_rc2_p28450 USE="X a52 aac alsa ass doc dts dv dvd encode gif gtk iconv ipv6 jpeg live mad md5sum mmx mp2 mp3 opengl oss png quicktime theora truetype unicode vorbis x264 xscreensaver xv xvid -3dnow -3dnowext -aalib (-altivec) -amrnb -amrwb -arts -bidi -bindist -bl -cddb -cdio -cdparanoia -cpudetection -custom-cflags -custom-cpuopts -debug -dga -dirac -directfb -dvb (-dvdnav) -dxr3 -enca -esd -fbcon -ftp -ggi -jack -joystick -ladspa -libcaca -lirc -lzo -mmxext -mng -musepack -nas -nemesi -openal -pnm -pulseaudio -pvr -radio -rar (-real) -rtc -samba -schroedinger -sdl -speex -sse -sse2 -ssse3 -svga -teletext -tga -v4l -v4l2 -vidix -win32codecs -xanim -xinerama -xvmc -zoran" VIDEO_CARDS="-mga -s3virge -tdfx -vesa" 0 kB


明明就有truetype和unicode嘛!! 为什么不行?

气得最后我连mplayer的GUI界面(gnome-mplayer)都安装了, 搞了通还是不行!

看影片的心情一点一点的被磨掉!!!!

没有办法了, 只能对自己说: 我就算不看影片, 奶奶的我也要把你搞好.

气火火的去看man手册. 不断地search着subtitle, 目光在"-ass (FreeType only)"中停顿下来. mplayer的truetype不起作用? 试了一下使用freetype, 呃.....有字幕了!


下面总结一下mplayer使用中文字幕的方法:
未知配置: mplayer的truetype和unicode编译参数的作用是未知, 本人的mplayer是有这两个参数的.

1. ~/.mplayer/config需要两个配置:
font=/home/jessinio/.mplayer/wqy-zenhei.ttc
subcp=cp936

font为字体文件的路径
subcp为字体的编码(不知道为什么使用utf8就不行, 目前只能使用cp936)

2. 使用-ass参数启动mplayer

又是 23:45, 看个屁影片呀!

Friday, May 1, 2009

ctrl-s引发的问题

在使用terminal时, 有时会不小心按到ctr-s, 这时....呃..... freeze了!!

怎么解开?

google了一下, 发现解开的方法: ctrl-q

然后想了想: 这样下去不是个办法呀. ctrl-s为什么要被搞成这种没有意义的用途呢(至少我还没有想到)

ctrl-s能不能被map到其它作用?
刚开始, 猜是terminal软件的问题, 但是测试了一下, urxvt和terminal(xfce下默认安装的一个软件)都对ctrl-s起作用. 好像自己的是想法是不对的.

找着找着, 跑入了linux的历史......

什么是tty?
The name of the program comes from teletypewriter, abbreviated "TTY".
* http://en.wikipedia.org/wiki/Teleprinter
就是输入与输出的设备. tty的man手册中写到:
tty - print the file name of the terminal connected to standard input
* 为什么没有说standard output的呢?
命令运行的结果:
jessinio@nio-laptop ~ $ tty
/dev/pts/9

什么是终端?
终端其实应该叫terminal emulate
* http://en.wikipedia.org/wiki/Terminal_emulator

tty是设备(就算pts也是模拟的), terminal amulator算是使用tty的一个软件, terminal amulator是用户与tty设备的纽带.

现在知道用户的会被两次处理:
1. 被terminal emulator处理.
1. 被tty处理.

之前猜测是terminal emulator的处理, 其实是tty的处理.

tty的设置有专用的命令, 如下:

stty - change and print terminal line settings

现有的设置:
jessinio@nio-laptop ~ $ stty -a|less
speed 38400 baud; rows 32; columns 116; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ;
eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab3 bs0 vt0 ff0
isig -icanon iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

去掉ctrl-s的作用:

非常激动的发现了新的作用, 如下:
jessinio@nio-laptop ~ $ stty stop ^-
(i-search)`':

出现了向前搜索!!我之前一直认为bash是没有这个功能的(不想使用arrow键)

把这命令行加到~/.bashrc下即可!(当然, terminal emulator需要是login shell)

Monday, April 27, 2009

DNS与IP之间的互查

最近, 公司将搬迁到新大楼, 这也是烦SA的事情.

本人很懒, 平时都是不喜欢去记录一些机器配置变化的. 就算是自己为机器申请的

这可好了, 搬迁机器都要变化IP, 域名需要申请变化!

一个个找email是不靠谱的.

就自己找了个程序去跑, (^_^) 一身轻松

import os, sys
import re


regx = r"PTR.*?\b(?P<dns>(\w*\.){4})"
pattern = re.compile(regx)

def LookUpDns(Ip):
ANSWER = os.popen("dig -x %s" % Ip).read()
#print regx
match = pattern.search(ANSWER)
if match:
print "%s => %s" % (Ip, match.group("dns"))

BTW::

关于dig的使用手册: http://www.madboa.com/geek/dig/

XGL与AIGLX

前几天在搞Xorg-server和compiz, 就会被扯进3D的技术世界中.

要在linux下使用3D的特效, 都是需要使用OpenGL的. 对于怎么使用OpenGL, 有两种方法:

There are two ways in which a windowing system can allow an OpenGL implementation to talk to the graphics card.

The first is to specify the OpenGL command stream in a portable network-neutral manner using a client/server implementation similar to the X11 drawing routines. This method, used by AIGLX, is indirect in that the drawing commands are sent to the X server and then the X server sends them along to the graphics card.

The second way, which is at the base of Xgl, is to open a window and then allow the OpenGL library to send commands directly to the graphics card.

从上面的文字中看出, 就是直接与间接的区别.

两种方式需要不同的图形服务程序去支持.

对于直接的方法, 是使用一个叫XGL的服务程序, Xgl is an X server architecture designed to take advantage of modern graphics cards via their OpenGL drivers

间接的方法就是使用现在广泛使用的xorg-server, 那么要xorg-server接受OpenGL指令, 还是需要一定的扩展的, 这就是GLX (initialism for "OpenGL Extension to the X Window System") provides the binding connecting OpenGL and the X Window System: it enables programs wishing to use OpenGL to do so within a window provided by the X Window System.

http://en.wikipedia.org/wiki/AIGLX
http://www.gentoo-wiki.info/XGL
http://en.wikipedia.org/wiki/XGL
http://www.gentoo-wiki.info/AIGLX

对openoffice有点好感

对openoffice有点好感还是头一次, 之前在2.0时代的OOo看上去就很人不舒服的感觉. 更不用说使用它进行烦人的文字和表格处理了.

虽然本人是CLI风格的家伙, 但是本人对外观的需求还是有的, 所谓: "人要脸, 树要皮"嘛. 本人的terminal的外观可是很好看的呀(^_^)

有了好感, 那么.....就会对它想入非非的了.......

首先出现在头脑中的是openoffice的表格与database结合了. 因为使用xlrd, pyExcelerator, xlwt有点不爽.

加上学习学习DB还是很好的. 人差的就是借口 (^_^), 有借口人就不会懒啦

在看OpenOffice与数据connect时, 首先出现在眼前的便是:
* ODBC
* unixODBC
* 具体的DB的ODBC, 比如:sqliteODBC, myODBC等等.

三者的关系:
1. ODBC
ODBC在wikipedia上的描述:
ODBC uses as its basis the various Call Level Interface (CLI) specifications from the SQL Access Group, The Call Level Interface (CLI) is a software standard defined in ISO/IEC 9075-3:2003.
应该这样理解:ODBC是一套ISO标准, 存在于描述文字中
2. unixODBC
unixODBC是在unix下的一套实现, 已经把标准使用代码实现出来.

3. 具体的DB的ODBC
这就是具体的DB使用unixODBC接口实现的应用接口


正在学习OpenOffice与DB的联系

Saturday, April 25, 2009

ls与less的故事

ls可以使输出的数据有颜色, 如:

ls -G /

但是当ls的输出被重定向到less命令后会怎么样呢?

呃..... 没有了颜色, 等于使用不使用-G都是一样的后果.

当然, 可以安装一个有颜色的less, 这就没有什么好说的, 再向下看也就没有意义了.

晚上, 无意中发现ls命令早已经很好的解决这个问题了, 如下:

ls -F / |less

关于-F的作用:
-F, --classify
append indicator (one of */=>@|) to entries

发现了这种用法后, 心中一顿惊讶呀, GNU的工具太无敌了! 考虑的情况可以说是一切变态需求

emerge学习

使用gentoo有一段时间了, 其实还不是很不解它的包机制. 最近常使用, 就随便记录一点点笔记.( 记性一天比一天差了 )

emerge是gentoo的用户级接口. 如下:

emerge [options] [action] [ebuild | tbz2file | file | set | atom] ...

optins和action就常见了, 是命令行的就会有一两个的. 重点在于后面的ebuild, tbz2file等等几个概念.

[ ... | ... | ...]这种结构表示多选一, 就是只为能其中的一种.

命令行最后的"..."表示还可以重复使用前的选项,这里指的是[...]结构

emerge对ebuild的定义为:
1. ebuild, 有几种情况: 包名, 分类/包名, 或者是直接是*.build的完整路径, 这种是最常使用的

2. tbz2file, 这种还不清楚, 不知道是不安装二进制的包.

3. set, 中文也叫集合. 还是比较好理解, 见: A set is a convenient shorthand for a large group of packages. Two sets are currently available: system and world. 这样的集合是早有的. 知道目前只有system和world这两个set就算了解了

4. atom, 什么叫atom? 在portage的man手册中这样描述:
DEPEND atom
A string which matches a package. It is of the form category/package. It may also
contain optional logical operators and versions.
More reading: ebuild(5)

atom重点是有逻辑操作与版本的, 更的信息应该参看ebuild中的DEPEND atom一节.

本人觉得atom这个概念很复杂.


不同的包使用不同的USE, 有如下文件:
/etc/make.profile/
package.use
package.use.force
package.use.mask
文件内的内容:
# force docs for GTK 2.x
=x11-libs/gtk+-2* doc
# unforce mysql support for QT
x11-libs/qt -mysql


还有一个概念: slot , 什么叫slot?
With Portage different versions of a single package can coexist on a system. While other distributions tend to name their package to those versions (like freetype and freetype2) Portage uses a technology called SLOTs. An ebuild declares a certain SLOT for its version. Ebuilds with different SLOTs can coexist on the same system. For instance, the freetype package has ebuilds with SLOT="1" and SLOT="2".

可见, slot是very powerful的东西

如下:
Atom Slots
Beginning with EAPI 1, any atom can be constrained to match a specific SLOT.
This is accomplished by appending a colon followed by a SLOT:
x11-libs/qt:3
~x11-libs/qt-3.3.8:3
>=x11-libs/qt-3.3.8:3
=x11-libs/qt-3.3*:3

升级firefox到最新版本

这两天, 打开firefox老是提示有新版本更新, 于是就开始了:

sudo autounmask www-client/mozilla-firefox-bin-3.0.9

sudo emerge -av www-client/mozilla-firefox-bin

xfce4.4升级到xfce4.6

发现这几天都是升级! 难道是ubuntu新版本发布带来的冲动?

使用emerge包管理方式升级, 其中, 为了方便, 使用到了autounmask这个工具

如下是旧版时:

jessinio@nio-laptop ~ $ sudo emerge -av xfce4

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild R ] xfce-base/xfce4-4.4.3 USE="alsa cups -minimal -oss -xscreensaver" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB


可以知道xfce4套件的放置位置: /usr/portage/xfce-base/xfce4
jessinio@nio-laptop ~ $ ls /usr/portage/xfce-base/xfce4
ChangeLog Manifest metadata.xml xfce4-4.4.3.ebuild xfce4-4.6.1.ebuild

可以确认, portage tree中有xfce4-4.6.1

使用autounmask列出指定版本相关的包:
jessinio@nio-laptop ~ $ sudo autounmask xfce-base/xfce4-4.6.1

autounmask version 0.23 (using PortageXS-0.02.09 and portage-2.1.6.7)

* Using repository: /usr/portage

* Using package.keywords file: /etc/portage/package.keywords
* Using package.unmask file: /etc/portage/package.unmask

* Unmasking xfce-base/xfce4-4.6.1 and its dependencies.. this might take a while..

* Added '=xfce-base/xfce4-4.6.1 ~x86' to /etc/portage/package.keywords
* Added '=xfce-base/xfce4-settings-4.6.1 ~x86' to /etc/portage/package.keywords
* Added '=xfce-base/xfce4-panel-4.6.1 ~x86' to /etc/portage/package.keywords
* Added '=x11-themes/gtk-engines-xfce-2.6.0 ~x86' to /etc/portage/package.keywords
* Added '=x11-themes/xfwm4-themes-4.6.0 ~x86' to /etc/portage/package.keywords
* Added '=xfce-extra/xfce4-appfinder-4.6.1 ~x86' to /etc/portage/package.keywords
* Added '=net-print/xfprint-4.6.1 ~x86' to /etc/portage/package.keywords
* Added '=xfce-base/thunar-1.0.1 ~x86' to /etc/portage/package.keywords
* Added '=xfce-base/xfce4-session-4.6.1 ~x86' to /etc/portage/package.keywords
* Added '=xfce-base/xfdesktop-4.6.1 ~x86' to /etc/portage/package.keywords
* Added '=app-office/orage-4.6.1 ~x86' to /etc/portage/package.keywords
* Added '=xfce-base/xfwm4-4.6.1 ~x86' to /etc/portage/package.keywords
* Added '=xfce-base/xfce-utils-4.6.1 ~x86' to /etc/portage/package.keywords
* Added '=xfce-extra/xfce4-mixer-4.6.1 ~x86' to /etc/portage/package.keywords
* done!
autoumask就会把上面指定的版本号加入到/etc/portage/package.keywords文件中

发现emerge 还是会有其它的包也需要指定版本的, 如:

jessinio@nio-laptop ~ $ sudo emerge -av xfce4

These are the packages that would be merged, in order:

Calculating dependencies... done!

!!! All ebuilds that could satisfy ">=xfce-base/libxfce4util-4.6.1" have been masked.
!!! One of the following masked packages is required to complete your request:
- xfce-base/libxfce4util-4.6.1 (masked by: ~x86 keyword)

For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.
(dependency required by "xfce-extra/xfce4-mixer-4.6.1" [ebuild])
(dependency required by "xfce-base/xfce4-4.6.1" [ebuild])
(dependency required by "xfce4" [argument])


这时就需要一个个的autounmask了, 没有发现autounmask没有把全部的依赖都解决. 烦!!!

正找到可以全部依赖都可以解决的方法

intel驱动与xorg之间的问题

前天, 由于手热, 一把火把xorg和world都update到最新版本了.

于是..... 开始乱来了, 首先, 需要make差不多200个包!

然后, 又开始搞compiz了!

把compiz-fusion安装了, 就是NN的那个慢呀!

3D没有开?

emerge了xorg-server不知道多少次, 使用了所有有可疑的USE, 还是不行.

参照了http://en.gentoo-wiki.com/wiki/Intel_GMA

3D功能开了呀! 就是NND不行

glxgears得到的53.610 FPS, 运行compiz-manager还是很慢

无奈之下, 跑到了http://en.gentoo-wiki.com/wiki/Intel_GMA

看到:
The latest release is xf86-video-intel-2.6.2, which requires xorg-server 1.6.0 or newer.

我日, emerge的xorg不一样的:
jessinio@nio-laptop ~ $ equery list|grep xorg-server
x11-base/xorg-server-1.5.3-r5
jessinio@nio-laptop ~ $ equery list|grep video-intel
x11-drivers/xf86-video-intel-2.6.3


什么意思? gentoo的包超前了??

不理, 降驱动!
jessinio@nio-laptop /usr/portage/x11-drivers/xf86-video-intel $ sudo ebuild xf86-video-intel-2.5.1-r1.ebuild merge


安装后, 使用glxgears还是一样60FPS的样子, 当是运行compiz-fusion可以很流利!

Yes!! 驱动与xorg之间有个问题, 具体不知道.