月度归档:2014年03月

苹果macbook air的一些使用体验

使用macbook air也有一两年了,今天来分享下macbook air的一些个人使用体验吧;

这个OS X操作系统除了不能运行windows软件外,基本再也找不到什么缺点了,刚开始从微软系统过渡过来,还是有点不习惯,但一旦上手,就不再想用windows的电脑了;

55

优点:

1.基本上不用关机,一个月重启一两次,像使用手机一样,不用时盒上,拿起就走;

2.不用关机的好处太多了,上班处理的文档,回到家里还是那个状态,因为你根本就不用关掉,有时文档打开一星期都没关一次;

3.由于轻便,带出门超方便,他的电池续航能力也让人满意,现在用了两年了,基本还能5-7个小时的续航;

4.超强性能,可以同时处理的任务太多了,基本上也是开着非常多的窗口,工作任务,而且你一整个星期不去关掉也没事;

5.视频处理远超PC,苹果系统自带视频处理软件,功能太强大 了,让我这个菜鸟很容易也能剪辑出自己的MV;

6.图片处理方面,macbook air上的PS可以同时运行非常多个工作窗口,且在处理像淘宝详情页那种非常长的页面也是完全没问题;22 334443

7.苹果操作系统还有个明显的优点,就是你基本不用去担心病毒问题,不用每天总去烦垃圾清理问题,这个系统在安全方面做总了功夫,插件,流氓软件基本很少有机会放肆!!内存占用方面,重启一下基本就全部释放了!

8.开机方面,mac基本保持在几秒内到十几秒内,装软件方面,更是简单得不行了,用了mac后,你基本很难明白,为什么在windows装软件和卸载软件总是会有那么多下一步,苹果只须一个点击!

下面说说缺点吧:

最大的缺点就是对已养成习惯的挑战,很多刚开始接触这个操作系统的朋友会很不习惯他的操作方式,毕竟这个系统跟windows区别还是很大的;

另一方面就是windows的生态链跟OS的生态链是完全独立的,windows上有丰富的应用软件,但这些都不能在OS上用,要想在OS上使用,都必须完全重新开发,其开发语言也不一样!

还有就是如果习惯用office的软件套餐,再来用苹果的,就有点麻烦,至少我目前如果在处理这方面的文档,都会用回微软的系统;

目前来说,大多数主流的应用软件都有OS 版本,但是像银行系统的插件就可悲了,所以在mac上支付有点麻烦;可喜的是目前支付宝可以在OS上完成支付了;淘宝的旺旺也在前不久可以了,只是千牛还不行;

PS:看到有很多朋友拿着苹果的电脑,但却装了微软系统,真的有点无语;当然,也能理解,确实在应用程序方面及对生活工作方面,苹果系统来对接朋友伙伴们的一些文档时,处理起来显得很麻烦!不过这样确实是大材小用!

directadmin安装成功后2222访问不了(All)

这是官方的处理方法:

If you are unable to access your server via http://1.2.3.4:2222, then 1 of 3 things is likely happening:

1. DirectAdmin might not be running or(第一种可能,就是DA没有正常安装)

2. You have a firewall blocking port 2222.(第二就是防火)

Number 2 is easy to check by simply running (only on redhat systems):
/sbin/service iptables stop
/sbin/chkconfig iptables off

Then test directadmin again.

If that didn't fix it, then you'd need to check your /var/log/directadmin/error.log to check for any errors as to why it isn't starting:
tail /var/log/directadmin/error.log (如果 试了上在两个方法还是不行,可查看错误列表)

Common problems are:
3. Incorrect ethernet_dev set in the /usr/local/directadmin/conf/directadmin.conf file. guide

4. Invalid license, either due to wrong uid/lid, IP, or date.  Try: Updating your DirectAdmin License manually

5. Your IP is blacklisted in /usr/local/directadmin/data/admin/ip_blacklist.  This is controlled by the "brute force login detection" in Admin Settings.  Use a setting no lower than 10, since even loading the login page counts as 1 failed attempt.

6. Binaries for a different operating system. Related

