Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Sep 5, 2011

Install driver for Atheros AR9271 on Ubuntu

    thinkpad x10 无线网卡太弱,买了块无线网卡,插入无法识别,打开带的光盘,里面只有windows驱动。

   了解了下,已经有人做好了安装工具 - ath9k_htc-installer,还是deb包,下载安装,然后,终端运行

$ ath9k_htc-installer

出来一个图形界面,直接安装即可,然后,插入 无线网卡 ,仍然无法识别
$ dmesg | tail
[  143.882952] usb 1-1: ath9k_htc: Firmware - htc_9271.fw not found
[  143.882983] ath9k_htc: probe of 1-1:1.0 failed with error -22

$ sudo wget  -P /lib/firmware http://wireless.kernel.org/download/htc_fw/1.3/htc_9271.fw

重新插上,小灯开始闪烁了。

从 ath9k_htc-installer 的运行log看,这个工具应该是修改.config文件,然后重新编译kernel了,所以,和http://wireless.kernel.org/en/users/Drivers/ath9k_htc 讲的一样,只是不用一般用户自己编译kernel。

Feb 18, 2011

empathy MSN error "Network error connecting"

ubuntu 10.10, empathy 无法登录 MSN, 错误信息: "Network error connecting"

解决:
$ sudo apt-get purge telepathy-butterfly

Jan 31, 2011

fatal: error processing config file(s)

一台服务器上的git版本太低, 如果 apt-get remove git 会 remove 掉很多我还想要得软件包。只好下载源码编译覆盖掉以前的(./configure --prefix /usr).

但,运行 git 然后tab补齐时报错 "fatal: error processing config file(s)"

fix:
$ touch ~/.gitconfig

很早前就有人报过这个问题.

Jan 22, 2011

折腾gnome3

今天看到 gnome3.org 上线了,上去看了看,发现不错,就开始折腾了。

/*
早上又给长城宽带打电话让过来收钱, kao, 还是给我说,他们会尽快安排过来。一天又过去了,还是没见到他们工作人员,连个电话都没有。md, 这帮家伙是老板不给没发年终奖,还是打算闪人了 ....
*/

http://live.gnome.org/GnomeShell#building 根据这个页面讲得应该可以装好。

Note:
1. libtool 需要 2.2.10, 我的 ubuntu 10.10安装的是 2.2.6, 所以,需要自己下载编译.
2. gnome3 装好后,运行 $ ./gnome-shell --replace 报错
mutter: symbol lookup error: /home/ox0/gnome-shell/install/lib/gtk-3.0/modules/libcanberra-  gtk-module.so: undefined symbol: gtk_quit_add
ox0@lucid:~/gnome-shell/source/gnome-shell/src$ Cannot register the panel shell: there is already one running.
 解决:
$  rm ~/gnome-shell/install/lib/gtk-3.0/modules/libcanberra-gtk-module.so

Dec 28, 2010

这收获,太大了

首先感谢今天点击我广告的同学, 我快有 1$ 了, 哈哈

大学3年, 一直在"推销" Linux (ubuntu, debian ...), Google, Firefox , 现在好像也没几个人用他们。

今天项目组就有2人开始尝试blogspot.com 了, 而,Ubuntu、Firefox是我们的指定工作平台和浏览器, 哈哈

Dec 25, 2010

setup subversion on Debian/Ubuntu

清理目录时,发现很久前为我妹演示svn的工作机制时,写的怎么搭建subversion服务.

1. install software
$ sudo apt-get install subversion libapache2-svn

2.
$ sudo svnadmin create /home/svn
$ sudo chown -R www-data:www-data /home/svn

3. configure
$ sudo vim /etc/apache2/mods-enabled/dav_svn.conf
uncomment

DAV svn
SVNPath /home/svn
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd


4. create password file
$ sudo htpasswd2 -cm /etc/apache2/dav_svn.passwd
$ sudo htpasswd2 -m /etc/apache2/dav_svn.passwd

5. reload apache2
$ sudo /etc/init.d/apache2 reload

authenticate Debian/Ubuntu repositories: install public key

 W: GPG error: http://ftp.us.debian.org testing Release: The following signatures
couldn't be verified because the public key is not available: NO_PUBKEY xxxxxxxxxxxx

$ gpg --keyserver subkeys.pgp.net --recv-keys 55BE302B
$ gpg -a --export 55BE302B | sudo apt-key add -

or

sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 55BE302B

Nov 29, 2010

working in Ubuntu

终于可以直接在pure Linux 上工作,可以不在使用Windows了, 目前公司要求安装Ubuntu

明天过去继续安装、配置, 安装乱七八糟的软件,修改配置 总是很麻烦,但,能不用windows 这点麻烦算什么 :-)

Nov 25, 2010

fcitx en_US local

