2008/01/22

双系统互访分区的软件

没有评论:

《 Tools to access Linux Partitions from Windows 》
来自: http://www.ubuntugeek.com

如果安装了 Windows 和 Linux 双系统,数据可能会分散在Linux 和 Windows分区上。
Ubuntu可直接读写Windows分区,Win需装如下软件才能读写Linux分区。


Explore2fs (推荐)
http://www.chrysocome.net/explore2fs
Explore2fs是一个访问ext2和ext3的浏览器工具。可运行在所有版本的Windows下面并可以读取几乎所有ext2 和 ext3 文件系统。最大的特点是体积小,无需安装,仅有一个exe文件,下载后即可使用. 只能读取,不能写入


DiskInternals Linux Reader
http://www.diskinternals.com/linux-reader/
DiskInternals Linux Reader 是一个比较新的东东。这个程序担当的角色是在Windows和Ext2/Ext3 Linux文件系统之间架起了一座桥梁。这个简单易用的工具运行在Windows下让您浏览Ext2/Ext3 Linux文件系统并从中提取文件。


Ext2 IFS
http://www.fs-driver.org/
给Windows安装Ext2 文件系统驱动. 它让Windows NT4.0/2000/XP/2003能够彻底获得Linux Ext2文件卷的能力(读写)。在安装过程中即可指定Linux分区的盘符,安装完成之后即可像访问windows分区一样访问Linux分区了.文件复制速度也非常之快


Ext2fsd http://www.ext2fsd.com/
安装之后和Ext2 IFS类似,能够给Linux分区加上盘符.不过不兼容Windows Vista.

rfsd: ReiserDriver
http://sourceforge.net/projects/rfsd/
ReiserDriver是一个可安装文件系统驱动 (IFSD),能够让您在Microsoft Windows (2K/XP)下轻松读取本地ReiserFS文件分区。ReiserFS分区将在Windows系统中显示为一个磁盘。

2008/01/19

Ubuntu下安装 Java

没有评论:
安装java

---Ubuntu: 在firefox里安装java插件

Sun Java5: 从菜单 应用程序 -> 添加/删除... 中安装(只适合 Ubuntu),或者安装 sun-java5-plugin 软件包。 它同时也会要求附带安装 Sun Java5 (sun-java5-bin)。

安装完后firefox仍不能执行java插件,需要手工链接文件

插件放在
/usr/lib/jvm/java-1.5.0-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so

进入到firefox存放插件的目录
cd /usr/lib/firefox/plugins/
(cd ~/.mozilla/plugins )

作symlink:
sudo ln -s /usr/lib/jvm/java-1.5.0-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so

重起firefox,确定插件是否安装成功.在firefox输入
about:plugins.

有就成功了.

---选择默认的 Java 版本

在 Ubuntu 6.06 或者 5.10 中,如果你想使用 Sun's Java 代替开源的 GIJ (GNU Java bytecode interpreter),你需要将它设为默认,运行:

sudo update-alternatives --config java

并从列表中选择你的选项。

注意:你很可能想同样设置 jar, javac, javadoc, javah, javap and javaws:

sudo update-alternatives --config jar

为了使 Java 程序(使用 .deb 包安装的)能在你选择的 JVM 中运行,保证你也修改了 JVM 的配置文件:

sudo gedit /etc/jvm

# This file defines the default system JVM search order. Each
# JVM should list their JAVA_HOME compatible directory in this file.
# The default system JVM is the first one available from top to
# bottom.

/usr/lib/jvm/java-gcj
/usr/lib/jvm/ia32-java-1.5.0-sun
/usr/lib/jvm/java-1.5.0-sun
/usr


确认 /usr/lib/jvm/java-1.5.0-sun 在第一行.

2008/01/15

Ubuntu 播放rmvb等视频文件的配置