You can always try running DirectAdmin by hand (if it's not already running) to see what the problem is.
cd /usr/local/directadmin
./directadmin b200

to start it in the terminal with debug level 200.  Use Ctrl-C to stop.

7. If DirectAdmin is running, is bound to port 2222, but doesn't respond on "127.0.0.1", but does respond on "::1", then it's an IPv6 issue.  This guide would be related.

Directadmin如何更换授权IP

本次错误为:
The ip of this machine () does not match the ip in the license file
解决方法:

If you get the message:
The ip of this machine () does not match the ip in the license file

when trying to start DirectAdmin (or (1.2.3.4) instead of ()) then the ethernet_dev setting in your directadmin.conf files isn't setup correctly.

Type:
/sbin/ifconfig

to see which device name your IP is on.  Common devices names/formats are: eth0, eth0:1, eth1, venet0:0, etc..  Note that you can specify the sub-device name to get different IPs.

Once you know the device name, edit /usr/local/directadmin/conf/directadmin.conf
Change (or add) the setting:
ethernet_dev=eth0

再用下面的命令重启directadmin

# /etc/init.d/directadmin restart

django 安装 directadmin安装

django-admin.py startproject hello
python manage.py runserver p.smtch.com:8000

gunicorn hello.wsgi:application –bind p.smtch.com:8001


yum groupinstall -y development

yum groupinstall -y 'development tools'

curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python
或者: wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
$ python get-pip.py

pip install virtualenv
yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel


Create and activate an environment for your application

I like to keep all my web apps in the /webapps/ directory. If you prefer /var/www/ or something else, use that instead.

$ cd /webapps/
$ virtualenv hello_django(创建一个环境)

New python executable in hello_django/bin/python
Installing distribute..............done.
Installing pip.....................done.

$ cd hello_django
$ source bin/activate
(hello_django) $ 

接着安装django

Your environment is now activated and you can proceed to install Django inside it.

(hello_django) $ pip install django

Downloading/unpacking django
(...)
Installing collected packages: django
(...)
Successfully installed django
Cleaning up...


安装完成,运行project:

django-admin.py startproject hello

接着可试运行development server:



(hello_django) $ cd hello
(hello_django) $ python manage.py runserver example.com:8000
Validating models...

0 errors found
June 09, 2013 - 06:12:00
Django version 1.5.1, using settings 'hello.settings'
Development server is running at http://example.com:8000/
Quit the server with CONTROL-C.

Application user

Even though Django has a pretty good security track record, web applications can become compromised. If the application has limited access to resources on your server, potential damage can also be limited. Your web applications should run as system users with limited privileges.

Create a user for your app, named hello and assigned to a system group called web apps

$ sudo groupadd --system webapps
$ sudo useradd --system --gid webapps --home /webapps/hello_django hello 
Gunicorn

In production we won’t be using Django’s single-threaded development server, but a dedicated application server called gunicorn.

Install gunicorn in your application’s virtual environment:
(hello_django) $ pip install gunicorn
Downloading/unpacking gunicorn
  Downloading gunicorn-0.17.4.tar.gz (372Kb): 372Kb downloaded
  Running setup.py egg_info for package gunicorn

Installing collected packages: gunicorn
  Running setup.py install for gunicorn

    Installing gunicorn_paster script to /webapps/hello_django/bin
    Installing gunicorn script to /webapps/hello_django/bin
    Installing gunicorn_django script to /webapps/hello_django/bin
Successfully installed gunicorn
Cleaning up...

安装好gunicoin,运行django程序:

(hello_django) $ gunicorn hello.wsgi:application --bind example.com:8001

http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/

python manage.py runserver 27.54.250.15:8000

gunicorn hello.wsgi:application –bind 27.54.250.15:8001
Directadmin

1. 安装gcc, gcc-c++

yum install gcc
CODE

yum install gcc-c++
想当然第一次装的时候, 是一个header, 一个header,??一个RPM, 一个RPM慢慢装的啊, 哪里知道这两条命令就能全搞定. 幸好遇到这个新的公司的这个技术, 要不然还不一辈子当傻子了?

2. 之后开始安装DirectAdmin了, 其实只是按官方步骤就OK了, 我只是用中文转述一下, 哈哈.

安装之前请一定准备好DirectAdmin的授权信息, client ID, license ID, 并确定使用系统和IP都是正确的. 否则无法成功安装

1)用root帐号登录系统, 下载setup.sh文件, 运行

wget http://www.directadmin.com/setup.sh
2)改setup.sh属性,

chmod 755 setup.sh
3)运行程序

./setup.sh

Linux下python升级步骤

  首先下载源tar包

  可利用linux自带下载工具wget下载,如下所示:

1
# wget http://www.python.org/ftp/python/3.3.0/Python-3.3.0.tgz
  或自己去网上找,这里提供一个最新版的下载链接:http://xiazai.zol.com.cn/detail/33/320958.shtml

  这里我用的是第二种方法,下载的是Python-3.1.2.tar.bz2版本,下载完成后到下载目录下,解压

1
bunzip2 Python-3.1.2.tar.bz2
2
tar -xvf Python-3.1.2.tar(若是第一种方法,则直接解压缩tar -xzvf Python-3.3.0.tgz)
  进入解压缩后的文件夹