$ sudo apt-get install fcitx im-switch

英文locale, 所以要修改下配置文件, /etc/gtk-2.0/gtk.immodules 或者 /usr/lib/gtk-2.0/2.10.0/immodule-files.d/libgtk2.0-0.immodules

找到 xim , 在适当的地方加上 en,如下:
"xim" "X Input Method" "gtk20" "/usr/share/locale" "en:ko:ja:th:zh"

$ im-switch -s fcitx

note: 也许需要 dpkg-reconfigure locales

重启下 X即可

Oct 25, 2010

Eclips/Android-sdk: Unable to connect to repository

在Debian/Ubuntu上安装 Eclipse, 不管是apt-get 还是直接下载的, 当Help -> Install New Software 时,都会报相同的错误,Unable to connect to repository

使用android-sdk 的 $ android update sdk 时, 也有类似错误.

但是在Windows安装却没有问题,而且Linux下 curl 查看,可以连接到服务器的。

后来网上看到,应该是所有的Java app都会出现 “Unable to connect to”。

解决方法:
将/etc/sysctl.d/bindv6only.conf 中的 net.ipv6.bindv6only = 1 改为 net.ipv6.bindv6only = 0
$ sudo invoke-rc.d procps restart

Oct 16, 2010

Ubuntu 升级到 10.10, 解决Firefox无法播放flash

昨天看了Tsung的Ubuntu 10.04 升級到10.10 Maverick Meerkat 與 問題排除 晚上回去就把我的ubuntu 10.04 desktop升级了,升级很简单, 一路也很顺利。

想想,这是我用Linux这么多年来,第一次升级系统, 每次我都觉得升级太麻烦, 要等好长时间,所以,直接下载iso,重新安装;昨天睡觉前开始升级,早上起来就好了,整体感觉很好。

10.04 desktop 升级到 10.10
Alt + F2, 输入 update-manager -d , 下面根据提示操作就对了。

目前唯一的问题是 Firefox 看不了 flash, 从 Firefox -> Tools -> Add-ons 看到播放flash用的是 gnash 而不是 adobe-flash,虽然 dpkg -l | grep adobe-flash , 可以看到 adobe-flashplugin已经安装了,但 firefox add-ons 上看不到, 我认为是这两个冲突导致的。
卸载 gnash
$ sudo apt-get purge gnash
$ sudo apt-get purge gnash-common
重新安装 adobe-flash,问题解决.
$ sudo apt-get install --reinstall adobe-flashplugin

Oct 14, 2010

public access git on ubuntu/debian

前面介绍了
gitosis搭建: setting up gitosis on ubuntudebian
gitweb搭建: setting up gitweb on ubuntudebian
gitosis权限: gitosis权限

现在,有个项目,自己项目组的人肯定要有commit权限,但其他人也要有readonly权限,虽然,可以在gitosis-admin 中添加readonly组,但,我们不可能找每个人要ssh public key吧

这时候, 可以用 git-daemon
$ sudo apt-get install git-daemon-run
修改 /etc/sv/git-daemon/run , 把git repo的路径设置正确就行
$ cat /etc/sv/git-daemon/run
#!/bin/sh
exec 2>&1
echo 'git-daemon starting.'
exec chpst -ugitdaemon \
  /usr/lib/git-core/git-daemon --verbose --base-path=/srv/gitosis/repositories

把要让匿名访问的git repository目录下放一个名为 git-daemon-export-ok 的空文件.

$ sudo sv restart git-daemon

$ git clone git://mypc/Your-test.git

Oct 10, 2010

gitosis权限设置

通过gitosis搭建git服务器可以参考 http://ox0spy.blogspot.com/2010/10/setting-up-gitosis-on-ubuntudebian.html.

下面看下gitosis权限设置
gitosis有组(group)和成员(members), 权限就是对repository的访问限制.
有两个关键字修饰 repository ,一个是 writable, 一个是 readonly.
writable 意思是,对这个repository 有写权限
readonly 是, 对这个repository 只有读权限

最常见的例子:
[group gitosis-admin]
writable = gitosis-admin   # 注意,后面不要加 .git
members = ox0spy@lucid

这三句话是啥意思呢?
第1句,定义一个组, 名字为 gitosis-admin
第2句,  writable = 后面跟的是仓库名, 只是这个仓库名是去掉.git的,所以, 我们在 git clone 时,要自己加上 .git,如下:
$ git clone gitosis@localhost:gitosis-admin.git  # 注意最后的 .git
writable 后面可以跟很多个仓库名, 他们以whitespace分开, 一般以空格分隔,如下:
writable = gitosis-admin android mytest
第3句, members 说明这个组的成员, 成员名是 username@hostname , @hostname 不能去,否则会报错.
成员之间也通过 whitespace 分隔,通常用空格分隔.

