K.I.S.S. – 简单哲学 Linux, Freedom, Arch, Python, Gtk+, C … Keep It Simple, Stupid!

1六/093

舒服干练的发行版——Linux Mint

一直对于 的衍生版很感兴趣,可是至今只装过 Kubuntu,感觉并不是特别顺手,Hiweed 据说挺好,但是 rc 个没完,没兴趣下载。最近听说 Linux Mint 7 发布了,赶紧下来试试。

Linux Mint是一份基于的发行,其目标是提供一种更完整的即刻可用体验,这包括提供浏览器插件、多媒体编解码器、对DVD播放的支持、Java和其他组件。它与软件仓库兼容。

很遗憾,到目前为止,Linux Mint 的 64 位 iso 还没有打好,只好下载了一个 i386 的。值得一提的是官方同样提供一个 Universal 版本,自带了大量的语言支持(包含中文),不过为了在美国、日本等版权保护的国家通用,这个版本移除了默认版本中一些自带的受版权保护的软件和技术,所以如果你不在意从网上下载语言包的话,还是安装默认版本吧~
Linux Mint 的安装和 极为相似,这里就不详细介绍了,值得一提的是,Linux Mint 在安装过程中会自动安装语言包,所以不要像我一样傻乎乎的在安装界面选上英语哦~
安装完成,效果如下:

mint1.png

可以看到,Linux Mint 官方版使用的是 GNOME 桌面环境,另外,社区还提供了 KDE、XFCE、Fluxbox 等版本。Linux Mint 使用了自己的菜单控件,显然,这个菜单相比 GNOME 默认菜单有着更多的变化,我们来看~

mint_menu.png

Linux Mint 自带了大量的实用软件,我们需要的解码器等等,可以说是个 的开箱即用版……

mint2.png

除了可以使用新立德软件包管理器之外,Linux Mint 也自带了一个 MintInstall,这个程序提供了强大的打分系统,还有软件截图预览,对于 Linux 新手来说最好不过~

mintinstall.png

这样一个简洁实用、美工也不差的发行版,连我看了都会心动……最主要的是屏蔽了 安装后的后续工作、并且还能跟 源兼容,软件资源当然是不用愁的。
唯一的问题就是,Mint 自己的源是国外的,国内也没有听说过有镜像,教育网的朋友可能无福享受了……
如果你已经看得心动了,赶紧去 Linux Mint 的官方网站下载光盘镜像吧~

标签: , 3 评论
3五/096

轻松建立 Ubuntu/Debian 源镜像

服务器上的源是 的,考虑到学校里面已经没有多少人使用 ,而使用 来做推广显然更加合适,同学们遇到什么问题,也可以得到更好的支持,于是决定把 源换成 的。
建立源,当然要用 rsync ,不过这里并非直接使用,而是用的 官网提供的一段脚本,叫做 anonftpsync,加上 作为定时任务做成的。
是 Linux 下的计划任务工具,可以按每小时、每天、每星期、每月执行任务,支持多用户多设置,很是方便。往下看之前,确认你安装了 rsync,并且开启了 守护程序。

下面说一下步骤:
首先,建立源目录。如果想放在 FTP 服务器上,应该建立在 FTP 目录里,比如:

mkdir /home/ftp/

由于脚本的需要,最好建立一个文件夹来记录最后同步的时间:

mkdir -p /home/ftp//project/trace/

然后建立脚本 anonftpsync。拷贝下面的脚本存放在稳妥位置。

#! /bin/sh -p
set -e