没有评论:
Linux里面的播放软件主要有四个:mplayer,xine,gstreamer,vlc
mplayer是一个全能的播放软件。xine是一个播放器后端。gstreamer是一个多媒体框架。vlc是一个简单但功能强大的播放软件。其中mplayer和xine能用w32codecs,而gstreamer和vlc不能. xine是一个播放引擎。很多软件拿他做后端。如totem-xine,kaffeine,kmplayer,gxine,amarok等。要是以xine做后端的程序能播放更多格式,就必须安装libxine-extracodecs和w32codecs. vlc播放DVD,VCD,HDTV,xvid+lame的avi不错。

视频解决方案: 有一个mplayer足够。支持所有的格式,占用资源少,播放效果也好,功能也强大。 totem是一个简单的播放软件,功能太弱,现在用的人多是因为他是很多发行版默认的。但是不管他用哪个后端,播放效果都不理想。 目前网上的电影带外挂字幕的大多是xvid+mp3的avi视频,加上srt的字幕,这个用vlc就可以搞定了。

安装mplayer播放器sudo apt-get install mplayer-fonts mplayer mplayer-skins mozilla-mplayer
在开始用它进行视频播放前还需要进行以下设置(先启动它),然后右键弹出主菜单 -> Preferences/属性 -> Video/视频,在”Available drivers/可用驱动”中选择”x11″或”xv”,在同一窗口下半部份钩上”允许掉帧/Enable frame dropping”。

安装vlc: sudo apt-get install vlc

安装 realplayer11 for linux 简体中文版
看rm, rmvb还真要靠他. RealPlayer 11在媒体支持格式上也更加丰富,不但可以播放RealNetworks自家的 RealVideo和RealAudio,还能支持Flash、Windows Media、QuickTime等格式。RealPlayer 11可以自动播放受DRM保护的视频内容,甚至可以对视频内容进行提取、复制和剪辑。

1)下载bin包,到realplayer主页上下载 http://www.real.com/linux
2)安装: sudo chmod 755 *.bin
sudo *.bin #一定要root安装,否则安装后无法启动。安装后不需要像realplayer10那样进行任何配置。


安装gstreamer的解码器
gstreamer是gnome主推的多媒体平台,目前是0.10。但是默认没有安装完全,导致mp3等不能播放。所以,我们要安装 gstreamer0.10 .
sudo apt-get install gstreamer0.10-*

安装xine的解码器 libxine-extracodecs
xine是另外一个多媒体平台,功能非常强大。我们还把系统自带的totem卸载,改为使用xine后端的totem-xine,这样才可以播放rmvb等视频。顺便安装上mplayer这个强大的播放器,我一般用它来播放dvd。注意如果是 amd的CPU,需要安装mplayer-k7,当然,大家也可以直接安装mplayer,这个比较通用。
sudo apt-get install libxine-extracodecs mjpegtools ffmpeg lame faad sox mplayer libxine-main1 totem-xine

安装w32codecs
这个解码器支持几乎所有的Windows AVI 格式的影像, win32 codecs在官方源里没有(版权原因),可以到Mplayer的官网上去下载,然后以root登录,解压到/usr/lib/win32,或者下载 deb 包,直接安装,deb包下载地址
http://mirror.ubuntulinux.nl/pool/dapper-seveas/extras /w32codecs_20060611-0.0_i386.deb
(已下载)

Possible problems:
1. 如果出现: Error opening/initializing the selected video_out (-vo) device,在 mplaer播放器的属性(preference)设置中,video标签下的可获取驱动要选xv X11/xv,因为你还有其他显卡

2. totem播放rmvb无声音. totem在Ubuntu中默认的解码器是gstreamer,但是用它来播放rmvb格式的文件都没有声音。解决办法是:
a.在新立得中安装totme-xine,新立得会自动卸载gstreamer。
b.编辑~/.xine/catalog.cache,找到/usr/lib/xine/plugins/1.1.4/xineplug_decode_real_audio.so,将下面的decoder_priority=5选项值由5改为10即可。