1
cd Python-3.1.2
  在编译前先在/usr/local建一个文件夹python3(作为python的安装路径,以免覆盖老的版本)

1
mkdir /usr/local/python3
  开始编译安装

1
 ./configure --prefix=/usr/local/python3
2
make
3
 make install
  此时没有覆盖老版本,再将原来/usr/bin/python链接改为别的名字

1
 mv /usr/bin/python /usr/bin/python_old
  再建立新版本python的链接

1
 ln -s /usr/local/python3/bin/python3 /usr/bin/python
  这个时候输入

1
python
  就会显示出python的新版本信息

点击率系列一:如何提高直通车图片点击率

互联网上决定流量流向的就是点击率,包括:文字,图片,视频; 而直通车的点击率涉及目的人群,价格,已买人数,标题,关键词,图片;其中图片是最主要的一块;

那么如何提高直通车图片点击率呢?

在标题,关键词都优化好的前提下,影响直通车图片点击率主要有以下几方面:

1.有清晰美女图点击率更高;有性感美女更吸引人;

2.有可爱宝宝

3.图片展示出的产品够清晰,够大;

4.哪个产品的颜色转化高,卖得多,就以那个颜色作为主图;一般情况下,服饰黑白点击会高于其他色,冬天黑高于白;夏天可能白好些(有待测试)

5.内容简洁,一目了然;1-2个卖点,每个卖点2-4个字;

6.2个以上卖点时,分主次,突出其中一个,2-4个字,放到最大,大到你在手机端列表看时,也很清晰;

7.什么卖点吸引什么人,一定要是该产品转化最高的卖点,如果该卖点吸引的人流大,那就更完美;卖点尽量是大亮点,优势点,差异点;

8.卖点如果是痛点会更完美,卖点可跟当前天气结合;

9.还有就是从美工角度的色彩搭配,从而突出主次,人看的人一眼就能看到我们想让他看的点;

10.每张图必须有一个聚焦点,就是我们最想让人看的那个点;这个点必须非常突出,显眼;

11.在卡位时,需要观察前后左右相关的图片,参考这些图片来出鹤立鸡群的那张图;

优秀的美工可以让很多事情事半功倍,如果没有,那就找一流的外包公司,省时省力更省钱!一定要让最专业的人来做对应的事;

更多的点可能没覆盖到,欢迎交流

WeB App服务端一些相关知识RestFul API

The term cloud actually has a number of meanings and discrete forms besides simple data storage.

 Software as a Service (SaaS) means applications hosted on a server that you could access and use almost as if they were installed on your local device. SaaS also to some means web application programming interfaces (APIs) that you can access remotely. Some examples of SaaS include Salesforce (www.salesforce.com), a customer relationship management (CRM) service, and GoToMeeting (www.gotomeeting.com), an online virtual meeting service.
 Infrastructure as a Service (IaaS) means the hosting of real or virtualized systems. If you need a Linux machine, for example, you can have a virtual server built