# EXCLUDE 是你要排除的文件和目录。
EXCLUDE="--exclude *alpha.deb \
    --exclude *alpha.udeb \
    --exclude binary-alpha/ \
    --exclude disks-alpha/ \
    --exclude *-alpha.gz \
    --exclude installer-alpha/ \
    --exclude binary-arm/ \
    --exclude *arm.deb \
    --exclude *arm.udeb \
    --exclude disks-arm/ \
    --exclude *-arm.gz \
    --exclude installer-arm/ \
    --exclude binary-m68k/ \
    --exclude *m68k.deb \
    --exclude *m68k.udeb \
    --exclude disks-m68k/ \
    --exclude *-m68k.gz \
    --exclude installer-m68k/ \
    --exclude binary-hppa/ \
    --exclude *hppa.deb \
    --exclude *hppa.udeb \
    --exclude disks-hppa/ \
    --exclude *-hppa.gz \
    --exclude installer-hppa/ \
    --exclude binary-ia64/ \
    --exclude *ia64.deb \
    --exclude *ia64.udeb \
    --exclude disks-ia64/ \
    --exclude *-ia64.gz \
    --exclude installer-ia64/ \
    --exclude binary-mips/ \
    --exclude *mips.deb \
    --exclude *mips.udeb \
    --exclude disks-mips/ \
    --exclude *-mips.gz \
    --exclude installer-mips/ \
    --exclude binary-mipsel/ \
    --exclude *mipsel.deb \
    --exclude *mipsel.udeb \
    --exclude disks-mipsel/ \
    --exclude *-mipsel.gz \
    --exclude installer-mipsel/ \
    --exclude binary-s360/ \
    --exclude *s360.deb \
    --exclude *s360.udeb \
    --exclude disks-s360/ \
    --exclude *-s360.gz \
    --exclude installer-s360/ \
    --exclude binary-s390/ \
    --exclude *s390.deb \
    --exclude *s390.udeb \
    --exclude disks-s390/ \
    --exclude *-s390.gz \
    --exclude installer-s390/ \
    --exclude binary-sh/ \
    --exclude *sh.deb \
    --exclude *sh.udeb \
    --exclude disks-sh/ \
    --exclude *-sh.gz \
    --exclude installer-sh/ \
    --exclude binary-sparc/ \
    --exclude *sparc.deb \
    --exclude *sparc.udeb \
    --exclude disks-sparc/ \
    --exclude *-sparc.gz \
    --exclude installer-sparc/ \
    --exclude /-1.3* \
    --exclude /Debian3.1* \
    --exclude local/ \
    --exclude stable/ \
    --exclude slink-proposed-updates/ \
    --exclude slink/ \
    --exclude bo/ \
    --exclude bo-unstable/ \
    --exclude bo-updates/ \
    --exclude binary-hurd-i386/ \
    --exclude *hurd-i386.deb \
    --exclude *hurd-i386.udeb \
    --exclude disks-hurd-i386/ \
    --exclude *-hurd-i386.gz \
    --exclude installer-hurd-i386/ \
    --exclude binary-powerpc/ \
    --exclude *powerpc.deb \
    --exclude *powerpc.udeb \
    --exclude disks-powerpc/ \
    --exclude *-powerpc.gz \
    --exclude installer-powerpc/ "
#--exclude /contrib/ --exclude /non-free/ --exclude source/\
#    --exclude Incoming/ \
#######################################

# TO 是目标目录
TO=/home/ftp/
# 以下两个合起来就是源地址: .ustc.edu.cn//
# 这里设置同步的服务器域名
RSYNC_HOST=.ustc.edu.cn
# 这里是同步服务器上源所在的目录
RSYNC_DIR=/

LOCK="${TO}/Archive-Update-in-Progress-`hostname -f`"

# Get in the right directory and set the umask to be group writable
#
cd $HOME
umask 002

# Check to see if another sync is in progress
if lockfile -! -l 43200 -r 0 "$LOCK"; then
  echo `hostname` is unable to start rsync, lock file exists
  exit 1
fi
trap "rm -f $LOCK > /dev/null 2>&1" exit  

set +e

#result=1
#while (( $result != 0 )) ; do
rsync -rltv --progress --delete \
     --exclude "Archive-Update-in-Progress-`hostname -f`" \
     --exclude "project/trace/`hostname -f`" \
     $EXCLUDE \
     $RSYNC_HOST::$RSYNC_DIR $TO > ${HOME}/log/rsync.log 2>&1
#result=$?
#done

date -u > "${TO}/project/trace/`hostname -f`"
savelog ${HOME}/log/rsync.log > /dev/null 2>&1

设置权限。确定脚本可以被执行,目标目录有写权限。

chmod +x anonftpsync
chmod 755 /home/ftp/

添加计划任务。这里使用 crontab 设置,-e 选项表示编辑设置:

crontab -e

输入下面的一行,表示每天凌晨 2:00 运行 /usr/local/bin/anonftpsync,添加完毕保存:

00 2 * * *   /usr/local/bin/anonftpsync

使用下面的命令查看是否添加成功:

crontab -l

重启 更改完设置需要重启 ,通常是:

/etc/init.d/ restart

Linux 下是:

/etc/rc.d/crond restart

接下来就是等待咯,如果你迫不及待,可以直接运行脚本同步。
可以看到,建立一个 / 源并没有如何麻烦,这不得不归功于 linux 下工具和脚本的强大,呵呵~
如果有教育网的同学,可以加这个源,现在还在同步中,呵呵~每天从中国科技大学同步一次。从这里下载源列表:

ftp://.org/sources.list/

