终于可以直接在pure Linux 上工作,可以不在使用Windows了, 目前公司要求安装Ubuntu
明天过去继续安装、配置, 安装乱七八糟的软件,修改配置 总是很麻烦,但,能不用windows 这点麻烦算什么 :-)
Nov 29, 2010
chinaunix php code jam
去年 CU 的C编程, 拿了个小奖, 结果看到晚了,我要的书都被其他人拿走了,只好拿了1000分。
今年十一快结束了,发现CU的PHP编程大赛,做了10几道题,又一个2等小奖。
今年CU mm 显然更加友好,我以为只有一件T恤,今天CU mm 打电话说还有本书呢, 赞
广告时间, 迎接ChinaUnix九周年庆技术实践之二----C/C++编程大赛!
今年十一快结束了,发现CU的PHP编程大赛,做了10几道题,又一个2等小奖。
今年CU mm 显然更加友好,我以为只有一件T恤,今天CU mm 打电话说还有本书呢, 赞
广告时间, 迎接ChinaUnix九周年庆技术实践之二----C/C++编程大赛!
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即可
英文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即可
Nov 18, 2010
Nov 4, 2010
first oss contribution
很久之前发现 alsa 有个shell script (alsa-compile.sh)不支持 Debian/Ubuntu, 刚好我公司用的是Debian testing, 所以发现了, 并且加了几行代码就可以支持了。
最近我的任务就是给开源社区fix bug,所以,用我的巨烂英语, 很不好意思的和国外developer交流着
patch 如下,下次争取fix c code
diff --git a/utils/alsa-compile.sh b/utils/alsa-compile.sh
index 4f72d10..1ae0c49 100755
--- a/utils/alsa-compile.sh
+++ b/utils/alsa-compile.sh
@@ -329,6 +329,16 @@ is_rpm_installed() {
fi
}
+# Echo "true" if deb installed, else "false"
+is_deb_installed() {
+ dpkg -l $1 2>&1 | grep -Eq '^ii'
+ if test "$?" = "0"; then
+ echo "true"
+ else
+ echo "false"
+ fi
+}
+
# Install package
# $1 is package name
install_package() {
@@ -340,6 +350,14 @@ install_package() {
Fedora|RHEL)
test "$pkg" == "lsb" && pkg="redhat-lsb"
;;
+ Debian|Ubuntu)
+ test "$pkg" == "lsb" && pkg="lsb-release"
+ test "$pkg" == "git" && pkg="git-core"
+ test "$pkg" == "alsa-lib-devel" && pkg="libasound2-dev"
+ test "$pkg" == "gettext-tools" && pkg="gettext-base"
+ test "$pkg" == "gettext-devel" && pkg="gettext"
+ test "$pkg" == "ncurses-devel" && pkg="ncurses-bin"
+ ;;
*)
echo >&2 "Cannot install $1 for unsupported distribution $distrib."
exit 1
@@ -352,6 +370,9 @@ install_package() {
Fedora|RHEL)
yum install -y $pkg
;;
+ Debian|Ubuntu)
+ apt-get install -y $pkg
+ ;;
*)
echo >&2 "Cannot install $pkg for unsupported distribution $distrib."
exit 1
@@ -400,6 +421,12 @@ check_kernel_source() {
install_package $kernel_devel
fi
;;
+ Debian|Ubuntu)
+ local kernel_devel="linux-source-$(uname --kernel-release | sed 's/-.*$//')"
+ if test $(is_deb_installed $kernel_devel) = "false" ; then
+ install_package $kernel_devel
+ fi
+ ;;
*)
echo >&2 "Cannot install kernel sources for unsupported distribution $distrib."
exit 1
最近我的任务就是给开源社区fix bug,所以,用我的巨烂英语, 很不好意思的和国外developer交流着
patch 如下,下次争取fix c code
diff --git a/utils/alsa-compile.sh b/utils/alsa-compile.sh
index 4f72d10..1ae0c49 100755
--- a/utils/alsa-compile.sh
+++ b/utils/alsa-compile.sh
@@ -329,6 +329,16 @@ is_rpm_installed() {
fi
}
+# Echo "true" if deb installed, else "false"
+is_deb_installed() {
+ dpkg -l $1 2>&1 | grep -Eq '^ii'
+ if test "$?" = "0"; then
+ echo "true"
+ else
+ echo "false"
+ fi
+}
+
# Install package
# $1 is package name
install_package() {
@@ -340,6 +350,14 @@ install_package() {
Fedora|RHEL)
test "$pkg" == "lsb" && pkg="redhat-lsb"
;;
+ Debian|Ubuntu)
+ test "$pkg" == "lsb" && pkg="lsb-release"
+ test "$pkg" == "git" && pkg="git-core"
+ test "$pkg" == "alsa-lib-devel" && pkg="libasound2-dev"
+ test "$pkg" == "gettext-tools" && pkg="gettext-base"
+ test "$pkg" == "gettext-devel" && pkg="gettext"
+ test "$pkg" == "ncurses-devel" && pkg="ncurses-bin"
+ ;;
*)
echo >&2 "Cannot install $1 for unsupported distribution $distrib."
exit 1
@@ -352,6 +370,9 @@ install_package() {
Fedora|RHEL)
yum install -y $pkg
;;
+ Debian|Ubuntu)
+ apt-get install -y $pkg
+ ;;
*)
echo >&2 "Cannot install $pkg for unsupported distribution $distrib."
exit 1
@@ -400,6 +421,12 @@ check_kernel_source() {
install_package $kernel_devel
fi
;;
+ Debian|Ubuntu)
+ local kernel_devel="linux-source-$(uname --kernel-release | sed 's/-.*$//')"
+ if test $(is_deb_installed $kernel_devel) = "false" ; then
+ install_package $kernel_devel
+ fi
+ ;;
*)
echo >&2 "Cannot install kernel sources for unsupported distribution $distrib."
exit 1
Labels:
alsa
Subscribe to:
Posts (Atom)