可以发现,成员属于某个组, 而对repository的访问权限是通过组控制的.
这样的话,如果同一个repository,想让某些用户只能读,不能写,就必须新建一个组, 下面就看下怎么实现这个功能.
[group test]  # 该组用户可写
members = ox0spy@lucid lfs@debian
writable = mytest

[group test_ro] # 该组用户只读
members = toor@ubuntu
readonly = mytest              # 只读,这里是readonly 而不是 readable

这样,toor@ubuntu 就只能对 gitosis@Your-server:mytest.git 进行读

members 可以包含其他组的所有成员
[group member_test]
writable = memberTest
readonly = mytest
members = ox0spy@lucid @test
# 这里的 @test 就是上面 test组的所有成员 (ox0spy@lucid lfs@debian)

最后,要说的是, 一个组可以只有 members, 没有 writable 和 readonly,如下:
[group another_group]
members = monkey@abc cow@gentoo

这个组只是为了被其他组包含而定义.

setting up gitweb on ubuntu/debian

1. 安装
$ sudo apt-get install gitweb

2. 设置
修改 /etc/gitweb.conf
# projectroot 设置成你自己的仓库路径, 这是gitosis默认路径
$projectroot = "/srv/gitosis/repositories/"; 

view /etc/apache2/conf.d/gitweb  # 一般不用修改

$ cp -r /usr/share/gitweb /var/www

3. 测试
$ curl localhost/gitweb/

Oct 8, 2010

setting up gitosis on ubuntu/debian

1. install
# run on server
$ sudo apt-get install git-core gitosis

2. generate ssh key
# run on your pc
$ ssh-keygen -t rsa

3. upload the ssh public key
# run on your pc
$ scp ~/.ssh/id_rsa.pub USER@YOUR_SERVER:/tmp

4. create admin repository
# run on server
$ sudo -H -u gitosis gitosis-init < /tmp/id_rsa.pub # monkey's ssh public key
$ sudo chmod 755 /srv/gitosis/repositories/gitosis-admin.git/hooks/post-update

5. checkout gitosis-admin
# run on your pc
$ git clone gitosis@YOUR_SERvER:gitosis-admin.git

6. grante right for members
# run on your pc, add new group - android
[group android] # team name
writable = 0xdroid-0x5 0xdroid-0x4  # project name
members  = monkey@debian cow@ubuntu  # members

# add cow's ssh public key
$ git add keydir/cow@ubuntu.pub gitosis.conf

# grante cow commit right to android
$ git commit -m "Granted cow commit right to android"
$ git push  # now, cow has the commit right.

7. create new repositories
There are two ways to commit your code:
a. checkin your codes from zero
# create new repositories - 0xdroid-0x5.git
$ cd YOUR-CODE-DIR
$ mkdir 0xdroid-0x5.git && cd 0xdroid-0x5.git
$ git init

# modify .gitignore

$ git remote add origin gitosis@YOUR_SERVER:0xdroid-0x5.git
$ git add .
$ git commit -m "initial import"
$ git push origin master:refs/heads/master

b. checkin your codes from old git repo
$ cd YOUR-OlD-GiT-REPO
$ git remote -v
$ git pull  # update
$ git remote rm origin
$ git remote add origin gitosis@YOUR_SERVER:0xdroid-0x5.git
$ git push origin master:refs/heads/master

8. checkout codes
$ git clone gitosis@YOUR_SERVER:0xdroid-0x5.git

May 29, 2009

Cannot initiate the connection to 8080:80

$ export http_proxy=10.0.192.102:8080

$ sudo apt-get install apache2
Failed to fetch
http://ubuntu.cn99.com/ubuntu/pool/main/a/apache2/apache2.2-common_2.2.9-7ubuntu3_i386.deb
Cannot initiate the connection to 8080:80 (0.0.31.144). - connect (22
Invalid argument)

$ wget
http://ubuntu.cn99.com/ubuntu/pool/main/a/apache2/apache2.2-common_2.2.9-7ubuntu3_i386.deb
// 却可以下载

也就是 wget可以下载,apt-get可以获得软件包地址,但无法下载

查了下,apt-get要求把代理设成如下形式:
$ export http_proxy=http://10.0.192.102:8080

现在, wget apt-get 都可以使用了...

May 17, 2009

ubuntu lighttpd mysql fastcgi

打算用c写写cgi
不想用Apache2了,试试lighttpd

安装lighttpd
$ sudo apt-get install lighttpd

安装php5
$ sudo apt-get install php5 php5-cli php5-cgi php5-mysql

让Lighttpd支持CGI模式
$ sudo lighttpd-enable-mod cgi
$ sudo lighttpd-enable-mod fastcgi

注: 看下/etc/lighttpd/conf-enabled/10-cgi.conf中的cgi-bin目录是否正确