and hosted in the cloud with IaaS, removing the responsibility of building and maintaining the hardware yourself (whether that hardware is real or virtual doesn’t really matter in this model; you don’t care as the client of IaaS and in
fact may not even know). The benefit of this is that most of the responsibility for maintaining servers, worrying about updates, ensuring proper virus protection is in place, and so on, are dealt with by the provider, allowing you to focus on what really matters most to you, namely, your business. Some examples of IaaS include Amazon EC2 (http://aws.amazon.com/ec2) and Google App Engine (http://developers.google.com/appengine).
 Platform as a Service (PaaS) is effectively an extension of IaaS where instead of just a virtualized server you get a virtualized “full stack” including things such as databases, web/app servers, and programming execution environments. Examples of PaaS include IBM’s SmartCloud Application Services (www.ibm.com/cloud-computing/us/en/paas.html) and VCE’s VBLOCK (www.vce.com/products/vblock/overview).
6 CHAPTER 1: Designing My Mobile Organizer
 Network as a Service (NaaS) includes capabilities such as VPNs and “bandwidth on demand.” Once again, this removes the need to administer the hardware and/or software for your networking capabilities yourself. Any VPN, such as GigaNews’ VyprVPN (www.giganews.com/vyprvpn), is an example of NaaS.
 Storage as a Service (also abbreviated SaaS) is similar to IaaS but deals specifically with data storage. Sites such as Dropbox, Google Drive, and Microsoft’s SkyDrive are all examples of SaaS.


When you start to look at the mobile web libraries available, you’ll come across a number of options. There’s Sencha Touch (www.sencha.com), which is a very good library designed specifically for mobile web development. It allows us to develop screens using JavaScript and provides things such as widgets (grids, buttons, calendars, and so on) as well as a robust data-handling module, among lots of other things.
There’s DHTMLX Touch (www.dhtmlx.com) that provides a full HTML5-based framework and widget set for developing mobile applications.
There are also some old favorites like Dojo (www.dojotoolkit.org) and Yahoo’s YUI (www.yuilibrary.com) that, while not exclusively mobile-oriented, are capable of helping develop mobile web apps nonetheless.
However, one of the most popular general JavaScript libraries in existence (many polls indicate it is in fact the most popular) is jQuery (www.jquery.com). As a more general-purpose JavaScript library, however, jQuery isn’t focused on mobile development. Although not an all-inclusive description,probably the main goal of jQuery is to make Document Object Model (DOM) manipulation easier, and it does this exceedingly well. It’s extremely fast, lightweight, and, most importantly for the purposes of this discussion, extensible.
That extensibility comes into play with jQuery Mobile (www.jquerymobile.com), which is built on top of jQuery. This library is an HTML5-based system for developing mobile UIs. It contains widgets and helper functions for putting such apps together, among other things

Server-Side Architecture

With the client-side decisions of mobile web app using jQuery Mobile decided, how do we build the server side? Clearly, there’s a ton of choices there too.
Do you already know Java (www.oracle.com)? Then that might be a good choice. What about PHP (http://us.php.net)? Again, there’s nothing wrong with PHP in my mind, even though some would argue that it isn’t appropriate for “professional” development. I’m not here to pass judgment, though! If you know PHP already, then it’s certainly worth considering. Are Microsoft technologies (www.microsoft.com) up your alley? If that’s a skill set you already have, then they are not a bad choice. Ruby on Rails (www.rubyonrails.org) perhaps? Yes, it’s worthy of consideration certainly, as are any of a dozen other possible technologies you might come across.
All of these also require potentially significant server infrastructures. Java requires an entire servlet container. PHP is an extension to an existing web server. Microsoft of course requires IIS, its proprietary web server, plus the appropriate extensions. Ruby on Rails is its own server product essentially. All of these also require administration expertise and are therefore somewhat complex to work with, depending on what you might already know.
At the end of the day, there’s another option that’s fast becoming very popular, and for good reason: node.js (www.nodejs.org). One of the key benefits to node.js is that the code you write on the server side is written in JavaScript, just as your client-side code is. Since one of the reasons I stated for going with a mobile web approach is reuse of skills, shouldn’t that apply to the server side as well?
I think so! The idea of the same language on both sides of the conversation, meaning client side and server side, and assuming performance isn’t a problem, is attractive to many people.
The other big benefit of node.js is that it is designed for high performance and concurrency from the start. While neither of these concerns is particularly big for My Mobile Organizer frankly, there’s no good reason to use technologies that hamstring us in either regard.

What About the Database?

Of course, just deciding on node.js for the server side isn’t quite the whole story. There’s also data storage to consider. We need a database of some sort too, don’t we?
Of course we do!
26 CHAPTER 1: Designing My Mobile Organizer
So then, which do we use? Oracle (www.oracle.com)? It’s a great database supporting tons of massive, high-availability systems out there. Yet, it’s expensive, so it’s probably not the best choice for our relatively minor app. What about the popular MySQL (www.mysql.com)? It’s very good, no question; I use it tons myself. To make a long story short, there are many choices to choose from in this area, too many to name.
Given that we’ve decided on node.js, are there any options that work well with it? Yes, all of the above in fact can be used with it. There’s another choice, though, that is very popular and is part of the “NoSQL” movement: MongoDB.
The NoSQL movement is an approach to data storage that eschews the need for Structured Query Language (SQL) that all relational database management systems (RDBMSs) are based upon. It’s fundamentally different in that you store “documents,” as opposed to relational data in the form
of tables and rows of data. It goes along fantastically well with JavaScript, and therefore node.js, because a “document” can be simply an object represented with JSON, which of course is native, even the lingua franca really, of JavaScript. MongoDB is one very popular implementation of this concept, and it integrates exceedingly well with node.js.
Chapter 6 is where we’ll deep-dive into MongoDB so for now, suffice to say that its NoSQL approach, and the simple API made available to our node.js app for it, makes it easy to work with and provides a good data storage mechanism for our PIM app.

his stack, the combination of PhoneGap, jQuery, jQuery Mobile, node.js, REST, and MongoDB, is rapidly becoming a popular one because it is flexible, is easy to learn, performs well (if you do your job as a developer reasonably well at least), and is based on open, free technologies.