Feb 24, 2009

ubuntu 8.10 安装无线网卡驱动

摘要:ubuntu 8.10 安装 Atheros Communications Inc. AR242x 无线网卡

通过System -> Administration -> Hardware Drivers 把显卡驱动装好了,但是
无线网卡还是不能用
ox0spy@ox0spy-laptop:~$ iwconfig
lo no wireless extensions.

eth0 no wireless extensions.

pan0 no wireless extensions.

ox0spy@ox0spy-laptop:~$ lspci -v | grep Wireless
03:00.0 Ethernet controller: Atheros Communications Inc. AR242x
802.11abg Wireless PCI Express Adapter (rev 01)

无线网卡是: Atheros的 AR242x
官网上没找到 AR242x的驱动,网上看也安装madwifi
dns无法解析svn.madwifi.org
ox0spy@ox0spy-laptop:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 ox0spy-laptop
217.24.1.142 svn.madwifi.org

下面是安装过程:
1. System -> Administration -> Hardware Drivers , Deactive Atheros 驱动
2. $ mkdir madwifi && cd madwifi
3. $ svn co https://svn.madwifi.org/madwifi/branches/madwifi-hal-0.10.5.6
4. $ make && sudo make install
4. 在/etc/module的最后添加一行:
ath_pci
5. $ sudo modprobe ath_pci

现在, iwconfig 看看,可以看到wifi0 ath0 了吧
如果还是没驱动起来,reboot 启动起来应该就发现已经驱动起来了

Feb 23, 2009

ubuntu eva 无法调用 ibus

qq for linux 功能还是很弱
pigdin不是很喜欢

所以用 eva 和QQ好友聊天
但默认无法在eva中调用ibus,解决方法:
System -> Preferences -> Main Menu,找到"eva"这一项,编辑"Properties",
在"Command" 原来命令的前面加上 :
env QT_IM_MODULE=xim XMODIFIERS="@im=ibus"

安装 ubuntu 8.10 (server, desktop)

server:
安装grub
下载 vmlinuz initrd.gz

下载地址:
http://archive.ubuntu.com/ubuntu/dists/intrepid/main/installer-i386/current/images/hd-media/

grub -> command line :
root (hd0, 3)
kernel /vmlinuz root=/dev/ram ramdisk_size=768000 devfs=mount,all
initrd /initrd.gz
boot

无法分区 :
$ sudo umount -l /hd-media

desktop:
从iso文件中的casper中提取: vmlinuz, initr.gz

grub -> command line :
root (hd0, 3)
kernel /vmlinuz boot=casper iso-scan/filename=/ubuntu-8.10-desktop-i386.iso
boot

无法分区:
$ sudo umount -l isodevice

Feb 21, 2009

.vimrc 文件

$ sudo apt-get install vim-full
##########
# .vimrc #
##########
set encoding=utf-8
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set tabstop=4

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" General
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nocompatible " get out of horrible vi-compatible mode
filetype on " detect the type of file
set history=100 " How many lines of history to remember
set ffs=unix,dos,mac " support all three, in this order
filetype plugin indent on " load filetype plugins
set viminfo+=! " make sure it can save viminfo
set isk+=_,$,@,%,#,- " none of these should be word dividers, so make
them not be

" Theme/Colors
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set background=dark " we are using a dark background
syntax on " syntax highlighting on
"colorscheme desert " my theme for gui
colorscheme evening " my theme for terminal

" Files/Backups
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nobackup " make backup file
set makeef=error.err " When using make, where should it dump the file

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim UI
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set wildmenu " turn on wild menu
set ruler " Always show current positions along the bottom
set cmdheight=1 " the command bar is 1 high
set nu " turn off line numbers
"set numberwidth=4 " minimum width to use for the number column,not a
fix size Vim64不支持
set hid " you can change buffer without saving
set backspace=2 " make backspace work normal
set whichwrap+=<,>,h,l " backspace and cursor keys wrap to
set mouse=a " use mouse everywhere
set shortmess=atI " shortens messages to avoid 'press a key' prompt
set report=0 " tell us when anything is changed via :...
set lz " do not redraw while running macros (much faster) (LazyRedraw)
" make the splitters between windows be blank
set fillchars=vert:\ ,stl:\ ,stlnc:\
"set lsp=0 " space it out a little more (easier to read)

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Visual Cues
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set showmatch " show matching brackets
set hlsearch " do highlight searched for phrases
set incsearch " BUT do highlight as you type you search phrase
set listchars=tab:\|\ ,trail:.,extends:>,precedes:<,eol:$ " what to show
when I hit :set list
set so=15 " Keep 10 lines (top/bottom) for scope
set novisualbell " don't blink
set noerrorbells " no noises
set laststatus=2 " always show the status line

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Text Formatting/Layout
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set formatoptions+=mM " for charactors fold and patch
set ai " autoindent
set si " smartindent
set cindent " do c-style indenting
set tabstop=4 " tab spacing (settings below are just to unify it)
set softtabstop=4 " unify
set shiftwidth=4 " unify
set noexpandtab " real tabs please!
set nowrap " do not wrap lines
set smarttab " use tabs at the start of a line, spaces elsewhere

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Folding
" Enable folding, but by default make it act like folding is off,
because folding is annoying in anything but a few rare cases
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set foldenable " Turn on folding
set foldlevel=100 " Don't autofold anything (but I can still fold manually)
set foldopen-=search " don't open folds when you search into them
set foldopen-=undo " don't open folds when you undo stuff

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" File Explorer
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:explVertical=1 " should I split verticially
let g:explWinSize=35 " width of 35 pixels

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CTags and Taglist
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let Tlist_Ctags_Cmd = "/usr/bin/ctags-exuberant" " Location of my ctags
let Tlist_Sort_Type = "name" " order by
let Tlist_Use_Right_Window = 0 " split to the left side of the screen
let Tlist_Compart_Format = 1 " show small meny
let Tlist_Exist_OnlyWindow = 1 " if you are the last, kill yourself
let Tlist_File_Fold_Auto_Close = 0 " Do not close tags for other files
let Tlist_Enable_Fold_Column = 0 " Do not show folding tree

