Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15331696
  • 博文数量: 2005
  • 博客积分: 11986
  • 博客等级: 上将
  • 技术积分: 22535
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-17 13:56
文章分类

全部博文(2005)

文章存档

2014年(2)

2013年(2)

2012年(16)

2011年(66)

2010年(368)

2009年(743)

2008年(491)

2007年(317)

分类: LINUX

2009-08-22 15:51:43

最新ubuntu 8.10 - 9.10 - 10.10装机步骤-简化版

==============================================





http://cdimage.ubuntu.com/netboot













中 国Postal/Zip Code为320000
批量修改文件名的参考代码
find * | xargs -I name bash -c 'mv "name" $(echo "name" |sed "s/[0-9]/a/g")'

makefile中引用shell变量需要$$连续2个--拷贝例子
编译android时自动将linux内核做build的kernel.mk脚本

使用mplayer快速管理大批mp3,ogg,wma,midi等格式音频文件的脚本,你可以将不同音频文件夹ln -s软链接到一个目录下,使用gplay统一管理,gplay会自动从上次退出时的音频文件开始继续播放.
 gplay.rar  
  1. #!/bin/bash

  2. #config_file=~/.gplay.luther.gliethttp
  3. #play_list=~/.gplay.luther.gliethttp.list
  4. config_file=`pwd`/.gplay.luther.gliethttp
  5. play_list=${config_file}.list
  6. files=""
  7. cfile=""
  8. rel_cfile=""
  9. list=""
  10. findex_from=0

  11. while getopts lf: op; do
  12.     case $op in
  13.         l) list=1;;
  14.         f) findex_from=$OPTARG;;
  15.     esac
  16. done

  17. shift `expr $OPTIND - 1`

  18. function gen_list2() {
  19.     find . -iname "$1" | sort >> ${play_list} 2>/dev/null
  20.     find . -maxdepth 1 -type l | xargs -I file bash -c "[ -d file ] && echo file" |\
  21.     xargs -I file find file/ -iname "$1" | sort >> ${play_list} 2>/dev/null
  22. }

  23. play_list=$(readlink -f ${play_list})
  24. > ${play_list}
  25. files="$1"
  26. if [ ${files} ]; then
  27.     files="-iname *.${files}"
  28.     gen_list2 "*.$1"
  29.     shift
  30.     until [ $# -eq 0 ]; do
  31.         files=${files}" -o -iname *$1"
  32.         gen_list2 "*.$1"
  33.         shift
  34.     done
  35. else
  36.     files="-iname *.mp3 -o -iname *.wma -o -iname *.ogg -o -iname *.wav"
  37.     gen_list2 "*.mp3"
  38.     gen_list2 "*.wma"
  39.     gen_list2 "*.ogg"
  40.     gen_list2 "*.wav"
  41.     gen_list2 "*.mid"
  42.     gen_list2 "*.midi"
  43. fi

  44. function gen_list() {
  45. # > ${play_list}
  46. # find . ${files} | sort >> ${play_list} 2>/dev/null
  47. # find . -maxdepth 1 -type l |xargs -l1 echo |\
  48. # xargs -I file find file/ ${files} | sort >> ${play_list} 2>/dev/null
  49.     return
  50. }

  51. function do_list() {
  52.     echo '++++++++++++++++++'
  53.     awk '{printf "[ %04d ] %s\n", NR, $0}' ${play_list}
  54. }

  55. if [ "${list}" ]; then
  56.     gen_list
  57.     do_list
  58.     exit;
  59. fi


  60. function check_file() {
  61.     if [ ! -f "$1" ]; then
  62.         touch "$1"
  63.     fi
  64. }

  65. function read_key() {
  66.     check_file "${config_file}"
  67.     if [ -f "${config_file}" ]; then
  68.         echo $(echo $(sed -n "s/^$1=//p" ${config_file}) | sed '1q')
  69.     fi
  70. }

  71. function write_key() {
  72.     if [ -f "${config_file}" ]; then
  73.         if [ "$(sed -n "/^$1=/{p;q}" ${config_file})" ]; then
  74.             sed -i "/^$1=/c\\$1=$2" ${config_file}
  75.         else
  76.             echo "$1=$2" >> ${config_file}
  77.         fi
  78.     fi
  79. }

  80. config_file=$(readlink -f ${config_file})
  81. if [ -f "${config_file}" ]; then
  82.     rel_cfile="$(read_key file)"
  83.     [ "$rel_cfile" ] && cfile="$(readlink -f "${rel_cfile}")"
  84. fi

  85. function findex_inc() {
  86.     myindex=$(read_key findex)
  87.     ((myindex = myindex + $1))
  88.     write_key findex ${myindex}
  89. }

  90. function findex_dec() {
  91.     myindex=$(read_key findex)
  92.     ((myindex = myindex - $1))
  93.     if ((myindex < 0)); then
  94.         myindex=0
  95.     fi
  96.     write_key findex ${myindex}
  97. }

  98. function mplayer_loop_exit() {
  99.     write_key loop_exit 1
  100. }

  101. function mplayer_play() {
  102.     [ "$(read_key loop_exit)" ] && exit 0
  103.     [ "$(read_key exit)" ] && exit 1
  104. # findex=$(read_key findex)
  105. # [ "$findex" ] || findex=0
  106. # ((++findex))
  107. # write_key findex ${findex}
  108. # if ((findex < findex_from)); then
  109. # return
  110. # fi
  111.     findex_inc 1
  112.     write_key file "$1"
  113.     printf "[ %04d ] %s\n" ${myindex} "$1"
  114.     mplayer "$1" >/dev/null 2>&1
  115. }

  116. # declare -f mplayer_play >/dev/null
  117. # typeset -f mplayer_play
  118. export -f mplayer_play write_key read_key check_file findex_inc findex_dec mplayer_loop_exit
  119. export config_file rel_cfile findex_from

  120. function do_exit() {
  121.     stty echo # 恢复回显
  122.     write_key exit 1
  123.     killall mplayer
  124. }
  125. # sTTY=$(stty -g)
  126. # stty $sTTY
  127. trap "do_exit" 0 1 2 3 6 15 16 17

  128. function do_mplayer() {
  129.     gen_list
  130. if [ 1 ] ; then # "${cfile}" ]; then
  131.     if ((findex_from == 0)); then
  132.         findex_from=$(sed -n "/^$(echo "${rel_cfile}"|sed 's/\//\\\//g')/{=;q}" ${play_list})
  133.         [ "${findex_from}" ] ||\
  134.         findex_from=$(sed -n "/$(basename ${rel_cfile})/{=;q}" ${play_list})
  135.         if [ "${findex_from}" = "" ];then
  136.             echo
  137.             echo "File $(basename ${rel_cfile}) not found!"
  138.             echo
  139.             findex_from=0
  140.         fi
  141.     fi
  142. # echo $rel_cfile
  143. # mplayer_play "${cfile}"
  144. # echo "$(echo ${rel_cfile}|sed 's/\//\\\//g')"
  145. # find . ${files} | sort | xargs -l1 echo |\
  146. # sed "1,/$(echo ${rel_cfile}|sed 's/\//\\\//g')/d" |\
  147. # xargs -I file bash -c "mplayer_play \"file\""
  148. fi

  149. while [ 1 ]; do
  150.     if [ "$(sed -n "1{p;q}" ${play_list})" = "" ]; then
  151.         echo
  152.         echo "This Dir not found any media file"
  153.         echo
  154.         exit 1
  155.     fi
  156.     [ "$(read_key exit)" ] && exit 1

  157.     if ((findex_from > 0)); then
  158.         ((--findex_from))
  159.         write_key findex ${findex_from}
  160.     fi
  161.     
  162. # if ((findex_from > 0)); then
  163. # find . ${files} | sort | xargs -l1 echo |\
  164. # sed "1,${findex_from}d" |\
  165. # xargs -I file bash -c "mplayer_play \"file\""
  166. # else
  167. # find ${files} | sort | xargs -l1 echo |\
  168. # xargs -I file bash -c "mplayer_play \"file\""
  169. # fi
  170.     if ((findex_from > 0)); then
  171.         index=${findex_from}
  172.     else
  173.         index=0
  174.     fi

  175.     until [ "$(read_key exit)" != "" ] || [ "$(read_key loop_exit)" != "" ]; do
  176.         ((++index))
  177.         f="$(sed -n "${index}{p;q}" ${play_list})"
  178.         if [ "${f}" = "" ]; then
  179.             index=0
  180.             write_key findex ${index}
  181.             continue
  182.         fi
  183.         mplayer_play "${f}"
  184.     done

  185.     findex_from=0
  186.     if [ "$(read_key loop_exit)" ]; then
  187.         findex_from=$(read_key findex)
  188.         write_key loop_exit
  189.     fi

  190.     write_key findex ${findex_from}

  191. done
  192. }

  193. write_key exit
  194. write_key loop_exit
  195. write_key findex 0

  196. export PID="$$"

  197. do_mplayer &

  198. function get_tty_key() {
  199.     pos=
  200.     stty -echo # 屏蔽回显
  201.     while read -s -n 1 char; do
  202.         case $char in
  203.             q|Q)
  204.                 echo "Quit"
  205.                 break
  206.             ;;
  207.             n|N)
  208.                 killall mplayer
  209.             ;;
  210.             p|P)
  211.                 findex_dec 1
  212.                 mplayer_loop_exit
  213.                 killall mplayer
  214.             ;;
  215.             l|L)
  216.                 do_list
  217.                 echo '=================='
  218.                 printf "[ %04d ] %s\n" $(read_key findex) "$(read_key file)"
  219.             ;;
  220.             [0-9])
  221.                 pos=${pos}${char}
  222.                 echo -n ${char}
  223.             ;;
  224.             c|C)
  225.                 [ "${pos}" ] && echo
  226.                 pos=
  227.             ;;
  228.             g|G)
  229.                 if [ "${pos}" ]; then
  230.                     echo
  231.                     write_key findex ${pos}
  232.                     mplayer_loop_exit
  233.                     killall mplayer
  234.                     pos=
  235.                 fi
  236.             ;;
  237.             r|R)
  238.                 reset
  239.                 printf "[ %04d ] %s\n" $(read_key findex) "$(read_key file)"
  240.             ;;
  241.             h|H)
  242. cat <<__EOF

  243.  --------------------------------
  244. | key | usage |
  245. |-----|--------------------------|
  246. | q | quit |
  247. | n | next song |
  248. | p | prev song |
  249. | l | list all songs |
  250. | c | clear screen |
  251. | g | goto the pos number song |
  252. | r | cancel pos number input |
  253. |[0-9]| pos number |
  254. |--------------------------------|
  255. | http://gliethttp.cublog.cn |
  256. | luther.gliethttp |
  257.  --------------------------------
  258. Example:

  259. 1. play from the 30th song
  260. gplay -f 30

  261. 2. play all rmvb & rm files sorted by name order
  262. gplay rmvb rm

  263. __EOF
  264.             ;;
  265.         esac
  266.     done
  267. }

  268. get_tty_key
luther@gliethttp:~/gplay$ gplay
[ 0543 ] ./musics/爸妈的话.mp3

 --------------------------------
| key |         usage            |
|-----|--------------------------|
|  q  | quit                     |
|  n  | next song                |
|  p  | prev song                |
|  l  | list all songs           |
|  c  | clear screen             |
|  g  | goto the pos number song |
|  r  | cancel pos number input  |
|[0-9]| pos number               |
|--------------------------------|
|   http://gliethttp.cublog.cn   |
|        luther.gliethttp        |
 --------------------------------
Example:

1. play from the 30th song
gplay -f 30

