手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表2009年12月24日的文章

平安夜快乐

平安夜快乐啊。。。

不想多写了。否则明天就又该说圣诞节快乐了。哈哈

少男少女们可以出去约会了。我是木有机会了啦 。。

jQuery插件:图片自动缩放

同事需要,就写了个插件 。。。。
原来我也写过两个,但这次是正式为jQuery写的插件。。。

JavaScript代码
  1. $(document).ready(function(){  
  2.     $('div').autoResize({height:50});  
  3. });  
  4.   
  5. jQuery.fn.autoResize = function(options)  
  6. {  
  7.     var opts = {  
  8.         'width' : 400,  
  9.         'height': 300  
  10.     }  
  11.     var opt = $.extend(true, {},opts,options || {});  
  12.     width = opt.width;  
  13.     height = opt.height;  
  14.     $('img',this).each(function(){  
  15.         var image = new Image();  
  16.         image.src = $(this).attr('src');  
  17.         //开始检查图片  
  18.         if(image.width > 0 && image.height > 0 ){  
  19.             var image_rate = 1;  
  20.             if( (width / image.width) < (height / image.height)){  
  21.                 image_rate = width / image.width ;  
  22.             }else{  
  23.                 image_rate = height / image.height ;  
  24.             }  
  25.             if ( image_rate <= 1){  
  26.                 $(this).width(image.width * image_rate);  
  27.                 $(this).height(image.height * image_rate);  
  28.             }  
  29.         }  
  30.     });  
  31. }  

原来的两篇在这里:

 

关于CRM的一些想法

这两天在写公司的程序,也在想着把自己的sbPHP【SuperBase PHP】做好,正好遇到一朋友在试用CRM,突然想起,其实我的服务器基本上还空着。如果我装上CRM,是不是也可以让人使用呢?

于是找了点资料:The Top 10 Open-Source CRM Solutions ,看了一下,这些CRM中,有一些是不能够被我所使用的。。。因为我的服务器终究是只支持LAMP的。所以,只有三个程序可以被支持:

1. SugarCRM Inc. is the 800-pound gorilla in the open-source CRM category. Founded in 2004 by John Roberts, Clint Oram and Jacob Taylor, the Sugar open-source code has been downloaded more than 3 million times. The company has received $26 million in venture financing and employs more than 100 people. More than 12,000 companies use SugarCRM including Honeywell International, Starbucks Corp., First Federal Bank and BDO Seidman LLP. SugarCRM is written in PHP and is compatible with the MySQL database.

6. Vtiger CRM is built upon the LAMP/WAMP (Linux/Windows, Apache, MySQL and PHP) architecture, with the main development team based in Chennai, India. Vtiger CRM includes SFA (Sales Force Automation), customer-support and -service, marketing automation, inventory-management, multiple database support, security-management, product-customization, calendaring and email-integration features. It also offers add-ons (Outlook Plug-in, Office Plug-in, Thunderbird Extension, Customer Self-service Portal and Web Forms) and support for other add-ons. Vtiger is written in JavaScript, PHP and Visual Basic. It is compatible with ADOdb, MySQL and PostgreSQL databases.

8. XRMS CRM is a Web-based application suite that incorporates human-resources management, SFA and CRM. It is an on-premise solution for the small to midsize company. XRMS CRM includes computer telephony integration and the ability to add plug-ins for programs such as Outlook. XRMS CRM is operating-system independent, and it is written in an interpreted language (PHP). Compatible databases include ADOdb, SQL-based, Microsoft SQL Server, MySQL and other network-based DBMS.

好象sugarCRM和vtiger仿佛是一家的。。以前在篱笆的时候,还用过一个简单的CRM,不记得是什么名字了。。【找到了,是http://www.group-office.com/】

 

如果您需要在线的CRM也可以联系我哦。呵呵【随便说说。。。】

Tags: crm, sugarcrm, vtigercrm

【笔记】UBUNTU下安装zendoptimizer

我用的vps是rashost的,装的是64位的ubuntu,9.10哦,最新版的。朋友在上面装个程序,结果发现无法运行。才想起来还没有安装ZendOptimizer。