如果对 不够明白,可以参考:计划任务工具 cron 的配置和说明

29四/096

让 Arch Linux 也使用 Ubuntu 9.04 的新通知机制

看到 TualatriX 兄在 Gentoo 下使用 Ubuntu 的新通知机制 notify-osd,心里很痒啊,在 下能不能用呢?
首先想到的是看看 TX 兄是怎么改的,不过没用过 Gentoo,Ebuild 也看不出所以然来,想自己改是不可能了。
Google 一下吧," linux notify-osd",晕,发现 AUR 里面已经有了,还不止一个……

[iven@~]$ yaourt 
1 aur/banshee- 1.4.3-3 (15)
    Patched banshee version for 
2 aur/gajim- 0.12.1-1 (2)
    Jabber client written in PyGTK
3 aur/gnome-mount- 0.8-2 (11)
    GNOME mount program
4 aur/gnome-power-manager- 2.24.4-5 (Out of Date) (18)
    Session daemon that makes it easy to manage your laptop or desktop system.
5 aur/libnetworkmanager- 0.7.1-1 (5)
    The Network Manager Library
6 aur/networkmanager- 0.7.1-1 (5)
    Network Management daemon
7 aur/nm-applet- 0.7.1-1 (3)
    GNOME frontends to NetWorkmanager
8 aur/ 0.9.12-1 (25)
    daemon that displays passive pop-up notifications
9 aur/-bzr 311-1 [312-1 installed] (45)
    Canonical's on-screen notification display agent, implementing the FreeDesktop.org notification specification with semi-transparent click-through bubbles.
10 aur/pidgin-libnotify- 0.14-2 (25)
    Patched pidgin-libnotify version for 

可以看到,不但有 notify-osd,还有 bzr 版的,还有针对 pidgin 各种应用的 hack 版。
我不用 pidgin,所以直接安 notify-osd-bzr,这个包与 notification-daemon 和 notify-osd 冲突,我没有安 notify-osd,所以应该先:

yaourt -Rd notification-daemon

然后:

yaourt -S notify-osd-bzr

最后注销一下即可。
下面是骨头兄 的效果( 里面没有 gnome-osd,怨念……):

screenshot_002.png

呵呵, 还是群众力量大啊,AUR 这个平台简直神了!

2三/092

Quartus 8.1在Linux上的安装破解方法

学习SOPC,自然会用到 II和NIOS,这两个软件似乎是java编写的,所以都有linux版。
首先,到官方网站下载 II Subscription Edition Software v8.1(Includes MegaCore IP Library)Nios II Embedded Design Suite 这两个软件,下载时需要注册,也可以选择 Get One-Time Access 取得一次下载权限。
然后,解压两个tar包,分别以root权限运行install脚本,注意运行此脚本需要
最后,运行 安装目录//bin/ 即可。
我在 Linux 64bit 下运行会出现段错误,在 8.10 32bit 下运行正常,可能是64位问题,也可能是 问题,不过总算是能用了。

注册时,licence.dat可以用windows下的,对于没有licence的同学,可以参照这个:

How to crack for linux:
===============================
cd /linux
cp libsys_cpt.so libsys_cpt.so.bak

then run gdb:
gdb> file libsys_cpt.so
gdb> info function l_pubkey_verify

Note the resulting address (for 7.2 it was 0x000c617b)

quit gdb, then open libsys_cpt.so using a hex editor, then go to the address
that you got from gdb and replace the 3 bytes starting at that address with
those bytes: 31 C0 C3

Alternatively one can get the address of 'l_pubkey_verify' function using the
command:
nm libsys_cpt.so | grep l_pubkey_verify

Now regular tool flow can work, except for the Design Space Explorer,
to get the Design Space Explorer working do the following:
* Note the first few bytes (8 or more) in the 'l_pubkey_verify' function of the
original libsys_cpt.so, and search for those bytes in quartus_sh (using a hex
editor). I found that the number of bytes to search for (which were 8 for
8.0) are the minimum number of bytes which will match only once in
quartus_sh.
* Replace the first 3 bytes with those bytes: 31 C0 C3

30四/080

Ubuntu Hardy 时间不正确的解决办法

刚刚装了 Hardy,发现系统的时间不正确。 安装的时候是选的哈尔滨(+8时区)的,但是显示怎么就不对呢? 虽然时间设置里面显示正确,可是时间applet就不正确了。
查了查,发现是UTC时间的问题,关闭即可。 打开配置编辑器(gconf-editor),找到/apps/panel/applets/clock_screen0/prefs/gmt_time,把复选框去掉即可。