3. 看RM,或RMVB提示装入库或解码器发生问题.
sudo ln -s /usr/lib/codecs/ /usr/local/lib/



Ubuntu下安装 matlab

没有评论:
安装matlab

1)下载Matlab.R2007b.UNIX.DVD(大小约2.8G,完整安装占用磁盘空间约2.3G左右)
下载地址:
ed2k://|file|Mathworks.Matlab.R2007b.UNIX.DVD.-TBE.iso|3594958848|58E5A99B5C4E921D0FDCC51B4F827765|/

2)加载mount ISO文件,可以用Gmount-iso打开。

3)建立安装matlab的目录:我是装在 /opt/matlab,
命令:
sudo mkdir /opt/matlab
然后把license文件拷贝到安装目录下面。如果版本是2007b,在crack文件夹下面,可以找到两个license的文件,以及一个简单的安装说明,将其中任意一个拷贝到/opt/matlab/license.dat。
sudo cp …/crack/license_locked.dat /opt/matlab/license.dat

4)安装,运行相应光盘下的install文件: sudo /media/cdrom0/install

5)运行:sudo /opt/matlab/install_matlab进行一些相关的设置,就按照默认的就行了.

解决在gnome下界面显示不正常的问题:
在matlab安装目录下的bin/matlab文件中添加:(添加在文件开始处即可)
export MATLAB_JAVA=/usr/lib/jvm/java-6-sun/jre/

6)建立启动器:命令为:/opt/matlab/bin/matlab -desktop

matlab在linux下的安装速度和启动速度都比在Win下快得多。


参考:http://www.quhuashuai.com/2007/08/install_matlab_on_ubuntu/

2008/01/08

OpenGL 3D driver

没有评论:

最近在ubuntu上安装secondlife,结果程序视频窗口起不来,提示是3D direct rendering没有。

* DRI,全称 Direct Rendering Infrastructure,是 X 窗口系统里允许应用程序以一种安全有效的方式直接访问显示设备的框架。它包括对 X 服务器,某些X客户端库和内核的改动。DRI 的第一个主要应用是创建快速的 OpenGL 实现。

* DRI 是 XFree86 4.x 以及其后继者 X.org 的组成部分,也是 Mesa -一个 OpenGL API 的开源实现-的组成部分。有一些3D加速驱动是按照 DRI 标准写成的,包括 ATI,Matrox,3DFX 和 Intel。

* DRI 最初是由 Precision Insight, Inc. (PI) 公司在 Red Hat Inc. 和 SGI 的合作和部分资助下开发的。随着 PI 被 VA Linux 所收购,以及后来 VA Linux 退出 Linux 领域,DRI 现在由Tungsten Graphics Inc.公司继续维护。该公司由当初 PI 公司的一些 DRI 开发者所创建。Tungsten Graphics 是目前所有 DRI 开发的焦点,许多开源开发者通过 sourceforge 上的 DRI 项目继续为 DRI 贡献代码。

How to update OpenGL 3D driver

Identifying your card
ATI (fglrx) Driver
fglrx 是ATI提供的非公开驱动,ubuntu (>=6.10)对显卡使用开源的驱动,一般情况没必要换。

$lspci
reveals a card with "Radeon" in it, or you know you own a Radeon card

$ fglrxinfo
(install: sudo apt-get install xorg-driver-fglrx )

display: :0.0 screen: 0
OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Intel(R) 845G 20061017 x86/MMX/SSE2
OpenGL version string: 1.3 Mesa 6.5.2

说明已经启用了openGL。

$glxinfo |grep direct
outputs
direct rendering: No
, or it outputs
direct rendering: Yes, but performance in 3D applications such as games is unacceptable
说明没有direct rendering infrastrucutre(DRI)

$glxgears 评测工具

Make sure fglrx is not disabled: gksudo gedit /etc/default/linux-restricted-modules-common

