Archive for 十一月, 2008

Chinese Input for Ubuntu

Posted by 机器人 on 30th 十一月 2008 in linux/server

1) install the following packages:
* scim
* scim-chinese
* scim-config-socket
* scim-frontend-socket
* scim-gtk2-immodule
* scim-server-socket
* scim-tables-zh (option)
* xfonts-intl-chinese
* xfonts-intl-chinese-big Read the rest of this entry »

总结一下贴库和移库的步骤

Posted by 机器人 on 29th 十一月 2008 in mylife

这个礼拜开始我才真正开始上车,前段时间不是法培就是等待,都快把人给急死了,还好,后来嗺了一下教练,终于给我安排上车了。

周一到周五下午半天学习。前二天进行了基本的启动和加减档等练习,后三天就进行了科目二中,最为关键的贴库和移库练习,如果这两个科目练好了,基本是科目二考试就通过了。刚开始没有找到感觉,老是出界和撞杆,没少被教练骂(对你不负责的教练是不会骂你的),还好,后来基本上找到了感觉。

下面是一些经验分享一下

贴库上线:
车左前角与6米线重合时向右将轮打死(也就是打满),至车正时向左打2圈(将方向盘调正),
Read the rest of this entry »

很好的一篇文章!特转之!

Posted by 机器人 on 26th 十一月 2008 in 其它

今晚要闲逛博客时,无意发现在了一篇好文章,很多问题分析的很有道理!!原文如下:

在微软的时候,有一件事让我印象深刻,启发我在动手建立复杂的IT系统之前,先想一想“自己要完成的目标是什么”,而不是“自己要建立的系统是什么”。这件事就是“英文润色”服务的流程。

可靠的英文润色服务

事情是这样的。微软在上海的全球技术中心同时服务微软美洲和欧洲的客户。为了保证所有工程师写出的英文的邮件不会有太多的语法和使用习惯错误,技术中心建立了“英文润色”团队,全是由英文是母语的人员组成,来帮助工程师修改发出
Read the rest of this entry »

看来,最近还不能上班

Posted by 机器人 on 24th 十一月 2008 in mylife

11月1号离职到现在,也差不多在家里呆了快一个月了。先前计划是一个月来考驾照,从目前看来还不行。

11月3-4日:两天法培学习
11月10日:法培考试 (隔了一个礼拜)
11月24日-12月16日:科目二学习(16天左右),这期间不能有任何缺席。

呆了这么久,说实话,很想上班,很想每天忙碌的感觉!
看来,最近还不行!!!
机器人 2008-11-24 22:56 于 北京
Read the rest of this entry »

shell if 命令参数说明

Posted by 机器人 on 23rd 十一月 2008 in linux/server

shell if 命令参数说明

-b 当file存在并且是块文件时返回真

-c 当file存在并且是字符文件时返回真

-d 当pathname存在并且是一个目录时返回真

-e 当pathname指定的文件或目录存在时返回真

-f 当file存在并且是正规文件时返回真

-g 当由pathname指定的文件或目录存在并且设置了SGID位时返回为真

-h 当file存在并且是符号链接文件时返回真,该选项在一些老系统上无效

-k 当由pathname指定的文件或目录存在并且设置了“粘滞”位时返回真

-p 当file存在并且是命令管道时返回为真

-r 当由pathname指定的文件或目录存在并且可读时返回为真

-s 当file存在文件大小大于0时返回真

-u 当由pathname指定的文件或目录存在并且设置了SUID位时返回真

-w 当由pathname指定的文件或目录存在并且可执行时返回真。一个目录为了它的内容被访问必然是可执行的。

-o 当由pathname指定的文件或目录存在并且被子当前进程的有效用户ID所指定的用户拥有时返回真。

比较字符写法:

-eq 等于

-ne 不等于

-gt 大于

-lt 小于

-le 小于等于

-ge 大于等于

-z 空串

* = 两个字符相等

* != 两个字符不等

* -n 非空串

几步创建您的php扩展

Posted by 机器人 on 16th 十一月 2008 in c/c++, linux/server

下面以开发hello world这个简单的应用扩展为例,来说明开发的步骤,这个扩展提供一个hello_world()函数,该函数会返回一个”hello world”字符串,在php中的调用方式如下:

< ?php
    echo hello_world();
?>

首先进入php源码中的ext目录,php的所有扩展库的源码都放在这里。
然后创建hello目录,这个目录里就存放我们helloworld扩展的源码和相关文件.
Read the rest of this entry »

博客迁移至wordpress

Posted by 机器人 on 15th 十一月 2008 in mylife

