Showing posts with label software. Show all posts
Showing posts with label software. Show all posts

Thursday, May 1, 2008

Buring Files bigger than 4GB to DVD

Update2 (5 May 2009) - The issue below is fixed in k3b 1.63 (r948463) in slackware current and cdrtools-2.01.01a57.

Update - Issue: The DVDs burnt using K3B (and cdrtools) cannot be mounted with appropriate permissions using type udf. The permission is "d---------" when mounted. Mounting as iso9660 gives right permission.

After some trying, I finally managed to burn files bigger than 4GB to DVDs.

Required software:
cdrtools-2.01.01a38-i486-1 or later
k3b-1.0.4-i486-3 or later

From www.k3b.org k3b 1.0.4 Annoucement:
K3b now silently allows the burning of files bigger than 4 GB if an appropriate version of genisoimage or mkisofs is installed ("silently" means that I did not introduce any new messages)

Before start burning DVD, change the Filesystem Settings as follows: (see screenshot below)

- Check "Generate UDF structures"
- Select "Level 3" under "ISO Level"














Note if the settings are not appropriate, k3b will still go ahead to burn the DVD, but happily leave out the file that is more than 4GB and close the DVD, effectively wasting the DVD.

Thursday, August 23, 2007

Custom Font Config

<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

<!--
default settings for all fonts.
-->
<match target="font" >
<edit mode="assign" name="rgba" >
<const>rgb</const>
</edit>
</match>
<match target="font" >
<edit mode="assign" name="hinting" >
<bool>true</bool>
</edit>
</match>
<match target="font" >
<edit mode="assign" name="hintstyle" >
<const>hintmedium</const>
</edit>
</match>
<match target="font" >
<edit mode="assign" name="antialias" >
<bool>true</bool>
</edit>
</match>


<!-- disable anti-alias for 8-17 size fonts -->
<match target="font" >

<test compare="contains" name="lang" qual="any">
<string>zh-cn</string>
<string>zh-sg</string>
<string>zh-tw</string>
<string>ja</string>
<string>ko</string>
</test>

<test compare="more_eq" name="pixelsize" qual="any" >
<double>8</double>
</test>
<test compare="less_eq" name="pixelsize" qual="any" >
<double>17</double>
</test>
<edit mode="assign" name="antialias" >
<bool>false</bool>
</edit>
</match>

<!-- the space between English fonts is too wide,solve this problem -->
<match target="font">

<test name="lang" compare="contains" qual="any">
<string>zh-tw</string>
<string>zh-sg</string>
<string>zh-cn</string>
<string>ja</string>
<string>ko</string>
</test>
<edit name="spacing">
<const>proportional</const>
</edit>
<edit name="globaladvance">
<bool>false</bool>
</edit>
</match>

<!--
define the smallest size of Chinese fonts
-->
<match target="font" >
<test name="family" qual="any" >
<string>SimSun</string>
<string>NSimSun</string>
<string>SimHei</string>
<string>AR PL ShanHeiSun Uni</string>
<string>AR PL ZenKai Uni</string>
<string>AR PL New Sung</string>
</test>
<test compare="more_eq" name="pixelsize" >
<int>8</int>
</test>
<test compare="less_eq" name="pixelsize" >
<int>12</int>
</test>
<edit compare="eq" name="pixelsize" >
<int>12</int>
</edit>
</match>
<!--
sort the family of "serif ,sans,monospace",make it fit to Chinese people
-->
<alias>
<family>serif</family>
<prefer>
<family>Times New Roman</family>
<family>Liberation Serif</family>
<family>Nimbus Roman No9 L</family>
<family>Luxi Serif</family>
<family>Times</family>
<family>Bitstream Vera Serif</family>
<family>DejaVu Serif</family>
<family>Simsun</family>
<family>MingLiu</family>
<family>WenQuanYi Bitmap Song</family>
<family>AR PL ShanHeiSun Uni</family>
<family>AR PL ZenKai Uni</family>
<family>AR PL New Sung</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Arial</family>
<family>Verdana</family>
<family>Tahoma</family>
<family>Helvetica</family>
<family>Liberation Sans</family>
<family>Bitstream Vera Sans</family>
<family>DejaVu Sans</family>
<family>SimSun</family>
<family>WenQuanYi Bitmap Song</family>
<family>AR PL ShanHeiSun Uni</family>
<family>AR PL ZenKai Uni</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Courier New</family>
<family>Liberation Mono</family>
<family>Luxi Mono</family>
<family>Andale Mono</family>
<family>Bitstream Vera Sans Mono</family>
<family>Nimbus Mono L</family>
<family>NSimSun</family>
<family>PMingLiu</family>
<family>WenQuanYi Bitmap Song</family>
<family>AR PL ShanHeiSun Uni</family>
<family>AR PL ZenKai Uni</family>
</prefer>
</alias>
<alias>
<family>Courier New</family>
<prefer>
<family>Courier New</family>
<family>Liberation Mono</family>
<family>Bitstream Vera Sans Mono</family>
<family>Nimbus Mono L</family>
<family>Courier</family>
<family>Luxi Mono</family>
<family>Andale Mono</family>
<family>NSimSun</family>
<family>PMingLiu</family>
<family>WenQuanYi Bitmap Song</family>
<family>AR PL ShanHeiSun Uni</family>
<family>AR PL ZenKai Uni</family>
</prefer>
</alias>
</fontconfig>