set tags=./tags,./../tags,./../../tags,./**/tags,tags " which tags files
CTRL-] will search
"set autochdir " auto change the current dierctory when you open the
file or window or any other buffer Vim64不支持
set makeef=makeerror.err
set path=.,./../**,/usr/include/*,,

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Minibuf
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:miniBufExplTabWrap = 1 " make tabs show complete (no broken on two
lines)
let g:miniBufExplModSelTarget = 1

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Matchit
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let b:match_ignorecase = 1

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Mappings,I don't need any mapping now
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"map <right> <ESC>:MBEbn<RETURN> " right arrow (normal mode) switches
buffers (excluding minibuf)
"map <left> <ESC>:MBEbp<RETURN> " left arrow (normal mode) switches
buffers (excluding minibuf)
"map <up> <ESC>:Sex<RETURN><ESC><C-W><C-W> " up arrow (normal mode)
brings up a file list
"map <down> <ESC>:Tlist<RETURN> " down arrow (normal mode) brings up
the tag list
"map <A-i> i <ESC>r " alt-i (normal mode) inserts a single char, and
then switches back to normal
"map <F2> <ESC>ggVG:call SuperRetab()<left>
"map <F12> ggVGg? " encypt the file (toggle)

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Autocommands
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
autocmd BufEnter * :syntax sync fromstart " ensure every file does
syntax highlighting (full)
"autocmd GUIEnter * :simalt ~x -- " having it auto maximize the screen
au BufEnter /usr/include/c++/* setf cpp " all the file under the
directory are recognized as cpp files by vim

" if there are any error space(the end of line or before the tabs) in
c/c++ code,highlight it
"if $VIM_HATE_SPACE_ERRORS != '0'
"let c_space_errors=1
"endif

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Useful abbrevs, I don't need any iab now
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"iab xasp <%@language=jscript%><CR><%<CR><TAB><CR><BS>%><ESC><<O<TAB>
"iab xdate <c-r>=strftime("%d/%m/%y %H:%M:%S")<cr>


if has("autocmd")

" 自动检测文件类型并加载相应的设置
filetype plugin indent on

" Python 文件的一般设置,比如不要 tab 等
autocmd FileType python setlocal et | setlocal sta | setlocal sw=4

" Python Unittest 的一些设置
" 可以让我们在编写 Python 代码及 unittest 测试时不需要离开 vim
" 键入 :make 或者点击 gvim 工具条上的 make 按钮就自动执行测试用例
autocmd FileType python compiler pyunit
autocmd FileType python setlocal makeprg=python\ ./alltests.py
autocmd BufNewFile,BufRead test*.py setlocal makeprg=python\ %

" 自动使用新文件模板
autocmd BufNewFile test*.py 0r ~/.vim/skeleton/test.py
autocmd BufNewFile alltests.py 0r ~/.vim/skeleton/alltests.py
" autocmd BufNewFile *.py 0r ~/.vim/skeleton/skeleton.py

""新建.c,.h,.sh,.java文件,自动插入文件头
autocmd BufNewFile *.[ch],*.sh,*.java,*.py,*.pl,*.cpp,*.xhtml exec
":call SetTitle()"
"新建文件后,自动定位到文件末尾
"autocmd BufNewFile * normal G

endif


" python auto-complete code
" Typing the following (in insert mode):
" os.lis<Ctrl-n>
" will expand to:
" os.listdir(
" Python 自动补全功能,只需要反覆按 Ctrl-N 就行了
if has("autocmd")
autocmd FileType python set complete+=k~/.vim/tools/pydiction
endif

"定义函数SetTitle,自动插入文件头
func SetTitle()
""如果文件类型为.sh, .py, .pl 文件
if (&filetype == 'python' || &filetype == 'sh' || &filetype == 'perl')
if &filetype == 'python'
call setline(1, "\#!/usr/bin/env python")
call append(line("."), "\# -*- coding: utf-8 -*-")
elseif &filetype == 'sh'
call setline(1, "\#!/bin/bash")
call append(line("."), "")
elseif &filetype == 'perl'
call setline(1, "\#!/usr/bin/env perl")
call append(line("."), "")
endif

call append(line(".")+1,
"\#########################################################################")
call append(line(".")+2, "\# Author : ox0spy")
call append(line(".")+3, "\# Email : ossteerer@gmail.com")
call append(line(".")+4, "\# Blog : ox0spy.blogspot.com")
call append(line(".")+5, "\# Created Time : ".strftime("%c"))
call append(line(".")+6, "\# File Name : ".expand("%"))
call append(line(".")+7, "\# Description : ")
call append(line(".")+8,
"\#########################################################################")
cal append(line(".")+9, "")

if(&filetype == 'python')
call append(line(".")+10, "\"\"\"docstring")
call append(line(".")+11, "\"\"\"")
cal append(line(".")+12, "")
cal append(line(".")+13, "__revision__ = '0.1'")
cal append(line(".")+14, "")
cal append(line(".")+15, "")
endif
elseif (&filetype == 'xhtml')
call setline(1, "{% extends 'base.xhtml'}")
call append(line("."), "{% block title %} {% endblock %}")
call append(line(".")+1, "{% block content %}")
call append(line(".")+2, "")
call append(line(".")+3, "{% endblock %}")
else
call setline(1,
"/*************************************************************************")
call append(line("."), " Author : ox0spy")
call append(line(".")+1, " Email : ossteerer@gmail.com")
call append(line(".")+2, " Blog : ox0spy.blogspot.com")
call append(line(".")+3, " Created Time : ".strftime("%c"))
call append(line(".")+4, " File Name : ".expand("%"))
call append(line(".")+5, " Description : ")
call append(line(".")+6, "
************************************************************************/")
call append(line(".")+7, "")
endif
endfunc

