May 31 2008

还是下雨

Category: 乱up当秘笈ssmax @ 20:31:28

最近天天都下雨,很潮湿,这种天气最好就是呆在家吹吹风扇,打打游戏,有人称呼我做宅男,其实离这种水平还很远,所谓宅男,最大一个特征就是每天都待在家里,所以所谓的soho一族就和宅很贴近了,不过宅一般都是和打游戏有联系的,记得以前有人问我wow最快要多长时间才能升到60呢,那时候lexx就插嘴说,这就要看你“宅”的程度了,那个时候最快好像是solo的话每天8个小时,7天就差不多了。。。不知道现在的记录是多少了。。。


May 30 2008

永远在一起

Category: Lovessmax @ 22:50:22

有点肉麻,说到就要做到。


May 29 2008

Solaris 下的网卡驱动和网络配置

Category: 技术ssmax @ 15:06:41

本文在solaris下面写的,最新版,自带的拼音输入法还不错,很流畅。。。

昨天安装了solaris,但是网卡驱动找不到,去网上找了一下,发现solaris支持的网卡还是很少的,机上的集成网卡芯片是 Realtek RTL8168/8111 ,好像是比较普遍的网卡了,但是Solaris就是没有自带驱动,在网上找到一个人写的驱动,说是支持 Realtek RTL8169/8110的,也支持8168,下载,u盘,copy。。。

按步骤一步步来。。。

# gunzip -cd gani-x.x.x.tar.gz | tar xf –

% cd /…/gani-x.x.x
% rm obj Makefile
% ln -s Makefile.${KARCH}_${COMPILER} Makefile
% ln -s ${KARCH} obj

isainfo看体系,应该是amd64了。。

# cd /…/gani-x.x.x
# /usr/ccs/bin/make install
# ./adddrv.sh
# /usr/ccs/bin/make uninstall (for solaris7, don’t remove the file )
# modload obj/gani
# devfsadm -i gani (for solaris7, use drvconfig and reboot with -r )
# ifconfig ganiN plumb ( where N is an instance number, typcally 0 for first card)
# ifconfig -a ( you will see an entry for ganiN)
# ifconfig ganiN YOUR-HOST-NAME
# ifconfig ganiN ( ensure IP address is correct)
# ifconfig ganiN up ( and then you can test with ping, telnet, ftp …)

做到devfsadm -i gani的时候死活也装不上,这个命令是把驱动绑定设备上面并且生成/dev/gani的,出错:

devfsadm: driver failed to attach: gani

改一下设备名称啦之类的都不行,一直在研究,后来找到网上说solaris新版已经带8169的驱动了,是/kernel/drv/amd64/rge模块,好,试一下能不能强行装上用用。。。

先用prtconf -v | less 找到设备pci地址,网卡设备名一般是Ethernet controller,搜索Ethernet,找到设备地址

pci1458,e000,或者用别名pci10ec,8168都应该可以的,然后强行装上驱动

/usr/sbin/add_drv -n -v -m ‘* 0600 root sys’ -i “pci1458,e000” rge

没出问题

modload /kernel/drv/amd64/rge

devfsadm -i rge

竟然没有出问题,装上了,有个设备rge0了

然后

touch /etc/hostname.rge0

touch /etc/dhcp.rge0

配置成dhcp模式,

dhcp会自动配置

/etc/resolv.conf        dns服务器

/etc/nsswitch.conf    域名解释顺序

等一堆东西。。。然后reboot之。。

开机了,拿到ip地址,dns地址,以为没有问题了,谁知道ping一下网关,没有反应,全部包都丢失,再重启一下看看,正常了,但是解释不了dns。。。只有ping可以通,其他所有服务都用不了,直接ip访问页面也不行,出绝招,

sys-unconfig

重新设定系统的所有配置,oh shit,更惨,连ip都拿不到了,估计还是驱动问题,汗阿汗。。。

死死地气去问it借了个3com的网卡来。。。插上,开机,认出来了,

pci10b7,9055,3Com 3C905B-TX