这一年多来,一直使用的是自己做的博客系统,但由于功能有限,所以使用起来有很多不方便的地方,本来想是把需要的功能给加上,但很难腾得出时间,所以也就难得去弄了,正好自己体验一下wp,感受一下它的强大之处。

今天一天时间,不对,应该说是昨天到现在,一直忙到现在,现在时间是2:12分,一天主要是用来导数据,由于旧博客的表结构和wp的差别很大,所以这一步比较麻烦,wp的表设计可真有水平,功能这么强大的一个系统居然只设计了10张表,也是因为这范式选择的太高了,所以导起数据来也麻烦了不少。

接下来就是做一个日志地址的兼容,为了让旧博客能正常访问,特意为它启用了一个二级域名, 可能通过http://blog.hqlong.com进行访问,但以后的新日志不再提交到旧系统中。
Read the rest of this entry »

subversion安装备忘

Posted by 机器人 on 12th 十一月 2008 in linux/server

1. 所需软件包清单
a. apr-1.3.3.tar.gz
b. apr-util-1.3.4.tar.gz
获取地址: http://apr.apache.org/
c.neon-0.28.3.tar.gz
获取地址:http://www.webdav.org/neon/
d. subversion-1.5.4.tar.bz2
获取地址: http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=260&expandFolder=74
e. httpd-2.2.10.tar.gz
获取地址: http://httpd.apache.org/
Read the rest of this entry »

firefox中flash没有声音的解决方案

Posted by 机器人 on 10th 十一月 2008 in linux/server

方法如下:

hqlong@hqlong:~$ sudo ln -s /usr/lib/libbesd.so.0 /usr/lib/libesd.so.1
[sudo] password for hqlong:
hqlong@hqlong:~$ sudo mkdir -p /tmp/.esd
hqlong@hqlong:~$ sudo touch /tmp/.esd/socket

然后重启firefox
或者写成一个脚本,然后让系统启动时,自动运行
Read the rest of this entry »

[转]Install Samba Server on Ubuntu

Posted by 机器人 on 6th 十一月 2008 in linux/server

If you want to share files between your Ubuntu and Windows computers, your best option is to use Samba file sharing.

To install, first open a terminal window and enter the following command:

    sudo apt-get install samba smbfs

We’ve got samba installed, but now we’ll need to configure it to make it accessible. Run the following command to open the configuration file, substituting your editor of choice:

    sudo gedit /etc/samba/smb.conf

Find this section in the file:

    ####### Authentication #######
 
    # "security = user" is always a good idea. This will require a Unix account
    # in this server for every user accessing the server. See
    # /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html
    # in the samba-doc package for details.
    ;  security = user

Uncomment the security line, and add another line to make it look like this:

    security = user
    username map = /etc/samba/smbusers

This will set Samba to use the smbusers file for looking up the user list.

Create a Samba User

There are two steps to creating a user. First we’ll run the smbpasswd utility to create a samba password for the user.

    sudo smbpasswd -a <username>
</username>

Next, we’ll add that username to the smbusers file.

    sudo gedit /etc/samba/smbusers

Add in the following line, substituting the username with the one you want to give access to. The format is = ““. You can use a different samba user name to map to an ubuntu account, but that’s not really necessary right now.

    <username> = "</username><username>"
</username>

Now you can create samba shares and give access to the users that you listed here.

How do I set permissions to Samba shares?

Samba Basic permissions are as follows (configuration file is smb.conf [/etc/samba/smb.conf]):

* read only : This parameter controls whether an user has the ability to create or modify files within a share. This is default.
* guest ok : Uf this parameter is set to yes, the users will have access to the share without
having to enter a password. This can pose security risk.
* writeable : Specifies users should have write access to the share.

You can create the share called helpfiles with read only permission

[helpfiles]
path = /usr/share/docs
read only = Yes

You can create the share called salesdoc with write permission

[salesdoc]
path = /home/shared/sales
writeable = Yes

You can also create a list of users to give write access to the share with write list option. For example allow rocky and tony to write to the share called sales:

[salesdoc]
path = /home/shared/sales
write list = rocky tony

You can use following options

* read list : This option accepts a list of usernames or a group as its value. Users will be given read-only access to the share.
* valid users : You can make a share available to specific users. Usernames or group names can be passed on as its value.
* invalid users : Users or groups listed will be denied access to this share.

Samba mask permission

It is also possible to specify samba default file creation permission using mask.

* create mask : This option is set using an octal value when setting permissions for files.
* directory mask : Directories must have the execute bit for proper access. Default parameter is 0755.

[salesdoc]
path = /home/shared/sales
write list = rocky sys
create mask = 0775

At the end, please run the command:

    sudo /etc/init.d/samba reload

to reload the config file or run command:

    sudo /etc/init.d/samba restart

to restart the server.