Generate a new set of module dependencies so the fglrx driver starts properly.

sudo depmod -a

You now have to configure xorg to use your graphic card. The "aticonfig" tool, provided with the driver, will do that for you:

sudo aticonfig --initial
sudo aticonfig --overlay-type=Xv

ATI are well known not to be able to provide correct drivers for their hardware so you will have to deactivate the composite extension in /etc/X11/xorg.conf , otherwise you will get a jerky video display: gksudo gedit /etc/X11/xorg.conf and add the following lines at the end of the file:

Section "Extensions"
Option "Composite" "0"
EndSection

// After making all those modifications, your X server might not want to start again. Don't worry, you can still modify xorg.conf using vim sudo vim /etc/X11/xorg.conf. To enter edit mode press i, to escape press escape, to save type :w and to quit type :q . And to start X again, on the command line type startx. //

如果修改配置后重启无法进入图形界面,需要在ubuntu restricted mode下将 /etc/X11/xorg.conf 改回 xorg.conf.original-0 然后再重启。出错信息见 /var/log/xorg.log

Save and restart xorg by pressing Ctrl Alt and Backspace simultaneously.

Confirm it worked, by issuing the "fglrxinfo" command:

Troubleshooting

If fglrxinfo gives you the following, your installation is not completed correctly:

$ fglrxinfo
display: :0.0 screen: 0
OpenGL vendor string: Mesa project: www.mesa3d.org
OpenGL renderer string: Mesa GLX Indirect
OpenGL version string: 1.2 (1.5 Mesa 6.4.1)

These two commands might fix your installation, try this, reboot, and run fglrxinfo again:

mkdir -p /usr/X11R6/lib/modules/dri
ln -s /usr/lib/dri/fglrx_dri.so /usr/X11R6/lib/modules/dri


xorg 工具: gtf 和 xdpyinfo

解决您的显示方面的问题,比如屏幕偏移,分辨率上不去等问题。我们可以用gtf 工具来尝试。

  1、gtf工具来自哪个软件包。

  gtf 是来自软件包 xorg-x11,一般的情况下,如果您安装了桌面环境,就有这个工具。系统大多是默认安装的。

  2、什么是gtf 。

  gtf - calculate VESA GTF mode lines 中文的意思是计算显示设备VESA驱动GTF模式命令行工具。

  什么是gtf?gtf(generalized timing formula),一般程序时间,定义了产生画面所需要的时间,包括了诸如画面刷新率等),另外gtf也是显示设备的一个工业标准。通过GTF则可以自动调节屏幕尺寸。

  我们通过gtf 工具计算显示器屏幕尺寸、分辨率,然后我们把计算出来的值插入到 xorg.conf配置文件中,就能达到自动调节屏幕的显示尺寸、位置 及分辨率。

  3、gtf的用法。

    gtf h-resolution v-resolution refresh

     [-v|--verbose] [-f|--fbmode] [-x|--xorgmode]

  举例:我的显示器支持1024x768 ,能达到85HZ,在X模式下。

    [beinan@localhost ~]# /usr/X11R6/bin/gtf 1024 768 85 -x

     # 1024x768 @ 85.00 Hz (GTF) hsync: 68.60 kHz; pclk: 94.39 MHz

     Modeline "1024x768_85.00"

     94.39 1024 1088 1200 1376 768 769 772 807 -HSync +Vsync

  把上面的输出的信息中Modeline一行,插入到/etc/X11/xorg.conf配置文件中的显示器(Monitor)配置那段中。加入后类似。

    Section "Monitor"

        Identifier "Monitor0"

        VendorName "Monitor Vendor"

        ModelName "LCD Panel 1280x1024"

        HorizSync 31.5 - 67.0

        VertRefresh 50.0 - 75.0

        Option "dpms"

        Modeline "1024x768_85.00"

        94.39 1024 1088 1200 1376 768 769 772 807

        -HSync +Vsync

        EndSection

  改动后,重启X。重新进入桌面模式。

  4、 xdpyinfo工具。

  我们通过gtf 工具调整了显示器的属性,我们通过观察一般就知道是不是可行了。比如屏幕不闪动的过于厉害。显示区域处于显示屏正中等。但我们还有一个测试工具xdpyinfo 来测试我们的调整 。

    xdpyinfo - display information utility for X (用于X的显示信息测试工具)。

    [beinan@localhost ~]$ /usr/X11R6/bin/xdpyinfo

  通过这个输出,我们能查看到很多信息,最重要的有如下一段。

    default screen number: 0

    number of screens: 1

    screen #0:

    dimensions: 1024x768 pixels (302x232 millimeters)

    resolution: 86x84 dots per inch

    depths (7): 24, 1, 4, 8, 15, 16, 32

    root window id: 0x3f

    depth of root window: 24 planes

  我们可以在 xorg.conf中定义多个显示屏幕,比如 1024x768;800x600等。显示屏的定义的标识符号序列从0开始,以此类推。其实定义好一个就足够用。默认的一般就行。如果我们自己调整,把 1024x768类似的加入到screen 中色深为24那段的 Modes 行中。然后把默认色深设置为24就好。

    Section "Screen"

        Identifier "Screen0"

        Device "Videocard0"

        Monitor "Monitor0"

        DefaultDepth 24

        SubSection "Display"

            Viewport 0 0

            Depth 16

            Modes "800x600" "640x480"

        EndSubSection

        SubSection "Display"

            Viewport 0 0

            Depth 24

            Modes "1280x1024" "1152x864" "1152x768"

            "1024x768" "800x600" "640x480"

         EndSubSection

         EndSection

  其实上面的一段,我们足可以把色深为16的那段删除或者下面的一段每行前面加#号注掉。因为我们用的是 24的。

    SubSection "Display"

         Viewport 0 0

         Depth 16

         Modes "800x600" "640x480"

         EndSubSection

  如果我们只有把 DefaultDepth 24 中的24改为16时,这段才起作用。