驱动是elxl,设备号是elxl0。。。

配置好hostname和dhcp,reboot拿到ip,能ping通,能nslookup,但是ping域名或者用firefox上的时候还是不行,unknown hosts错误,tnnd,又检查了半天,觉得可能是nscd服务没有开,这个是name service cache daemon,做dns缓存的,把服务打开,ok了,tnnd。。。

总结一下,

主要的启动日志在/var/adm/message,很多时候要看。

solaris里面的ifconfig比较怪异,基本还是和linux差不多的

tar也比较怪异,没有z项,不能直接tar压缩文件

ps 也很怪异,暂时没有研究它的选项,反正默认显示不了多少东西。。。

route更怪异,没有打印路由的功能,要netstat -nr

最后就是服务管理了,可以直接用unix的常用方法,直接搞/etc/rcx.d/

也有自己提供的方法 svcs 来观察服务是否启动

svcs -v

这套东西是它自己的smf,Solaris Service Management Facility

  • Enabling and disabling servicesPrior to Solaris 10, there wasn’t a good way to permanently disable a service in Solaris. The typical method used is to rename the relevant rc script to a name that won’t get executed, but that change will get overlooked the next time the system is upgraded. Furthermore, inetd-based services are enabled and disabled by a totally different method — editing a configuration file. Under SMF, both types of services can be configured using the svcadm(1M) command, and the changes will persist if the machine is upgraded. Here’s a comparison of how to enable and disable some services:
    Old method
    SMF Method
    mv /etc/rc2.d/S75cron /etc/rc2.d/x.S75cron
    svcadm disable system/cron:default
    edit /etc/inet/inetd.conf, uncomment the finger line
    svcadm enable network/finger:default

    The last argument to svcadm in these examples is the FMRI of the service.

    Note that svcadm should only be used for SMF services — legacy rc script-controlled services work the same as in past releases.

  • Stopping, starting, and restarting servicesTraditionally, services have been started by an rc script run at boot, run with the argument start. Some rc scripts provide a stop option, and a few also allow restart. In SMF, these tasks are all accomplished with the svcadm(1M) command:
    Old method
    SMF Method
    /etc/init.d/sshd stop
    svcadm disable -t network/ssh:default
    /etc/init.d/sshd start
    svcadm enable -t network/ssh:default
    /etc/init.d/sshd stop; /etc/init.d/sshd start
    svcadm restart network/ssh:default
    kill -HUP `cat /var/run/sshd.pid`
    svcadm refresh network/ssh:default

    The “-t” option to svcadm enable and svcadm disable indicates that the requested action should be temporary — it will not affect whether the service is started the next time that the system boots.

不过solaris的错误跟踪是比较强大,比如

truss ping www.163.com

出来一堆跟踪信息。。。

明天还要看dtrace,这个才是这次主要研究对象。。。tnnd郁闷阿。。。


May 28 2008

Windows Services for UNIX

Category: 技术ssmax @ 14:14:19

上面基本上有unix上面的所有gun基本命令,在windows下面使用,200多m,nfs啊之类的什么都有,所以说微软的开发人员还是很不错的,这些用户支持方面做得太tmd好了,赚这么多也是理所当然。。。

Windows Services for UNIX version provides a full range of cross-platform services for integrating Windows into existing UNIX-based environments.


May 28 2008

solaris u盘启动

Category: 乱up当秘笈ssmax @ 11:17:35

默认光盘好像是用grub启动的,正好有一个u盘做了grub4dos,直接拿过来试试,正常启动成功,就是不知道核心还有什么参数要传过去,汗啊。没有光驱的机器,所有系统都没有自带该网卡驱动,无法光盘安装,无法网络安装,麻烦得很,研究研究u盘安装试试,嘿嘿,还没有研究出来,主要是只有2g u盘,不够玩啊。。。solaris的dvd有2g多。。。

先抄抄它的install参数:

x86: GRUB Menu Commands for Installation

