Aug 14, 2009

Rhythmbox 乱码

在Linux中碰到乱码实在是常见而又恼火的事情
不过肯定是可以解决的...

$ sudo apt-get install python-mutagen
写个脚本...

#!/bin/bash
#########################################################################
# Author : ox0spy
# Email : ossteerer#gmail.com
# Blog : ox0spy.cn
# Created Time : 2009年08月14日 星期五 20时03分02秒
# File Name : mp3_gbk.sh
# Description :
#########################################################################
MP3DIR="$1"
#echo $MP3DIR
if [ $# -ne 1 ] || [ ! -d $MP3DIR ]
then
program=`basename $0`
msg="usage : $program musicDir"
echo $msg
exit 1
else
mp3list=`find $MP3DIR -name '*.mp3' -printf '"%p"\n'`
mp3list=${mp3list/"\n"/""} # 替换所有的 \n
if [ ! "x$mp3list" = "x" ]
then
echo $mp3list | xargs mid3iconv -e GBK
fi
fi

Aug 4, 2009

5个月了

时间飞逝,在这边5个月了
短短5个月的时间我却在两家公司呆过,工作地点也从省xx到市xx,到现在的
xxxx开发中心。工作环境发生了很大的变化,总的来说是向好的方向发展

这段时间有些堕落,只在工作时间学习,回来基本学不下去,要看到东西很多

近期把以前同事的那本书看完,拿过来好久了,。。。

其他行业相关的也要抓紧看啊,这边开发部员工的技术的确是我工作以来最强
的,多像大家学习,同时也得给大家带来点惊喜。。。

能力有限,精力有限。既然稀里糊涂的混进这个行业,而且这个行业也还可以,
就好好干吧,在一个行业中干出点成绩来~

Jul 7, 2009

算下我的工作天数

大部分公司应该都把工作天数定为22天,而今天才知道现在的公司把工作天数
定为 21 天,我就想知道到底每个月我工作了多少天,这个问题以前从来没想过...

经测试
ox0spy@ubuntu:/code/python$ ./workday.py -y 2009
2009-01 : 22
2009-02 : 20
2009-03 : 22
2009-04 : 22
2009-05 : 21
2009-06 : 22
2009-07 : 23
2009-08 : 21
2009-09 : 22
2009-10 : 22
2009-11 : 21
2009-12 : 23
2009 total work day : 261
以后52年
ox0spy@ubuntu:/code/python$ ./workday.py -s 2009 -e 2060
[2009] real work day: 261
[2010] real work day: 261
[2011] real work day: 260
[2012] real work day: 261
[2013] real work day: 261
[2014] real work day: 261
[2015] real work day: 261
[2016] real work day: 261
[2017] real work day: 260
[2018] real work day: 261
[2019] real work day: 261
[2020] real work day: 262
[2021] real work day: 261
[2022] real work day: 260
[2023] real work day: 260
[2024] real work day: 262
[2025] real work day: 261
[2026] real work day: 261
[2027] real work day: 261
[2028] real work day: 260
[2029] real work day: 261
[2030] real work day: 261
[2031] real work day: 261
[2032] real work day: 262
[2033] real work day: 260
[2034] real work day: 260
[2035] real work day: 261
[2036] real work day: 262
[2037] real work day: 261
[2038] real work day: 261
[2039] real work day: 260
[2040] real work day: 261
[2041] real work day: 261
[2042] real work day: 261
[2043] real work day: 261
[2044] real work day: 261
[2045] real work day: 260
[2046] real work day: 261
[2047] real work day: 261
[2048] real work day: 262
[2049] real work day: 261
[2050] real work day: 260
[2051] real work day: 260
[2052] real work day: 262
[2053] real work day: 261
[2054] real work day: 261
[2055] real work day: 261
[2056] real work day: 260
[2057] real work day: 261
[2058] real work day: 261
[2059] real work day: 261
[2060] real work day: 262
company work day : 252
total waste work day 463

ox0spy@ubuntu:/code/python$ ./workday.py -s 2009 -e 2060 | grep -E '\['
| awk '{print $5}' | sort | uniq -c
12 260
33 261
7 262
可以发现未来的52年,从来就没有少于260天的

公司的 21 * 12 = 252
而大部分公司 22 * 12 = 264

实际工作天数 * 月工资/本月的工作天数

我公司的算法 : (实际工作天数 - 1) * 月工资/21
6月工作天数应该是 : 22, 所以从我实际工作天数中减一, 我对这种算法很无语
还好我工作了4天, 要只工作一天就被减没了
有机会验证下如果本月应该工作天数为20天, 是不是发工资时 (实际工作天数 +
1) * 月工资/21 , 估计很显然...

Jun 20, 2009

好好干活

删除校内数据、关闭校内
关闭Qzone : http://imgcache.qq.com/qzone/web/load_login_2.htm
基本退出了所有的QQ群, 基本不再上QQ, 绝对不会让QQ在线了...

其实有好多应该做的事情...

fighting

2009-6-19 辞职 NT

预计 2009-6-22 去 XXX 报道...

May 31, 2009

麻木了...

虽然已经麻木了,该看的还是必须要看到

GAppProxy 可以满足你的很多需求...

项目地址: http://code.google.com/p/gappproxy/

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 25, 2009

河蟹中...

KISS: Keep It Simple, Stupid
Get it right the first time.

为了代码中尽可能少的出现低级错误,节省调试时间,我觉着应该至少知道每句代
码是做什么的,然后写完每一句都用1秒检查是否有"粗心的错误"

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.