第二基地

July 28, 2006

解压一大堆文件的脚本

Filed under: linux, program, bash

#!/bin/bash
do_dir ()
{
cd $1
for i in *
do
if [[ -f $i ]]
then
decompress $i
elif [[ $i == "." ]] || [[ $i == ".." ]]
then
continue
elif [[ -d $i ]]
then
[[ $recue == 1 ]] && do_dir $i
fi
done
}

decompress ()
{
case $1 in

*.tar.bz2)
tar jxvf $1
;;
*.tar.gz)
tar zxvf $1
;;
*.rar)
rar x $1
;;
*.gz)
gzip -d $1
;;
*.bz2)
bzip2 -d $1
;;
*)
echo "$1:not a compressed file,do nothing"
return
;;
esac
[[ $del == 1 ]] && rm $1
}

get_help ()
{
echo "this bash script is written to get all the compressed files under a directory to be uncompressed."
echo "Usage:tarball.sh [OPTION] [DIR]"
echo "OPTION:"
echo -e "\t-r\trecursively"
echo -e "\t-d\tremove the file after decompress it"
}

if [[ $# == 0 ]]
then
echo "no arguments detected,do you want to continue or just get help?[c/H]:"
read help
fi

[[ $help != "c" ]] && get_help && exit 0

for arg in $@
do
case $arg in
-r)
recue=1
;;
-d)
del=1
;;
-h)
get_help
exit 0
;;
-*)
echo "unknown arg:$arg"
echo "type tarball.sh -h to get help"
get_help
exit 1
;;
*)
[[ $arg != $0 ]] && [ -d $arg ] && name=$arg
;;
esac
done

if [[ -n $name ]]
then
do_dir $name
else
do_dir "."
fi

July 27, 2006

fanmm同学

Filed under: Uncategorized

今天已经问了两次我有没有在这里提到她了
现在完成任务,oh yeah

sawfish-ui

Filed under: linux, sawfish

sawfish-ui我一直没怎么重视,今天才发现简直太有用了
直到今天之前我一直在纳闷,fvwm能够指定特定的程序map到特定的桌面,也能在聚焦的同时提升窗口,为什么sawfish都不行呢?
原来都可以在sawfish-ui里设置的
在Focus标签下有三个子标签:Focus,Window Cycling和Auto-Raise
第一个设置聚焦方式,第二个没兴趣,第三个设置聚焦的时候要不要自动提升
还有一个叫Matched Windows的标签,可以根据名字等匹配窗口,然后对窗口做特殊的设定,这样就可以让fvwm一样了,hoho

rxvt-unicode的问题

Filed under: linux, system

之前用得好好的,不知道怎么回事突然出问题了,具体表现为在有中文时CPU会占到100%好一会儿,然后才能把中文显示出来,而且中文变得奇丑无比。刚开始判断可能是字体没找到,于是调整了.Xdefaults,字体是找到了,但是CPU100%的问题依旧。改了无数次,还是没用,google也没结果,很是郁闷。
后来才知道原来是urxvtd的原因。要把urxvtd重启才能应用新设置。
顺便强烈推荐一下urxvtd和urxvtc的组合,开新term的速度那叫一个快呀
再顺便贴一下.Xdefaults
Xft.dpi:96
URxvt.background:black
URxvt.foreground:white
URxvt.scrollBar:False
URxvt.saveLines:3000
URxvt.color12:DodgerBlue
URxvt.font:7x14,xft:AR PL New Sung:antialias=false
URxvt.mfont:7x14,xft:AR PL New Sung:antialias=false
URxvt.boldFont:7x14,xft:AR PL New Sung:antialias=false
URxvt.italicFont:7x14,xft:Bitstream Vera Sans:antialias=true
URxvt.boldItalicFont:7x14,xft:Bitstream Vera Sans:sytle=Bold:antialias=true
URxvt.preeditType:Root

July 26, 2006

grub啊

Filed under: linux, system

问题是解决了,不过总归是莫名其妙的,把kernel后面的那个root=/dev/xxx参数去掉竟然就可以了,什么概念?嗯?






















Get free blog up and running in minutes with Blogsome | Theme designs available here