remove “Processing triggers for shared-mime-info”

Each time apt-get tries to process triggers for shared-mime-info, it reports warnings like:

...
Processing triggers for shared-mime-info...
Unknown media type in type 'all/all'
Unknown media type in type 'all/allfiles'
Unknown media type in type 'uri/mms'
Unknown media type in type 'uri/mmst'
Unknown media type in type 'uri/mmsu'
Unknown media type in type 'uri/pnm'
Unknown media type in type 'uri/rtspt'
Unknown media type in type 'uri/rtspu'
Unknown media type in type 'interface/x-winamp-skin'

I’ve checked /usr/share/mime-info but doesn’t see any of them:

/usr/share/mime-info$ grep 'url/rtspu' *
(Got nothing)

So, how to clean up my system so it won’t report these unknown media types?

 

sudo rm /usr/share/mime/packages/kde.xml 
 sudo update-mime-database /usr/share/mime

Should fix the warnings.

Linux下vmware虚拟机中永久激活Windows7

Linuxvmware虚拟机中永久激活Windows7
  1. 简述
     
    vmware可以指定一个外部文件作为其虚拟机的BIOS,那么就可以通过把品牌机的SLIC2.1的信息写到这个BIOS文件中来激活Windows 7. 只要能够生成这个BIOS文件,其余的步骤就和兼容机刷BIOS永久激活Windows 7的方法一样了,网上教程到处可见,比如这篇就是个不错的教程。
     
  2. 基本环境
     
    1. 主机操作系统:Ubuntu 13.04 64bit
    2. 虚拟机软件:vmware player for linux 64bit
    3. 目标虚拟机:Windows 7 64bit旗舰版
       
  3. 所需工具
     
    1. SLIC Toolkit V3.2 (用来验证SLIC是否成功写入)
    2. rw-everything
    3. PhoenixTool (需要.Net Framework 2.0)
  4. 流程
     
    1. 第一步:提取vmwarebios
      Ubuntu, vmwarebios/usr/lib/vmware/bin/vmware-vmx中。用objcopy提取bios440section
      objcopy vmware-vmx -O binary -j bios440 --set-section-flags bios440=a bios440.rom.z
      注:这里我先把/usr/lib/vmware/bin/vmware-vmx拷贝到里临时目录下。

      如果不能提取,可以用objdump命令:
      objdump -h vmware-vmx | grep bios440
      确认下bios440 section是否存在或名称是否正确(有些版本的vmware section名字是.bios440)。得到结果如下:

      28bios440 00033d47 0000000000000000 0000000000000000 00d6c0d0 2**0
      另外也可以根据objdump的信息用dd命令把bios440 section dump出来。
      dd skip=14074064 bs=1 count=212295 ibs=1 obs=1 if=vmware-vmx of=bios440.rom.z

      其中14074064对应与objdump00d6c0d0,bios440 secitonvmware-vmx中起始位置,而212295是大小,对应objdump00033d47段。

      用下面的命令对刚才提出的bios440.room.z解压:

      [plain] view plaincopy

      1. perl -e ‘use Compress::Zlib; my $v; read STDIN, $v, 212295; $v = uncompress($v); print $v;’ < bios440.rom.z > bios440.rom  
      这里212295就是bios440.rom.z的文件大小,vmware版本不同,大小可能略有不同。
      这样的的bios440.rom就是vmware的 512K 的虚拟机BIOS了。
       
       
    2. 第二步:用rw-everything提取ACPI Tables
      启动虚拟机,运行rw.exe .Access菜单->ACPI Tables,从ACPI Tables的子窗口上选Save All按钮(或Ctrl+F2),保存文件名就用缺省的即可AcpiTbls.rw 。如图:
    3. 第三步:用PhoenixTool合并SLIC生成bios
      vmware 虚拟机的BIOS是属于Phoenix类的。感谢PhoenixTool的作者,有了这个工具,就不必再用Phoenix BIOS Editor和 WinHex繁琐无比的操作来生成Phoenixbios了。
      1. Original里输入从vmware-vmx里抽出的bios440.rom。 等待PhoenixTool完成分析。
      2. Manufacturer里选择厂商,这个取决于你准备好的SLIC2.1OEM证书文件是那个厂商的。
      3. SLIC File里输入你的SLIC2.1的文件。
      4. RW File里输入刚才rw-everything生成的AcpiTbls.rw .

      5. 点击Advanced按钮,出现可能会刷砖的警告,点“是”,出现advanced option对话框,确保”Only alter RSDT and XSDT tables”选中,点Done按钮退出设置。


      6. Go按钮开始生成。
        成功生成的话,新的BIOS文件会在bios440.rom所在的目录里,文件名是bios440_SLIC.rom
         
    4. 第四步:修改.vmx文件
       
      虚拟机关机。用文本编辑软件打开要修改的虚拟机对应的.vmx文件,在文件尾加上:
      bios440.filename = “bios440_SLIC.rom”
      理论上bios440_SLIC.rom可以放在任何目录,只要配置文件写上绝对路径即可。
      重新启动虚拟机。运行SLIC Toolkit V3.2检查SLIC2.1是否成功加入BIOS。如下图红框中字样表示成功提取到SLIC,厂商是LENOVO,型号TC-5K,版本2.1.
最后提供一个各品牌SLIC和证书的下载地址。http://www.360doc.com/content/12/0229/14/1309227_190545700.shtml

 

另外,如果需要序列号的话,请注意序列号要和你的windows版本匹配,比如你的BIOS烧的是联想的SLICWindows7是旗舰版,则需要找个联想OEMWindows 7旗舰版的序列号,否则可能还是不能成功激活Window
VMware 14 SN
vmware workstation14永久激活密钥分享:
 
CG54H-D8D0H-H8DHY-C6X7X-N2KG6
 
ZC3WK-AFXEK-488JP-A7MQX-XL8YF
 
AC5XK-0ZD4H-088HP-9NQZV-ZG2R4
 
ZC5XK-A6E0M-080XQ-04ZZG-YF08D
 
ZY5H0-D3Y8K-M89EZ-AYPEG-MYUA8

Intel Graphics

Intel Graphics (简体中文)

(Redirected from Intel (简体中文))

相关文章

翻译状态: 本文是英文页面 Intel_Graphics 的翻译,最后翻译时间:2013-01-14,点击这里可以查看翻译后英文页面的改动。

由于Intel对X.Org开源驱动的支持,现在所需做的基本上是即插即用。

Intel显卡和相应芯片组、cpu的完整型号参考this comparison on wikipedia

注意: 开源驱动不支持基于PowerVR的显卡(GMA 500 and GMA 3600 series)。

安装

先安装 Xorg,然后安装位于官方软件仓库的 xf86-video-intel 软件包。它提供了用于2D加速的DDX驱动和旧显卡的XvMC视频解码驱动。它依赖于3D加速的DRI驱动(intel-dri)。

要使用新 GPU 的硬件编解码功能,请按装官方软件仓库中的libva-intel-driver软件包,它提供了VA-API驱动。

64位系统需要安装lib32-intel-dri才能在 32 位程序中使用加速功能。

配置

没必要做任何形式的配置来运行X.ORG(不需要xorg.conf,但若有则要正确配置)。

查看完整选项,输入man intel

KMS (Kernel Mode Setting,内核模式设置)