安装mysql
$ sudo apt-get install mysql-server

安装phpmyadmin
$ sudo apt-get install phpmyadmin

重起Lighttpd
$ sudo /etc/init.d/lighttpd restart

May 1, 2009

informix The type of your terminal is unknown to the system or the screen size is,too small

informix
informix@ubuntu:~$ dbaccess
The type of your terminal is unknown to the system or the screen size is
too small

解决:
ox0spy@ubuntu:~$ tail -n 4 /etc/profile
TERMCAP=$INFORMIXDIR/etc/termcap
export TERMCAP
INFORMIXTERM=termcap
export INFORMIXTERM

Informix 11.5 Installation on Ubuntu 8.10 server

最近工作需要,想熟悉下Informix
安装过程很是曲折,先尝试着安装IDS 9.4,最后在Ubuntu上也安装成功了.
但是,$ onstat -i
系统报错:symbol errno, version GLIBC_2.0 not defined in file libc.so.6 with link time referencthe
虽然找到了 传说中的两种解决方法, 但貌似都是不可行的.

最后,好心人提供了一个 11.5的下载链接
informix 11.5 for linux X86 : 下 载

更 多

ok,下面说说Ubuntu 8.10 Server 上安装informix 11.5

============很傻很天真的分割线====================
1. 用户、组创建
    ox0spy@ubuntu:~$ sudo groupadd informix
    ox0spy@ubuntu:~$ sudo useradd -g informix -d /opt/informix -m -s /bin/bash informix

2. 环境变量设置
    ox0spy@ubuntu:~$ tail /etc/profile
    # add for informix
    INFORMIXDIR=/opt/informix
    INFORMIXSERVER=info_dbs
    INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhosts
    ONCONFIG=onconfig.std
    DBDATE=Y4MD*
    LD_LIBRARY_PATH=$INFORMIXDIR/lib:$INFORMIXDIR/lib/esql:$LD_LIBRARY_PATH
    export INFORMIXDIR INFORMIXSERVER ONCONFIG LD_LIBRARY_PATH
    PATH=$PATH:$INFORMIXDIR/bin
    export PATH

3. 解压安装文件
    以informix用户登陆系统
    将C1P6NEN.tar放到/opt/informix下
    解压缩:
    informix@ubuntu:~$ tar xvf C1P6NEN.tar

4. 安装
    以root的权限安装
    ox0spy@ubuntu:/opt/informix$ sudo ./ids_install
    下面根据提示就可以搞定了

5. 配置
    我是以 文本模式安装的,下面开始配置
    1) 在/etc/services中添加两行,如下:
    informix@ubuntu:~$ grep sqlexe /etc/services
    sqlexe          8887/tcp                        # informix
    sqlexec         8888/tcp                        # informix

  2) 修改/etc/hosts
    informix@ubuntu:~$ grep 'ubuntu' /etc/hosts
    192.168.43.128  ubuntu

  3) 配置$INFORMIXDIR/etc/sqlhosts
    informix@ubuntu:~$ cat $INFORMIXDIR/etc/sqlhosts | grep -E '^[^#]'
    info_dbs                onipcshm        ubuntu          sqlexe
    info_dbs_tcp    onsoctcp        ubuntu          sqlexec

  4) 建立空间
    informix@ubuntu:~$ mkdir dbs && cd dbs && touch rootdbs rootdbs_mirror && chmod 660 *
 
  5) 配置$INFORMIXDIR/etc/onconfig.std文件
    ROOTNAME rootdbs
    ROOTPATH $INFORMIXDIR/dbs/rootdbs

    MIRRORPATH $INFORMIXDIR/dbs/rootdbs_mirror

    SERVERNUM 0
    DBSERVERNAME info_dbs
    DBSERVERALIASES info_dbs_tcp

    NETTYPE ipcshm,1,50,CPU
    NETTYPE soctcp,1,50,NET

    TAPEDEV /dev/null

    LTAPEDEV /dev/null

6. 初始化数据库
    informix@ubuntu:~$ oninit -ivy

    深夜里看着一串串的 ...successed 真爽

    informix@ubuntu:~$ onstat -i

    IBM Informix Dynamic Server Version 11.50.UC3     -- On-Line -- Up 00:44:43 -- 144676 Kbytes
    onstat>

到此,数据库安装工作就完成了, good luck.

Apr 7, 2009

ubuntu gedit 乱码

Ubuntu 8.04 英文locale
gedit显示GB2312编码的文件总数乱码,很是郁闷
查了下,下面的方法可以解决:

$ gconf-editor
找到 apps -> gedit2 -> preferences -> encodings
设置auto_detected 的值,增加一个GB2312 ,没必要一定要up到第一个,打开文件时
会按你设置的顺序检测编码的.