2. play all rmvb & rm files sorted by name order
gplay rmvb rm
[0-9]数字批量修改
  1. #!/bin/bash
  2. name=$1
  3. year=$(date +%y)
  4. if [ "$name" == "" ]; then
  5.     printf "\nPlease input your name xxx\n\n"
  6.     exit -1
  7. fi

  8. echo "$(
  9. cat <<__EOF
  10. ||Jan||Feb||Mar||Apr||May||Jun||Jul||Aug||Sep||Oct||Nov||Dec||
  11. ||1||6||10||15||19||24||28||32||37||41||46||50||
  12. ||2||7||11||16||20||25||29||33||38||42||47||51||
  13. ||3||8||12||17||21||26||30||34||39||43||48||52||
  14. ||4||9||13||18||22||27||31||35||40||44||49||53||
  15. ||5|| ||14|| ||23|| || ||36|| ||45|| ||54||
  16. __EOF
  17. )" | sed -e "s/\([0-9]\{1,\}\)/[wiki:\"${name} ${year}WK\1\" \1]/g"
kernel.release.sh发布脚本

#!/bin/bash

dst_dir_base="$1"
[ "$dst_dir_base" ] || dst_dir_base="${HOME}/kernel.release"

[ "
$(readlink -f `pwd`)" = "$(readlink -f $(dirname $dst_dir_base))" ] && dst_dir_base="${HOME}/${dst_dir_base}"

echo "=== [${dst_dir_base}] ==="
echo '1. creating dirs...'
find . -type d |xargs -I luther.gliethttp.abc.123 mkdir -p ${dst_dir_base}/luther.gliethttp.abc.123
echo '2. coping files...'
find . \( -iname '*.ko' -o -iname '*.c'
-o -iname '*.cpp' -o -iname '*.o' -o -iname 'modules.order' -o -name vmlinux -o -name System.map \) -prune -o -iname '\.*' -o -type d -o -print |xargs -I luther.gliethttp.abc.123 cp -a luther.gliethttp.abc.123 ${dst_dir_base}/luther.gliethttp.abc.123
cd ${dst_dir_base}
echo '3. deleting dirty files...'
find -iname '\.*'|xargs rm -rf 2>/dev/null
# date_time="$(date +%Y-%m-%d' '%H:%M)"

date_time="$(date +%Y-%m-%d' '09:00)"
echo '4. timeing...'
find |xargs touch -d "${date_time}"
find -type d |xargs -I luther.gliethttp.abc.123 touch -d "${date_time}"
"luther.gliethttp.abc.123/.." 

find -type d |xargs -I luther.gliethttp.abc.123 touch -d "${date_time}" "luther.gliethttp.abc.123/."

rm touch 2>/dev/null
cd - >/dev/null
echo '5. done'

执行完毕上面的脚本之后,还需要手工进入dst_dir_base目录执行一次步骤4的操作,以保证.和..时间被修改

通过本地mail查看后台daemon执行程序输出到stdout和stderr的log数据

cat /var/mail/luther  所以如果daemon脚本有很多log输出,那么可以使用2>&1 >/dev/null来不存储到/var/mail/luther,或者每次脚本执行完成之后> /var/mail/luther以面mail最终巨大
查看当前众多网卡中 都有哪个网卡是插着网线被激活的
ethtool eth0 如果网速为Speed: Unknown!,那么表示该网口没有连接网线
查看所有被检测到的网卡,包 括未激活的
ifconfig -a
切换到root用 户或者其他任意用户
su root 提示输入root用户密码
su gliethttp 提示输入gliethttp用户密码
判断执行脚本的用户是否为root用户(这个UID在env中并不能看到,只在sh脚本中可见)
if [ ${UID} -ne 0 ]; then
    echo "不是root用户"
    echo
    exit 1
fi
或 者
if [ `id -u` -ne 0 ]; then
如何在 sh脚本中执行shell命令
比如执行命令:dirname
echo $(dirname $0)  使用$()函数功能
echo `dirname $0`   使用``执行命令
echo $(echo '/vobs/gliethttp' | sed -e 's/\//\\\//g')
使用/etc/sudoers为个别普通用户开启只有root用户才能够执行的某些个别命令
vim /etc/sudoers
# 定义GLIETHTTP组内成员
User_Alias GLIETHTTP = glx,  zhangsan, lisi
# 表示该组内成员能够执行tcpdump命令
GLIETHTTP ALL=/usr/sbin/tcpdump
或者加入NOPASSWD:让这些人都不用输入密码就可以直接使用,如果需要允许执行多条命令,使用 逗号分割即可.
GLIETHTTP ALL=NOPASSWD:/usr/sbin/tcpdump
查看登录用户信息
w
查看登录用户log日志
last
查看所有组名和组id
vim /etc/group
id -nG  查看当前用户所处的所有组
id -G   查看当前用户所处的所有组组名对应的id
可以使用sudo usermod -G <新的组> <用户名> 来将用户追加到新的组上,
这样id -nG就会多出刚刚追加的新组
创建用户时自定义用户home目录和用户所在主组group和附加组
useradd -d /vobs/gliethttp -g gliethttp123 -G root,ftp gliethttp
useradd -m自动建立用户目录;useradd -M不建立用户目录
userdel gliethttp 删除用户gliethttp
userdel -r gliethttp 删除用户gliethttp,同时一并删除用户目录
省去手工输入,从文件直接读取密码
sudo useradd test
sudo passwd test < 1.txt  其中1.txt中存放了2行相同的字符串,作为密码
查 看用户uid和gid
id; id -u; id -g; id -G; id gliethttp; id -u gliethttp; id -g gliethttp
改变用户主目录,用 户所在组和账户有效期
useradd -d /vobs/home_users/"$1" -g gliethttp123 "$1" 可以这样添加新用户,指定主目录和用户所在组
usermod -d /vobs/gliethttp gliethttp 变更主目录
usermod -g gliethttp123 gliethttp  将用户gliethttp的组改为gliethttp123
usermod -G <新的组> <用户名> 来将用户追加到新的组上
查看os系统当前开机多长时间了
uptime
查看格式化的年月日时分秒
date +%y%m%d%H%M%S
date +%y年%m月%d日%H时%M分%S秒
date +%y%m%d%H%M%S_trac_svnrepos_configs.tar.bz2
测试硬盘速度,查看硬盘读取速度
sudo hdparm -t /dev/sda
列出所有磁盘分区信息
sudo fdisk -l
每1秒显示一次磁盘使用情况
iostat 1
测试文件读写速度
time dd if=/dev/zero of=/nfs/testfile bs=8k count=1024 这是来测试nfs写
time dd if=/nfs/testfile of=/dev/null bs=8k count=1024 这是测试nfs读
查询mount上的所有文件系统和强制卸载unreachable的nfs
vim /proc/mounts      #查询当前mount上的所有文件系统
umount -f /vobs/nfs   # Force unmount用来强制卸载网络断开unreachable的nfs文件系统
umount -l /isodevices # Lazy unmount卸载硬盘安装ubuntu 9.10时的iso系统文件
如何 mount通过nfs的iso文件(加入-o ro选项即可)
sudo mount /nfs/gliethttp.iso /mnt -o ro,loop
如何将一个.nrg文件转换为iso文件
sudo apt-get install nrg2iso
nrg2iso pxa303_linux.nrg pxa303_linux.iso
如何mount一个.nrg文件
sudo mount pxa303_linux.nrg 303 -o,ro,loop,iocharset=utf8,offset=307200
如何制作iso文件
sudo apt-get install mkisofs
mkisofs -jcharset utf8 -o gliethttp.iso gliethttp_dir/ luther_dir/
sudo mount gliethttp.iso /mnt -o loop,iocharset=utf8
如何向iso文件追加新内容
mkdir -p gliethttp_append/test/release
cp readme.txt gliethttp_append/test/release
mkisofs -jcharset utf8 -o gliethttp_new.iso /mnt/ gliethttp_append/ 123test.c
用来镜像cdrom光盘到iso文件
dd if=/dev/cdrom of=cd.iso
查看使用文件夹/test/的用户
fuser /test 或者使用更详细的查询 lsof |grep /test
查 看程序都打开了哪些文件
sudo lsof -c 程序名称
sudo lsof -p 程序的pid号
查看都哪些程序在使用某个文件或者目录,和某个目录下包含的所有文件中都有哪个文件正在被打开 和使用
sudo lsof /lib/libglib-2.0.so.0
sudo lsof /media/e
sudo lsof +d /lib
使用tcpdump查看流经网卡的网络数据
sudo tcpdump -n ip
sudo tcpdump -n arp
sudo tcpdump -n udp
sudo tcpdump -n tcp
或这对指定网卡进行数据监控
sudo tcpdump -i usb0 -n ip 表示监控流经usb0网卡的数据
查看tcp/ip所有网络协议
vim /etc/protocols
查看本地ip地址端口和程序名称
netstat -anp
或者
sudo lsof -i :端口号
或者
sudo lsof -i TCP 显示所有建立tcp的程序
显示所有使用unix通信的程序
lsof -U
或者
netstat -n
显示当前内存使用信息
free -m
free -m -s 1 每隔1秒动态显示
显示系统共享内存﹑共享信号量以及共享 队列
ipcs
ipcs -m // 只显示共享内存
ipcs -s // 只显示共享信号量
删除系统共享内存﹑共享信号量以及共享队列
ipcrm -m mem_id // 删除shmid对应的内存共享区
ipcrm -s sem_id // 删除semid对应的信号量共享区
查看系统环境变量
env
查看当前使用的字符集
locale
locale -m 列出所有charmaps
locale -a 列出所有locales
转换文本文件编码格式(可以结合fencview.vim来确认文本文件的编码格式)
iconv -l 显示支持的字符集
iconv -f cp936 -t utf8 test.c > gliethttp.c  把cp936编码格式的test.c文件,转换为utf8编码格式
立即生 效.bashrc等shell脚本
. .bashrc // 使用.点操作,或者使用source
或者
source .bashrc
对于useradd的用户需要在相应~/目录下建 立.profile执行文件,而不是.bashrc,当然.profile内容可以是.bashrc内容
修改主机名
hostname  显示当前主机名
hostname gliethttp 临时修改主机名为gliethttp
vim /etc/hostname  ubuntu永久修改
vim /etc/hosts     redhat/fedora永久修改
查看网 关
ip route
设置网关(如果2个pc网线直连(rhel5.1),a有2个网卡可以上网,那么b如果设置了自己的网 关为a,同时a没有启动NAT,那么将导致a不能ssh登录b,同时a执行nfs操作也将失败,所以此种情况就不能设置b机的网关,空着即可
route add default gw 192.168.1.1
设置ip地址
ifconfig eth0 192.168.1.101/24 其中/24表示24bit的netmask掩码,等同于255.255.255.0
设 置永久固定静态ip地址
luther@gliethttp:~$ sudo vim /etc/network/interfaces  追加如下内容
auto eth1
iface eth1 inet static
address 192.168.1.249
netmask 255.255.255.0
gateway 192.168.1.1
luther@gliethttp:~$ sudo ifdown eth1   物理禁用网卡
luther@gliethttp:~$ sudo ifup eth1     物理启用网卡
或者
luther@gliethttp:~$ sudo ifdown eth1;sudo ifup eth1
如果清除或更名固定静态ip地址
sudo /etc/init.d/network-manager restart
sudo /etc/init.d/networking restart
一个网卡如何帮定2个ip地址
luther@gliethttp:~$ sudo vim /etc/network/interfaces
auto eth0:1
iface eth0:1 inet static
address 192.168.1.249
netmask 255.255.255.0
gateway 192.168.1.1
luther@gliethttp:~$ sudo /etc/init.d/networking restart
luther@gliethttp:~$ ifconfig 就可以看到在一个网卡上设置的新ip了
嵌入式网线直连 开发板断电网线拔掉之后,上电仍能自动设置静态ip地址
1.首先按照上面步骤设置永久固定静态ip地址
2.安装网线状态变 化监控daemon工具软件
luther@gliethttp:~$ sudo apt-get install ifplugd
luther@gliethttp:~$ sudo vim /etc/ifplugd/action.d/ifupdown 该文件是网线拔掉又插上之后还能正常自动设置静态ip的关键,为了能够每次tftp都成功,加入如下一句service xinetd restart
#!/bin/sh
set -e

case "$2" in
up)
    /sbin/ifup $1
    service xinetd restart
    ;;
down)
    /sbin/ifdown $1
    ;;
esac
luther@gliethttp:~$ sudo ifplugd -d 0 -i eth1
luther@gliethttp:~$ sudo ifplugd -k -i eth1 用来停止刚刚给eth1创建的daemon程序
查看DNS地址
vim /etc/resolv.conf
nameserver 202.106.0.20
追家固定的DNS地址ip
sudo vim /etc/dhcp3/dhclient.conf
# 格式为prepend domain-name-servers ip1,ip2,ip3;
# 追家如下一行来强制dhcp添加固定dns地址,下面追加了2个ip作为固定DNS
prepend domain-name-servers 172.16.32.112,172.16.13.37;
sudo dhclient eth0
查看rpm包
rpm -qa | grep gliethttp //查看安装的rpm中是否有gliethttp字段的rpm
rpm -qpl gliethttp.rpm //查看gliethttp.rpm包中的内容
工具控制中心
gnome-control-center
声音控制面板
gnome-volume-control或者 alsamixer
屏幕刷新率和分辨率(wmii不能改变,wmii只能使 用xorg.conf=>Option "PreferredMode" "1024x768_60.00"默认分辨率)
gnome-display-properties
修改桌面壁纸
gnome-appearance-properties
启动File browser文件浏览器
nautilus
启动ftp,windows shares和ssh等文件工具
nautilus-connect-server
启动任务管理器,查看cpu,进程和内存使用情况
gnome-system-monitor
启动Eye of Gnome图片浏览器,可以直接显示j2c文件
eog
浏览chm工具
kchmviewer -- 系统自带的gnochm拷贝数据时,回车全被取消
设置环境变量和如何取消删 除环境变量
gliethttp=123  仅被当前shell使用的环境变量
export gliethttp=123 加入export将环境变量导出去,允许其他应用程序直接使用该环境变量,达到进程间共享目的
unset gliethttp  删除环境变量
alias ll='ls -lrht' 设置别名,这样直接使用ll即可,所以可以将该句加到.bashrc中
批 量修改目录和文件的创建时间
find . -name '*' -exec touch {} \;
touch -d "2010-03-29 13:15" Ghost网络克隆.txt 将文件创建时间修改成指定时间
查找文件大小大 于,小于和等于50M的所有文件
find . -size +50M  查找大小超过50M的所有文件
find . -size -50M  查找大小小于50M的所有文件
find . -size 50M   查找大小等于50M的所有文件
对find参数-prune的理解
(PS:对find参数-prune的理解
-prune就像一个判断语 句,当发现-prune前面的表达式math时,执行到-prune之后就会输出一个1结果,如果shell的话,
可以使用echo $?来看结果,如果-prune后面跟的是-o选项,用c语言的语法来讲的话就是1 || -print,所以明显可以看到
当-prune前面的 表达式成立的话,就不会执行-o后面的内容了,如果不成立,即0 || -print,那么将打印输出,
另外需要注意的是-path路径不能加入 结尾的/,
比如路径/vobs/gliethttp/signature,不能写成/vobs/gliethttp/signature/,这是 硬性规定
find /vobs/tmp/ -path /vobs/tmp/signature -a -print
如果find .那么后面-path的必须使用相对路径./gliethttp
除 find中.之外,其他所有查找,比如find tmp或者find /vobs等,-path都必须使用绝对路径
)

显示除hid_uart开头的所有目录或文件,以及名为 signature的目录或文件之外的所有文件
find . \( -name hid_uart* -o -name signature \) -prune -o -print
显示除当前目录./signature之外的所有文件
find . -path ./signature -prune -o -print
只打印当前目录下的./signature目录
find . -path ./signature -prune -a -print
打印除.svn下的所有.c文件
find . -name .svn -prune -o -iname '*.c' -a -print
或者使用-path参数
find . -path ./.svn -prune -o -print
统 计文件夹大小
du -sh /vobs/gliethttp  统计文件夹下所有文件大小总和
du --exclude='*.o' -sh /vobs/gliethttp/src 统计除.o文件之外所有文件大小
程序运行时lib 路径设置,ldconfig向系统ld.so.conf添加local用户lib库path自动搜索路径
echo '/usr/local/lib/gliethttp' >> /etc/ld.so.conf
cp libhello.so /usr/local/lib/gliethttp
sudo ldconfig 或者 export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH或者将该export语句放在/etc/bashrc或/etc/profile 中
使用strings /etc/ld.so.cache | grep gliethttp 可以查看自定义路径下被添加到系统中的so
-----------------
ldconfig 提示is not a symbolic link警告的去除方法
错误提示:
ldconfig
ldconfig: /usr/local/lib/gliethttp/libxerces-c-3.0.so is not a symbolic link
问题 分析:
因为libxerces-c-3.0.so正常情况下应该是一个符号链接,而不是实体文集件,修改其为符号链接即可
解决方法:
mv libxerces-c-3.0.so libxerces-c.so.3.0
ln -s libxerces-c.so.3.0 libxerces-c-3.0.so
这样就ok了
程序开发时lib 路径设置,设置LIBRARY_PATH动态链接库用来免去gcc -L自定义lib路径
gcc 先查找-L定义路径,然后是LIBRARY_PATH指定路径,最后是/lib /usr/lib等gcc默认路径,但是
设置完 LIBRARY_PATH之后,readht el 5.1出现make驱动提示
./include/linux/kernel.h:10:20: error: stdarg.h: No such file or directory
的错误,解决方法是,在执行make的gnome- terminal中
使用unset LIBRARY_PATH,然后make就ok了,ubuntu不存在该问题.
或者直接gcc -v查看版本为4.1.2,然后到export LIBRARY_PATH=/usr/lib/gcc/i386-redhat-linux/4.1.2:自己的路径:$LIBRARY_PATH也可以 解决该问题.
vim /etc/profile或者vim /etc/bashrc追加如下一行
export LIBRARY_PATH=/usr/local/lib/gliethttp_lib1:/usr/local/lib/gliethttp_lib2:$LIBRARY_PATH
加 入上面一行保证gcc时能够找到库,等效于gcc -L/usr/local/lib/gliethttp_lib1 -L/usr/local/lib/gliethttp_lib2
程序开发时include默 认头文件路径设置,设 置C_INCLUDE_PATH和CPLUS_INCLUDE_PATH用来免去gcc -I自定义include文件头路径的麻烦
vim /etc/profile或者vim /etc/bashrc追加如下一行
export C_INCLUDE_PATH=/usr/local/lib/gliethttp_include1:/usr/local/lib/gliethttp_include2:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/usr/local/lib/gliethttp_include1:/usr/local/lib/gliethttp_include2:$CPLUS_INCLUDE_PATH
添加elf执行bin文件的执行自动搜索路径
# SVN_EDITOR必须使用export导出,因为svn作为另一方程序会直接引用该环境变量
export SVN_EDITOR=vim
echo 'PATH=/usr/local/gliethttp:$PATH' >>/etc/bashrc对于ubuntu为/etc/bash.bashrc
或者
echo 'PATH=/usr/local/gliethttp:$PATH' >>/etc/profile这样远程用户ssh登录时将自动执行登录用户主目录下的.profile文件
或者
echo 'PATH=/usr/local/gliethttp:$PATH' >>~/.bashrc只有用户自己使用该自定义路径
如果 /etc/profile中加入以下一行用来显示登录用户名,那么每个远程登录的用户都将执行一次/etc/bashrc,所以当PATH添加到/etc /bashrc 里面的话将导致一次次的被递归,除非/etc/bashrc中直接设置PATH=/usr/local/gliethttp而不是再加入:$PATH
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi
获取路径字符串中的路径名和文件名
dirname /vobs/works/hid_uart/main.c
basename /vobs/works/hid_uart/main.c
以tree形式显示ps进程
pstree -anp
tree -N 用来显示中文文件名
查看elf程序使用到的so库
ldd elf程序路径 比如: ldd /bin/sh
svn递归添加so等二进制文件

find * |sed /\.svn/d |xargs svn add
清空 printk打印的由dmesg查看的内核log缓存
dmesg -c 即可清空
设置printk信息打印级别为15(默认为7),打印所有的log
echo 15 > /proc/sys/kernel/printk
常用的8个printk优先级,比如 printk(KERN_NOTICE "Hi,gliethttp\n");
#define    KERN_EMERG    "<0>"    /* system is unusable            */
#define    KERN_ALERT    "<1>"    /* action must be taken immediately    */
#define    KERN_CRIT    "<2>"    /* critical conditions            */
#define    KERN_ERR    "<3>"    /* error conditions            */
#define    KERN_WARNING    "<4>"    /* warning conditions            */
#define    KERN_NOTICE    "<5>"    /* normal but significant condition    */
#define    KERN_INFO    "<6>"    /* informational            */
#define    KERN_DEBUG    "<7>"    /* debug-level messages            */
如何使用cat /proc/kmsg直接读取printk数据
sudo lsof /proc/kmsg
对于ubuntu是dd程序在使用该文件
对于rhel5.1是klogd程序在使用该文件
sudo lsof -c klogd和sudo lsof -c dd可以查看这2个程序都打开了什么文件
所以如果想自己使用cat来读取printk 数据
cat /proc/kmsg
那么就需要kill掉上面读取/proc/kmsg的进程
配置udev脚本使/dev/dchars字符设备节点被insmod时自动修改权限,允许普通 用户读写该char设备
sudo vim /etc/udev/rules.d/40-basic-permissions.rules
# 在文件结尾追加如下一条rules规则
KERNEL=="dchars",            MODE="0666"
vim批量修改选中的内容
选中编辑内容,然后输 入:就会提示
:'<,'>
接下来输入s命令
:'<,'>s/$/,/g
这样就在选中行的末尾追加,逗号了
配置b机NAT 共享上网
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F 清空filter表中防火墙设置
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
这 样其他机子将网关设置为b机,然后其他机子就能通过b机共享上网了.
如果使 用NFS网络文件系统
vim /etc/exports 加入如下一行
/vobs *(rw,sync,no_root_squash)
然后(加入nolock可以解决samba快速访问mount过来的nfs文件)
mount -t nfs -o nolock 10.1.0.1:/vobs /mnt/movies
top命令使用详解
h       显示帮助信息
u       显示指定用户开启的程序
s或d    设置top刷新时间间隔,默认3秒
1       显示多cpu信息
k       杀死进程
r       设置进程nice
H       显示threads线程
c       用来切换命令和参数
f       用来选择都显示哪些监控字段
o       用来改变显示字段的左右显示顺序
F或O    用来选择使用哪一个字段作为默认sort排序字段
R       用来reverse当前排序
<和>    用来改变当前默认排序,需要结合z颜色显示和x都开启[luther.gliethttp]
z       使用color显示模式
x       将当前sort的列用白色字体显示(列显示)
y       将当前没有调用睡眠函数做睡眠的进程,即正在运行的进程使用白色字体(行显示)
b       将x和y的行列反显
B       将x和y的行列白色字体加粗,同时变为红色字体[luther.gliethttp]
W       将当前配置写入~/.toprc
ps常用命令组合
man ps
ps --help
ps au              只显示有终端的程序,加入x参数将显示没有终端而运行的程序
ps aux |grep       你要查找的进程信息[luther.gliethttp
ps aux ww          加入ww用来显示详细的参数信息,不会出现参数被截断现象
ps aux --sort pid  根据pid排序[luther.gliethttp
ps aux --sort rss  根据占用物理内存的大小(单位k)
ps -A -opid,etime,args,lstart  详细显示进程启动时间和进程持续运行时长
ps axf             显示进程见关联的树状结构图,类同
pstree -a
ps auxm -L         显示进程包含的threads线程数目和线程pid
grep一些常用参数
grep -nr  abc *    大小写敏感查找,n显示行号,r递归子目录
grep -inr abc *    忽略大小写查找
grep -lr  abc *    只显示匹配上的文件名称,不显示内容
sed -i             不用打印到stdout,直接对源文件进行操作

BASE_SECTION=gliethttp
gliethttp_value=123test
sed "s/${BASE_SECTION}=.*/${BASE_SECTION}=${gliethttp_value}/" < luther.gliethttp.txt
sed -i "s/${BASE_SECTION}=.*/${BASE_SECTION}=${gliethttp_value}/" luther.gliethttp.txt
在含有java字符串的行首添加123456
sed '/java/ s/^/123456/' gliethttp.java
将未含有java字符串的行删除,同时在含有java字符串的行首添加123456
sed '/java/!d s/^/123456/' gliethttp.java
alias别名的简便使用
alias gliethttp='ls -lrht'
gliethttp 直接输入即等效于ls -lrht命令
alias 查看当前所有设置的alias别名
unalias gliethttp 删除设置的别名
cut的使用替代awk的字段处理
cut -d: -f1,2 gliethttp.txt  以:为字段分割符号,提取1和2字段内容
cut -d: -f4- gliethttp.txt   以:为字段分割符号,提取4字段之后的所有字段内容
cut -d' ' -f1 gliethttp.txt  以空格为分割符号,提取第1个字段内容
cut -c5-8 gliethttp.txt      提取第5个到8个之间的所有字符
cut -c7 gliethttp.txt        提取第7个字符
cut -c5-8,20- gliethttp.txt  提取第5个到8个之间的所有字符,以及第20个字符之后的所有字符
grep和sed -i结合完成文件内容批量修改
grep -rl gliethttp123 * |xargs sed -i 's/gliethttp123/gliethttp/g'
如 何让sed引用env环境变量
str=gliethttp
echo abc|sed "s/^/${str}/"

str='\/gliethttp\/'
echo abc|sed "s/^/${str}/"

echo /123/abc/ |sed "s/\//\\\\\//g"
如果在 sh脚本里面可以这样执行
echo $(echo '/vobs/gliethttp' | sed -e 's/\//\\\//g')
批量建立ln链接别名(把所有mips-linux-gnu-*链接为mipsel- linux-*)
find * |awk -F - '{system("ln -s "$0" mipsel-linux-"$4$5$6$7$8$9"")}'
使用mv批量修改文件名
find * |awk '{system("mv "$0" 1920x1080_"$0"")}'
使用 rename批量修改文件名
rename 's/[^0-9.flv]//g' *  直接就搞定了,不用下面分体的设置了,因为出了0-9数字和后缀之外,全部都是汉字
rename 's/\.flv/\.rm/g' *.flv                     将.flv后缀改为.rm后缀
rename 's/[^0-9]//g' *;rename 's/$/.flv/g' *      只留下文件的数字部分,然后在数字结尾追加.flv后缀(主要是iku爱酷下载的火影名字都不统一,所以作这个统一修改)
使用dd读取文件的第4个字节,将stderr数据送入/dev/null,而stdout正常 输出
dd bs=1 skip=3 count=1 if=gliethttp.bin 2>/dev/null | xxd -g 1
sudo dd if=/dev/sda bs=1 count=2048 2>/dev/null |hexdump -C
使用od倒 序将bin显示为hex或xxd显示和拼接16进制数据和将hex还原为bin
xxd -g 1 < gliethttp.bin         显示gliethttp.bin
xxd -p gliethttp.bin |tr -d '\n' 剔除\n回车,让所有hex数据变为1行,参数-p表示连续输出hex
echo 30313233340a |xxd -r -p     将hex数据转换为bin数据,参数-p表示输入的hex为连续格式
od -A n -t x1 -v gliethttp.bin| tac -s ' ' | tr -d ' ' | tr -d '\n'
echo 123 | od -A n -t x1 -v | tac -s ' ' | tr -d ' ' | tr -d '\n' 对文件内容作倒序hex显示
在/tmp目录下创建一个随机(或者gliethttp为开头的)文件或者文件夹
mktemp      创建文件
mktemp -d   创建目录
mktemp /tmp/gliethttp.XXXXXXXX   后面的X将被mktemp替换成随机的hex数据
mktemp ~/gliethtp.XXXXXXXXXXXX   指定文件路径
在shell中直接使用printf打印
luther@gliethttp:~$ printf "%04x,%d\n" 123 0xa
luther@gliethttp:~$ printf "\x35"  打印十六进制数据0x35为二进制
luther@gliethttp:~$ printf "%-015s = %04d\n" gliethttp 0xa
向一个文件的结尾padding填充0数据
head -c 16 /dev/zero >>gliethttp.bin
设置screen分辨率(使用cvt命令生成xorg.conf下的屏幕分辨率和刷 新率)
生成1280x600刷新75Hz
luther@gliethttp:~$ cvt 1280 600 75 或这 gtf 1280 600 75(cvt是基于gtf开发的 程序,所以cvt更好一些)
# 1280x600 74.76 Hz (CVT) hsync: 47.03 kHz; pclk: 78.25 MHz
Modeline "1280x600_75.00"   78.25  1280 1344 1472 1664  600 603 613 629 -hsync +vsync
luther@gliethttp:~$ sudo vim /etc/X11/xorg.conf
Section "Monitor"
Identifier "Configured Monitor"
Modeline "1024x768_75.00"   82.00  1024 1088 1192 1360  768 771 775 805 -hsync +vsync
Modeline "1280x600_75.00"   78.25  1280 1344 1472 1664  600 603 613 629 -hsync +vsync
Option "PreferredMode" "1024x768_75.00"
EndSection

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
EndSection

Section "Device"
Identifier "Configured Video Device"
EndSection
设置crontab的默认charset字符集-POSIX为en_US.UTF-8以避免svn汉字操作异常
使用 crontab执行svn时应该在crontab执行的脚本头部中加入如下一行,来设置字符集,crontab默认为"POSIX"
export LC_CTYPE="en_US.UTF-8"不过最好设置为export LC_ALL="en_US.UTF-8"
这样当svn有中文时, 就不会提示:
svn:Can’t convert string from ‘UTF-8′ to native encoding
使用crontab 定时获取文件的创建和修改时间
export LC_ALL="en_US.UTF-8"
ls -l /tmp/gliethttp.crontab.statistics_report_svn

查看和设置字符集(不推荐自己设置)
locale 查看当前使用的字符集
locale -m和locale -a也可以查看字符集
vim /usr/share/i18n/SUPPORTED 这是所有可以使用的设置
export LC_ALL=zh_CN.GBK
export LC_ALL=zh_CN.GB2312
也可以只改变LC_CTYPE这1个最重要的 变量export LC_CTYPE="en_US.UTF-8"
给vim 安装plugin插件fencview.vim来查看和自动识别文件的编码格式


文件:fencview.vim.tar.bz2
大小:12KB
下载:下载





luther@gliethttp:~$ sudo cp fencview.vim /usr/share/vim/vim72/plugin/
首先输 入:FencAutoDectect自动检测,然后就可以:FencView查看自动检测到的字符集是什么了.
:F然后直接tab按键就可以了, 不用全部输入
:FencAutoDectect
:FencView
重复输入:FencView世视窗在'关闭/打开'之间切换
这 时高亮显示的字符集就是当前文件使用的字符集了
如果mount的iso文件夹里面出现了乱码,怎么来判断iso的编码呢,
可以这样
luther@gliethttp:~$ ls /mnt/iso > ~/gliethtp
luther@gliethttp:~$ vim ~/gliethttp
然 后
:F输入tab按键
:FencAutoDectect
:FencView
就可以看到iso的编码方案了,我的是 cp936
对于vim打开文件时如何自动识别,可以有如下2个方法:
1. 在.vimrc中加入如下一行
set fileencodings=utf-8,gb2312,ucs-bom,euc-cn,euc-tw,gb18030,gbk,cp936
2. 在.vimrc中加入上面安装的fencview插件指令
let g:fencview_autodetect=1
let g:fencview_auto_patterns='*'
对于方法2因为每次打开都将执行检测运算,所以效率比较低,使用方法1效率最 高的(推荐),
当方法1不能识别时,可以使用:FencAutoDectect自动检测,然后追加encoding到方法1中.
文件分割与合并
split -b 1M gliethttp.bin gliethttp_test
cat gliethttp_test* > new_gliethttp.bin
测试声卡2声道和5.1声道的左右声道对应的音箱
speaker-test -Dplug:front -c2
speaker-test -Dplug:front -c5
关于code代码超强阅读工具ctags和cscope的使用
1. 生成索引文件,类似ctags -R
cscope -Rbkq
2. 使用cs find命令查找
比如:
cs f c start.* 以start开头的所有函数都在哪里被调用了
cs f d start_k.* 以start_k开头的所有函数都调用了哪些函数
cs f f main 这样可以列出所有含main字段名字的文件
cs f g start.* 以start开头的所有函数或变量

常用的find自命令如下:
* c: 查找该函数被调用的位置
* d: 查找该函数调用了哪些函数
* e: 查找指定的正规表达式
* f: 查找指定的文件
* g: 查找指定标识符的定义位置
* i: 查找该文件在哪些地方被包含
* s: 查找指定标识符的使用位置
* t: 查找指定的文本字符串
==============================================
如何自定义windows项目管理软件project的项目字段排列方式
项 目/分组依据/自定义组
word中如何输入打勾方框
1.输入对勾
“插入/符号/数学运算符”,然后选择对勾
2.在方框内打上勾
“格式/中文板式/带圈字符”,然后选择方框,增大圈 号即可
如何清除windows共享目录登录后记忆下的登录用户密码
控 制面板==>用户账户==>选择账户,比如Administrator==>左上角的管理我的网络密码==>删除存储用户名和密 码即可
net use 查看当前拥有的所有windows共享连接
net use \\192.168.1.101\tupian /del
向xp系统“管理工具”->“服务”里面任意添加自己的东西 的简易方法,让程序开机后自动运行
注意start=后面是有空格的,还有 binpath=,displayname= [luther.gliethttp]
  1> 安装服务
    sc create subversion_luther.gliethttp_service start= auto binpath= "svnserve --service -r d:\svn_repos" displayname= "Subversion Repository" depend= Tcpip
  2> 启动服务
    sc start subversion_luther.gliethttp_service
  3> 删除服务
    sc delete subversion_luther.gliethttp_service
  这样每次起机之后就完全是我想要的了,嘿嘿
从grub提示符下进 入windows步骤
在windows下使 用磁盘管理器,把原来的fc6系统格式化成k盘了,结果一开机
就直接进入grub,好是麻烦,以下是从grub提示符下进入windows步骤
1.grub>root (hd0,0)          //第1块硬盘的第一个分区C
2.grub>chainloader (hd0,0)+1 //加入链
3.grub>boot                  //即可进入windows系统
但是每次重启 pc之后,都要输入上面的内容,所以可以直接把grub删除掉
方法1:使用系统启动盘,进入dos,执行 fdisk /mbr,清楚MBR
方法2:进入windows之后,下 载还原精灵卸载程序clsmbr.exe,直接清楚MBR[不推荐]

压缩解密exe,dll,ocx,bpl,cpl程序的加壳软件
Free UPX 1.2 绿色版_ 一个UPX 加壳压缩工具
==============================================
如何使用嵌入式设备上gadget设备g_serial.ko驱动
modprobe g_serial.ko 或者 modprobe g_serial.ko use_acm=1
如何使用嵌入式设备上gadget设备g_ether.ko驱动让arm开发板通过usb上网
1. 加载usb-net驱动
modprobe g_ether或者modprobe g_ether idVendor=0x0525 idProduct=0xa4a2 表示这是NetChip的Ethernet/RNDIS Gadget
2. 设置arm上ip地址
ifconfig usb0 192.168.1.6
3. 设置pc上的ip地址
ifconfig usb0 192.168.1.88
4. 如果想ping通本嵌入式机的自身ip那么需要设置lo的ip地址为127
ifconfig lo 127.0.0.1
这样ping 192.168.1.6就能通了
5. 设置通过pc机让usb手机NAT上网
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
6. 然后设置arm上的gw为pc机usb0的ip
route add default gw 192.168.1.88
7. 在arm上设置dns
echo 'nameserver 202.106.0.20' >> /etc/resolv.conf
8. 测试dns域名是否可用
ping baidu.com
9. 如何让pc自动设置usb0的ip地址(注意:ubuntu 9.10当如下配置之后,反而会影响usb net的数据传输,所以不要作如下设置)
sudo vim /etc/network/interfaces
auto usb0
iface usb0 inet static
address 192.168.1.88
netmask 255.255.255.0
10. ok,搞定
如何挂载嵌入式设备上gadget闪usb盘(注意busybox不能是1.0.1版本,如果是1.0.1,那么可以使用insmod命令,而不能使用modprobe了,我的是1.16.1版本,可以正常加载u盘,同时拷贝完数据之后执行sync,以便数据回写到u盘)
# cat /proc/mtd 查看用于u盘的存储分区,我的是mtdblock3
# busybox mkfs.vfat /dev/mtdblock3
或者
# busybox mkdosfs /dev/mtdblock3  
使用mkfs.vfat或者mkdosfs格式化后,如果windows上拷贝东西到u盘,linux挂载的目录下立即可见新东西,
但是linux行挂载盘拷贝数据之后,windows上的磁盘不能立即看到更新数据
# mount /dev/mtdblock3 /mnt -t vfat
# sync 将缓冲中的拷贝数据回写到flash中
# ls /lib/modules/2.6.34/kernel/drivers/usb/gadget/  查看我们当前拥有的gadget驱动
g_ether.ko         g_file_storage.ko  g_serial.ko
# modprobe g_file_storage file=/dev/mtdblock3 stall=0 removable=1
# rmmod g_file_storage 卸载u盘
如何交叉编译arm-linux程序
./configure --host=arm-linux
或者
CC=arm-linux-gcc ./configure
或者
make CC=arm-linux-gcc
或者
make CC=arm-linux-gcc LDFLAGS=-static 编译与库无关的完全独立程序
如何直接查看arm-linux上应用程序使用 到的库
arm-linux-readelf -d udevd|grep lib 或者使用busybox的ldd命令直接查看
选使用arm-linux-gcc-4.3.2编译必须启用内核中的Use the ARM EABI项
如果使用了arm-linux-gcc-4.3.2.tgz(with EABI)含有EABI的gcc编译器,
那 么编译内核也应该在make menuconfig时选择EABI特有支持,否则编译出来的内核和rootfs中的程序都不能正常运行.

错 误原因:没有选择Use the ARM EABI to compile the kernel选项
Kernel Features
[ ] Use the ARM EABI to compile the kernel
解决方法:将它寻上之后自动多出下面一行,这样再次编译的 内核就ok了,嘿嘿:)
[*] Use the ARM EABI to compile the kernel
[*]   Allow old ABI binaries to run with this kernel (EXPERIMENTAL) (NEW)
make modules_install指定ko安装路径
make modules_install INSTALL_MOD_PATH=/home/luther/gliethttp_dir
如何编译某一个ko模块
make modules M=drivers/usb/gadget/
这样可以只是编译drivers/usb/gadget/目录下的ko模块
为arm平台的内核安装/lib/modules/路径
luther@gliethttp:~$ mkdir -p gliethttp_rootfs/lib/modules/2.6.21
luther@gliethttp:~$ /sbin/depmod -ae -F System.map -b gliethttp_rootfs -r 2.6.21
luther@gliethttp:~$ tree gliethttp_rootfs/
gliethttp_rootfs/
`-- lib
    `-- modules
        `-- 2.6.21
            |-- modules.alias
            |-- modules.alias.bin
            |-- modules.ccwmap
            |-- modules.dep
            |-- modules.dep.bin
            |-- modules.ieee1394map
            |-- modules.inputmap
            |-- modules.isapnpmap
            |-- modules.ofmap
            |-- modules.pcimap
            |-- modules.seriomap
            |-- modules.symbols
            |-- modules.symbols.bin
            `-- modules.usbmap
如何将tmpfs内存文件系统挂载 到一个目录
mount -t tmpfs tmpfs /tmp/
如何将ramfs内存文件系统挂载到一个目录
mount -t ramfs none /ramfs/
如何向kernel内核添加yaffs2文件系统支持


~$ tar zvxf cvs-root.tar.gz
~/cvs/yaffs2$ vim README-linux-patch
可以看到向linux内核源码追加yaffs2的方法,我们将仿照该命令为linux- 2.6.30.4内核源码安装yaffs2文件系统.
./patch-ker.sh c /usr/src/linux
~/cvs/yaffs2$ ./patch-ker.sh c /luther/linux-2.6.30.4/
~/cvs/yaffs2$ vim /luther/linux-2.6.30.4/fs/Kconfig
~/cvs/yaffs2$ vim /luther/linux-2.6.30.4/fs/Makefile
可以看到都已经自动添加了yaffs2支持和编译.
/luther/linux-2.6.30.4$ make menuconfig
就可以看到
File systems  --->
[*] Miscellaneous filesystems  --->
< >   YAFFS2 file system support (NEW)
如何制作yaffs2文件系统
mkfs.yaffs2或者mkyaffs2image该工具在上面yaffs2源码utils/目录下
格式:mkyaffs2image dir image_file [convert] 其中参数[convert]用来produce a big-endian image from a little-endian machine
./mkyaffs2image /vobs/rootfs /tftp/rootfs_yaffs2.img
如何制作jffs2文件系统
# mkfs.jffs2 -s 0x1000 -e 0x40000 -p 0x500000 -r /vobs/rootfs -o /vobs/tftp/gliethttp.jffs2
页大小0x1000   4k
块大小0x40000  256k
jffs2分区总空间0x500000即5M
当然生成的test.img.jffs2并没有一下子分配5M,还是实际大小0xc0000
如何在pc上mount一个jffs2文件
sudo modprobe jffs2
sudo modprobe mtdchar
sudo modprobe mtdblock
sudo modprobe mtdram total_size=0x2800000 申请一个40M大小的模拟mtd分区的内存
sudo dd if=/jffs2.img of=/dev/mtd0
sudo mount -t jffs2 /dev/mtdblock0 /mnt/
如何制作fat32文件系统
busybox mkfs.vfat /dev/mtdblock3
如何生成和查看initramfs文件系统
生成initramfs.gz加载文件
scripts/gen_initramfs_list.sh -o /vobs/gliethttp/initramfs.gz /vobs/nfs/
如果-d后面不加任何参数那么将显示默认的 initramfs中包含的文件
scripts/gen_initramfs_list.sh -d
显示 initramfs.cpio中的包含的文件
gunzip /vobs/gliethttp/initramfs.gz
cpio -i -t < /vobs/gliethttp/initramfs
或者直接显示initramfs.gz中包含的文件
gunzip -c /vobs/gliethttp/initramfs.gz | cpio -i -t
如何让busybox快速install到指定目录
1. make install CONFIG_PREFIX="/home/luther/gliethttp_busybox"
2. 如果busybox已经在arm平台上,那么只能执行
   ./busybox --install -s 将创建符号连接
   ./busybox --install 将直接生成文件
如何配置busybox内置的telnet服务程序
无论哪一种方法,首先都需要有passwd文件,编辑该文件.
# vi /etc/passwd 追加如下一行内容
root::0:0:root:/:/bin/sh
这样pc上的telnet使用root用户,不用输入密码自动登录到arm开发板了[luther.gliethttp]
方法1:直接启动
# telnetd
方法2:添加到启动脚本中
# vi /etc/inittab   在inittab中追加如下内容,然后reboot开发板,重启之后,
::once:/sbin/telnetd
如何配置busybox内置的tftpd服务程序
server服务器配置
方法1:
# mkdir /gliethttp_tftpd_dir
# udpsvd -vE 0 69 tftpd -c /gliethttp_tftpd_dir &
// 上面的0表示对所有ip地址都进行侦听
// 如果设置为127.0.0.1那么只能开发板本地arm可以进行ftp
// 比如开发板eth0的的ip地址设为192.168.1.102,那么就不能通过该ip登录
// 所以上面指定ip等于0,那么无论来自127.0.0.1还是192.168.1.102网络地址的
// 数据都能使用tftpd服务器.
// 参数-c表示允许client客户端上传文件到/gliethttp_tftpd_dir根目录[luther.gliethttp]
方法2:
# mkdir /gliethttp_tftpd_dir
# vi /etc/inetd.conf
69 dgram udp nowait root tftpd tftpd -c /gliethttp_tftpd_dir
# inetd  // inetd会执行/etc/inetd.conf脚本中的命令行,这样ftpd就作为daemon运行到起来了
(注意:以上2种方式运行的tftpd都不会在ps中看到tftpd进程的运行)
在pc上执行如下测试 (注意:必须使用i386版本busybox的tftp程序才可以进行数据传输,
ubuntu 8.10上默认的tftp因为封包协议问题不能工作,将提示:Error code 0: malformed packet)
1.将pc上的gliethttp.c文件put到arm开发板 tftpd的根目录下,并且重命名为gliethttp.pc.c
~$ busybox tftp -l gliethttp.c -r gliethttp.pc.c -p 192.168.1.102
2.将arm开发板tftpd根目录下的busybox拷贝到pc上,重命名为busybox.arm
~$ busybox tftp -l busybox.arm -r busybox -p 192.168.1.102
如何配置busybox内置的ftpd服务程序
server服务器配置
方法1:
# mkdir /gliethttp_ftpd_dir
# tcpsvd 0 21 ftpd -w /gliethttp_ftpd_dir &
// 上面的0表示对所有ip地址都进行侦听
// 如果设置为127.0.0.1那么只能开发板本地arm可以进行ftp
// 比如开发板eth0的的ip地址设为172.20.0.2,那么就不能通过该ip登录
// 所以上面指定ip等于0,那么无论来自127.0.0.1还是172.20.0.2网络地址的
// 数据都能使用ftpd服务器.
// ftpd -w这里的参数-w表示client可以对目录执行写操作
// 可以使用-t和-T参数设置client在没有任何操作的最大时间之后ftpd主动断开client连接,即:Idle and absolute timeouts
// 默认-t为2分钟=2 * 60,-T为1小时=1 * 60 * 60
方法2:
# mkdir /gliethttp_ftpd_dir
# vi /etc/inetd.conf
21 stream tcp nowait root ftpd ftpd -w /gliethttp_ftpd_dir
# inetd                 // inetd会执行/etc/inetd.conf脚本中的命令行,这样ftpd就作为daemon运行到起来了
(注意:以上2种方式运行的 ftpd都不会在ps中看到ftpd进程的运行)
如何使用busybox提供的mdev热插拔设备节点的动态创建
echo /sbin/mdev > /proc/sys/kernel/hotplug
如何使用busybox提供的dhcp动态获取ip
方法1:
udhcpc eth0  (pc上是dhclient eth0)
方法2:
busybox中udhcpc的默认script脚本地址为
#define DEFAULT_SCRIPT   CONFIG_UDHCPC_DEFAULT_SCRIPT
#define CONFIG_UDHCPC_DEFAULT_SCRIPT "/usr/share/udhcpc/default.script"
我想之所以以它作为默认地址,肯定有他的道理,所以在这个地址上创建它
luther@gliethttp:/vobs/initramfs$ mkdir usr/share/udhcpc/ -p
luther@gliethttp:/vobs/initramfs$ cp ~/busybox-1.14.3/examples/udhcp/simple.script usr/share/udhcpc/default.script
luther@gliethttp:/vobs/initramfs$ chmod +x usr/share/udhcpc/default.script
在/etc/inittab中加入下面一行语句:
::once:"/sbin/udhcpc >/dev/null 2>&1" # udhcpc会退出,所以不能使用respawn,必须为once,1次,否则将一直出现udhcpc重启log信息
就这样简单的几行ip和 dns就能自动获取了[luther.gliethttp]
其实有些东西就可以放在rcS等启动脚本中,有些可以到init脚本中去完成.
blob操作
setip client -   查看当前ip信息
setip client 192.168.1.248 - 设置client端ip
setip server 192.168.1.249 - 设置server端ip
autoip       -   自动dhcp一个ip
tftp zImage  -   下载zImage内核
boot         -   直接执行tftp下载过来的文件
nkernel      -   从flash中直接加载kernel

在flash操作命令中,-j表示写入jffs2文件,-y表示写入yaffs2文 件,-z表示写入obm,blob或者zImage文件
擦除flash
nanderase [-j|-z|-y] flash_addr length
使用nanderase -j选项除了执行mhn_erase_one_block擦出整块操作之外,还会将每块的page0的oob空间填入jffs2_sb_oob或者jffs2_lb_oob格式化数据,所以感觉最好不要使用该选项来erase,就使用干净的-z即可
写flash命令
nandwrite [-j|-z|-y] ram_addr flash_addr length
如何使用blob重新建立bbt坏块检索表
1. reset_bbt 首先通过复位bbt来擦除原有bbt,会提示擦出的flash范围,我的是0-0x20000
2. nanderase -z 0x0 0xf0000000 将整个flash重新erase一遍
3. init_bb
如何使用ntbb和wtptp烧写flash
1. 生成wtptp使用的NTIM头信息文件和在所有bin数据开头加入4字节id头信息的_h.bin文件,其中images_chain.txt中的第1个文件名就是NTIM文件名
ntbb.exe -m 1 -r images_chain.txt
2. 擦除整个flash,然后wtptp下载dkb,之后dkb程序会倒序下载烧写上面生成的所有NTIM和它包含的_h.bin文件
(-t表示NTIM文件,-f表示含有4字节id链头的_h.bin文件)
ntwtptp.exe -P USB -t GLIETHTTP_DKBNTIM.bin -f GLIETHTTP_NTDKB_h.bin 下载dkb
ntwtptp.exe -P USB -t GLIETHTTP_IMAGES_NTIM.bin -f GP_NTOBM_h.bin -f blob_h.bin -f zImage_h.bin -f GP_rootfs_h.bin
如何使用jtag运行MHLV_NTDKB.bin这个dkb烧写obm+blob+zImage+rootfs
1. 打开ads的axd调试程序
2. 先run一下,然后stop,这时我们就可以对0x5c013000地址有写权限了
3. File->Load Memory from file
4. 将Address写为:0x5c013000,然后选择MHLV_NTDKB.bin文件
5. 在code汇编码的视窗中
   右键->Set PC然后输入0x5c013000,然后Stack pointer设为User define设为0x5c013000
   之后run,这样DKB就可以下载东西了
6. 运行wtptp就可以下载如上文件了(需要注意的是,这时pxa310板子usb必须直接接到pc主机的usb口上不能使用hub,否则烧写会出现停顿)
地址0x5c000000-0x5c008000之间32k的空间专门用来存储caddo代码
地址0x5c008000-0x5c013000之间44k的空间一般用来作为data/statck空间
地址0x5c013000-0x5c040000之间180k的空间一般用来存放加载的obm,dkb之类
对于pxa3xx系列sram一共256k
或者先下载dkb运行,来完成DDR初始化,之后将blob下载到DDR的0x80200000地址,至于下载DKB还是blob各种情况都有变,所以只能尝试.
关于marvell的pxa3xx处理器代号对照
pxa300代号MonahansL
pxa310代号MonahansLV
pxa320代号MonahansP
pxa930代号Tavor P
==============================================
wildcard    -   扩展通配符  src=$(wildcard *.c ./abc/*.c)  将当前目录下和abc目录下的所有.c文件列举出来
notdir      -   去除路径    $(notdir $(src)) 去处所有路径,只剩下文件名,与shell命令basename类似
patsubst    -   替换通配符  $(patsubst %.c, %.o, $(dir) $(dir2) ) 将参数$(dir)和$(dir2)中包含的所有结尾的.c替换为.o
subst       -   字符替换    $(subst $(space),, $(string)) 将$(string)字符串中包含的$(space)删除
shell       -   执行shell   $(shell pwd) 执行shell命令pwd
@           -   不将执行的命令显示出来 @echo $(shell pwd)
-           -   即便该语句执行失败,make也不停止
call        -   调用函数    $(call cmd,vmlinux__)
ARCH:=arm   -   变量将立即展开,被赋值为arm
ARCH=arm    -   在变量被引用时刻才展开
PHONY += abc -  继续向变量PHONY追加内容
foreach     -   把参数中的单词逐一取出放到参数所指定的变量中,
                然后再执行所包含的表达式$(foreach ,,)
sort        -   升序排序$(sort )
strip       -   去掉字符串中的空格 $(strip )
addprefix   -   把前缀加到中的每个单词后面  $(addprefix ,)
basename    -   从文件名序列中取出各个文件名的前缀部分$(basename )
findstring  -   在字串中查找字串 $(findstring ,)
INSTALL_PATH ?= /boot 如果INSTALL_PATH没有被定义,那么将其定义为/boot
origin      -   检查变量是从哪个地方传进来的 $(origin )
                "undefined"     - 表示从来没有定义过
                "default"       - 表示是一个默认的定义
                "environment"   - 表示是一个环境变量并且当Makefile 被执行时,"-e"参数没有被打开
                "file"          - 表示这个变量被定义在Makefile中
                "command line"  - 表示这个变量是被命令行定义的
                "override"      - 表示是被override 指示符重新定义的
                "automatic"     - 表示是一个命令运行中的自动化变量
VPATH       -   make会在当当前目录找不到的情况下,到VPATH = src:../headers所指定的目录中去找寻文件
vpath       -   这和上面提到的那个VPATH 变量很类似,但是它可以更灵活的指定不同的文件在不同的搜索目录中
                1. vpath
                   为符合模式的文件指定搜索目录
                2. vpath
                   清除符合模式的文件的搜索目录
                3. vpath
                   清除所有已被设置好了的文件搜索目录
                vpath %.h ../headers 表示如果某文件在当前目录没有找到的话,make就会去../headers下查找

automake根据Makefile.am生成Makefile.in
configure根据Makefile.in生成Makefile
==============================================
多组key和key_id同时传给server,这样client上可以随时更换key
每 个key都有1个key_id来对应,client端加密数据时,在加密的数据头部加入key_id,这样在server接收端就可以根据 key_id,通过查表使用相应的key来解密数据了,但是需要先将所有key_id对应的key传输到server端,然后client端不论是定时还 是任意时刻更换数据加密key,server端都可以根据加密数据头部的key_id来找到对应的解密key来完成数据解密.
加入dump_stack()辅助阅读复杂的ko驱动的和内核源码调用关系
dump_stack()
c++调用c生成的so库或者c库函数
#include
using namespace  std;
c语言读取bin文件
int fd;
fd = open("出嫁.wav", O_RDWR);
lseek(fd, 46, SEEK_SET);    // 前46字节为wav音频头忽略
read(fd, buf, AUDIO_CACHE); // 读取pcm音频数据
c语言一行行读取文本文件

FILE *fp;
fp = fopen("readme.txt","r");
fseek(fp, 0L, SEEK_SET);
while (fgets(path, sizeof path, fp)) {}
生 成.so动态库
gcc -shared -fPIC -o libhello.so hello.c
gcc -L. -lhello -o hello main.c
生成.a静态库

gcc -c hello.c
ar rc libhello.a hello.o
gcc -L. -lhello -o hello main.c
获取struct结构体某个数据项的size大小和 offset偏移量,以及container_of结构体内局部变量到结构体头部快速计算
#define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)
#define ssizeof(TYPE, MEMBER) (sizeof(((TYPE *)0)->MEMBER))
#define container_of(ptr, type, member) ({            \
    const typeof(((type *)0)->member) * __mptr = (ptr);    \
    (type *)((char *)__mptr - offsetof(type, member)); })
struct abc {
    char a[3];
    char *b;
};
printf("%d:%d:%d\n", ssizeof(struct abc, a), ssizeof(struct abc, b), sizeof(struct abc));
原来数组还可以指定具体索引号index来初始化和批量初始化
struct abc {
    int a;
    char *b;
};
#define OFFSET 99
#define ELEMENT_MAX 100
struct abc tst[ELEMENT_MAX] = {
        [OFFSET] = {1, "gliethttp"}, // 设置tst[99]的数值
};
或者
[OFFSET] = {.a = 1, .b = "gliethttp"},
还有就是批量赋初始值
[0 ... ELEMENT_MAX-1] = {1, "gliethttp"}
gcc编译器字节非优化对齐属性
编 译属性:__attribute__((aligned(4))) //4字节对齐,即2**4=32bits位对齐
spinlock_t  luther_gliethttp_test_spin_lock __attribute__((aligned(4)));
编译属 性:__attribute__ ((packed)) //不进行变量空间优化,紧凑分配变量空间
spinlock_t  luther_gliethttp_test_spin_lock_packed __attribute__ ((packed));
将字符串0x25,-1,23等转化为整型的
int main(int argc, char *argv[])
int result = strtol(argv[2],NULL,0);可以实现0x25,-1之类输入的转换
还有些函数 atoi,strchr,strsep,strtok
几种定 义#define printf的形式
#define luther_printf(msg...) printf("===luther:=== "msg)
比如:luther_printf("event : custom -> %s\n", buf);
#define lu_printf(level, msg...) LU_PRINTF_##level(msg)
#define lu_printf2(...) printf(__VA_ARGS__)
#define lu_printf3(...) lu_printf(__VA_ARGS__)
static int lu_printf4_format(int prio, const char *fmt, ...);
#define lu_printf4(prio, fmt...) lu_printf4_format(prio, fmt);
#define pr_debug(fmt, ...) do { \
    dynamic_pr_debug(fmt, ##__VA_ARGS__); \
    } while (0)
如果获取系统时间
struct timeval tv;
gettimeofday(&tv, NULL);
fprintf(stderr, "[ %ld.%06ld ] ", tv.tv_sec, tv.tv_usec);
驱 动中可以直接调用系统调用实现函数do_gettimeofday()
折半 快速查找
bsearch
使用nm查看 a.out,vmlinux未压缩内核等拥有的符号表
nm a.out
使用size查看text,data,bss段大小
size a.out
使用strip -s优化代码大小,经过优化的代码就不能使用nm查看了
strip -s a.out
在gnome-termial中比较2个字符串是否相 等,为0相等,1不等
expr a1b5433209ef92a940c96d09e2c23e4f = a1b5433209ef92a940c96d09e2c23e4f
计算一 个文件的md5指纹值
md5sum gliethttp.bin
计算一个文件的sha1哈西指纹
sha1sum gliethttp.bin
计算一个文件的sha256哈西指纹
sha256sum gliethttp.bin
kernel中添加一个可以被其他.c引用的函 数EXPORT_SYMBOL
需 要EXPORT_SYMBOL(wlan_get_mmc_host);导出,这样.ko,其他独立的非编译到内核中的module即.ko程序对函数 void *wlan_get_mmc_host(unsigned long *detect_delay);才可见.
对bin或者elf文件做反汇编
arm-linux-objdump -DS -b binary -m arm redboot.bin 反汇编arm模式bin文件
arm-linux-objdump -DS -b binary -m arm -M force-thumb redboot.thumb.bin 反汇编thumb模式bin文件
arm-elf-objdump -DS flasher.elf
生成一个文件的aes-128-cbc加 密后的密文和解密
openssl enc -aes-128-cbc  < luther.gliethttp.test.c > gliethttp
openssl enc -aes-128-cbc -d < gliethttp
或者
openssl aes-128-cbc < luther.gliethttp.test.c > gliethttp
openssl aes-128-cbc -d < gliethttp
使用openssl version为OpenSSL 0.9.8g 19 Oct 2007生成hmac sha1摘要数据
openssl dgst -sha1 -hmac 123456 -binary test_gliethttp.bin >> hmacsha1.bin

对于加密,如果没 有使用-S指定hsalt,那么openssl会
调用RAND_pseudo_bytes(salt, sizeof salt)随机产生一个salt值,
当然salt和magic是用来综合产生key和iv的,如果使用-K和-iv强行指定了key和iv的话,
那 么-S就没有任何意义了,因为虽然-S也执行,但是函数根据salt产生的key和iv
EVP_BytesToKey(cipher,dgst,sptr, (unsigned char *)str, strlen(str),1,key,iv);
将在下面
if ((hiv != NULL) && !set_hex(hiv,iv,sizeof iv))
if ((hkey != NULL) && !set_hex(hkey,key,sizeof key))
直接覆盖,所以最终会使用用户自定义的十六进制格式key 和iv来加密数据,因为没有定义password,所以也就不会生成magic和salt这16个字节数据域到out输出文件中.

openssl aes-128-cbc -v -p -iv 00000000000000000000000000000000 -K 00000000000000000000000000000000 -in luther.gliethttp.test.c -out gliethttp
openssl aes-128-cbc -v -p -d -iv 00000000000000000000000000000000 -K 00000000000000000000000000000000 -in gliethttp -out gliethttp.c

==============================================
我 的liveusb中syslinux/text.cfg追加的自己的文件
LABEL MaxDOS
MENU LABEL Max DOS V7.1
kernel /dos/memdisk c=555 h=2 s=18 flopp
append initrd=/dos/Maxs.sys c=555 h=2 s=18 floppy

LABEL redhatel5
MENU LABEL Redhat Entreprise Server Linux 5
kernel /ubu_rhel/rhel5/vmlinuz
append initrd=/ubu_rhel/rhel5/initrd.img root=/dev/sda1

# 只有alternates能够netboot安装,desktop不能做netboot安装,在ubuntu-9.10-alternate-i386.iso的install/netboot /ubuntu-installer/i386/下就有专用linux和initrd.gz
LABEL ubuntu910net
MENU LABEL ubuntu 9.10 net
kernel /ubu_rhel/net/u910/linux
append initrd=/ubu_rhel/net/u910/initrd.gz

LABEL ubuntu910
MENU LABEL ubuntu 9.10
kernel /ubu_rhel/ubuntu_9.10/vmlinuz
append initrd=/ubu_rhel/ubuntu_9.10/initrd.lz root=/dev/sda8 boot=casper iso-scan/filename=/ubuntu-9.10-desktop-i386.iso quiet splash ro
==============================================
// 电信,ubuntu-8.10-desktop-i386.iso更新源
luther@gliethttp:~$ sudo vim /etc/apt/sources.list
deb intrepid main restricted universe multiverse
deb intrepid-security main restricted universe multiverse
deb intrepid-updates main restricted universe multiverse
deb intrepid-proposed main restricted universe multiverse
deb intrepid-backports main restricted universe multiverse
deb-src intrepid main restricted universe multiverse
deb-src intrepid-security main restricted universe multiverse
deb-src intrepid-updates main restricted universe multiverse
deb-src intrepid-proposed main restricted universe multiverse
deb-src intrepid-backports main restricted universe multiverse
deb intrepid main restricted universe multiverse
==============================================
// 电信,ubuntu-9.10-desktop-i386.iso更新源
luther@gliethttp:~$ sudo vim /etc/apt/sources.list
deb karmic main restricted universe multiverse
deb karmic-security main restricted universe multiverse
deb karmic-updates main restricted universe multiverse
deb karmic-proposed main restricted universe multiverse
deb karmic-backports main restricted universe multiverse
deb-src karmic main restricted universe multiverse
deb-src karmic-security main restricted universe multiverse
deb-src karmic-updates main restricted universe multiverse
deb-src karmic-proposed main restricted universe multiverse
deb-src karmic-backports main restricted universe multiverse
或者(推荐)
deb karmic main restricted
deb-src karmic main restricted
deb karmic-updates main restricted
deb-src karmic-updates main restricted
deb karmic universe
deb-src karmic universe
deb karmic-updates universe
deb-src karmic-updates universe
deb karmic multiverse
deb-src karmic multiverse
deb karmic-updates multiverse
deb-src karmic-updates multiverse
deb karmic-security main restricted
deb-src karmic-security main restricted
deb karmic-security universe
deb-src karmic-security universe
deb karmic-security multiverse
deb-src karmic-security multiverse
==============================================
// 电信,ubuntu-10.04-desktop-i386.iso更新源
luther@gliethttp:~$ sudo vim /etc/apt/sources.list
deb lucid main multiverse restricted universe
deb lucid-backports main multiverse restricted universe
deb lucid-proposed main multiverse restricted universe
deb lucid-security main multiverse restricted universe
deb lucid-updates main multiverse restricted universe
deb-src lucid main multiverse restricted universe
deb-src lucid-backports main multiverse restricted universe
deb-src lucid-proposed main multiverse restricted universe
deb-src lucid-security main multiverse restricted universe
deb-src lucid-updates main multiverse restricted universe
==============================================
// 电信,ubuntu-10.10-desktop-i386.iso更新源
deb maverick main multiverse restricted universe
deb maverick-backports main multiverse restricted universe
deb maverick-proposed main multiverse restricted universe
deb maverick-security main multiverse restricted universe
deb maverick-updates main multiverse restricted universe
deb-src maverick main multiverse restricted universe
deb-src maverick-backports main multiverse restricted universe
deb-src maverick-proposed main multiverse restricted universe
deb-src maverick-security main multiverse restricted universe
deb-src maverick-updates main multiverse restricted universe
==============================================
luther@gliethttp:~$ sudo apt-get update
luther@gliethttp:~$ sudo apt-get install build-essential libncurses5-dev patch stardict subversion subversion-tools scim-chinese ctags minicom lrzsz putty openssh-server openssh-client gparted gthumb vbindiff wmii ghex pwgen syslinux mtools filezilla xvnc4viewer rar tree gnochm samba smbfs vim-gnome tofrodos audacious smplayer w32codecs xinetd tftpd-hpa tftp-hpa wine poppler-data g++ scrot manpages-dev bluefish dia kchmviewer

----------start 10.04和10.10的安装--------------
将《ubuntu-10.04-安装包》中的所有文件拷贝到/var/cache/apt/archives文件夹下,这样可以避免网络下载deb安装包
luther@gliethttp:~$ sudo apt-get install build-essential libqt3-mt libncurses5-dev patch stardict subversion subversion-tools scim-chinese ctags cscope minicom lrzsz putty openssh-server openssh-client gparted gthumb vbindiff wmii ghex pwgen syslinux mtools filezilla xvnc4viewer rar tree samba smbfs vim-gnome tofrodos audacious smplayer xinetd tftpd-hpa tftp-hpa wine poppler-data g++ scrot manpages-dev kchmviewer automake cairo-dock p7zip-full pidgin git-core git-daemon-run nfs-kernel-server qemu thunderbird lm-sensors sensors-applet hddtemp sshfs beagle

vim ~/.gitconfig添加如下内容(color用来让git自动显示颜色)
[user]
    email = luther.ge@163.com
    name = gliethttp
[color]
    ui = auto

在/etc/beagle/config-files/FilesQueryable.xml含有所有需要被过滤的文件信息

然后进入《linux下tools》目录,安装如下软件:

virtualbox-3.2_3.2.6-63112~Ubuntu~lucid_i386.deb
skype-debian_2.1.0.81-1_i386.deb
khexedit_3.5.9-2_i386.deb
bcompare-3.1.11.12238_i386.deb
linuxqq_v1.0.2-beta1_i386.deb
install_flash_player_10_linux.tar.gz

luther@gliethttp:~$ sudo tar zxvf /install_flash_player_10_linux.tar.gz -C usr/lib/firefox-3.6.3/plugins/
----------end 10.04的安装--------------

[ps1:9.10需要去掉 w32codecs,当然即使去掉,smplayer仍然可以正常播放rmvb
 ps2:9.10使用了grub2 所以相应的menu.lst也就变成了/boot/grub/grub.cfg,所以需要
     luther@gliethttp:~$ sudo vim /boot/grub/grub.cfg
]

dia绘制流程图软件

luther@gliethttp:~$ sudo vim /etc/sudoers
在该文件的末尾追加期望不输入密码的用户.
luther  ALL=NOPASSWD: ALL

luther@gliethttp:~$ sudo vim /etc/X11/Xsession.d/95xinput
/usr/bin/scim -d
XMODIFIERS="@im=SCIM"
export XMODIFIERS
export GTK_IM_MODULE=scim
加入上面内容之后ctrl+alt+backspace重启x即可使用scim了.

去掉 update manager开机运行对笔记本硬盘没什么好处
luther@gliethttp:~$ sudo mv /usr/bin/update-manager /usr/bin/update-manager.raw

luther@gliethttp:~$ sudo mkdir /usr/bin/tracker.raw
luther@gliethttp:~$ sudo mv /usr/bin/tracker* /usr/bin/tracker.raw
luther@gliethttp:~$ sudo mv /usr/bin/updatedb /usr/bin/updatedb.raw
luther@gliethttp:~$ sudo mv /usr/bin/updatedb.mlocate /usr/bin/updatedb.mlocate.raw
对于占用 cpu 100%的update-apt-xapi后台进程如何删除
luther@gliethttp:~$ vim /etc/cron.weekly/apt-xapian-index  这是它启动的脚本源文件地址
可以通过如下指令删除
luther@gliethttp:~$ sudo apt-get remove apt-xapian-index

ubuntu8.10不能正常关机的解决方法
luther@gliethttp:~$ sudo vim /etc/init.d/alsa-utils
注释掉第362行
#    mute_and_zero_levels "$TARGET_CARD" || EXITSTATUS=1
保存之后就不会在关机时提示 Alsa...了.

luther@gliethttp:~$ wget
luther@gliethttp:~$ sudo apt-get install libqt3-mt
luther@gliethttp:~$ sudo dpkg -i BCompareLinux-3.1.6.10721_i386.deb

当前世界上压缩比最高的压缩工具: zip.org
luther@gliethttp:~$ sudo apt-get install p7zip-full
or
luther@gliethttp:~$ wget ~dfsg.1-1_i386.deb
luther@gliethttp:~$ sudo dpkg -i p7zip_9.04~dfsg.1-1_i386.deb
这样Archive Manager就有.7z这样一个压缩选项了.
命令行手工启动ubuntu内置压缩工具Archive Manager
luther@gliethttp:~$ file-roller

将ftp地址mount映射到本地目录的方法
luther@gliethttp:~$ sudo apt-get install curlftpfs
luther@gliethttp:~$ sudo curlftpfs -o rw,allow_other ftp://172.16.32.123  /home/ubuntu/ftp

用于10.04
sudo apt-get install tftpd-hpa tftp-hpa
sudo vim /etc/default/tftpd-hpa 设置内容如下

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/vobs/tftp-dir/"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="-l -c -s"

sudo chmod 777 /vobs/tftp-dir
sudo service tftpd-hpa restart
用于8.10,9.10
luther@gliethttp:~$ mkdir -p /vobs/tftp-dir
luther@gliethttp:~$ chmod a+w /vobs/tftp-dir
luther@gliethttp:~$ sudo vim /etc/xinetd.d/tftp
service tftp
{
    socket_type         = dgram
    protocol            = udp
    wait                = no
    user                = root
    server              = /usr/sbin/in.tftpd
    server_args         = -s /vobs/tftp-dir -c
    disable             = no
    per_source          = 11
    cps                 = 100 2
    flags               = IPv4
}
luther@gliethttp:~$ sudo vim /etc/inetd.conf 注释掉/etc/inetd.conf文件中tftpd启动
#tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/lib/tftpboot
luther@gliethttp:~$ sudo service xinetd restart

---------------------------------------
如何制作usb启动盘

步骤:
0、下载《WINPE LINUX DOS 完美者U盘维护系统V9》
1、用ULTRAISO打开ISO
2、启动--->写入硬盘映像
3、格式化U盘
4、便捷启动-->写入新的硬盘主引导记录(MBR)-->选择一种方式
5、便捷启动-->写入新的驱动器引导记录-->选择SYSLINUX
6、返回ULTRAISO主界面,把ISO全部文件提取到U盘(操作-->提取-->选择你的U盘盘符)
这样你的U盘中就已经是SYSLINUX版的天意8.5了,只是菜单中的返回EZBOOT菜单会用不了(这很正常,因为不是CD)
---------------------------------------
安装xp.iso光盘镜像文件
1. 进入winpe
2. 将.iso文件拷贝到本地磁盘
3. 将u盘拔出(必须作,否则xp安装时会将一些启动数据存到U盘中,同时导致u盘的mbr和syslinux丢失而不能再次启动)
4. 使用winpe的虚拟光驱加载iso
5. 点击打开虚拟光驱,install xp安装即可
6. reboot之后进入xp的正式安装
---------------------------------------
如何删除grub
1. 进入maxdos(如果不能进入dos,那么可以进入winpe,使用winpe的引导管理工具集删除)
2. 输入diskgen
3. 进入之后因为u盘现在是默认磁盘,所以需要选择硬盘作为默认磁盘
4. 按alt键,在一个下拉菜单中选择"清空主引导记录MBR",这样就可以将硬盘上的MBR恢复到默认值了
---------------------------------------
安装ubuntu 10.04恢复grub.cfg中被屏蔽掉的windows xp系统引导

1. 首先将所有mount的磁盘umount掉
2. 查询sda1对应的uuid,我的是4858-2A29
luther@gliethttp:~$ ll /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 2010-06-22 19:06 c651f0a5-c337-4502-8fb4-30c624f059c5 -> ../../sda9
lrwxrwxrwx 1 root root 10 2010-06-22 19:06 ce6d7ece-c2d2-456c-8dc9-a0adeb22f2d4 -> ../../sda8
lrwxrwxrwx 1 root root 10 2010-06-22 19:06 F845-6411 -> ../../sda6
lrwxrwxrwx 1 root root 10 2010-06-22 19:06 4858-56A5 -> ../../sda7
lrwxrwxrwx 1 root root 10 2010-06-22 19:28 4858-2A29 -> ../../sda1
lrwxrwxrwx 1 root root 10 2010-06-22 19:29 90B0-5456 -> ../../sda5
3. 向grub.cfg追加windows xp的启动参数
luther@gliethttp:~$ sudo vim /boot/grub/grub.cfg
### BEGIN /etc/grub.d/30_os-prober ###
##这里加入XP启动项参数
menuentry "Windows XP (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set 4858-2A29  ##这就是上面查询到的c盘盘对应的uuid
chainloader +1
}
### END /etc/grub.d/30_os-prober ###
最后修改默认windows启动,delay时长为1秒
set default="4"
set timeout=1

luther@gliethttp:~$ mkdir -p /vobs/nfs
luther@gliethttp:~$ sudo apt-get install nfs-kernel-server
luther@gliethttp:~$ sudo vim /etc/exports
/vobs/nfs 192.168.1.*(rw,sync,no_root_squash)
(其 中*号和(作括号之间不能有空格,否则对开发板mount上的/vobs/nfs不能执行写操作,
 但是这样pc不能mount,只有在*和(之 间加入空格,pc才能mount,但是这时,arm开发板就不能执行写操作了)
luther@gliethttp:~$ sudo service nfs-kernel-server restart
现在我们可以在我们的ubuntu 8.10主机上测试nfs是否正常启动.
luther@gliethttp:~$ mkdir gliethttp
luther@gliethttp:~$ sudo mount -t nfs 192.168.1.101:/vobs/nfs gliethttp

luther@gliethttp:~$ wget
luther@gliethttp:~$ sudo dpkg -i linuxqq_v1.0.2-beta1_i386.deb
luther@gliethttp:~$ qq
或 者安装eva
luther@gliethttp:~$ sudo apt-get install eva 但是所有老版本eva都不能登录qq了,所以需要按如下方式安装最新eva版本
luther@gliethttp:~$ wget ftp://
luther@gliethttp:~$ sudo apt-get install kdelibs4c2a
luther@gliethttp:~$ sudo apt-get install kdelibs
luther@gliethttp:~$ sudo dpkg -i eva_0.4.921bugfix58_etch_i386.deb
luther@gliethttp:~$ eva即可运行了
如果还 一直登录不能成功,那么将network登录方式改为UDP或者TCP总有一个登录协议可以使用
,同样是ubuntu 9.10,但是家里笔记本上的使用eva默认的UDP登录方式,公司台式机上的
使用eva默认UDP就是不能登录,改为TCP就可以正常登录了 [luther.gliethttp]
luther@gliethttp:~$ eva -m TCP不能使用
可以在GUI上设置TCP 模式之后,选择remember选项,这样也就将QQ号码,密码和TCP模式同时记录,不用每次登录eva都重新选择TCP模式了,第一次启动会提示一个 错误连接不上,关闭eva,再登录就能成功了[luther.gliethttp]

安装超酷的linux版本MSN客户端软件
luther@gliethttp:~$ sudo apt-get install emesene

直接使用gtalk客户端
luther@gliethttp:~$ sudo apt-get install pidgin或者 empathy
luther@gliethttp:~$ empathy或者pidgin
或者
1. 启动Application->Internet->Empathy IM Client,添加一个新账户
2. 选择Google Talk,只需要输入登录id,比如:luther.ge@gmail.com和密码即可正常登录gtalk,不需要作任何其他设置.

luther@gliethttp:~$ wget
去 网站下载最新的firefox
luther@gliethttp:~$ sudo tar jxvf firefox-3.5.2.tar.bz2 -C /usr/local/bin/
luther@gliethttp:~$ sudo rm /usr/bin/firefox
luther@gliethttp:~$ sudo ln -s /usr/local/bin/firefox/firefox /usr/bin/firefox
luther@gliethttp:~$ firefox
luther@gliethttp:~$ wget
luther@gliethttp:~$ wget
使 用firefox=>open file打开刚才下载的2个文件:fast_dial-2.23b1-fx.xpi和unmht-5.2.0.1-fx.xpi
luther@gliethttp:~$ wget
或 者
luther@gliethttp:~$ wget
luther@gliethttp:~$ wget http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.deb
luther@gliethttp:~$ sudo tar zxvf install_flash_player_10_linux.tar.gz -C /usr/local/bin/firefox/plugins
在firefox的地址栏输入:about:plugins
可以看到 Shockwave Flash的提示,这表示flashplayer安装成功了.

让firefox可以在线播放baidu的mp3文件 流音频
luther@gliethttp:~$ sudo apt-get remove totem-mozilla
luther@gliethttp:~$ sudo apt-get install mozilla-mplayer

luther@gliethttp:~$ sudo vim /etc/rc.local 在ubuntu10.04上已经不适合这样做了,可以将下面的代码放入新建的/usr/local/bin/startup_init.sh脚本中,然后
可以在Systemp==>Preferences==>Startup Applications中添加登录之后执行的程序startup_init.sh名字
sudo mount /dev/sda8 /vobs -o loop
svnserve -d -r /vobs/svn_repos/

luther@gliethttp:~$ sudo vim ~/.bashrc    追加如下内容
alias ll='ls -lrht'
export PATH='/vobs/tools/arm-tools/arm-linux-gcc-4.3.2/bin':$PATH
alias insc='sudo mount /dev/sda1 /media/c -o iocharset=utf8,loop,uid=luther,gid=luther'
alias insd='sudo mount /dev/sda5 /media/d -o iocharset=utf8,loop,uid=luther,gid=luther'
alias inse='sudo mount /dev/sda6 /media/e -o iocharset=utf8,loop,uid=luther,gid=luther'
alias insf='sudo mount /dev/sda7 /media/f -o iocharset=utf8,loop,uid=luther,gid=luther'
alias insv='sudo mount /dev/sda8 /vobs -o loop'
alias udisk='sudo mount /media/gliethttp/casper-rw /media/udisk -o loop,acl;sudo setfacl -m u:luther:rwx /media/udisk'
alias my='sudo setfacl -m u:luther:rwx .'
alias undisk='sudo umount /media/udisk'
alias 250samba='sudo mount -o iocharset=utf8 //192.168.1.250/share ~/samba/250'
alias lc='find . -name "'"*.c"'" -exec cat {} "'";"'" | grep -v "'"^$"'" | wc -l'
alias lh='find . -name "'"*.h"'" -exec cat {} "'";"'" | grep -v "'"^$"'" | wc -l'
alias lch='find . -name "'"*.c"'" -o -name "'"*.h"'" | xargs cat | grep -v "'"^$"'" | wc -l'
alias lt='scp -r /vobs/release root@172.16.32.64:/vobs/'
alias lr='scp -r root@172.16.32.64:/vobs/upload/ /vobs/'
alias dos='find . -type f  ! -path "*svn*" -exec dos2unix {} \;'
alias lps='ps -A -opid,etime,args,lstart'
alias ldu='du -sh --exclude="*.o" --exclude="*.h"'  # 查看除.o和.h文件之外所有文件的总大小
alias lrsync='rsync -avh --delete /vobs/works/gliethttp/ /media/udisk/gliethttp' #rsync src/ dst如果只是想将src/中更改的内容同步到dst上,而对src/删除的内容不再dst中加以删除,那么可以去掉--delete选项
alias lrsyncssh='rsync -avh --delete luther@127.0.0.1:/media/udisk/gliethttp/ gliethttp.local' #默认使用ssh远程登录luther用户,然后使用ssh加密通道进行数据传输,同步/media/udisk/gliethttp/文件夹中的内容到 本地的gliethttp.local目录下
alias ltree='tree -N' # 加入-N选项可以正常显示中文
export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
alias lftp='sudo curlftpfs -o rw,allow_other ftp://172.16.32.123  /home/ubuntu/ftp'
alias date.my='sudo date -s 100307 -s 11:33:08'
alias hwclock.my='sudo hwclock -w'
alias mac='echo $RANDOM | md5sum | sed "s/\(..\)/&:/g" | cut -c1-17'
alias nokia6303c='nautilus obex://[00:26:68:0C:61:92]/' # 通过蓝牙协议obex直接浏览手机上的文件

luther@gliethttp:~$ sudo cp ~/.bashrc /root

luther@gliethttp:~$ vim .vimrc
追加http://blog.chinaunix.net/u1/38994/showart.php?id=515444中 的脚本
luther@gliethttp:~$ sudo cp ~/.vimrc /root
==========================================
设置screen分辨率(使用cvt命令生成xorg.conf下的屏幕分辨率和刷新率)
生 成1280x600刷新75Hz
luther@gliethttp:~$ cvt 1280 600 75
# 1280x600 74.76 Hz (CVT) hsync: 47.03 kHz; pclk: 78.25 MHz
Modeline "1280x600_75.00"   78.25  1280 1344 1472 1664  600 603 613 629 -hsync +vsync

luther@gliethttp:~$ sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.raw
luther@gliethttp:~$ sudo vim /etc/X11/xorg.conf
Section "Monitor"
Identifier "Configured Monitor"

Modeline "1024x768_60.00"   63.50  1024 1072 1176 1328  768 771 775 798 -hsync +vsync
Modeline "1024x768_75.00"   82.00  1024 1088 1192 1360  768 771 775 805 -hsync +vsync
Modeline "1024x768_80.00"   87.50  1024 1088 1192 1360  768 771 775 807 -hsync +vsync

Modeline "1152x864_60.00"   81.75  1152 1216 1336 1520  864 867 871 897 -hsync +vsync
Modeline "1152x864_75.00"  104.00  1152 1224 1344 1536  864 867 871 905 -hsync +vsync
Modeline "1152x864_80.00"  112.50  1152 1232 1352 1552  864 867 871 907 -hsync +vsync

Modeline "1280x720_60.00"   74.50  1280 1344 1472 1664  720 723 728 748 -hsync +vsync
Modeline "1280x720_75.00"   95.75  1280 1360 1488 1696  720 723 728 755 -hsync +vsync
Modeline "1280x720_80.00"  102.50  1280 1360 1488 1696  720 723 728 757 -hsync +vsync

Modeline "1280x768_60.00"   79.50  1280 1344 1472 1664  768 771 781 798 -hsync +vsync
Modeline "1280x768_75.00"  102.25  1280 1360 1488 1696  768 771 781 805 -hsync +vsync
Modeline "1280x768_80.00"  110.25  1280 1368 1496 1712  768 771 781 807 -hsync +vsync

Modeline "1280x800_60.00"   83.50  1280 1352 1480 1680  800 803 809 831 -hsync +vsync
Modeline "1280x800_75.00"  106.50  1280 1360 1488 1696  800 803 809 838 -hsync +vsync
Modeline "1280x800_80.00"  115.00  1280 1368 1496 1712  800 803 809 840 -hsync +vsync

Modeline "1280x960_60.00"  101.25  1280 1360 1488 1696  960 963 967 996 -hsync +vsync
Modeline "1280x960_75.00"  130.00  1280 1368 1504 1728  960 963 967 1005 -hsync +vsync
Modeline "1280x960_80.00"  139.25  1280 1368 1504 1728  960 963 967 1008 -hsync +vsync

Modeline "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
Modeline "1280x1024_75.00"  138.75  1280 1368 1504 1728  1024 1027 1034 1072 -hsync +vsync
Modeline "1280x1024_80.00"  148.50  1280 1368 1504 1728  1024 1027 1034 1075 -hsync +vsync

Modeline "1360x768_60.00"   84.75  1360 1432 1568 1776  768 771 781 798 -hsync +vsync
Modeline "1360x768_75.00"  109.00  1360 1448 1584 1808  768 771 781 805 -hsync +vsync
Modeline "1360x768_80.00"  116.50  1360 1448 1584 1808  768 771 781 807 -hsync +vsync

Modeline "1400x1050_60.00"  121.75  1400 1488 1632 1864  1050 1053 1057 1089 -hsync +vsync
Modeline "1400x1050_75.00"  156.00  1400 1504 1648 1896  1050 1053 1057 1099 -hsync +vsync
Modeline "1400x1050_80.00"  167.00  1400 1504 1648 1896  1050 1053 1057 1102 -hsync +vsync

Modeline "1440x900_60.00"  106.50  1440 1528 1672 1904  900 903 909 934 -hsync +vsync
Modeline "1440x900_75.00"  136.75  1440 1536 1688 1936  900 903 909 942 -hsync +vsync
Modeline "1440x900_80.00"  146.25  1440 1536 1688 1936  900 903 909 945 -hsync +vsync

Modeline "1600x900_60.00"  118.25  1600 1696 1856 2112  900 903 908 934 -hsync +vsync
Modeline "1600x900_75.00"  151.25  1600 1704 1872 2144  900 903 908 942 -hsync +vsync
Modeline "1600x900_80.00"  163.00  1600 1712 1880 2160  900 903 908 945 -hsync +vsync

Modeline "1600x1200_60.00"  161.00  1600 1712 1880 2160  1200 1203 1207 1245 -hsync +vsync
Modeline "1600x1200_75.00"  204.75  1600 1720 1888 2176  1200 1203 1207 1255 -hsync +vsync
Modeline "1600x1200_80.00"  220.50  1600 1728 1896 2192  1200 1203 1207 1259 -hsync +vsync

Modeline "1680x1024_60.00"  142.50  1680 1784 1960 2240  1024 1027 1037 1063 -hsync +vsync
Modeline "1680x1024_75.00"  182.50  1680 1800 1976 2272  1024 1027 1037 1072 -hsync +vsync
Modeline "1680x1024_80.00"  195.25  1680 1800 1976 2272  1024 1027 1037 1075 -hsync +vsync

Modeline "1680x1050_60.00"  146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync
Modeline "1680x1050_75.00"  187.00  1680 1800 1976 2272  1050 1053 1059 1099 -hsync +vsync
Modeline "1680x1050_80.00"  201.50  1680 1808 1984 2288  1050 1053 1059 1102 -hsync +vsync

Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
Modeline "1920x1080_75.00"  220.75  1920 2064 2264 2608  1080 1083 1088 1130 -hsync +vsync
Modeline "1920x1080_80.00"  236.25  1920 2064 2264 2608  1080 1083 1088 1133 -hsync +vsync

Modeline "2048x1152_60.00"  197.00  2048 2184 2400 2752  1152 1155 1160 1195 -hsync +vsync
Modeline "2048x1152_75.00"  251.50  2048 2200 2416 2784  1152 1155 1160 1205 -hsync +vsync
Modeline "2048x1152_80.00"  270.50  2048 2208 2424 2800  1152 1155 1160 1209 -hsync +vsync

Modeline "2048x1536_60.00"  267.25  2048 2208 2424 2800  1536 1539 1543 1592 -hsync +vsync
Modeline "2048x1536_75.00"  339.00  2048 2208 2432 2816  1536 1539 1543 1606 -hsync +vsync
Modeline "2048x1536_80.00"  362.50  2048 2208 2432 2816  1536 1539 1543 1610 -hsync +vsync

Option "PreferredMode" "1024x768_60.00"
#Option "PreferredMode" "1920x1080_60.00"
EndSection

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
EndSection

Section "Device"
Identifier "Configured Video Device"
EndSection
==========================================
luther@gliethttp:~$ sudo apt-get install ksnapshot
luther@gliethttp:~$ sudo apt-get install thunderbird
如何配置 thunderbird雷鸟mail
luther@gliethttp:~$ find . -type f  ! -path "*svn*" -exec dos2unix {} \;
==========================================
美化ubuntu,安装类似mac dock的工具栏
luther@gliethttp:~$ sudo apt-get install cairo-dock
然后打开 Applications=>即可看到特效的栏目了
另外一个 超酷的dock就是Kiba Dock了
对于windows可以安装<仿mac的Dock悬浮机制AquaDock-v1.0H>
==========================================
linux 下监控cpu温度﹑显卡温度和硬盘温度

1.安装applet
luther@gliethttp:~$ apt-get install lm-sensors sensors-applet // 之后添加"Hardware Sensors Monitor到面板上,如果没有该applet,那么重启一下电脑就可以了.
luther@gliethttp:~$ sudo sensors-detect // 一路回车就可以了
效果图:
2.安装硬件检测软件
luther@gliethttp:~$ sudo apt-get install hddtemp
luther@gliethttp:~$ sudo hddtemp /dev/sda
/dev/sda: ST3160815AS: 36°C
3.安装nvidia驱动
参考《ubuntu 8.10上安装nvidia显卡驱动详细步骤》
4.安装virtualbox虚拟机
参考《如何在 ubuntu 9.10上安装配置最新的virtualbox虚拟机》



《ubuuntu 系统管理常用命令》
《浅析 ubuntu下如何修改网卡网速--将100M网卡改为10M网卡》
《ubuntu 9.10如何在xwindows或者GDM启动之后自动运行的图形应用程序》
《一 款非常不错 的linux下pdf阅读器 -- Foxit Reader可以与evince媲美》
《linux下 如何修改网卡mac地址和随机产生mac地址》

PS:如果想正常显示显卡温度,首先不需安装显卡驱动,比如nvidia显卡驱 动:)
   另外还有一个apt-get install computertemp软件,它和sensors-applet相似,但是重启电脑之后,添加到panel时
   总是提示一个错误,所以放弃使用computertemp.
阅读(7536) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~