运行X和桌面环境如GNOMEKDEXfceLXDE等都需要KMS。在使用i915 DRM驱动的芯片组中,内核2.6.32及以后的内核都默认启用KMS。2.10及更新的{{Pkg|xf86-video-intel}驱动都不支持UMS(旧的810芯片家族例外),且强制使用KMS[1]。通常,KMS是在内核启动后才进行初始化,但也可以在内核启动阶段就启动KMS,这样在整个启动过程中都是原始分辨率。

注意: 必须 在启动配置中移除与KMS相冲突的项,如:vga 或 nomodeset

要早启动,添加i915模块到/etc/mkinitcpio.confMODULES行:

MODULES="i915"

然后,重新生成initramfs

mkinitcpio -p linux

重启系统,一切搞定!

技巧

选择加速方式

  • UXA – (Unified Acceleration Architecture) 是支持GEM驱动模型(GEM driver model)的成熟后端(backend)
  • SNA – (Sandybridge’s New Acceleration) 在有硬件支持下比UXA更快

现在默认的加速方式为SNA(截至 2013-08-05[2]),比UXA更快,但是稳定性比UXA稍差

DDX驱动可重设你需要的加速方式。Phoronix的基准测试在 [3].Sandy Bridge为[4],Ivy Bridge为[5]. 若使用SNA有问题,UXA仍为稳妥的选择.

要使用旧的UXA加速方式, 创建包含下列内容的/etc/X11/xorg.conf.d/20-intel.conf 就可使用UXA:

/etc/X11/xorg.conf.d/20-intel.conf
Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "AccelMethod"  "uxa"
EndSection

设置自动缩放模式

在一些全屏应用中此方法适用:

$ xrandr --output LVDS1 --set PANEL_FITTING param

param 可以是:

  • center: 使用自定义分辨率,不缩放;
  • full: 使用全屏;
  • full_aspect: 在长宽比不变的情况下使用最大可用分辨率。

若无效,可尝试:

$ xrandr --output LVDS1 --set "scaling mode" param

param可以是"Full""Center" 或 "Full aspect".

KMS 问题: 终端面积很小

在启动阶段,启用了低分辨率的接口会导致终端面积很小。通过i915模块设置可解决此问题,具体在加载器的内核参数添加 video=SVIDEO-1:d。内核参数的更多信息参考 Kernel parameters .

若无效,可试着禁用 TV1 或 VGA1 接口。

在 GMA 4500 硬解 H.264

GMA 4500 平台上,libva-intel-driver 只能硬解 MPEG-2。 H.264 的硬解为另一分支——g45-h264, 在 Arch User Repository 中安装 libva-driver-intel-g45-h264 就OK。 但注意 g45-h264 目前仍处于试验阶段,且开发不活跃。通过 VA-API 会减轻cpu的负载但不如使用非加速方式流畅。 mplayer的测试表明 使用vaapi 播放H.264 编码的 1080p 视频会让cpu的负载减半 (与XV相比) ,但播放很不稳定, 而 720p 则很到位 [6]。其他一些用户也提到这点[7]

设置伽马和亮度

Intel没有提供在驱动层面设置这些值的途径,幸运的是,可通过 xgamma 和 xrandr 来设置。

设置伽马:

$ xgamma -gamma 1.0

或:

$ xrandr --output VGA1 --gamma 1.0:1.0:1.0

设置亮度:

$ xrandr --output VGA1 --brightness 1.0

疑难解答

Glxgears 显示性能低下

注意: glxgears 不是在不同系统上进行比较的基准测试工具。

若运行 glxgears 来获取显卡性能参数, 你会发现结果都在 60 FPS 左右, 如:

[...]
311 frames in 5.0 seconds = 61.973 FPS
311 frames in 5.0 seconds = 62.064 FPS
311 frames in 5.0 seconds = 62.026 FPS
[...]

这不是性能低下的表现, 这是因为显卡使用了 vertical synchronization, 也就是显示器的原生帧频.

禁用 VSYNC

/etc/X11/xorg.conf.d/20-intel.conf 的 Section "Device" 段添加 Option "SwapbuffersWait" "false" 可禁用 VSYNC.

在 ~/.drirc 中将 vblank_mode 设为 0 并且将 driver 设为 dri2 也可达到上述效果:

~/.drirc
<device screen="0" driver="dri2">
   <application name="Default">
   <option name="vblank_mode" value="0"/>
   </application>
</device>

在启动阶段,当 “Loading modules” 时黑屏

若使用 “late start” KMS ,当 “Loading modules” 时黑屏, 在 initramfs 中添加 i915 和 intel_agp 可能有帮助. 查看 the above 的 KMS 节.

在尾部添加下面 kernel parameter 可能也会有效果:

video=SVIDEO-1:d

播放视频时屏幕撕裂

若使用 SNA,将下列内容添加到 /etc/X11/xorg.conf.d/20-intel.conf 的 Device 段可杜绝屏幕撕裂问题。

Option "TearFree" "true"

X 冻结/崩溃

使用 NoAccel 选项可能对 X 冻结/崩溃或显卡停止工作有效。

/etc/X11/xorg.conf.d/20-intel.conf
Section "Device"
   Identifier "Intel Graphics"
   Driver "intel"
   Option "NoAccel" "True"
EndSection

此外, 也可尝试 DRI 选项来禁用 3D 加速:

/etc/X11/xorg.conf.d/20-intel.conf
Section "Device"
   Identifier "Intel Graphics"
   Driver "intel"
   Option "DRI" "False"
EndSection

添加未识别分辨率

Xrandr page 讲到了此问题。

更新到 libGL 9 和 Intel-DRI 9 后,系统变慢

降级软件包 到 Intel-DRI 8 和 libGL 8.

视频游戏时出现黑色纹理

启用 S3TC 纹理压缩支持可能会解决此问题。 通过 driconf 或安装 libtxc_dxtn 都可启用。

此问题很快会得到解决,参考 newer drivers

更多 S3TC 信息参考: http://dri.freedesktop.org/wiki/S3TC wikipedia:S3_Texture_Compression

受此影响的其中一个游戏是 Oil Rush

 

 

适用于 Intel Graphics 或 AMD 催化剂的libvdpau-va-gl驱动需要手动启用。方法是创建下列文件:

/etc/profile.d/vdpau_vaapi.sh
#!/bin/sh
export VDPAU_DRIVER=va_gl

使其变为可执行文件:

# chmod +x /etc/profile.d/vdpau_vaapi.sh

然后重启计算机或重登录。

运行下面的命令以查看你的GPU支持哪些功能。这个命令由 vdpauinfo 软件包提供:

$ vdpauinfo

支持的软件

Adobe Flash Player

要在 Adobe Flash Player 中使用硬件加速, 在 /etc/adobe/mms.cfg 文件中加入下面这一行:

EnableLinuxHWVideoDecode=1

MPlayer

安装 MPlayer (简体中文), 它位于官方软件仓库

$ mplayer -vo vdpau, -vc ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,ffh264vdpau,ffodivxvdpau, foobar.mpeg
警告: 只有最新的NVIDIA显卡系列才支持 ffodivxvdpau 编解码。如果你的硬件不支持,请略去该选项。
  • -vo – 指定 vdpau 视频输出驱动
  • -vc – 指定 vdpau 视频编解码

基于 MPlayer 的播放器:

  • gnome-mplayer: 开启硬件加速的方法: 编辑 > 首选项 > 播放器, 并设置视频输出为 vdpau
  • smplayer: 开启硬件加速的方法: 选项 > 首选项 > 常规 > 视频, 并设置输出驱动为 vdpau

VLC media player

安装 vlc 软件包,它位于官方软件仓库。

开启硬件加速的方法: 工具 > 首选项 > 输入 / 编解码器, 然后设置 硬件加速解码 为 Unix视频解码及演示 API (VDPAU)

使用GoAgent让PHP空间变成你的专属代理服务

使用GoAgent让PHP空间变成你的专属代理服务

一、准备php空间

首先准备一个PHP空间,如果你有自己的收费空间自然最好。要是没有可以申请一个支持PHP的免费空间。(当然是国外没有被墙的空间,墙内的空间是没有用的)。当然是稳定速度快的空间最好,流量要根据自己需要选择合适的。

经测试,不是所有空间都可以,空间必须支持 curl模块或者allow_url_fopen打开,有的空间如日本的sitemix的不能打开youtube(该空间已经被墙);sourceforge.net的空间虽然支持函数,但是却不能用来做代理,应该是封了端口,该空间完全不能连接到其他网络。据作者说goagent不支持有广告的空间,如sitemix空间广告可以通过在该空间建一个网站,比如用wordpress安装一个博客,然后将我们的文件放到wp-admin目录,就可以避开广告了。

phus.lu说有下面三个需求

1. curl模块或者allow_url_fopen打开
2. zlib压缩模块
3. php空间不能有广告。

当然,部分广告代码goagent还是能够正确处理的。

一些空间推荐:几个流量大速度快的空间,可以用来做代理

GoAgent项目地址:http://code.google.com/p/goagent/

最新版下载地址:

测试用的公共端:《放出几个公共的goagent的PHP服务端地址》(已挂)

二、部署服务端

把下载的GoAgent最新版解压,把server/php/目录下的php文件上传到网页根目录。

注意:不一定你用ftp登录后看到的目录就是根目录,不同服务器的网页根目录有所不同,不过不外乎public_html、www、htdocs几种,只有这些目录下及其子目录下的文件才能被访问到。

建议在根目录下新建一个目录后将这两个php文件放到这个目录并且将index.php自己修改为一个随机名字,网址修改为对应地址就可以。比如修改文件名为my.php并放到  根目录名/go/   目录下就访问http://你的域名/go/my.php,访问这个地址的时候会跳转至某个网站。

1.8.5会跳转到http://stackoverflow.com/index.php

1.8.6会跳转到https://www.google.com/index.php

实际上你只要确定自己上传完成就行了,不用管打开是什么样子。

三、配置本地端

记事本打开在local目录下的proxy.ini文件,将

1
2
3
4
5
6
[paas]
enable = 0
password = 123456
listen = 127.0.0.1:8088
isphp = 0
fetchserver = http://1.duapp.com/index.php

修改为

1
2
3
4
5
6
[paas]
enable = 1 (1为启用GAE,0为不启用)
password = 123456
listen = 127.0.0.1:8088
isphp = 0
fetchserver = http:///你网站的域名/index.php

如果你是放在其他目录则修改为对应的index.php的地址

以上代码不要直接复制,自己找到对应的地方在原文件修改即可。

注意:从1.8.7开始,原[php]更名为[paas],且不支持配置多个服务端。

四、运行本地端

完成上述步骤后,就运行GoAgent.exe。

Linux/Mac用户运行proxy.py

五、设置浏览器代理

代理地址设置为使用goagent代理,即将代理地址设置为127.0.0.1:8088,之后就可以畅游网络了。

浏览器代理设置请参看《使用GoAgent基于GAE的搭建自己的代理服务器翻*墙详细教程

只需将浏览器代理端口相应的改为8088即可。

Tips:

1.

[gae]
enable = 1

懂代码就知道0为假,1为真,这里可以保留1,保留1就可以一个goagent.exe同时连接google app和自己的免费空间做双线,但是注意不要使用相同端口,浏览器可以配置不同代理端口,自由切换。

2.另外有一个小技巧:

修改代码中的prot=8087可以改变代理端口,visible = 1是表示GoAgent窗口是否默认最小化的,默认是1,即不自动最小化,我把它改成0了,这样就每次启动后都自动最小化到托盘中。自己根据自己喜好修改。推荐改为0!!

[listen] ip = 127.0.0.1 port = 8087 visible = 1

 

3.怎么防止他人知道我的index.php地址盗用我流量?

编辑index.php开头部分的$__password__ = ”;为$__password__ = ‘这里写你的密码’;

同时编辑proxy.ini

[paas]
enable = 0
listen = 127.0.0.1:8088
password = 你的密码
fetchserver = http://scan.org/fetch.php

重启goagent.exe

最新1.8.4版已经支持php和GAE的密码分开了。

目前goagent还没有将php模式密码和GAE模式的密码分开,期待以后会加人吧,不过我们将它们的密码设置成一样也不影响我们的体验不是。

当然如果你会python可以尝试修改proxy.py,我看来一下代码,应该是可以实现,不过我不会。

4.如何配置多个服务端?从1.8.7开始,不支持配置多个服务端。

listen = 127.0.0.1:8088|127.0.0.1:8089
fetchserver = http://你网站的域名1/index.php|http://你网站的域名2/index.php

更多服务端也可以类似添加,分别监听不同端口即可(不要与系统中其他端口冲突)。

ubuntu12.04_amd64裝draftsight

Draftsight for Ubuntu版本只支持32位的, 在Ubuntu64下下载后双击DraftSight.deb被告知不支持。

step 1: 先在这里下载draftsight,我下载到的是一个deb包:http://www.3ds.com/products/draftsight/download-draftsight/

step 2:解压

dpkg-deb -x DraftSight.deb tmp

step 3:提取控制文件

dpkg-deb --control DraftSight.deb tmp/DEBIAN

step 4:编制控制文件

vi tmp/DEBIAN/control

在文件里面找到“Architecture: i386”一行,改为”Architecture: all“

step 5:重新打包

dpkg -b tmp DraftSight_all.deb

step 6:双击安装,如果不能成功,则再安装ia32-libs
sudo apt-get install libdirectfb-extra libxcb-render-util0 ia32-libs
最后再双击DraftSight_all.deb安装

DraftSight and Ubuntu 12.04 LTS 64bit
Ubuntu 12.04 LTS will be released on April 26 with some important and useful features like multiarch-support. However some 32bit packages still have installation problems on 64bit systems because they don’t follow the new specifications. One of the packages that need some tricks in order to install it on a 64 bit Ubuntu 12.04 system is the current V1R1.4 of DraftSight.
Normally I wouldn’t provide any workarounds for beta or experimental versions of Ubuntu or any other distro for one simple reason: If a distro is under active development many things will be changed until the final release.
But thanks to Normand who informed me in this post that some users are already trying to install DraftSight on Ubuntu 12.04 LTS and considering that the development status is nearly at the end, I will make an exception.
So here are the instructions, don’t be afraid of the number of steps, it’s really a very easy process.

Step 1:
Download Draftsight and make a copy of draftsight.deb in your Home folder. A copy is needed because you will make some changes in the .deb file so keep the original file as a backup. Just a right click on draftsight.deb and select copy to Home folder and you’re ready.

 

Step 2:
Open a terminal simply by pressing Ctrl+Alt+T and type:
ar x draftSight.deb control.tar.gz
This command extracts the control.tar.gz compressed archive from the .deb file. Keep the terminal open you will use it for one more time.

Step 3:
Extract the control.tar.gz compressed archive to your home folder. From Nautilus right click on it and select “Extract here”. You will see a folder named “control” inside your Home folder.
Step 4:
Open the control folder and then the control file inside it with gedit (Text Editor).

Step 5:
Now you must be careful! You have to delete from the list of dependencies libdirectfb-extra. Simply select with the mouse: “libdirectfb-extra (>=1.2.7-2)” the space before it and the comma after it in order to keep the correct syntax (see the screenshot below). Save the file and close gedit.

Step 6:
From Nautilus select all the contents of the control folder ( Simply press Ctrl+A), right click on one of the selected items and select “Compress”.

Step 7:
In the dialog box that opens select as “Location” your Home folder.

Step 8:
You will see a warning that a file with the same name already exists. Select to overwrite it.

Step 9:
Go back to your open terminal and type:
ar r draftSight.deb control.tar.gz
This command will put back the modified control.tar.gz compressed archive into your draftsight.deb file

Step 10:
Right click on your modified draftsight.deb file and select “Open with Gdebi Package Installer”. If you don’t have gdebi already installed, install it because DraftSight’s installation is successful only with gdebi.(or via terminal with dpkg but this is more complicated for new users 🙂 )

Step 11:
Install DraftSight. Normally you will not take any error messages.

Step 12:
DraftSight still needs some extra software in order to run. So install with Ubuntu Software Center or Synaptic ia32-libs and libdirectfb-extra.

Enjoy DraftSight on Ubuntu 12.04 LTS 64bit!

 

130 comments:

Normand C.March 22, 2012 at 2:35 AM
So you don’t need to install ia32-libs anymore?

Thanks for that very detailed explanation.

ReplyDelete

Spyros M.March 22, 2012 at 8:50 AM
Without ia32-libs DraftSight will not run. However this package is actually no longer needed if you try to find (with ldd) which of these 32bit libraries are necessary and put them into the dependencies list.
Dassault should spend a few hours or minutes in order to make a correct dependencies list.

ReplyDelete

HeikoApril 5, 2012 at 7:10 AM
Hi, thank you for your workaround. A another way I found is change in the control file the Architecture from i386 to all. So it’s not necessary to delete the libdirectfb-extra (>=1.2.7-2).
Could you find out which 32bit libraries exactly we need, because on my system the ia32-lib installed 259 packages!
Greetings Heiko

ReplyDelete
Replies

AnonymousMay 25, 2012 at 1:18 PM
hi I’m Jorge, I did it and it works well.

Delete

AnonymousDecember 20, 2012 at 2:43 AM
Hi, I am Tommaselli.
I have been messing around like a fool, trying all the manners to install this great piece of software. No way to perform such task. Fortunately, the above tutorial was awesome! Perfect! It works greatly on may LMDE 13 maya.
I would like to express my deepest regards to these guys. Nothings compare to person who have “savoir fair” or “know how”.
Congratulations!!!!!!!

Delete
Reply

Spyros M.April 5, 2012 at 10:55 AM
Changing the Architecture to all may work if you’re lucky.
It isn’t the recommended way to install 32bit packages on a 64bit system with the new multi-arch dpkg.
I’ll give a try to find exactly the necessary 32bit libraries, it will be very useful.

ReplyDelete
Replies

tsilimanDecember 3, 2012 at 2:17 PM
Spyros M. how can I remove DraftSight from Ubuntu 12.04. I haven’t installed either ia32-libs or libdirectfb-extras. Draftsight wont load (produces an error), but it is visible on Ubuntu Software Center.
Thanks in advance

Delete
Reply

AnonymousApril 11, 2012 at 11:10 PM
Brilliant – works for me!

Thanks for the helpful instructions.

ReplyDelete

AnonymousApril 21, 2012 at 3:20 PM
Cannot get this to work on my ubuntu 12.04 system. Draftsight installs OK as per these steps (very good HOWTO btw 🙂 then fails with an error message “Failed to load modules. The application will close. Please reinstall the application.” when an attempt to run it is made – also true when trying to run it as root. I’m thinking it’s possibly something to do with my graphics card drivers (ati fglrx) – although I’ve tried the open source alternative drivers with the same message being displayed.

ReplyDelete
Replies

AnonymousMay 3, 2012 at 1:13 PM
I have the same exact problem did you find solution email me [email protected]

Delete

Spyros M.May 3, 2012 at 1:25 PM
You don’t have the ia32-libs installed. Please install it and you will get DS working.

Delete

AnonymousMay 3, 2012 at 3:17 PM
I found the problem it works I cant believe it.
okay this is what you have to do.

sudo apt-get install ia32-libs

you have to install this first then you install

sudo apt-get install libdirectfb-extra libxcb-render-util0

Delete

AnonymousJune 5, 2012 at 9:11 AM
thank you. it works.

Delete

UnknownNovember 5, 2012 at 9:45 AM
“AnonymousMay 3, 2012 3:17 PM
I found the problem it works I cant believe it.
okay this is what you have to do.

sudo apt-get install ia32-libs

you have to install this first then you install

sudo apt-get install libdirectfb-extra libxcb- render-util0”
I had done all the steps on ubuntu 64bit 12.10 and it didn’t work.With these two extra steps it works.Thanks!

Delete
Reply

Spyros M.April 21, 2012 at 6:48 PM
You forgot the last step. The manual installation of ia-32libs and libdirectfb-extra.

ReplyDelete

xian555April 24, 2012 at 4:03 PM
Hi,

Installed on 3 Ubuntu 32 bit machines. Works like a charm on first 2, for last couple of months. On 3rd machine will only run as root. Noticed that Gdebi installed files with Root as owner and rights, but I installed it from my account. Tried changing access permission to include my account, and applied to all files below /opt/dass…. but to no avail.

What to do? Thx!

ReplyDelete

Spyros M.April 24, 2012 at 8:33 PM
Do you have a custom gtk theme? Some of these themes cause errors on DraftSight. Try to open DraftSight from terminal with the command:
/opt/dassault-systemes/draftsight/bin/draftsight -style plastique
and see if it opens correctly.

ReplyDelete

AnonymousApril 29, 2012 at 10:33 AM
When I try it, gdebi tells me that it “requires the installation of 76 packages” lots of i386 packages like gcc-4.6-base:i386, libath1.0-0:i386, etc. Do you have to run through all that?

ReplyDelete
Replies

Spyros M.April 29, 2012 at 12:39 PM
Yes, 32bit applications need a lot of 32 bit dependencies on a 64bit system in order to work properly. I took the screenshots after my first attempt to install DraftSight so I already had installed the necessary dependencies.Also you have to install manually libdirectfb-extra and ia32-libs.

Delete
Reply

Toni RidwanApril 30, 2012 at 11:26 AM
Thank you Spyros. It is a relieve to be able to use Draft Sight again being early adaptor of Ubuntu 12.04 64 bit.

Please correct me if I am wrong, in STEP 9 I think there should be a dot between control and tar (control.tar.gz instead of control tar.gz).

ReplyDelete
Replies

Spyros M.April 30, 2012 at 11:30 AM
Yes, there is a missing dot.

Delete
Reply

GabrieleMay 1, 2012 at 12:20 PM
Hi, I’ve installed draftSight following you guide but omitting step 12, i.e. I’ve NOT installed ia32-libs and libdirectfb-extra and everything seems to work well!
I checked with dpkg -l and I’m sure ia32-libs and libdirectfb-extra are not installed (but libdirectfb-1.2-9 is installed).
I’ve a lot of i386 libs that have been installed by wine 1.5, so I guess these are enough to get in working 🙂
If needed, I can post a list of these i386 libs.
Best regards and thank for your guide

ReplyDelete
Replies

Spyros M.May 1, 2012 at 12:41 PM
Wine installs all the components of ia32-libs on a 64bit system.
ia32-libs is a meta-package that installs all the common 32bit libraries on a 64bit system. It’s useless for applications that follow the new multiarch specification but necessary for packages that follow the previous standards (just like DraftSight). Libdirectfb-extra is a package that actually boosts your system’s performance with 2d Graphics(PNG,JPG and Fonts). Without it DraftSight’s perfomance might be slower when you work with images and fonts.

Delete

GabrieleMay 2, 2012 at 4:43 PM
Thanks a lot for your replay, everything clear now 🙂

Delete
Reply

Oscar SanchezMay 7, 2012 at 8:11 PM
Thank you very much!!
It works perfect on xubuntu 12.04 64-bit
You have a very helpful blog!
Congrats!!!

ReplyDelete

allanMay 9, 2012 at 5:48 AM
wish the instructions were all clear I see no control folder in Step 3

ReplyDelete
Replies

AnonymousMay 9, 2012 at 6:24 AM
step 2 no luck either..error message!!!

Delete
Reply

oslMay 10, 2012 at 3:03 PM
Very clear tutorial thanks.

I’ve carried out all the steps three times in a row but I still get a “Could not open ‘draftsight.deb’ error (package is either corrupted or with no sufficient permissions). I’ve cross-checked the permissions, but to no avail.

Has anyone uploaded the modified .deb file somewhere I could download it from?

Thanks

ReplyDelete
Replies

Spyros M.May 10, 2012 at 7:09 PM
Downloading and installing .deb files from untrusted sources is a possible security risk for your computer. That’s why I prefer to post detailed instructions instead of uploading somewhere a modified version of the .deb file.
I cannot reproduce your problem. Re-download DraftSight and try again. Be careful with steps 2,5,9

Delete

oslMay 11, 2012 at 12:16 PM
Redownloading did the trick.

Thanks!

Delete

Chris DoddsMay 25, 2012 at 8:44 AM
I had the same, there is a small type in the instructions which will get you into trouble if you copy/paste.

ar r draftsight.deb control.tar.gz

should be

ar r draftSight.deb control.tar.gz

Without the capital S it creates a new .deb file instead of writing back to the original.

Cheers,
Chris

Delete

Spyros M.May 25, 2012 at 11:30 AM
Fixed,Thanks!!!

Delete
Reply

AnonymousMay 26, 2012 at 8:55 PM
dear sir,

thank you for your kind help provided. and i have installed the draftsight V1R1.4 beta as stated above. and additionally with using wine. both are working fine. with out any sort of crash or bug.

however, draftsight V1R2.0 is out now on may. therefore i am trying the same both procedures again. as one stated above and using wine.

therefor, take some time to appreciate the kind helping hand provided by all the persons stated above and mainly tha narrator of this blog

Uditha Herath
From Sri Lanka

ReplyDelete
Replies

AnonymousMay 26, 2012 at 9:26 PM
draftsight V1R2.0 is working under wine flawlessly. the native deb file is to be tested on ubuntu 12.04 64bit

Uditha Herath
From Sri Lanka

Delete

AnonymousMay 26, 2012 at 9:42 PM
the draftsight native deb file of V1R2.0 for ubuntu is working flawlessly on UBUNTU 12.04 64bit. and it replaces the V1R1.4 which I installed previously with the help of this blog. in both instances

on step 5, i didnt do the same thing as told I changed the “Architecture: i386” to “Architecture: all” in the control file and proceeds with the rest of the procedures as stated above.

please be kind to note that i am not a computer specialist or any. i am just another UBUNTU user for over 4 years with B.Sc (hons) in Quantity Surveying. whom trying to introduce linux to the construction industry

Uditha Herath
From Sri Lanka

Delete

AnonymousMay 27, 2012 at 8:54 AM
BRIEF

here i have installed the draftsight in UBUNTU 12.04 64BIT with use of several methods.

mainly with the native DraftSight.deb V1R2.0 32BIT file implemented the changes stated above to the letter excluding the step 5 which i changed the Architecture: i386 to Architecture: all in Control file with out deleting the dependency file. (this installation replaced the draftsight.deb V1R1.4 32BIT which i installed on 64BIT ubuntu 12.04)

then I have installed the windows version of draftSight.exe V1R2.0 with using wine and PlayOnLinux with in a virtual drive

ultimately kept the previous version of windows version of draftSight.exe V1R1.4 in another virtual drive for backup

therefore i am having 3 copies of draftsight installed in UBUNTU 12.04 64BIT as Native DEB file V1R2.0 and EXE file respectively in separate virtual drives using PlayOnLinux V1R1.4 and V1R2.0 runs as native app. while all are running very quickly and flawlessly with out any bug.

______

Additionally, i have installed the draftsight on lubuntu 32BIT in my PenDrive/FlashDrive/Datatraveller for take it to place to place and boot it any where i am. (this is additional information for extra mobility)

______

Ultimately i am grateful for/to the draftsight creators and narrator of this blog for bringing the long waited need of CAD applications to the LINUX and mainly to UBUNTU 64BIT.

______

Uditha Herath
From Sri Lanka

Delete

AnonymousMay 27, 2012 at 1:51 PM
Final Result

I have installed draftSight in a windows computer for a friend of mine. Windows 7 32bit. and compaired it to all my installations under UBUNTU (Native 32bit DEB file V1R2.0 under UBUNTU 12.04 is the most responsive and speed-est, after that, DraftSight V1R2.0 and V1R1.4 under WINE and PlayOnLinux with separate virtual drives works near to perfection with marginal speed difference with native DEB installation in same machine UBUNTU 12.04 64BIT) works much faster and very responsive than Windows installation done for a friend on 32bit machine. while even 32bit installation in my 4GB PenDrive/FlashDrive/DataTaveller with lubuntu installation for mobility works much faster than the windows 7.

____

i am not trying to promote any more than this. please be kind to forgive me if i became more descriptive.

_____

thank you for all.

Uditha Herath
From Sri Lanka

Delete
Reply

AnonymousMay 30, 2012 at 1:44 PM
Have just followed your tutorial on a 32bit Kubuntu 12.04LTS machine.
Works perfectly without the ia32-libs and libdirectfb-extra.

Thanx

ReplyDelete
Replies

Spyros M.May 30, 2012 at 2:51 PM
On 32bit (K)Ubuntu the only requirement is to use GDebi package installer because both Ubuntu Software Center and the QApt Package Installer fail to install DraftSight due to a package issue. (These applications don’t allow the execution of the included ShowLicense script)

Delete
Reply

Malcolm J LastJune 4, 2012 at 2:34 PM
I have completely ignored all of the above and installed and run on Windows 7 64 bit – no problems at all 🙂

ReplyDelete
Replies

AnonymousJune 7, 2012 at 8:07 PM
Like!

Delete
Reply

Catalin C.June 4, 2012 at 11:02 PM
Excellent tutorial! Worked without any problem.

Thanx

ReplyDelete

AnonymousJune 8, 2012 at 4:22 AM
had to remove libglu1-mesa as well

ReplyDelete

AnonymousJune 10, 2012 at 2:33 PM
Hi, just installed, thanks for instruction!

ReplyDelete

Nicolas REYJune 14, 2012 at 12:29 PM
Hi, thanks a lot for the script,

Thent, then installation is not ok. The error message displayed is following :

“No protocol specified
No protocol specified
xhost: unable to open display “:0.0”
No protocol specified
No protocol specified
xhost: unable to open display “:0.0”
No protocol specified
No protocol specified

(ShowLicence:24770): Gtk-WARNING **: cannot open display: :0.0
No protocol specified
No protocol specified
xhost: unable to open display “:0.0”
No protocol specified
No protocol specified
xhost: unable to open display “:0.0″
dpkg : erreur de traitement de draftSight.deb (–install) :
le sous-processus nouveau script pre-installation a retourné une erreur de sortie d’état 1”

Do you have an idea ?

Thanks again.

ReplyDelete
Replies

AnonymousJanuary 7, 2013 at 12:08 AM
They hardcoded display number “:0.0” into the “preinst” script. You need to find out your actual display number and change the preinst script – it is located inside the control.tar.gz. This howto should help obviously with the task 😉

Delete
Reply

Spyros M.June 14, 2012 at 1:24 PM
This is the known problem with Ubuntu Software Center and DraftSight. Use Gdebi for the installation.
(Gdebi is a lightweight application for the installation of stand-alone .deb files, you can find it in the Ubuntu Software Center)

ReplyDelete
Replies

Nicolas REYJune 14, 2012 at 3:59 PM
Okay, thanks.

I ve just rebooted the computer and installed the deb with gdebi, all is fine.

Thanks a lot !

Delete
Reply

Matias PropatiJuly 12, 2012 at 6:16 AM
Thanks a lot! the only explanation that works perfectly!

ReplyDelete

AnonymousJuly 12, 2012 at 10:41 AM
Muchísimas gracias por tan brillante explicación para poner a funcionar este Soft.
Además de ameno ha sido práctico, conciso y preciso. Una joya.
Saludos.

ReplyDelete

AnonymousJuly 14, 2012 at 6:25 AM
Thanks very much. First google hit and worked perfectly.

ReplyDelete

AnonymousJuly 14, 2012 at 9:45 AM
After a number of weeks of draftsight working, the program suddenly stops loading after the splash screen appears. Found a way round by loading from existing drawing which worked a few times only. Reinstall did not work. Drawing loads perfectly in Windows version. Anyone else experiencing this problem?

ReplyDelete
Replies

Spyros M.July 14, 2012 at 9:28 PM
First, make sure that you don’t have any network problems.
DraftSight V1R2 has a know problem that crashes the application with segmentation fault when a network connection isn’t available.
Then make sure that the problem isn’t related with your settings.The easiest way to do that is to login as guest and try to launch DraftSight.

Delete

DusanSrJuly 11, 2013 at 8:33 PM
I loged in as guest and DraftSight worked OK. My problem is obviously related with my network settings. I`m connected via wireless, and everything else works well. Any suggesstion how to fix my network settings?

Delete
Reply

alecJuly 24, 2012 at 5:21 PM
Is there any way of adding a launcher with these instructions to the launcher bar???

/opt/dassault-systemes/draftsight/bin/draftsight -style plastique

works really well when I use this in terminal but I really would need a launcher
Thanks in advance

ReplyDelete
Replies

Spyros M.July 24, 2012 at 7:48 PM
The easiest way for this, is to edit the DraftSight’s startup script.
sudo gedit /opt/dassault-systemes/draftsight/bin/draftsight
and then apply the changes that I described in this post
http://linuxaideddesign.blogspot.com/2011/12/some-tweaks-for-draftsight-on-ubuntu.html

Delete

RayJuly 28, 2012 at 10:19 PM
I just went into the ubuntu software center, typed in the name of the program, and dragged it’s icon to the launcher bar.
Alternately, you can execute the program and while the icon is displayed in the laucher, right-click and select “lock to launcher”.

Delete
Reply

alecJuly 25, 2012 at 1:28 AM
Many Thanks! for your quick answer Spyros

ReplyDelete

AnonymousJuly 26, 2012 at 8:09 AM
If you have problem only with one library libdirectfb-extra, you can use simplier method:
sudo dpkg –force-depends -i draftSight.deb

ReplyDelete
Replies

Spyros M.July 26, 2012 at 11:00 AM
The –force-depends parameter isn’t usable any more with newer versions of dpkg. Your system will mark the package as damaged and you will not be able to do anything with your package manager (install/uninstall packages, update/upgrade your system) if the damaged package has not been removed. With the above method you will not face similar problems.

Delete
Reply

clausJuly 28, 2012 at 12:24 AM
I cannot activate the product…
Precizely:
i compile the activation form when I start the program, but no mails arrive…
Does it the same with you guys???

ReplyDelete
Replies

RayJuly 28, 2012 at 10:17 PM
The email arrived almost instantly. You might want to check your spam filter.
Even before I opened the email, the program operated. But there is a link back (in the email) that you are supposed to click on. When you do, it will send another email welcoming you to DS.

Delete
Reply

RayJuly 28, 2012 at 10:10 PM
Thank you! I have tried about a dozen other “solutions” but none worked. Your post was easy to follow and worked first time. Since I already had the two lib files, it installed without any extra work.

ReplyDelete

AnonymousAugust 1, 2012 at 2:16 AM
Thank you very much, I was trying different ways to install and only until I saw your blog I was able to achieve.
regards

ReplyDelete

UnknownAugust 6, 2012 at 11:33 AM
ar x draftsight.deb control.tar.gz

mkdir control

cd control

tar xf ../control.tar.gz

sed -i -e ‘s/libdirectfb-extra (>=1.2.7-2), //’ control

tar czf ../control.tar.gz ./*

cd ..

ar r draftsight.deb control.tar.gz

ReplyDelete

JJBAugust 12, 2012 at 11:06 PM
Thanks for your efforts! Worked great for me.

ReplyDelete

RichardAugust 17, 2012 at 4:59 PM
Thank you, I’ve just finished installing Draftsight onto Xubuntu 12.04. All worked perfectly.

ReplyDelete

zkollyAugust 24, 2012 at 5:11 AM
thanks for this man

ReplyDelete

tucmSeptember 14, 2012 at 11:01 AM
This works for me (Linux Mint 13 Maya 64 bit). Thank you very much!

ReplyDelete

AnonymousSeptember 22, 2012 at 7:14 AM
running 12.04 Ubuntu Studio (x64)

so far it looks like it’s working okay.

thanks for sharing the step-by-step!

ReplyDelete

rafiq.r3September 22, 2012 at 7:05 PM
Tahnks, It’s Work

ReplyDelete

Yandi Adi PrasetyaOctober 3, 2012 at 1:42 AM
Thanks friends

ReplyDelete

AnonymousOctober 19, 2012 at 3:28 PM
Thanks for the step by step instructions – however, I can only get 64 bit DraftSight to run by typing:

/opt/dassault-systemes/draftsight/bin/draftsight -style plastique

in the terminal. Is there a way to make DraftSight start from the Launcher or some other convienient place? It doesn’t appear in the Software Centre…. i would appreciate some help with this as I’m a newcomer to Linux

ReplyDelete
Replies

Spyros M.October 19, 2012 at 4:23 PM
http://linuxaideddesign.blogspot.com/2011/12/some-tweaks-for-draftsight-on-ubuntu.html

Delete
Reply

AnonymousOctober 19, 2012 at 6:23 PM
Thanks for the very rapid reply, Spyros – I have tried the solutions in the link you suggested, however DraftSight will still only start from the console as before, and does not appear in the Software Centre, nor does the DraftSight icon appear in the Launcher when the program is running.

I must have messed up the installation in some way – any suggestions?

ReplyDelete
Replies

Spyros M.October 19, 2012 at 7:03 PM
On USC you can find DraftSight under the section Installed–>Unknown. The -style plastique parameter ensures that
DraftSight doesn’t conflict with buggy gtk themes. So if you use a custom gtk theme you have to make DraftSight use this parameter by default.
If you find the editing of DraftSight’s start-up script difficult you may have to use qt-config. Make sure that you saved the changes.
Delete

tomasfietsNovember 1, 2012 at 4:57 PM
I don’t know what is USC, but I had a similar issue.
I solved by deleting ~/.local/share/applications/DraftSight.desktop (& DraftSight-1.desktop & dassault-systemes_draftsight.desktop). Then I searched again in the Dash Home and dragged to the Launcher.
(also following instructions on http://linuxaideddesign.blogspot.com/2011/12/some-tweaks-for-draftsight-on-ubuntu.html). Not sure if it will work for others, just sharing my experiences.

Worked for Ubuntu 12.04 64bit and DraftSight V1R3.

THANK YOU VERY MUCH FOR THE EXCELLENT INSTRUCTIONS!!!

Delete
Reply

AnonymousOctober 19, 2012 at 7:35 PM
Hi Spyros – I seem to be struggling here! DraftSight doesn’t appear in USC – I looked in the Installed / Uncategorized section. Perhaps it would be better to uninstall and try re-installation from the beginning?

Thanks again for your patience and help

ReplyDelete
Replies

Spyros M.October 19, 2012 at 7:56 PM
Please give the output of the command:
apt-cache policy dassault-systemes-draftsight

Delete
Reply

AnonymousOctober 19, 2012 at 11:41 PM
Hi Spyros

Here is the output you requested:
neil@neil-Ubuntu-System:~$ apt-cache policy dassault-systemes-draftsight
dassault-systemes-draftsight:i386:
Installed: 2012.7.340
Candidate: 2012.7.340
Version table:
*** 2012.7.340 0
100 /var/lib/dpkg/status
neil@neil-Ubuntu-System:~$

this is copy/paste directly from terminal

thanks
ReplyDelete
Replies

Spyros M.October 20, 2012 at 3:25 PM
It seems that DraftSight has been correctly installed and configured on your system.
Change your theme to Ubuntu’s defaut (ambiance) and try to launch DraftSight from the Dash.

Delete
Reply

AnonymousOctober 21, 2012 at 1:32 AM
For Dedian Wheezy (and possibly *buntu) users installing on amd64, you can omit the ia32-libs packages by adding i386 as as an architecture.

dpkg –add-architecture i386

Then install the required i386 dependencies (ex. apt-get install libgtk2.0-0:i386)

In addition you also need libasound2:i386 or else it will give you the “Failed to load modules” error.

ReplyDelete

AnonymousOctober 24, 2012 at 4:28 PM
thanks !!!

ReplyDelete

AnonymousOctober 26, 2012 at 5:36 PM
Thanks a lot! D.S. works very well 🙂
For the first time truly cad system works for me with my ubuntu.
Except Rhino it was only application I used on Win.

ReplyDelete

leverettsonNovember 5, 2012 at 5:47 AM
Thank you – thank you – thank you!!

ReplyDelete

Dymaxion KimNovember 20, 2012 at 10:02 AM
Thanks for your brief man!
It works in Linux Mint 13 Maya, too.
– from Korea

ReplyDelete

AnonymousNovember 22, 2012 at 8:20 PM
Work perfect in Ubuntu 12.10. Thank you

ReplyDelete

Dealga McArdleNovember 28, 2012 at 10:39 PM
Thanks for this post, I can now use draftsight again 🙂

ReplyDelete

AnonymousDecember 5, 2012 at 5:50 PM
Very good. Thanks 🙂

ReplyDelete

AnonymousDecember 30, 2012 at 7:19 AM
Thanks for this tutorial.
It works.

Darko

ReplyDelete

AnonymousJanuary 22, 2013 at 6:26 PM
Thank you!

ReplyDelete

AnonymousFebruary 7, 2013 at 2:21 PM
Fantastico Manual

Por fin consegui hacer funcionar DraftsIght con Ubuntu 64 bits.

Muchas Gracias

ReplyDelete

AnonymousFebruary 10, 2013 at 4:47 AM
Hello

I Just installed the draftSight.deb provided from http://www.3ds.com/es/products/draftsight/download-draftsight/?fromrss=1 on LinuxMint nadia 64 bits no need to do anything.

Just install it with gDebi it says you need to fill a lot of dependences but gDebi takes all the work done for you, as soon you install it you cannot running it because you got “failed to load modules, you need to reinstall the software”. Just type in the console:

sudo apt-get install ia32-libs

And “ta da” You can get draftsight running without of troubles.

I ran this other 2 commands:

sudo apt-get install libdirectfb-extra

sudo apt-get install libxcb-render-util0

Actually don’t see any improvement, I just do it for reliability.

Regards

ReplyDelete

mavelasquezzFebruary 25, 2013 at 2:35 AM
Gracias por el tutorial.

El instalador de paquetes Gdebi no me funcionó, decidí hacer en terminal y perfecto.

sudo dpkg -i dragtSight.deb

(DS lo trabajaba en kubuntu y generalmente fallaba, hace pocos días me pasé a ubuntu y excelente, corre mucho mejor).

ReplyDelete

AnonymousMarch 17, 2013 at 12:08 AM
Awesome instructions. from the step by step at the top of this Page,

Ubuntu 12.04.1 64 bit

Opened all of my complex architectural drawings, yes, some tweaking but other wise as close to my ACAD 2007 installation as it gets.

Fantastic job.

Cheers
Spart
ReplyDelete
Replies

AnonymousMarch 17, 2013 at 12:17 AM
Forgot to add I am using GNOME 3.6

Cheers
Spart

Delete
Reply

Guto MouraMarch 21, 2013 at 10:39 PM
Mandou bem demais

ReplyDelete

AnonymousMay 13, 2013 at 6:28 AM
i installed in ubuntu 13.04 it opens but not showing cross hair cursor , x and y axis arrow in working sheet

ReplyDelete
Replies

Spyros M.May 13, 2013 at 6:57 PM
Your Ubuntu system is 32 or 64 bit???
Typically these problems are related to your graphics driver.
Try to load DraftSight from terminal with the command:
draftsight
and post the output here.

Delete

AnonymousMay 14, 2013 at 5:23 AM
its 64-bit

here is the output

Gtk-Message: Failed to load module “overlay-scrollbar”
`menu_proxy_module_load’: /opt/dassault-systemes/draftsight/bin/draftsight.bin: undefined symbol: menu_proxy_module_load

(draftsight.bin:11600): Gtk-WARNING **: Failed to load type module: (null)

`menu_proxy_module_load’: /opt/dassault-systemes/draftsight/bin/draftsight.bin: undefined symbol: menu_proxy_module_load

(draftsight.bin:11600): Gtk-WARNING **: Failed to load type module: (null)

`menu_proxy_module_load’: /opt/dassault-systemes/draftsight/bin/draftsight.bin: undefined symbol: menu_proxy_module_load

(draftsight.bin:11600): Gtk-WARNING **: Failed to load type module: (null)

`menu_proxy_module_load’: /opt/dassault-systemes/draftsight/bin/draftsight.bin: undefined symbol: menu_proxy_module_load

(draftsight.bin:11600): Gtk-WARNING **: Failed to load type module: (null)

version = 13.1.56
libGL error: failed to load driver: swrast
libGL error: Try again with LIBGL_DEBUG=verbose for more details.
version = 13.1.56
libGL error: failed to load driver: swrast
libGL error: Try again with LIBGL_DEBUG=verbose for more details.
libGL error: failed to load driver: swrast
libGL error: Try again with LIBGL_DEBUG=verbose for more details.
libGL error: failed to load driver: swrast
libGL error: Try again with LIBGL_DEBUG=verbose for more details.

Delete

AnonymousMay 14, 2013 at 6:17 PM
Today i updated my nvidia driver to version 319.17 now draft sight not opening and shows following error

anandharaja@anandharaja-desktop:~$ draftsight
/opt/dassault-systemes/draftsight/bin/draftsight.bin: error while loading shared libraries: libGL.so.1: wrong ELF class: ELFCLASS64

Delete

Spyros M.May 16, 2013 at 1:02 AM
You don’t have the 32bit version of nvidia’s libgl on your system, which is necessary for using DraftSight.

Delete

AnonymousMay 16, 2013 at 7:04 AM
How to install 32bit version of nvidia libgl i downloaded driver as .rpm from nvidia site.

Delete

Spyros M.May 16, 2013 at 10:37 AM
Do not use rpms on Ubuntu. It ‘s not recommended and it may cause problems.
You have 2 options:
-Install the newer driver via a ppa like x-swat. The easiest and safer method.
-Nvidia’s installer usually asks if you want to install the 32-bit version of libgl during the manual installation. Make sure that you answer Yes.

Delete

AnonymousMay 16, 2013 at 4:26 PM
Yes i installed 32 bit versions during install, the libgl.so.1 fine available in usr/lib32 folder, how can i manually configure to draftsight.

Delete

Spyros M.May 17, 2013 at 12:12 PM
ldconfig usually makes the necessary configurations automatically.
If you have problems try the following workaround:
-Create a new file named lib32.conf inside your /etc/ld.so.conf.d/ folder with the command:
sudo gedit /etc/ld.so.conf.d/lib32.conf
-Add the following lines, then save the file and close gedit:
/usr/lib32
/usr/lib/i386-linux-gnu/mesa
-Then run the following command:
sudo ldconfig

Delete

AnonymousMay 18, 2013 at 6:36 AM
Thank You Finally working 🙂

Delete
Reply

AnonymousJune 30, 2013 at 4:56 PM
Worked like a charm on Kubuntu 13.04! Thanks!

note1: without gdebi
note2: funny thing is, I’ve installed it without problems on
ubuntu 13.04

ReplyDelete

AnonymousJuly 10, 2013 at 5:15 PM
Hi all,
new V1R3.2 version has issue with libxcomposite1 (>= 1:0.4.0-4), but I have suitable 1:0.4.3-2build1 version.
Should I do the same actions for this library, as Author recommended?

ReplyDelete
Replies

Spyros M.July 10, 2013 at 8:30 PM
V1R3.2 installed without issues with libxcomposite1 on my Ubuntu 12.04 64bit machine. Try to install it manually with the command sudo apt-get install libxcomposite1:i386

Delete
Reply

AnonymousJuly 12, 2013 at 3:11 PM
After installation of Draftsight on AMD64 laptop program crashed and report “Segmentation fault (Core dumped). After your suggestion, I logged in as guest, and DraftSight worked OK. Problem is obviously related with network settings. I’m connected via wireless, and everything else works well. Any suggestion how to fix that problem with network settings?

ReplyDelete
Replies

Spyros M.July 12, 2013 at 6:08 PM
Delete your ~/.config/draftsight folder and you will restore the default settings of DraftSight.

Delete
Reply

AnonymousJuly 12, 2013 at 6:20 PM
Thanks a lot, Maestro Spyros.

Dusan

ReplyDelete

Raúl Fernando Castro SuárezJuly 29, 2013 at 5:12 AM
Works perfect!

With this method the dependencies error for installing a new package or updating the system is fixed too.

Thanks a lot,

Raúl

ReplyDelete
Replies

Eleanor EllisJuly 30, 2013 at 2:46 AM
I’ve installed draftSight V1R3.2 on Ubuntu 12.04 64 bit using this tutorial. It runs and even appears to open dwg files successfully. The drop-down menus show the correct layers and linetypes from my drawing.

However, the drawing area doesn’t appear to update properly and doesn’t show the drawing. Dialog boxes like “Open file” or “Help|About” leave traces behind when dragging and do not close properly.

I have put some screenshots at http://www.flickr.com/photos/97219542@N07/sets/72157634854261224/

Can anyone help please? Thanks.

Regards,
Eleanor

Delete

Spyros M.July 31, 2013 at 7:39 PM
Problems of this kind probably have to do with the graphics card drivers.

Here are some possible explanations:

1. Make sure the 32 version of libgl1 is installed and configured properly on your system.
2. Try to update your graphics card drivers (there might be functionalities of Draftsight that are not supported by the graphics card).
3. Maybe your graphics card cannot support Draftsight at all.

In order to figure out what happens and give you further assistance open the terminal and type the following commands and then post the results:

lspci -nn | grep VGA

glxinfo | grep renderer

Delete
Reply

CippaciongAugust 18, 2013 at 5:32 PM
This guide is awesome! Worked like a charm on Mint 13 Maya.
Thank you for your work and the excellent explanation.

ReplyDelete

manuti manutiAugust 28, 2013 at 9:45 AM
This comment has been removed by the author.

ReplyDelete

manuti manutiAugust 28, 2013 at 9:46 AM
New versión v1R3.2 is more easy to install but it have a final workaround.

I have the solution, is in spanish but it works!!!

Cómo instalar Draftsight V1R3.2 en Ubuntu 64 bits 12.04

google translated: http://translate.google.com/translate?hl=es&sl=es&tl=en&u=http%3A%2F%2Fnumeriza.com%2Finformatica%2Fcomo-instalar-draftsight-v1r3-2-en-ubuntu-64-bits-12-04%2F

ReplyDelete

mahasiswa teladanAugust 29, 2013 at 6:27 AM
hi…Im student from Informatics engineering nice article,
thanks for sharing 🙂

ReplyDelete

AnonymousAugust 31, 2013 at 4:30 PM
Great help, thanks, did try to install on Zorin OS 64-bit with 12.04 LTS with no success up till now. Used numerous links and workarounds….

ReplyDelete

shiguetolimaSeptember 4, 2013 at 3:28 PM
Fantastic!
Thanks!

ReplyDelete

David SantosSeptember 9, 2013 at 5:41 AM
Hello. My name is David Santos.
I seem to have a similar problem to Eleanor Ellis. First I would like to say I’m a total noob on this things! I have Ubuntu 12.04 LTS 32 bits and have installed Draftsight on my computer. Everything seems to run ok but the project doesn’t show. I can see the menus and click on everything but nothing on the drawing area shows. Even the cursor from the mouse desappears whenever I go over the drawing area!
I typed lspci -nn | grep VGA on the terminal and got this:

00:02.0 VGA compatible controller [0300]: Intel Corporation Core Processor Integrated Graphics Controller [8086:0046] (rev 18)
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Madison [Mobility Radeon HD 5650/5750 / 6530M/6550M] [1002:68c1]

En typed glxinfo | grep renderer and first it told I didn’t have some kind of pakage that I can’t really recall te name (something “mesa”. I made the update and now when I type glxinfo | grep renderer I get this:

X Error of failed request: BadRequest (invalid request code or no such operation)
Major opcode of failed request: 154 (GLX)
Minor opcode of failed request: 19 (X_GLXQueryServerString)
Serial number of failed request: 12
Current serial number in output stream: 12

I really need to put draftsight working on this computer ASAP. If anyone can help me I’d really apreciate it.
Thanks.

David Santos

ReplyDelete
Replies

AnonymousSeptember 9, 2013 at 10:16 PM
Try to install proprietary AMD drivers: http://wiki.cchtml.com/index.php/Ubuntu_Precise_Installation_Guide

Delete

David SantosSeptember 10, 2013 at 5:55 AM
Hi.
Thank you very much for your quick answer. I’ve looked through the link you provided and there seems to be a lot of things that can go wrong. And if they do I’m sure I won’t be able handle them. I really like using ubuntu but it seems like it isn’t yet completely user friendly. One must be capable of solving lots of stuff. Besides this there is the problem of some software that won’t completely substitute the original software available for windows or mac.
I guess it’s time to go back to slavery and install windows once again! Someday I hope to come back to the free side.
Once again, thank you very much.

Delete
Reply

AnonymousSeptember 9, 2013 at 7:52 PM
This software is not proper to install under Ubuntu 64 bits systems, how do you want users to install it this way ? We have no money and no nerves to loose this way
We came back to QCAD pro, which is the only software giving results with our PCs.
Lamentable.

ReplyDelete

Chris GreveSeptember 10, 2013 at 7:12 PM
Has anyone encountered this error message:

Error: Dependency is not satisfiable: libcomerr2 (>= 1.41.9-1)

I have checked and I have the latest version of libcomerr2.

ReplyDelete
Replies

Chris GreveSeptember 10, 2013 at 7:14 PM
I recently upgraded to Ubuntu 12.04 LTS 64bit.

Delete
Reply

Paolo RedaelliOctober 9, 2013 at 11:23 AM
I wrote a little script that automates the instructions given here so that people not willing to patch it manually may still use it. You can find it at
http://www.monodes.com/blog/2013/10/09/english-a-usable-draftsight-debian-package/?lang=en

ReplyDelete

montOctober 26, 2013 at 5:55 AM
Hi when I tried to install DraftSight on my 64-bit Ubuntu 12.04 machine I get the error:
dpkg: error processing dassault-systemes-draftsight:i386 (–install):
dependency problems – leaving unconfigured
Errors were encountered while processing:
Thanks,
Phil

RedHat/CentOS 与 Ubuntu 保存 iptables 防火墙规则的方法

RedHat/CentOS 与 Ubuntu 保存 iptables 防火墙规则的方法

转载请注明出处:http://hi.baidu.com/leejun_2005/blog/item/41ca53583d1eae332934f04a.html

from:http://os.51cto.com/art/201103/249504.htm

from:http://wiki.ubuntu.org.cn/IptablesHowTo#Saving_iptables_.E4.BF.9D.E5.AD.98.E8.AE.BE.E7.BD.AE

iptables 是与最新的 2.6.x 版本Linux 内核集成的 IP 信息包过滤系统。在上篇文章里我为大家介绍了如何保存iptables日志,本文教大家保存iptables的防火墙规则的方法

1、RedHat/CentOS下保存iptables规则并开机自动加载的方法:

保存iptables防火墙规则的方法如下:

 

iptables命令建立的规则临时保存在内存中。如果系统在永久保存这些规则之前重启,所有设置的规则都将丢失。如果要想使iptables设置的规则在下次重启系统之后仍然生效则需要永久保存这些规则,以root身份执行:

/sbin/service iptables save

该操作将执行iptables初始化脚本,该脚本会运行/sbin/iptables-save程序并更新当前的iptables配置文件/etc/sysconfig/iptables。

而原来的配置文件将保存为iptables.save。

下次系统系统启动时,iptables初始化脚本将使用/sbin/iptables-restore命令重新读取/etc/sysconfig/iptables文件的内容。

因此比较好的方法是在将一条新的iptables规则提交到/etc/sysconfig/iptables文件之前先检查该规则。并且也可以将其他版本系统中的iptables配置文件应用于这里。这样就有助于分发该配置文件到多台Linux主机上。

注意:如果把/etc/sysconfig/iptables文件进行分发之后,每台系统都要执行/sbin/service iptables restart命令来使规则生效。

 

【编辑推荐】

iptables日志通过MySQL来保存

关掉Iptables防火墙的相关的命令

教你如何关闭iptables网络端口

UBUNTU 关闭iptables的方法

怎么关闭和卸载iptables

关闭iptables的方法

iptables命令的结构

Linux Iptables命令大全

2、Ubuntu下保存iptables规则并开机自动加载的方法:

 

Saving iptables 保存设置

If you were to reboot your machine right now, your iptables configurationwould disapear. Rather than type this each time you reboot, however, you cansave the configuration, and have it start up automatically. To save theconfiguration, you can use iptables-save and iptables-restore.

机器重启后,iptables中的配置信息会被清空。您可以将这些配置保存下来,让iptables在启动时自动加载,省得每次都得重新输入。iptables-save和iptables-restore 是用来保存和恢复设置的。

Configuration onstartup 开机自动加载配置

Save your firewall rules to a file

先将防火墙规则保存到/etc/iptables.up.rules文件中

# iptables-save > /etc/iptables.up.rules   #需要sudo su – root切换用户后执行,直接sudo cmd是不行的

Then modify the/etc/network/interfacesscript to apply the rulesautomatically (the bottom line is added)

然后修改脚本/etc/network/interfaces,使系统能自动应用这些规则(最后一行是我们手工添加的)。

auto eth0

iface eth0 inet dhcp

pre-up iptables-restore < /etc/iptables.up.rules

You can also prepare a set of down rules and apply it automatically

当网络接口关闭后,您可以让iptables使用一套不同的规则集。

auto eth0

iface eth0 inet dhcp

pre-up iptables-restore < /etc/iptables.up.rules

post-down iptables-restore < /etc/iptables.down.rules

Tips 技巧

If youmanually edit iptables on a regular basis 如果你经常手动编辑iptables 

The above steps go over how to setup your firewall rules and presume theywill be relatively static (and for most people they should be). But if you do alot of development work, you may want to have your iptables saved everytime youreboot. You could add a line like this one in /etc/network/interfaces:

大多数人并不需要经常改变他们的防火墙规则,因此只要根据前面的介绍,建立起防火墙规则就可以了。但是如果您要经常修改防火墙规则,以使其更加完善,那么您可能希望系统在每次重启前将防火墙的设置保存下来。为此您可以在/etc/network/interfaces文件中添加一行:

pre-up iptables-restore < /etc/iptables.up.rules

post-down iptables-save > /etc/iptables.up.rules

The line “post-down iptables-save > /etc/iptables.up.rules”will save the rules to be used on the next boot.

“post-down iptables-save > /etc/iptables.up.rules”会将设置保存下来,以便下次启动时使用。

Usingiptables-save/restore to test rules 使用iptables-save/restore测试规则

If you edit your iptables beyond this tutorial, you may want to use the iptables-saveand iptables-restore feature to edit and test your rules. To do this open therules file in your favorite text editor (in this example gedit).

使用iptables-save和iptables-restore可以很方便地修改和测试防火墙规则。首先运行iptables-save将规则保存到一个文件,然后用编辑器编辑该文件。

# iptables-save > /etc/iptables.test.rules

# gedit /etc/iptables.test.rules

You will have a file that appears similiar to (following the example above):

如果您根据前面的例子建立了防火墙规则,iptables-save将产生一个类似于如下内容的文件:

# Generated by iptables-save v1.3.1 on Sun Apr 2306:19:53 2006

*filter

:INPUT ACCEPT [368:102354]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [92952:20764374]

-A INPUT -m state –state RELATED,ESTABLISHED -j ACCEPT

-A INPUT -i eth0 -p tcp -m tcp –dport 22 -j ACCEPT

-A INPUT -i eth0 -p tcp -m tcp –dport 80 -j ACCEPT

-A INPUT -i lo -j ACCEPT

-A INPUT -m limit –limit 5/min -j LOG –log-prefix”iptables denied: ” –log-level 7

-A INPUT -j DROP

COMMIT

# Completed on Sun Apr 23 06:19:53 2006

Notice that these are iptables commands minus the iptable command. Feelfree to edit this to file and save when complete. Then to test simply:

文件内容其实就是各种iptables命令,只不过把命令名iptables省略了。您可以随意对这个文件进行编辑,然后保存。接着使用以下命令测试修改后的规则:

# iptables-restore < /etc/iptables.test.rules

After testing, if you have not added the iptables-save command above to your /etc/network/interfaces remember not to lose your changes:

之前您如果没有在/etc/network/interfaces文件中添加iptables-save命令,那么测试之后,别忘了把您所作的修改保存起来。

# iptables-save > /etc/iptables.up.rules

More detailed Logging关于日志记录的更多细节

For further detail in your syslog you may want create an additional Chain.This will be a very brief example of my /etc/iptables.up.rules showing how Isetup my iptables to log to syslog:

您可以创建额外的规则链,以便在syslog中作更加详细的记录。以下是我/etc/iptables.up.rules文件中的一个简单例子:

# Generated by iptables-save v1.3.1 on Sun Apr 2305:32:09 2006

*filter

:INPUT ACCEPT [273:55355]

:FORWARD ACCEPT [0:0]

:LOGNDROP – [0:0]

:OUTPUT ACCEPT [92376:20668252]

-A INPUT -m state –state RELATED,ESTABLISHED -j ACCEPT

-A INPUT -i eth0 -p tcp -m tcp –dport 22 -j ACCEPT

-A INPUT -i eth0 -p tcp -m tcp –dport 80 -j ACCEPT

-A INPUT -i lo -j ACCEPT

-A INPUT -j LOGNDROP

-A LOGNDROP -p tcp -m limit –limit 5/min -j LOG–log-prefix “Denied TCP: ” –log-level 7

-A LOGNDROP -p udp -m limit –limit 5/min -j LOG–log-prefix “Denied UDP: ” –log-level 7

-A LOGNDROP -p icmp -m limit –limit 5/min -j LOG–log-prefix “Denied ICMP: ” –log-level 7

-A LOGNDROP -j DROP

COMMIT

# Completed on Sun Apr 23 05:32:09 2006

Note a new CHAIN called LOGNDROP at the top of the file. Also, thestandard DROP at the bottom of the INPUT chain is replaceed with LOGNDROP andadd protocol descriptions so it makes sense looking at the log. Lastly we dropthe traffic at the end of the LOGNDROP chain. The following gives some idea ofwhat is happening:

–limit sets the number of times to log the same rule to syslog –log-prefix “Denied…” adds a prefix to make finding in the syslog easier –log-level 7 sets the syslog level to informational (see man syslog for more detail, but you can probably leave this)可以看到,文件前面多了一条名为LOGNDROP的规则链。此外,INPUT链最后一条规则中的DROP被LONGDROP替代。并且在后面我添加了一些内容来描述报文所使用的协议,这可以让记录更容易理解。最后,在LOGNDROP链的末尾,报文被丢弃。

–limit 对由此规则引发的记录事件的频率进行限制。–log-prefix “Denied…” 在每条记录前加上一个前缀,以便查找。–log-level 7     将记录的详细程度设为“informational”等级(详情请见man syslog,您也可以直接使用此处的设置)。Disabling the firewall 禁用防火墙

If you need to disable the firewall temporarily, you can flush all therules using

可以通过清除所有规则来暂时停止防火墙:(警告:这只适合在没有配置防火墙的环境中,如果已经配置过默认规则为deny的环境,此步骤将使系统的所有网络访问中断)

# sudo iptables -F

IptablesHowTo

Basic Iptables How to for Ubuntu Server Edition
Ubuntu 服务器版 Iptables 基本设置指南


原文出处:https://wiki.ubuntu.com/IptablesHowTo

原文作者:UbuntuWiki

授权许可:创作共用协议 GNU FDL

翻译人员:denven lxr1234

校对人员:5451vs5451

贡献者:

适用版本:

文章状态:翻译完成


THIS IS NOT COMPLETE AND SHOULD BE COMPLETED BY SOMEONE WHO KNOWS MORE THAN ME! THANKS!

本文尚未完成,希望比我更懂Iptables的同行能加以补充完毕,谢谢!


Iptables is a firewall, installed by default on the Ubuntu Server. On regullar ubuntu install, iptables is installed but allows all traffic (thus firewall is ineffective / inactive)

There is a wealth of information available about iptables, but much of it is fairly complex, and if you want to do a few basic things, this How To is for you.

iptables是一款防火墙软件。它在Ubuntu系统中是默认安装的。通常情况下,iptables随系统一起被安装,但没有对通信作任何限制,因此防火墙并没有真正建立起来。

尽管关于iptables的资料非常丰富,但大都比较复杂。如果您只想作些简单的设置,那么本文比较适合您的要求。

目录

[隐藏]

[编辑]Basic Commands 基本命令

进入iptables

# sudo iptables -L

列出目前的ip策略. 如果您刚刚配置好服务器,您是没有设置ip规则的,您要自己设置。

Chain INPUT (policy ACCEPT)
target     prot opt source               destination
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

使用命令

# sudo iptables -L

查看现有的iptables防火墙规则。如果您刚架设好服务器,那么规则表应该是空的,您将看到如下内容

Chain INPUT (policy ACCEPT)
target     prot opt source               destination
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

[编辑]Allowing Established Sessions 允许已建立的连接接收数据

We can allow established sessions to receive traffic:

可以使用下面的命令,允许已建立的连接接收数据:

# iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

lll

[编辑]Allowing Incoming Traffic on Specific Ports 开放指定的端口

You could start by blocking traffic, but you might be working over SSH, where you would need to allow SSH before blocking everything else.

To allow incoming traffic on port 22 (traditionally used by SSH), you could tell iptables to allow all TCP traffic on port 22 of your network adapter.

刚开始时您不妨阻断所有通信,但考虑到您将来可能要使用SSH,那么您要让iptables在使用默认规则丢弃报文之前,允许SSH报文通过。

要开放端口22(SSH的默认端口),您要告诉iptables允许接受到的所有目标端口为22的TCP报文通过。

# iptables -A INPUT -p tcp -i eth0 --dport ssh -j ACCEPT

Specifically, this appends (-A) to the table INPUT the rule that any traffic to the interface (-i) eth0 on the destination port for ssh that iptables should jump (-j), or perform the action, ACCEPT.

执行上面的命令,一条规则会被追加到INPUT规则表的末尾(-A表示追加)。根据这条规则,对所有从接口eth0(-i指出对通过哪个接口的报文运用此规则)接收到的目标端口为22的报文,iptables要执行ACCEPT行动(-j指明当报文与规则相匹配时应采取的行动)。

Lets check the rules: (only the first few lines shown, you will see more)

我们来看看规则表中的情况:(这里只列出了开始的几行,您应该会看到更多内容)

# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh

Now, let’s allow all web traffic

现在我们开放端口80:

# iptables -A INPUT -p tcp -i eth0 --dport 80 -j ACCEPT

Checking our rules, we have

此时的规则表中的内容如下:

# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:www

We have specifically allowed tcp traffic to the ssh and web ports, but as we have not blocked anything, all traffic can still come in.

通过上述命令,我们已经代开了SSH和web服务的相应的端口,但由于没有阻断任何通信,因此所有的报文都能通过。

[编辑]Blocking Traffic 阻断通信

Once a decision is made about a packet, no more rules affect it. As our rules allowing ssh and web traffic come first, as long as our rule to block all traffic comes after them, we can still accept the traffic we want. All we need to do is put the rule to block all traffic at the end. The -A command tells iptables to append the rule at the end, so we’ll use that again.

对每一个报文,iptables依次测试每一条规则,看报文与规则是否相匹配。一旦找到一条匹配的规则,就根据此规则中指定的行动,对报文进行处置,而对后面的规则不再进行测试。因此,如果我们在规则表的末尾添加一条规则,让iptables丢弃所有报文,但由于有了前面几条规则,ssh和web的正常通信不会受到影响。

# iptables -A INPUT -j DROP
# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:www
DROP       all  --  anywhere             anywhere

Because we didn’t specify an interface or a protocol, any traffic for any port on any interface is blocked, except for web and ssh.

在上面的规则中,没有明确指出针对哪个接口或哪种协议使用此规则,所以从每个接口接收到的除ssh和web之外的所有报文都会被丢弃。

[编辑]Editing iptables 编辑iptables

The only problem with our setup so far is that even the loopback port is blocked. We could have written the drop rule for just eth0 by specifying -i eth0, but we could also add a rule for the loopback. If we append this rule, it will come too late – after all the traffic has been dropped. We need to insert this rule onto the fourth line.

进行至此,仍有一个问题,就是环回接口也被阻断了。刚才添加DROP规则的时候其实就可以使用-i eth0来解决这一问题。然而我们也可以为环回接口添加一条新规则来解决这个问题。但是不能将新规则追加到末尾,因为前一条规则已经把所有报文都丢弃了,而应该把它插到DROP规则前面,即规则表中第四行的位置。

# iptables -I INPUT 4 -i lo -j ACCEPT
# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:www
ACCEPT     all  --  anywhere             anywhere
DROP       all  --  anywhere             anywhere

The last two lines look nearly the same, so we will list iptables in greater detail.

规则表中的最后两行几乎一样,为了看看它们到底有什么不同,我们可以使用

# iptables -L -v

[编辑]Logging 记录

In the above examples none of the traffic will be logged. If you would like to log dropped packets to syslog, this would be the quickest way:

在前面的例子中,没有任何报文会被记录到日志中。如果您希望将被丢弃的报文记录到syslog中,最简单的方法是:

# iptables -I INPUT 5 -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7

See Tips section for more ideas on logging.

更多关于日志记录的信息,请参照Tips(技巧)这一节。

[编辑]Saving iptables 保存设置

If you were to reboot your machine right now, your iptables configuration would disapear. Rather than type this each time you reboot, however, you can save the configuration, and have it start up automatically. To save the configuration, you can use iptables-saveand iptables-restore.

机器重启后,iptables中的配置信息会被清空。您可以将这些配置保存下来,让iptables在启动时自动加载,省得每次都得重新输入。iptables-saveiptables-restore 是用来保存和恢复设置的。

[编辑]Configuration on startup 开机自动加载配置

Save your firewall rules to a file

先将防火墙规则保存到/etc/iptables.up.rules文件中

# iptables-save > /etc/iptables.up.rules

Then modify the /etc/network/interfaces script to apply the rules automatically (the bottom line is added)

然后修改脚本/etc/network/interfaces,使系统能自动应用这些规则(最后一行是我们手工添加的)。

auto eth0
iface eth0 inet dhcp
pre-up iptables-restore < /etc/iptables.up.rules

You can also prepare a set of down rules and apply it automatically

当网络接口关闭后,您可以让iptables使用一套不同的规则集。

auto eth0
iface eth0 inet dhcp
pre-up iptables-restore < /etc/iptables.up.rules
post-down iptables-restore < /etc/iptables.down.rules

[编辑]Tips 技巧

[编辑]If you manually edit iptables on a regular basis 如果你经常手动编辑iptables

The above steps go over how to setup your firewall rules and presume they will be relatively static (and for most people they should be). But if you do a lot of development work, you may want to have your iptables saved everytime you reboot. You could add a line like this one in /etc/network/interfaces:

大多数人并不需要经常改变他们的防火墙规则,因此只要根据前面的介绍,建立起防火墙规则就可以了。但是如果您要经常修改防火墙规则,以使其更加完善,那么您可能希望系统在每次重启前将防火墙的设置保存下来。为此您可以在/etc/network/interfaces文件中添加一行:

pre-up iptables-restore < /etc/iptables.up.rules
post-down iptables-save > /etc/iptables.up.rules

The line “post-down iptables-save > /etc/iptables.up.rules” will save the rules to be used on the next boot.

“post-down iptables-save > /etc/iptables.up.rules”会将设置保存下来,以便下次启动时使用。

[编辑]Using iptables-save/restore to test rules 使用iptables-save/restore测试规则

If you edit your iptables beyond this tutorial, you may want to use the iptables-save and iptables-restore feature to edit and test your rules. To do this open the rules file in your favorite text editor (in this example gedit).

使用iptables-save和iptables-restore可以很方便地修改和测试防火墙规则。首先运行iptables-save将规则保存到一个文件,然后用编辑器编辑该文件。

# iptables-save > /etc/iptables.test.rules
# gedit /etc/iptables.test.rules

You will have a file that appears similiar to (following the example above):

如果您根据前面的例子建立了防火墙规则,iptables-save将产生一个类似于如下内容的文件:

# Generated by iptables-save v1.3.1 on Sun Apr 23 06:19:53 2006
*filter
:INPUT ACCEPT [368:102354]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [92952:20764374]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7
-A INPUT -j DROP
COMMIT
# Completed on Sun Apr 23 06:19:53 2006

Notice that these are iptables commands minus the iptable command. Feel free to edit this to file and save when complete. Then to test simply:

文件内容其实就是各种iptables命令,只不过把命令名iptables省略了。您可以随意对这个文件进行编辑,然后保存。接着使用以下命令测试修改后的规则:

# iptables-restore < /etc/iptables.test.rules

After testing, if you have not added the iptables-save command above to your /etc/network/interfaces remember not to lose your changes:

之前您如果没有在/etc/network/interfaces文件中添加iptables-save命令,那么测试之后,别忘了把您所作的修改保存起来。

# iptables-save > /etc/iptables.up.rules

[编辑]More detailed Logging 关于日志记录的更多细节

For further detail in your syslog you may want create an additional Chain. This will be a very brief example of my /etc/iptables.up.rules showing how I setup my iptables to log to syslog:

您可以创建额外的规则链,以便在syslog中作更加详细的记录。以下是我/etc/iptables.up.rules文件中的一个简单例子:

# Generated by iptables-save v1.3.1 on Sun Apr 23 05:32:09 2006
*filter
:INPUT ACCEPT [273:55355]
:FORWARD ACCEPT [0:0]
:LOGNDROP - [0:0]
:OUTPUT ACCEPT [92376:20668252]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -j LOGNDROP
-A LOGNDROP -p tcp -m limit --limit 5/min -j LOG --log-prefix "Denied TCP: " --log-level 7
-A LOGNDROP -p udp -m limit --limit 5/min -j LOG --log-prefix "Denied UDP: " --log-level 7
-A LOGNDROP -p icmp -m limit --limit 5/min -j LOG --log-prefix "Denied ICMP: " --log-level 7
-A LOGNDROP -j DROP
COMMIT
# Completed on Sun Apr 23 05:32:09 2006

Note a new CHAIN called LOGNDROP at the top of the file. Also, the standard DROP at the bottom of the INPUT chain is replaceed withLOGNDROP and add protocol descriptions so it makes sense looking at the log. Lastly we drop the traffic at the end of the LOGNDROPchain. The following gives some idea of what is happening:

  • --limit sets the number of times to log the same rule to syslog
  • --log-prefix "Denied..." adds a prefix to make finding in the syslog easier
  • --log-level 7 sets the syslog level to informational (see man syslog for more detail, but you can probably leave this)

可以看到,文件前面多了一条名为LOGNDROP的规则链。此外,INPUT链最后一条规则中的DROPLONGDROP替代。并且在后面我添加了一些内容来描述报文所使用的协议,这可以让记录更容易理解。最后,在LOGNDROP链的末尾,报文被丢弃。

  • --limit 对由此规则引发的记录事件的频率进行限制。
  • --log-prefix "Denied..." 在每条记录前加上一个前缀,以便查找。
  • --log-level 7 将记录的详细程度设为“informational”等级(详情请见man syslog,您也可以直接使用此处的设置)。

[编辑]Disabling the firewall 禁用防火墙

If you need to disable the firewall temporarily, you can flush all the rules using

可以通过清除所有规则来暂时停止防火墙: (警告:这只适合在没有配置防火墙的环境中,如果已经配置过默认规则为deny的环境,此步骤将使系统的所有网络访问中断)

# sudo iptables -F

[编辑]Easy configuration via GUI 通过GUI快速配置

A newbie can use Firestarter (a gui), available in repositories (Synaptic or apt-get) to configure her/his iptable rules, without needing the command line knowledge. Please see the tutorial though… Configuration is easy, but may not be enough for the advanced user. However, it should be enough for the most home users… The (read:my) suggested outbound configuration is “restrictive”, with whitelisting each connection type whenever you need it (port 80 for http, 443 for secure http -https-, 1863 for msn chat etc) from the “policy” tab within firestarter. You can also use it to see active connections from and to your computer… The firewall stays up once it is configured using the wizard. Dialup users will have to specify it to start automatically on dial up in the wizard.

Firestarter是一款图形界面的防火墙工具,您可以从软件库中得到它。(用“新立得”或者apt-get安装)使用Firestarter并不需要掌握命令行方式下的配置方法。想了解它的用法,请阅读相应的教程…… Firestarter使用简单,虽然可能无法实现某些较为复杂的功能,但仍可满足大多数家庭使用的要求。对于从您的主机发送到网络的报文,firestarter推荐使用“restrictive”配置方案。这种方案要求您在清单中指明哪些报文是可以通过的,除此之外的所有报文都将被丢弃。您可以在firestarter的“policy”选项卡中改变配置方案。您也可以使用firestarer查看当前有哪些活动连接…… 当配置向导运行结束后,防火墙就建立起来了。拨号用户必须在配置向导中进行设定,以使防火墙在拨号后自动建立起来。

Homepage for firestarter: http://www.fs-security.com/ (again, available in repositories, no compiling required)

Tutorial: http://www.fs-security.com/docs/tutorial.php

Personal note: Unfortunately, it does not have the option to block (or ask the user about) connections of specific applications/programs… Thus, my understanding is that once you enable port 80 (i.e. for web access), any program that uses port 80 can connect to any server and do anything it pleases…

Firestarter主页:http://www.fs-security.com/ (再次声明,firestarter已经收入软件库,不需要您自己编译)

firestarer教程: http://www.fs-security.com/docs/tutorial.php

注意事项:这款软件不会阻止(或者询问用户是否阻止)特定的程序访问网络。因此,根据我的使用经验,一旦您开启端口80(web服务),任何程序都可以使用此端口进行通信。

[编辑]Further Information 更多技术细节

[编辑]Credits 贡献者

Thanks to Rusty Russell and his How-To, as much of this is based off that.

感谢Rusty Russell和他写的How-To。

Pidgin 新QQ插件:pidgin-lwqq

Pidgin 新QQ插件:pidgin-lwqq27条评论

发表于2012-11-21    分类:软件    12,832

pidgin-lwqq 是一个基于webqq协议和lwqq库的pidgin插件。能实现简单的QQ 聊天功能,能够接收文件接收图片群聊天、发送简易的表情。

会自动转换pidgin 的表情为QQ 的默认表情,对方发送第三方表情的时候会自动转换成图片的形式,体验不错。

下面是Pidgin-LWQQ 的使用截图:

新协议WEBQQ:

互聊成功(会有1S左右的延迟):

接收图片:

接收文件(未尝试大文件):

发送成功:

注:测试的两个QQ 的Q名都是lingyired ,一个在WEBQQ 端,另一个在lwqq 端。

由于测试时间短,没出现被腾讯T 的情况,不清楚稳定性。如发生意外,我会在此文更新情况,如果离发文时间很久这句话还在,证明lwqq 的稳定性优秀。

项目首页:https://github.com/xiehuc/pidgin-lwqq

pidgin-lwqq 安装(Ubuntu 和LD用户):

 sudo add-apt-repository ppa:lainme/pidgin-lwqq
 sudo apt-get update
 sudo apt-get install libpurple0 pidgin-lwqq

注,此插件需要配合pidgin,所以没有安装pidgin 的,请查看此文《ubuntu下多种聊天工具集合:pidgin 》

转载请注明:Ubuntusoft » Pidgin 新QQ插件:pidgin-lwqq

Ubuntu12.10 下 PPA安装搜狗输入法 for Linux

Ubuntu12.10 下 PPA安装搜狗输入法 for Linux

发表于2013-04-01    分类:软件    5,636

目前的搜狗输入法 for Linux 是Linux Deepin 社区版的测试版,基于Fcitx 框架。

话不多说,直接上。

安装环境为Ubuntu 12.10

准备工作:卸载Ubuntu默认的ibus输入法:

sudo apt-get remove ibus

然后添加Fcitx 源:

sudo add-apt-repository ppa:fcitx-team/nightly
sudo apt-get update

然后 安装fcitx,搜狗输入法,Google输入法,云输入法,以及设置fcitx为默认:

sudo apt-get install fcitx fcitx-config-gtk fcitx-sunpinyin fcitx-googlepinyin fcitx-module-cloudpinyin  fcitx-sogoupinyin
sudo apt-get install fcitx-table-all
im-switch -s fcitx -z default

完成之后重起即可!

Gedit中文乱码

1.from ubuntucn wiki

Gedit中文乱码

缺省配置下,用 Ubuntu 的文本编辑器(Gedit)打开GB18030(繁体中文用户请将这里的出现的GB18030替换成BIG5-HKSCS)类型的中文编码文本文件时,将会出现乱码。

出现这种情况的原因是,Gedit 使用一个编码匹配列表,只有在这个列表中的编码才会进行匹配,不在这个列表中的编码将显示为乱码。您要做的就是将 GB18030 加入这个匹配列表。

目录

[隐藏]

[编辑]Gedit 3.x 版本设置 (适用于Ubuntu 11.10及以后)

[编辑]命令方式

gsettings set org.gnome.gedit.preferences.encodings auto-detected “[‘GB18030’, ‘UTF-8’, ‘GB2312’, ‘GBK’, ‘BIG5’, ‘CURRENT’, ‘UTF-16’]”

[编辑]图形方式

  1. 运行gconf-editor
  2. 展开/org/gnome/gedit/preferences/encodings
  3. auto-detected的Value中加入 ‘GB18030’ ,加在CURRENT前面;

[编辑]Gedit 2.x 版本设置 (适用于Ubuntu 11.04及以前)

[编辑]命令方式

gconftool-2 --set --type=list --list-type=string /apps/gedit-2/preferences/encodings/auto_detected "[UTF-8,CURRENT,GB18030,ISO-8859-15,UTF-16]"

[编辑]图形方式

  1. 运行gconf-editor
  2. 展开/apps/gedit-2/preferences/encodings
  3. 在auto_detected键中新增GB18030,并使它位于CURRENT前面,确定。

 

2.from 耀华.info

ubuntu 下gedit默认编码为UTF-8,而在windows下编写得txt默认编码位GBK,所以在windowx下面的txt用getdit打开则为乱码,解决方案:
在终端下输入:gsettings set org.gnome.gedit.preferences.encodings auto-detected “[‘UTF-8’, ‘GB18030’, ‘GB2312’, ‘GBK’, ‘BIG5’, ‘CURRENT’, ‘UTF-16’]”
然后继续输入:gsettings set org.gnome.gedit.preferences.encodings shown-in-menu “[‘UTF-8’, ‘GB18030’, ‘GB2312’, ‘GBK’, ‘BIG5’, ‘CURRENT’, ‘UTF-16’]”
这是在终端下设置的,同图形化界面,则安装 dconf-editor
sudo apt-get install dconf-tools
终端中输入命令:$ dconf-editor
依次点开->org->gnome->gedit->preferences->encodings
但是我改变里面得参数值,最终还是没有效果,原因不明,但是这里可以看到默认编码是什么。

Linux下Android手机刷机指南

Linux下Android手机刷机指南

现在用的手机是前年这个时候买的Moto Defy,由于工作比较忙没时间折腾它,直到今年的11月份也一直用的是Android 2.1系统。不过随着身边用Android的同事陆续多了起来,看到他们用的Android 2.3系统还不错,终于在前些天忍不住了,经历了我人生中第二次刷机经历。

为什么是第二次刷机经历?其实这也是另一个我一直不刷机的原因。以前在大学时玩过Moto P2k类型的手机,甚至由于感兴趣还做过主题包和ROM,IT168的Moto论坛现在还能找到我当时发的一些精品贴,所以知道刷机没什么技术含量也没什么意思。这次的刷机经历我的感受还是和以前一样,糟透了。大家整天都喊这刷机刷机,却很少有人真正去把刷机这件小事当回事儿,以至于我在刷机时遇到很多问题时最后都是参照国外论坛里面的解决方案解决,国内根本找不到。尤其像Linux用户,Linux的下刷机方案更是少之又少少之又少!所以,我觉得有必要写一篇blog记录一下,希望能帮到其他Linux&Android用户。

本指南将会以Moto Defy为例告诉你关于Android刷机的一切相关知识,我会尽全力来向你解释这款手机如何工作,怎么去Root,怎么安装SBF。最重要的是:这些固件如何起作用,这样你就不会因为安装一个不正确的Rom而让你的手机变砖了。

(注意:对你手机造成的任何破坏,我可概不负责 :D )

一、为什么你的Android手机不会“变砖”? 被锁的Bootloader,这又是什么意思?

对一些人来讲,被锁的Bootloader这个设置比较操蛋,而对大多数人来讲(一般不是高级玩家),这确实是一个相当酷的功能,这相当于给你的手机加了一道保险。这个锁定的Bootloader, 就意味着你没有办法重写官方的Bootloader, 或者官方版的Recovery。

当手机打开Bootloader的时候,也就意味着基本上手机的全部硬件都打开了,手机处于可用的状态。我们就能使用官方恢复功能,手机的这一个功能也被锁定,它既不能被删除,也不能被修改,但它具有恢复出厂功能,以及安装升级包的功能。

起初的时候,这个设置造成了一定的麻烦,因为有了这个被锁的Bootloader,你就没有办法安装一个像CM一样自定义的Rom。这时,2nd Init登场了,这个不起眼的应用可以在Bootloader运行之后取得权限,允许Defy去加载一个不同的,非官方版的Android版本。

你甚至可以安装一个自定义的恢复软件,这个恢复软件可以在手机内存中运行,而不是从手机恢复分区中运行,这意味着什么呢?这就是说,即使你的手机变成砖了,或者不慎删除了你的资料,又或者手机系统分区出现问题,你都可以利用它来进行恢复,手机仍能够被RSD(Linux下的一个刷机脚本,Windows下叫RSD Lite,很老的刷机软件了。)以引导模式状态来识别,手机还能够用官方或者修改的Rom重新刷机。这样,手机又能正常使用了。

幸亏有了这个被锁的Bootloader, 这样即使你想把Android变砖也相当困难。

国内论坛中出现的众多问题实际上并不是真的变砖了,而是没有正确的刷SBFs。手机要是真的变砖了就意味着手机不能加载引导程序,也不能初始化手机硬件,这时你就需要用JTAG来直接重新给你的手机写程序(这个软件我也不是很确定能不能在Defy上使用。)

二、root你的Android!

什么是root,为什么人人都在讨论它?

Android手机本质是Linux系统,生来文件系统就是被锁定的,这就是说用户只能对手机进行一些简单的操作,安装/卸载 应用程序,更换手机铃声或者其他的一些基本的东西。你可以看到系统文件,但是不能对其进行操作,也不能更改Android系统的实际操作。

ROOT也就是说你可以像Linux系统管理员一样来访问手机系统。也就说你可以访问和改变系统文件,删除/创建 文件或文件夹等等。想要安装像2ndInit一样需要访问Android系统文件的权限的应用的话,你就得取得读写系统文件的权限。

庆幸的是,给Defy Root是一件相对简单的事情,而且一般不会有什么问题。

友情提示:如果你买的是国行手机,取得root权限会使设备无法保修。

获取root权限:

1.安装ADB。

1.)下载ADB for Linux的工具包,解压到你便于找到的地方。下载地址
2.)新建并编辑一个文件:

1
sudo vi /etc/udev/rules.d/51-android.rules

在里面写入:

1
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"

其中ATTR{idVendor}的值不同厂商的标识不一样,请按照自己的手机更改。参照表如下:

Manufacturer USB Vendor ID
Acer 0502
Dell 413c
Foxconn 0489
Garmin-Asus 091E
HTC (Older Phones) 0bb4
HTC (Newer phones) 18d1
Huawei 12d1
Kyocera 0482
LG 1004
Motorola 22b8
Nexus One/S 18d1
Nvidia 0955
Pantech 10A9
Samsung 04e8
Sharp 04dd
Sony Ericsson 0fce
ZTE 19D2

3.)保存退出,设置权限:

1
sudo chmod a+rx /etc/udev/rules.d/51-android.rules

4.)编辑 ~/.bashrc 文件加入ADB tool的路径:

1
vi ~/.bashrc

在末尾加入刚下载的工具包解压的路径:

1
export PATH=${PATH}:/home/rabbit/Documents/platform-tools

5.)重启你的Ubuntu,然后USB连接手机,确保usb调试已打开,在终端下输入

1
2
adb start-server
adb devices

如果一切正常,就能显示出当前连接到电脑的android设备。

2. 下载 rageinthecage-arm5和 Superuser package:

rageagainstthecage-arm5:下载地址
md5: bfa28d457b54508326ab55d11399c586
Superuser package:下载地址
md5: 43d9a40b63e916635d5ad7ca32433fab

3.解压 rageinthecage-arm5 和 Superuser package 到 adb 所在目录(Android SDK 安装目录的 /platform-tools 下)。
4.用 USB 数据线将 Motorola Defy 连上电脑。
5.在电脑上打开终端并运行下列命令:

1
2
3
4
adb push rageagainstthecage-arm5.bin /data/local/tmp/
adb shell
chmod 755 /data/local/tmp/rageagainstthecage-arm5.bin
/data/local/tmp/rageagainstthecage-arm5.bin

运行完毕后继续执行下列命令:

1
2
3
4
exit
adb kill-server
adb start-server
adb shell

注意:这时命令行的提示符应该是“#”。如果你看到的是“$”说明命令没有正确执行,请重试第4和第5步。

1
2
3
4
5
mount -o rw,remount /system
exit
adb push su /system/xbin/
adb shell chmod 4755 /system/xbin/su
adb push Superuser.apk /system/app/

6.现在,你的 Motorola Defy 现在就拥有 ROOT 权限了。

三、刷机!

1.Linux下刷入SBF文件

什么是SBF?

SBF文件是Android打包的刷到你手机上全部信息的一个刷机包。在这个刷机包中,有众多的文件,每个文件都以CG XX命名,XX是数字,表示一个序号。

所以,当你给手机刷一个完整版的SBF文件时,它会先取得手机内存权限、格式化内存、创建新的分区,然后把刷机包中的文件拷贝到新的分区中。每个分区都对应着一个CG XX的文件。

刷机包中包含着众多的CG文件,这些CG文件中含有Android系统的版本号。假设你在用Android 2.0,第一版,没有任何升级包,没有任何其他乱七八糟的应用。这个版本的版本号就是第一版。

当手机升级之后,其版本号变成第二版,以此类推。每个Android版本都有独有的一个ID, 一旦你升级了,你就不能回滚到上个版本,在这个版本信息中保存在刷机包的CG31和CG39的文件中。

SBF修改版

这个版本就是说移除CG31和CG39的SBF版本,这样就能在不同Android版本中自由迁移。但是,因为修改版的SBF不能创建 /System (CG39) 和nd CDT (CG31)2个分区,我们需要自己用软件Nandroid Backup来复制系统文件,否则的话,手机可能在缺失/System的分区下不能正常使用。

这个软件就是一款能读写的可自定义恢复的zip文件,它能删除/拷贝 /system分区内的所有文件以及其他分区的文件,并且在操作的同时不会格式化分区也不会重新划分分区,这样就既不会修改系统配置。这也就意味着你不可能在操作的时候把你的手机变成砖,但你可能会使Android系统不能启动,新的SBF包或者Nandroid就需要安装。

CG 版本

有了以上的解释,顺便来说说CG版本。

如果你刷机的版本低于手机本来的版本,那么在手机启动之后会看到黑屏,或者是提示你刷一个官方的Rom版本。只要记住这一点,你就可以在不同Android版本之间来回刷机了,这样也不会让你的手机变砖。如果你有一块Android 2.0版的defy,而且希望它一直保持降级的能力,你只需要安装一个你想要的Android版本的修改版SBF,然后用相应的Nandroid来进行恢复系统文件。

官方SBF

这里是所有官方的SBF清单(目前这个清单下载链接已经失效,但可以作为参考,下载请看这个清单),就是说它们都包含全部的CG文件,刷这些SBF后你的手机就像刚从Moto卖给你一样,你要记着刷了这种完整的SBF包进行升级,你就不能降级到一个低版本了。了解了这些,你就应该能尝试不同的Android版本咯,也能毫无压力的去商店咯。只要弄清楚CG文件的原理,大胆刷机吧。

Do it!

0.)保持你的手机电量超过50%。(至少!)
1.)下载你想刷的SBF文件。
2.)下载sbf_flash文件到你的ADB目录下:下载sbf_flash作者blog
3.)

1
2
chmod +x sbf_flash
sudo ./sbf_flash xxxxxx.sbf

现在,命令行应该会提示你重启手机到bootloader模式。

2.通过fastboot刷入img文件

1.)下载fastboot:点击下载
2.)

1
2
sudo chmod a+x fastboot
sudo ./fastboot devices

成功识别到设备会出现一行字,如果没有成功则什么都没有。
3.)写一个文件到闪存分区,如写入一个文件到boot分区:

1
sudo ./fastboot boot XXX.img

友情提示:想要从任何一个ROM版降级,你只需要刷装一个完整版的官方版的SBF(切记检查CG版本)。

四、常见问题及解决办法:
1.启动的时候黑屏:尝试安装一个比目前手机系统中CG版本更低的系统。
2.安装修改版SBF后出现灵异问题:安装一个与手机SBF相匹配的Nandroid备份,记着先在Recovery模式中清除系统缓存。
3.如何进入恢复模式?同时按下手机电源键和音量减,直到屏幕上出现一个黄色的三角形,一旦看到这个,就意味着进入了recovery模式。现在同时按住音量加、音量减,屏幕上就会出现一个菜单,如果你的是 Éclair 版,不用按任何键就会出现这个菜单。
4.如何进入Bootloader模式?按住电源键和音量+键直到手机屏幕上出现一些白色的字,这就进入了Bootloader模式。

五、参考文章:
Motorola Defy: Full Update Guide
All-in-One Defy Beginner’s guide
How to root Defy via Linux!
Fastboot

写的有点乱,若在刷机中遇到其他问题,欢迎留言探讨!

最后,新年快乐!

Copyleft

GNU 自由文档许可证是将copyleft的形式应用于手册,说明书或者其他文档,以确保任何人都有复制和重新分发文档的充分的自用,无论是否修改过,无论是否用于商业目的。| GNU Free Documentation License

本文链接地址: http://blog.SeanChang.me/the-guide-of-falsh-the-android-system-on-the-linux.html