Starting in the Solaris 10 1/06 release, you can customize the network boot and installation of your system by editing the commands in the GRUB menu. This section describes several commands and arguments you can insert in the commands in the GRUB menu.

In the GRUB menu, you can access the GRUB command line by typing b at the prompt. A command line that is similar to the following output is displayed.

kernel /Solaris_10_x86/multiboot kernel/unix 
-B install_media=192.168.2.1:/export/sol_10_x86/boot
module /platform/i86pc/boot_archive

You can edit this command line to customize your boot and installation. The following list describes several common commands you might want to use. For a complete list of boot arguments that you can use with the -B, see the eeprom(1M) man page.

Table 10–1 x86: GRUB Menu Commands and Options

Command/Option  Description and Examples 
install Insert this option before the -B option to perform a custom JumpStart installation.

kernel /Solaris_10_x86/multiboot install 
-B install_media=192.168.2.1:/export/sol_10_x86/boot
module /platform/i86pc/boot_archive
url|ask Specifies the location of the custom JumpStart files or prompts you for the location. Insert either option with the install option.

  • url – Specifies the path to the files. You can specify a URL for files that are located in the following places:

    • Local hard disk
      file://jumpstart_dir_path/compressed_config_file

      For example:

      kernel /Solaris_10_x86/multiboot install 
      file://jumpstart/config.tar 
      -B install_media=192.168.2.1:/export/sol_10_x86/boot
      module /platform/i86pc/boot_archive
    • NFS server
      nfs://server_name:IP_address/jumpstart_dir_path/compressed_config_file

      For example:

      kernel /Solaris_10_x86/multiboot install 
      myserver:192.168.2.1/jumpstart/config.tar 
      -B install_media=192.168.2.1:/export/sol_10_x86/boot
      module /platform/i86pc/boot_archive
    • HTTP server
      http://server_name:IP_address/jumpstart_dir_path/
      compressed_config_file&proxy_info

      • If you placed a sysidcfg file in the compressed configuration file, you must specify the IP address of the server that contains the file, as in the following example:
        kernel /Solaris_10_x86/multiboot install 
        http://192.168.2.1/jumpstart/config.tar 
        -B install_media=192.168.2.1:/export/sol_10_x86/boot
        module /platform/i86pc/boot_archive
      • If you saved the compressed configuration file on an HTTP server that is behind a firewall, you must use a proxy specifier during boot. You do not need to specify an IP address for the server that contains the file. You must specify an IP address for the proxy server, as in the following example:
        kernel /Solaris_10_x86/multiboot install 
        http://www.shadow.com/jumpstart/config.tar&proxy=131.141.6.151 
        -B install_media=192.168.2.1:/export/sol_10_x86/boot
        module /platform/i86pc/boot_archive
url|ask (continued)

  • ask – When used with the install option, specifies that the installation program prompt you to type the location of the compressed configuration file after the system boots and connects to the network. If you use this option, you are not able to do a completely hands off JumpStart installation.

    If you bypass the prompt by pressing Return, the Solaris installation program interactively configures the network parameters. The installation program then prompts you for the location of the compressed configuration file.

    The following example performs a custom JumpStart and boots from a network installation image. You are prompted to input the location of the configuration file after the system connects to the network.

    kernel /Solaris_10_x86/multiboot install ask 
    -B install_media=192.168.2.1:/export/sol_10_x86/boot
    module /platform/i86pc/boot_archive
dhcp Insert this option before the -B option to instruct the installation programs to use a DHCP server to obtain network installation information that is needed to boot the system. If you do not specify to use a DHCP server by typing dhcp, the system uses the /etc/bootparams file or the name service bootparams database. For example, you would not specify dhcp if you wanted keep a static IP address.

kernel /Solaris_10_x86/multiboot dhcp 
-B install_media=192.168.2.1:/export/sol_10_x86/boot
module /platform/i86pc/boot_archive
- text Insert this option before the -B option to perform a text-based installation in a desktop session.