1. 本机显卡信息:

Dell Optiplex 160L,具体为P4 2.4B、I845GL(集成显卡)、DDR 333 256M、40G硬盘。

00:02.0 VGA compatible controller: Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device (rev 01)

display: :0.0 screen: 0
OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Intel(R) 845G 20061017 x86/MMX/SSE2
OpenGL version string: 1.3 Mesa 6.5.2

2 显卡驱动安装

由于我的是Intel Corporation 82865G Integrated Graphics Controller,故我需要安装xserver-xorg-video-i810驱动:这个可以采用命令和synaptic来进行安装:

apt-get update
apt-get install xserver-xorg-video-i810 # 默认已识别,无须再装

如果你是nvidia的显卡,则需要安装nvidia-kernel-common驱动:方法是
apt-get install linux-restricted-modules nvidia-glx nvidia-glx-dev nvidia-kernel-common

如果是ati的显卡,则需要安装xorg-driver-fglrx fglrx-kernel-*

安装以上驱动后,需要手动重新配置显卡,选择你的显卡驱动类型,具体采用命令为

dpkg-reconfigure xserver-xorg #慎用该命令!

或修改/etc/X11/xorg.conf文档

如果你幸运的话,在安装ubuntu系统的开始时,已经能正确识别你的显卡了,那么就不需要进行上面的驱动安装和显卡配置了。

3 安装xgl相关软件

apt-get xserver-xgl compiz compiz-core compiz-gnome compiz-manager compiz-plugins csm cgwd cdwd-themes

4 怎样才能回到硬件检测 (prob/probing/re-probe)?

在第二阶段安装时,Ubuntu 检测了您的硬件和设定了X 。如果您改变了显卡、声卡甚至显示器, 您可能需要再做这。

apt-get --purge remove xserver-xorg

或改回最初的配置 /etc/X11/xorg.conf