Saturday, August 4, 2007

转载:让 xterm 与其它程序间复制粘贴更灵活

在 TERM 中选中文字“甲”,需鼠标中键贴入其它程序(如 firefox ),而此时在 firefox 里选中文字“乙”并不 Ctrl-c ,再用鼠标中键贴出,发现贴出“乙”,而“甲”不见了。

需要效果:在 TERM 中选中即可 Ctrl-v 贴入 firefox 一类的程序中,无需鼠标中键。而在 firefox 一类的程序中 Ctrl-c 复制后,鼠标不论再选中什么,在 TERM 中 Shift-Insert 出的依然是 Ctrl-c 的内容

在 Xwindow 里有一个选中缓冲(PRIMARY)和一个剪贴板(CLIPBOARD)
几乎除了 TERM 程序以外,没有还在用选中缓冲的程序
造成 TERM 中选中的,需要鼠标中键才能贴到其它程序里。在贴之前,在其它程序中还不能选中任何东西,一旦选中,选中缓冲就被刷新

a) xterm 功能强大,本身就带剪贴板功能,如下配置即可
在 $HOME/.Xresources 里如下写,可让 xterm 的复制进入剪贴板,不再过选中缓中

*VT100*translations: #override \n\
Shift Insert:insert-selection(CLIPBOARD, CUT_BUFFER1) \n\
~Shift~Ctrl: insert-selection(CLIPBOARD, CUT_BUFFER1) \n\
~Shift: select-end(CLIPBOARD, CUT_BUFFER1)

前两句是说当 Shift-Insert 与鼠标中键(Btn2UP)效果是贴出剪贴板内容
第三句是说当 鼠标左键(BtnUP)效果是复制给剪贴板

这样一来,在 firefox 中任意选中的文字(不 Ctrl-c ),不管是 Shift-Insert 还是鼠标中键都复制不出来了

*VT100*translations: #override \n\
Shift Insert:insert-selection(CLIPBOARD, CUT_BUFFER1) \n\
~Shift~Ctrl: insert-selection(PRIMARY, CUT_BUFFER0) \n\
~Shift: select-end(CLIPBOARD, CUT_BUFFER1) \n\
~Shift: select-end(PRIMARY, CUT_BUFFER0)

这样就让在 firefox 里随意选中的文字,鼠标中键可贴在 TERM 中,而 Ctrl-c 的内容由 Shift-Insert 贴出
当然配置是灵活的,随自己喜欢了。

b) rxvt, aterm, mrxvt, rxvt-unicode 系列,需要一点小修改
这一系列都是基于 rxvt 的,代码相近,下面以 rxvt-unicode 为例:
(无需会编程,不过是替换游戏,把选中缓冲替换为剪贴板)

原理:把选中缓冲(XA_PRIMARY)换成剪贴板(xa[XA_CLIPBOARD])即可
vi rxvt-unicode-8.1/src/screen.C
2895 行:
if (selnum == Sel_Primary)
sel = xa[XA_CLIPBOARD];
else if (selnum == Sel_Secondary)
sel = XA_SECONDARY;
else
sel = XA_PRIMARY;

3066行:
XSetSelectionOwner (dpy, xa[XA_CLIPBOARD], vt, tm);
if (XGetSelectionOwner (dpy, xa[XA_CLIPBOARD]) == vt)

From: http://bbs.linuxsir.org/showthread.php?t=290883