路在何方

    最近忙着找工作,状况很不理想。哈哈,就如 仅仅是巧合??

    易穷则变,变则通,通则久,人总是在失意时思考的更深,我以前一直以为自己是棵葱,其实我啥都不是...
    想想我的工作经历,得安3个月;友为1年多
    得安3个月,2个月培训了,还好李老师比较看的起,在大家都没事做(公司不准让未转正的员工做项目)的时候,就让我给吉大正元做加密卡接口.
    得安的开发语言是c,公司最基本的加密卡API都是c写到的,自己又学习了Linux网络、shell编程。
    友为我是以Linux c程序员进入的,不过工作内容很杂。
    I、在RHEL 5上安装Oracle 9i
    II、IVR语音服务开发,最终修改了一个demo,做的最不成功的东西,因为我讨厌MFC。开发语言:VC
    III、嵌入式开发,我本来想做Linux的,但公司要做WinCe。做了一个号码归属地查询(检查来电、挂断有问题)。开发语言:C#
    IV、销售管理支撑系统(web/wap),开发语言:Python; 环境:Apache + MySQL + Mod_Python + Python + Django

    昨天和TaoA、Yang的聊天让我思考了我能做什么
    现在我能做什么:
    1、Linux系统管理员(一直喜欢Linux系统,对系统管理、网络安全有一定的认识,以优秀的成绩通过HP CSA认证)
    2、Linux C程序员,最好做Linux嵌入式开发(C是以前我最喜欢的语言,对Linux系统很熟)
    3、Web开发(我觉得Web开发挺有前途,也做过点东西)

    再看看我2009年的计划,明显看的出:鱼和熊掌都想要,哈哈

    也不说如果我当年就一直做什么,现在就。。。
    但现在必须选择一个方向,并且搞定它!

    ok,就WEB开发吧,语言Python,框架:CherryPy、Django、web2py

仅仅是巧合??

最近的事情想想就觉得很搞笑

天气:

14号到北京,songze接我到他那,然后就感觉开始降温。。。

15号和hewei去他那住

好像16号开始下雪,一下就是几天,今天雪还没化完呢。。。

最近北京很冷!

面试:

13号早上songze问我几点到,说他刚推掉一个面试,准备去接我。我告诉他14号到...

14号他说,他的一个同事13号去他推掉的那个公司,然后老板就要了

从此之后,一直到今天(20号),他一个电话通知也没有

刚聊起来,他说(13号)之前一天都有两个面试...
几天前就发现这问题,和一初中同学(liujia)聊。她告诉我,为了北京的朋友们,让我早点离开北京难过

难道真的是 故天将降大任。。。

 

PS:hewei早上回成都了

PPS:少不入川,老不出蜀。网上看了看,对成都有了莫名的好感

                                                                     2009-2-20 北京