kernel /Solaris_10_x86/multiboot - text 
-B install_media=192.168.2.1:/export/sol_10_x86/boot
module /platform/i86pc/boot_archive
- nowin Insert this option before the -B option to perform a text-based installation in a console session.

kernel /Solaris_10_x86/multiboot - nowin 
-B install_media=192.168.2.1:/export/sol_10_x86/boot
module /platform/i86pc/boot_archive
"console=serial-console" Use this argument with the -B option to instruct the system to use a serial console, such as ttya (COM1) or ttyb (COM2).

kernel /Solaris_10_x86/multiboot -B "console=ttya" 
install_media=192.168.2.1:/export/sol_10_x86/boot
module /platform/i86pc/boot_archive
"ata-dma-enable=[0|1]" Use this argument with the -B option to enable or disable Advanced Technology Attachment (ATA) or Integrated Drive Electronics (IDE) devices and Direct Memory Access (DMA) during the installation.

kernel /Solaris_10_x86/multiboot -B "ata-dma-enable=0" 
install_media=192.168.2.1:/export/sol_10_x86/boot
module /platform/i86pc/boot_archive
"acpi-enum=[0|1]" Use this argument with the -B option to enable or disable Advanced Configuration and Power Interface (ACPI ) power management.

kernel /Solaris_10_x86/multiboot -B "acpi-enum=0" 
install_media=192.168.2.1:/export/sol_10_x86/boot
module /platform/i86pc/boot_archive
"acpi-cd-dma-enabled=[0|1]" Use this argument with the -B option to enable or disable DMA for CD or DVD drives during the installation.

kernel /Solaris_10_x86/multiboot -B "acpi-cd-dma-enabled=0"
install_media=192.168.2.1:/export/sol_10_x86/boot
module /platform/i86pc/boot_archive

 

 


May 27 2008

jsp sendRedirect 出错

Category: 技术ssmax @ 18:52:19

java.lang.IllegalStateException: Can’t sendRedirect() after data has committed to the client.

本来就是最简单的错误了,sendRedirect之前已经flush过了,有可能是buffer满了或者手动flush,但是检查了一下就不对了,resin默认有8k的buffer,怎么看jsp都输出不了8k的东西,tag的换行最多也就是几十个字节,想不通啊,看resin编译出来的jsp源代码,也没找到有输出什么大东西啊,也不是每个浏览器都出错,偶然才会出现,难道是resin的智能flush作怪,tnnd。。。


May 26 2008

无线路由

Category: 乱up当秘笈ssmax @ 21:38:33

今天心血来潮,拍了一个无线路由来玩玩,经典linksys v4版,tnnd就一个路由都这么多版本,光是54g就有v1-v7。。。还能刷非公版firmware,什么dd-wrt/tomato之类的,好像还能增强不少功能,不知道能不能蹭到公司5楼的无线网络来用,可以的话就爽了,网通的光纤出口再加上我的双出口服务器vpn,有啥不能干,哈哈哈。


May 25 2008

下雨天

Category: 乱up当秘笈ssmax @ 20:53:58

这两天的天气真是十分闷热,那雨酝酿了一天还只是下了几滴,人身上觉得粘粘的,十分难受,洗完澡就舒服多了,好像快要到端午了,龙舟水就是这样子的。


May 24 2008

混沌军团.ChaosLegion

Category: Gamesssmax @ 22:49:43

好久没有玩游戏了,今天翻翻硬盘找到这只,动作游戏,花了半天通关,capcom的功力不是盖的,做得很流畅,让人打得畅快淋漓,一个字,爽,好像是03年移植到pc上面的,动作游戏的确是tv game占优势,大家都不看字幕,直接打就是了,哈哈。。


May 23 2008

广告投放系统需求

Category: 乱up当秘笈ssmax @ 10:10:57

其实需求文档不应该由程序员写吧。。。我都不知道投放商有什么需求,随便写了一页交上去算了,好像以前听过老丁说要做,都不知道什么东东来的,昨晚comx竟然和我说他也做过这个,还是半成品了,笑死。。。


Next Page »