找了一下ubuntu下如何安装的,却又搜索到Rashost的官方介绍。。。打开看了一下,没排过版。汗死。
原文内容如下:

XML/HTML代码
  1. Zend Optimizer是由PHP核心引擎“Zend”创建者Zend技术公司所开的免费PHP优化软件。据Zend公司透露使用这个软件某些情况下至少可以提高性能30%以上。今天我在安装了Ubuntu Hardy的VPS上配置了最新的ZendOp。过程记录如下:按照正常流程,在官方网站下载Zend Optimizer是需要注册用户登录之后才能下载的。下载一次后发现其实匿名用户也能下载,用下面这个URL即可: http://downloads.zend.com/optimizer/3.3.3/ZendOptimizer-3.3.3-linux-glib... 在安装Zend Optimizer之前需要先把apache,php安装好: apt-get install libapache2-mod-php 然后在/var/www/下创建index.php: echo "" > /var/www/index.php 然后用浏览器访问VPS,在首页里面搜索不到Zend Optimizer的字样.安装完成后应该能够搜索到Zend Optimizer才对。 tar zxf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz cd ZendOptimizer-3.3.3-linux-glibc23-i386 ./install.sh 然后安装程序会询问几个路径,一个个回答即可完成安装。 安装完成,重启apache,然后再访问首页,应该能搜索到Zend Optimizer的字样,说明安装成功了,接下来就可以开始测试性能了。   

不过,由于我装的是64位的,就没有办法这样安装了。所以我去官方下载了64位的ZendOptimizer。并解压到服务器上。却发现,根本没有上文说的install.sh
打开readme看了一下,才发现,原来在linux下面,居然只需要加一行代码就行了

XML/HTML代码
  1. [Zend]  
  2. zend_extension = "/xxx/xxx/ZendOptimizer.so"  

当然,这或许是3.3.9独有的安装方式,反正而不需象windows那样先设置 zend_extenstion_ts,再设置zend_extension_manager.optimizer_ts了

添加了这一行后,运行/etc/init.d/apache2 restart ,再新建一个phpinfo的文件,发现里面已经有了zend optimizer的信息了。

最后提供一下64位的zendoptimizer的下载地址:http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz

Tags: zend, optimizer

【笔记】ubuntu安装AMP后的小问题等

我曾经写过一篇很简单的笔记,是讲如何安装AMP的,当然很方便。。。,那篇文章在:http://www.neatstudio.com/show-522-1.shtml

今天我在使用了VPS后,也装了这些配置。但最后却仍然报错:

XML/HTML代码
  1. Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName  

现在我把我的步骤列出来。并列出解决方法

1、到/var/www/下新建一个目录,例如我的 sbphp.com,新目录的路径则为 /var/www/sbphp.com/
2、到/etc/apache2/sites-available/目录下,新建一个文件,名为sbphp.com,内容如下:

XML/HTML代码
  1. <VirtualHost *:80>  
  2. ServerAdmin xxx@xxx.com  
  3. ServerName sbphp.com  
  4. ServerAlias www.sbphp.com  
  5. DocumentRoot /var/www/sbphp.com/  
  6. <Directory /var/www/sbphp.com/ >  
  7. #这行是不显示列表   
  8. Options -Indexes  
  9. Order Deny,Allow  
  10. Allow from all  
  11. </Directory>  
  12. </VirtualHost>  

3、运行:a2ensite sbphp.com
4、然后系统会提示你重载一下apache,命令为 /etc/init.d/apache2 reload

于是乎就报上面的错了。这个问题的主要原因是没有定义ServerName,也就是没有定义默认的ServerName
5、到etc目录下建立一个hosts文件,内容为:127.0.0.1 localhost
6、回到apache2的目录,/etc/apache2/ ,打开httpd.conf,加上一行 ServerName 127.0.0.1 或者是你的服务器对应的IP地址

OK,再运行 /etc/init.d/apache2 reload ,不报错了吧。。

【备注】手工安装lamp的朋友可以看这里:http://hi.baidu.com/javatown/blog/item/c870547e956eb63d0dd7da3c.html

Tags: a2ensite