But the scenario is an i386 Debian is already installed on a machine that has a x86_64 CPU, and I want to bootstrap a x86_64 Debian on it. Can this be done?
The answer is yes, with a bit more extra work.
First install a x86_64 kernel, so that debootstrap can run x86_64 apps in the chroot. An i386 system can run under a x86_64 kernel, and Debian has prepared everything for you, just:
1 2 3 |
|
Select x86_64 kernel in the grub menu and boot, and the rest is just a normal debootstrap process:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Exit chroot and add the new entry in grub’s config file, reboot. Now you have a newly installed x86_64 Debian.
For more detail, see this chapter of Debian GNU/Linux Installation Guide and debootstrap manual.
]]>alt+tab
a lot when playing war3, maybe here is what you
want.
In normal fullscreen mode of war3, video display mode will change and cause flicking every time you alt-tab out and in. This is annoying.
Add -window
param to the war3 startup shortcut, this will let war3 run in
window mode. Use this piece of autohotkey script to remove the window
decoration and border, and make window fullscreen:
1 2 |
|
Script file here, base on Window Tools.
]]>$ git clone git://git.debian.org/git/buildd-tools/buildd.git
$ cd buildd && debuild binary
# dpkg -i ../buildd_*.deb
# aptitude install sbuild wanna-build buildd quin-diff dupload reprepro inoticoming
create chroots, watch final output:
# useradd -m -s /bin/bash buildd
# sbuild-createchroot --include="pkg-config" --arch=i386 sid /home/buildd/chroot/unstable http://ftp.debian.org/debian
refine auto added schroot config file:
# mv /etc/schroot/chroot.d/sid-i386-sbuild.pk4BSL /etc/schroot/chroot.d/sid-i386-sbuild
# edit /etc/schroot/chroot.d/sid-i386-sbuild, add [unstable-i386-sbuild]
edit /home/buildd/chroot/unstable/etc/apt/sources.list and /home/buildd/chroot/unstable/etc/apt/preferences:
add local repo to sources.list:
deb http://your-repo/debian sid main
deb-src http://your-repo/debian sid main
prefer local repo:
Package: *
Pin: release o=Azuwis, a=unstable # (for o=Azuwis, see reprepro setup)
Pin-Priority: 1000
Package: *
Pin: release a=unstable
Pin-Priority: 500
let user buildd use sbuild:
# sbuild-adduser buildd
# su - buildd
$ cp /usr/share/doc/sbuild/examples/example.sbuildrc ~/.sbuildrc
$mailto='azuwis@163.org';
$apt_update = 1;
$key_id = 'Azuwis Debian Repository Build Daemon <azuwis@163.org>';
$pgp_options = '';
generate gpg key for sbuild to sign and upload:
$ echo -n "" | gpg
$ echo -n "" | gpg
$ gpg --gen-key
... use 'Azuwis Debian Repository Build Daemon <azuwis@163.org>'
test sbuild and gpg sign, watch ouput and email:
$ sbuild hello_2.2-3
$ mkdir -p .ssh build logs mqueue old-logs stats/graphs upload upload-security
$ chmod o= .ssh upload-security old-logs mqueue logs build
$ zcat /usr/share/doc/buildd/examples/buildd.conf.gz > buildd.conf
$admin_mail = 'azuwis@163.org';
$statistics_mail = 'azuwis@163.org';
$dupload_to = "azuwis"; # see dupload below
$ zcat /usr/share/doc/buildd/examples/crontab.gz > cronjob
10,25,40,55 * * * * /usr/bin/buildd-uploader
20 * * * * /usr/bin/buildd-watcher
$ crontab cronjob
edit ~/.dupload.conf
package config;
$cfg{'azuwis'} = {
fqdn => "azuwis.people.163.org",
method => "ftp",
incoming => "/pub/UploadQueue/",
login => "anonymous",
dinstall_runs => 1,
};
1;
$ mkdir ~/wanna-build
$ chown 2755 ~/wanna-build
$ cp /etc/buildd/wanna-build.conf ~/.wanna-buildrc
$basedir = "/home/buildd/wanna-build";
$db_maint = 'azuwis@163.org';
$notforus_maint = 'azuwis@163.org';
$log_mail = 'azuwis@163.org';
$stat_mail = 'azuwis@163.org';
$web_stats = "/home/buildd/wanna-build/stats.txt";
# useradd -m -s /bin/bash reprepro
# su - reprepro
edit conf/distributions:
Origin: Azuwis
Label: Azuwis
Suite: unstable
Codename: sid
Architectures: i386 source
Components: main
Description: Random packages not in offical Debian archive
SignWith: yes
Uploaders: uploaders
DscIndices: Sources Release . .gz .bz2
DebIndices: Packages Release . .gz .bz2
Origin: Azuwis
Label: Azuwis
Suite: experimental
Codename: experimental
AlsoAcceptFor: UNRELEASED
Architectures: i386 source
Components: main
Description: Random packages not in offical Debian archive and experimental; use at your own risk.
SignWith: yes
NotAutomatic: yes
Uploaders: uploaders
DscIndices: Sources Release . .gz .bz2
DebIndices: Packages Release . .gz .bz2
edit conf/uploaders, only allow some users to upload, gpg pubkeys need to be imported, see below for how to get key-id and how to import:
allow * by key 5F617B74853F1566 # Azuwis Debian Repository Build Daemon <azuwis@163.org>
edit conf/incoming:
Name: incoming
IncomingDir: incoming
TempDir: temp
Allow: unstable>sid experimental>experimental UNRELEASED>experimental
prepare for ftp upload:
# chown reprepro:nogroup /home/ftp/pub/UploadQueue # (nogroup is user ftp's main group)
# chmod 01775 /home/ftp/pub/UploadQueue
$ ln -s /home/ftp/pub/UploadQueue /home/reprepro/incoming
auto process incoming using inoticoming:
$ cp /usr/share/doc/inoticoming/examples/cronjob ~/
@reboot inoticoming --logfile /home/reprepro/logs/inoticoming.log /home/reprepro/incoming/ --stderr-to-log --stdout-to-log --suffix '.changes' --chdir /home/reprepro reprepro -b /home/reprepro processincoming incoming {} \;
import user buildd’s gpg key, import other users’ in the same way, remember add key-id to conf/uploaders:
buildd@:~$ gpg --with-colons --list-secret-keys
sec::1024:17:5F617B74853F1566:2008-12-16::::Azuwis Debian Repository Build Daemon <azuwis@163.org>:::
ssb::2048:16:04A6D58060BC8BE7:2008-12-16:::::::
buildd@:~$ gpg -a --export 5F617B74853F1566 > ~/buildd.asc
reprepro@:~$ gpg --import /home/buildd/buildd.asc
export reprepro’s gpg pubkey to public:
reprepro@:~$ gpg --with-colons --list-secret-keys
sec::1024:17:43A170358765EF08:2008-11-28::::Azuwis' Debian Repository <azuwis@gmail.com>:::
ssb::2048:16:2CEB4DD6864C12E2:2008-11-28:::::::
reprepro@:~$ gpg -a --export 43A170358765EF08 > reprepro.asc
trust local repo in sbuild chroots:
# sbuild-shell unstable
# apt-key add /home/reprepro/reprepro.asc
$ dpkg --compare-versions 1.5.1 gt 1.5.1~svn && echo "1.5.1 is greater"
1.5.1 is greater
And there’re some api in package libapt-pkg-perl to, see:
$ /usr/share/doc/libapt-pkg-perl/examples/apt-version compare 1.5.1~svn 1.5.1
[System: Debian dpkg interface; Versioning type: Standard .deb]
* package version `1.5.1~svn' is earlier than `1.5.1'
]]># aptitude install pastebinit
就可以安装,使用很简单:
$ pastebinit file_to_paste
http://pastebin.com/f2a9b78ec
]]>For example, fusion-icon, in compiz-fusion debian repository by shames, depends on compiz-kde | compiz-gnome.
In fact, compiz-kde or compiz-gnome are not necessary. If the desktop environment is Xfce or KDE4, those packages are not needed at all.
So, here is how to directly modify deb packages without recompiling, remove dependence:
# apt-cache policy fusion-icon
fusion-icon:
Installed: (none)
Candidate: 0.1.2+git20080216.shame-1
Version table:
0.1.2+git20080216.shame-1 0
500 http://download.tuxfamily.org ./ Packages
0.0.0+git20071028-3 0
500 http://ftp.debian.org lenny/main Packages
300 http://ftp.debian.org sid/main Packages
# aptitude download fusion-icon=0.1.2+git20080216.shame-1
# dpkg-deb -x fusion-icon_0.1.2+git20080216.shame-1_amd64.deb deb/
# dpkg-deb -e fusion-icon_0.1.2+git20080216.shame-1_amd64.deb deb/DEBIAN/
# vi deb/DEBIAN/control ...edit the file
# dpkg-deb -b deb/ my.deb
# dpkg -i my.deb
]]>比较简单的方法是把原来的 *.ko 文件直接替换,但这样有不好的地方,如果想换回来,比较麻烦。
较好的方法是把模块装在 /lib/modules/`uname -r`/updates/
下面,再运行 depmod,这样下次开机自动加载模块,或者用 modprobe 加载模块时,就会用 updates 下面的。如:
# cp libdrm/linux-core/drm.ko /lib/modules/`uname -r`/updates/
# depmod
# /sbin/modinfo drm
filename: /lib/modules/2.6.25-2-amd64/updates/drm.ko
license: GPL and additional rights
description: DRM shared core routines
author: Gareth Hughes, Leif Delgass, José Fonseca, Jon Smirl
depends:
vermagic: 2.6.25 SMP mod_unload
parm: debug:Enable debug output (int)
]]>其实,Firefox 状态栏的图标一般是由扩展产生的,图标的顺序跟扩展的安装顺序对应。通过改扩展的顺序,可以改变状态栏图标的顺序。
在 Firefox 的配置目录(Linux 下为 ~/.mozilla/firefox/*.default/)里,extensions.ini 这个文件记录的是扩展的顺序,如:
[ExtensionDirs]
Extension0=/home/azuwis/.mozilla/firefox/cv7nxof9.default/extensions/firebug@software.joehewitt.com
Extension1=/home/azuwis/.mozilla/firefox/cv7nxof9.default/extensions/{0C4B554C-05D9-11DB-9804-B622A1EF5492}
通过查看 extensions.rdf 这个文件,可以得到扩展的 ID 和名称的对应,如:
<RDF:Description RDF:about="urn:mozilla:item:{73a6fe31-595d-460b-a920-fcc0f8843232}"
...
NS1:name="NoScript"
...
就知道 {73a6fe31-595d-460b-a920-fcc0f8843232} 这个 ID 是对应 NoScript 这个扩展的,根据这点修改 extensions.ini 的内容,改变扩展的顺序,重启 Firefox,状态栏图标的顺序就会跟著改变。
]]>1) I want to select text, why doesn't aptitude let me disable the mouse?
When a program running in an xterm is accessing the mouse, the xterm
disables text selection. However, you can override this behavior and
perform a selection by holding the Shift key down.
So, just hold down shift key, copying and pasting text in aptitude’s curses interface will work as expected.
It’s always good to look at software’s FAQ before using it.
]]>首先是让你的 google calendar 帐号跟你的手机绑定。
下面是一个 ruby 代码实现添加提醒:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
googlecalendar 的 rubygem 可以用 gem install googlecalendar 来安装。
还有 gcalcli 命令行工具,可以管理 google calendar,不喜欢自己写代码的也可以用这个实现。
]]>