大家来找碴
2007年3月28日星期三
Autopackage安装包
Autopackage是一个专门为Linux系统设计的多重分布式二进制程序打包格式,能够构造,安装,校验和卸载复杂的安装包.
主要功能:
- 构造适用于不同地区的安装包;
- 多种字体终端类型:支持自动选择,GUI用户可获得图形字体终端;命令行用户则可获得文本界面.
- 支持多种语言(工具内部和用户自定义的包);
- 软件安装顺序不限,支持自动校验和解决文件依赖性问题.
目前支持的软件列表: http://autopackage.org/packages/
演示: http://www.autopackage.org/flash-demo-install.html
截图:http://www.autopackage.org/gallery.html
超Cool小游戏GridWars2
在Ubuntu_cn上看到有人介绍就试玩了一把,确实太好玩了.不过实在是太累人了,现在两个胳膊还酸着呢,操作到还顺手.画面太炫了,好几次都不知道怎么就死了.现在最高分960776
Linux版本下载:TLGH
撒野之地有比较详细的游戏介绍,我就不多说了.
关于那个黑洞,在出现早期就应该快速干掉,它不仅会把打出来的武器之类的东西吸收,而且当黑洞吸收的东西一定量之后就会爆炸,并释放好多敌人,满屏都是,跑都没地方跑....-_-"
用 python-mutagen 转换 mp3 标签编码
2007年3月24日星期六
先安装 python-mutagen包,执行
sudo apt-get install python-mutagen
在有 mp3 的目录下执行编码转换
find . -iname "*.mp3" -execdir mid3iconv -e GBK {} \;
这会转换当前目录其子目录中的 mp3 文件标签编码为正确的 utf8 。
----------------------------------
如果你系统里安装了 python-mutagen , 却没有 /usr/bin/mid3iconv ,
那么试试手工建立 /usr/bin/mid3iconv 这个文件吧,
内容如下:
#!/usr/bin/python
#
# file: /usr/bin/mid3iconv
#
# ID3iconv is a Java based ID3 encoding convertor, here's the Python version.
# Copyright 2006 Emfox Zhou
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
import os
import sys
import locale
from optparse import OptionParser
VERSION = (0, 1)
def isascii(string):
return not string or min(string) < '\x127'
class ID3OptionParser(OptionParser):
def __init__(self):
mutagen_version = ".".join(map(str, mutagen.version))
my_version = ".".join(map(str, VERSION))
version = "mid3iconv %s\nUses Mutagen %s" % (
my_version, mutagen_version)
return OptionParser.__init__(
self, version=version,
usage="%prog [OPTION] [FILE]...",
description=("Mutagen-based replacement the id3iconv utility, "
"which converts ID3 tags from legacy encodings "
"to Unicode and stores them using the ID3v2 format."))
def format_help(self, *args, **kwargs):
text = OptionParser.format_help(self, *args, **kwargs)
return text + "\nFiles are updated in-place, so use --dry-run first.\n"
def update(options, filenames):
encoding = options.encoding or locale.getpreferredencoding()
verbose = options.verbose
noupdate = options.noupdate
force_v1 = options.force_v1
remove_v1 = options.remove_v1
def conv(uni):
return uni.encode('iso-8859-1').decode(encoding)
for filename in filenames:
if verbose != "quiet":
print "Updating", filename
if has_id3v1(filename) and not noupdate and force_v1:
mutagen.id3.delete(filename, False, True)
try: id3 = mutagen.id3.ID3(filename)
except mutagen.id3.ID3NoHeaderError:
if verbose != "quiet":
print "No ID3 header found; skipping..."
continue
except Exception, err:
if verbose != "quiet":
print str(err)
continue
for tag in filter(lambda t: t.startswith("T"), id3):
if tag == "TDRC": # non-unicode field
continue
frame = id3[tag]
try:
text = map(conv, frame.text)
except (UnicodeError, LookupError):
continue
else:
frame.text = text
if min(map(isascii, text)):
frame.encoding = 3
else:
frame.encoding = 1
enc = locale.getpreferredencoding()
if verbose == "debug":
print id3.pprint().encode(enc, "replace")
if not noupdate:
if remove_v1: id3.save(filename, v1=False)
else: id3.save(filename)
def has_id3v1(filename):
f = open(filename, 'rb+')
try: f.seek(-128, 2)
except IOError: pass
else: return (f.read(3) == "TAG")
def main(argv):
parser = ID3OptionParser()
parser.add_option(
"-e", "--encoding", metavar="ENCODING", action="store",
type="string", dest="encoding",
help=("Specify original tag encoding (default is %s)" %(
locale.getpreferredencoding())))
parser.add_option(
"-p", "--dry-run", action="store_true", dest="noupdate",
help="Do not actually modify files")
parser.add_option(
"--force-v1", action="store_true", dest="force_v1",
help="Use an ID3v1 tag even if an ID3v2 tag is present")
parser.add_option(
"--remove-v1", action="store_true", dest="remove_v1",
help="Remove v1 tag after processing the files")
parser.add_option(
"-q", "--quiet", action="store_const", dest="verbose",
const="quiet", help="Only output errors")
parser.add_option(
"-d", "--debug", action="store_const", dest="verbose",
const="debug", help="Output updated tags")
for i, arg in enumerate(sys.argv):
if arg == "-v1": sys.argv[i] = "--force-v1"
elif arg == "-removev1": sys.argv[i] = "--remove-v1"
(options, args) = parser.parse_args(argv[1:])
if args:
update(options, args)
else:
parser.print_help()
if __name__ == "__main__":
try: import mutagen, mutagen.id3
except ImportError:
# Run out of tools/
sys.path.append(os.path.abspath("../"))
import mutagen, mutagen.id3
main(sys.argv)
来源:huangjiahua
The Visual History of Ubuntu
2007年3月20日星期二
Ubuntu的视觉历史
原文:http://www.phoronix.com/scan.php?page=article&item=664&num=1
感谢TualatriX翻译并制作为pdf文档.
在 Nautilus 中预览音乐
2007年3月7日星期三
作为 GNOME 桌面中的默认文件管理器,Nautilus 不仅支持预览图片(采用缩略图),而且也能够对音乐文件进行预览。不过,要实现该功能,需要我们额外的安装两个小工具。
Nautilus 中预览音乐文件的设置
在默认情况下,Nautilus 的音乐预览功能是开启的,如果你不确定,可以从 Edit -> Preferences -> Preview 查看到关于 Sound Files 的设置。选择 Always 选项,或者 Local Files Only 选项都可以打开音乐预览功能。
在 Nautilus 中预览 MP3
你需要安装 mpg123,可以通过执行指令 sudo apt-get install mpg123 来完成。
在 Nautilus 中预览 OGG
对于 OGG 格式的音乐文件,你需要 ogg123 这个程序,可以通过 sudo apt-get install vorbis-tools 来安装。
当鼠标指针移到 MP3 或 OGG 音乐文件上面的时候,你就可以听到那优美而熟悉的旋律了。如果需要结束预览,则将鼠标指针移开。
为Ubuntu瘦身
2007年2月21日星期三
大家都知道系统用久了,就会慢慢变得臃肿,速度当然也就会有一些影响,所以当那些加速系统的方法不在奏效的时候,来试试给系统减肥吧.
其实Ubuntu的减肥很简单,只需简单的几步就可以吧那些不需要的文件彻底清除,还你一个清洁的系统..
1. 用新利得删除残留的配置文件
经常安装和卸载软件用户都知道只用 apt-get remove 是不能把软件彻底清除的,所以养成良好的习惯很重要,我一般都是认为那些以后不会再安装的软件都用 aptitude purge/apt-get remove -- purge 来卸载,这样就会把配置文档也一起删除,如果不知道以前卸载的那些配置文档删除有没有怎么办!?
没关系"凡存在过的必留下痕迹"(keso语^_^),我们来一步一步删除那些残留文档:
打开新利得(系统-系统管理-新利得),在左下角选择状态,现在在上面的列表里就会看到如下的分类:
- 已安装
- 已安装(本地的或陈旧的)
- 未安装
- 未安装的(残存配置)
- 软件仓库里的新内容
现在把右面列表里不想保留的配置文件删除就可以了.
2. 删除系统无用的软件包
当你需要安装某个软件包时,APT从/etc/apt/sources.list中所列的主机下载所 需的文件,将它们保存到本机软件库(
/var/cache/apt/archives/), 然后开始安装.本地软件库会不断膨胀占用大量硬盘空间,幸运的是,APT提供了工具来管理本地 软件库:
apt-get的clean方法和autoclean方法.apt-get clean将删除/var/cache/apt/archives目录 和/var/cache/apt/archives/partial目录下锁文件以外的所有文件. 这样以来,当你需要再次安装某个软件包时,APT将重新下载它.apt-get autoclean仅删除那些不需要再次下载的文件.3. 卸载那些不被使用的local翻译文档
这次我们要用到一个工具啦:localepurge 看名字就能明白他是干什么的啦.
安装localepurge: sudo apt-get install localepurge
安装好以后,当我们每次使用apt安装软件的时候localepurge就会根据你locale的设置来删除那些不需要的locale文档,比如:当我aapt安装armarok以后就会在安装完成之后看到像:
localepurge: Disk space freed in /usr/share/locale: 70***K (7M左右的文档,具体的数据忘了)
当然你也可以通过编辑/etc/locale.nopurge 来编辑需要保留的locale文档..
4. 使用一些工具删除"孤儿软件包"
孤儿软件包是指那些已经没有人维护的软件包当然也就没有软件要依赖它,这儿我们可以用GtkOrphan(要自己下载Deb包安装)或者Wajig(可以apt安装),这两个都是GUI的操作界面,我都没有使用过就不多说了,如果想了解更多的信息可以参考这儿 .
5. 使用debfoster来跟踪安装的软件包
安装:sudo apt-get install debfoster
当我们使用apt安装软件的时候,它会把那个软件所依赖的软件包都安装上去,但是当我们卸载这个软件包的时候,那些为满足这个软件包的依赖关系而装上去的包并没有从系统里卸载掉.这个时候我们就会用到debfoster啦.
debfoster是apt-get和dpkg的前端,当第一次运行debfoster的时候它会问你那些软件包是要保留的,如果不需要就选n就行了.
使用debfoster我们可以方便的安装和卸载软件,比如可以使用debfoster package 来安装某个软件,当我们不需要的时候可以用 debfoster package- 来删除它,同时那些没有用的包也会一起删掉.
6. 使用trans-purge 来为Linux桌面瘦身加速
这个可以参考LinuxTOY的介绍,十分详细.
好了经过这几步系统基本上就很清爽了..
Source(感谢):LinuxTOY,Ubuntu Tutorials

