Ubuntu 10.04.3升级3.2.0-8.14优化内核

一 7th, 2012
135 views | 没有评论


下载地址:
https://launchpad.net/ubuntu/+source/linux/3.2.0-8.14
32位
i386的很容易,选择i386的就好了,就是点击i386,只要找到linux-headers- 3.2.0-8_3.2.0-8.14_all.deb,linux-headers-3.2.0-8-generic_3.2.0-8.14.deb和 linux-image-3.2.0-8-generic_3.2.0-8.14.deb即可。

64位
amd64的安装麻烦些, 首先先去i386那里找到linux-headers-3.2.0-8_3.2.0-8.14_all.deb,然后到amd64那里找linux- headers-3.2.0-8-generic_3.2.0-8.14_amd64.deb和linux-image-3.2.0-8- generic_3.2.0-8.14_amd64.deb。

把上述文件deb包下载到一个单独的空文件夹之后直接sudo dpkg -i *.*就好了

64位
wget https://launchpadlibrarian.net/89215107/linux-headers-3.2.0-8_3.2.0-8.14_all.deb
wget https://launchpadlibrarian.net/89207522/linux-image-3.2.0-8-generic_3.2.0-8.14_amd64.deb
wget https://launchpadlibrarian.net/89207523/linux-headers-3.2.0-8-generic_3.2.0-8.14_amd64.deb
sudo dpkg -i *.*

标签: , ,

Nginx封锁中国IP

十 30th, 2011
528 views | 没有评论

Nginx 有个模块 ngx_http_access_module  简单即可实现封锁IP.
1.首先上个Python脚本,获取所有中国的IP段.

import urllib2
request = urllib2.urlopen("http://ftp.apnic.net/apnic/dbase/data/country-ipv4.lst")
contents = request.read()
lines = contents.split("\n")
for line in lines:
        temp = line.split(":")
        if len(temp) is not 5: continue
        if temp[2].strip() == "cn":
                block_range = temp[1].strip().split("/")[0]
                while len(block_range.split(".")) is not 4:
                        block_range += ".0"
                block_range += "/" + temp[1].strip().split("/")[1]
		open('block.conf','a').write('deny %s; \n'%(block_range))

2.运行这个脚本,会得到一个block.conf,里面就是所有的中国IP段了.
3.在Nginx配置文件server段里面加上

include block.conf;

4.把这个block.conf放在/usr/local/ngnix/conf/下面
5.重启Nginx,就可以看到效果了
6.另外还可以定制403错误页面 给访客提示,什么原因无法访问的,在block.conf头部加上如下代码:

error_page  403  http://xxx.cn/xxx.html;

使用whois3得网通 电信 铁通的IP地址段

十 29th, 2011
748 views | 没有评论
wget http://ftp.apnic.net/apnic/dbase/tools/ripe-dbase-client-v3.tar.gz
tar xzvf ripe-dbase-client-v3.tar.gz
cd whois-3.1
./configure
make
make install

中国网通:

whois3 -h whois.apnic.net -l -i mb MAINT-CNCGROUP > /root/cnc.txt

中国电信:

whois3 -h whois.apnic.net -l -i mb MAINT-CHINANET > /root/chinanet.txt

中国铁通:

whois3 -h whois.apnic.net -l -i mb MAINT-CNC-CRTC > /root/crtc.txt

获取广东网通:

whois3 -h whois.apnic.net -l -i mb MAINT-CHINANET-GD | grep "descr" | grep "Reverse" | awk -F "for" '{if ($2!="") print $2}'| sort -n > 广东电信.txt
标签:

VPS Hosting for WordPress

九 27th, 2011
512 views | 没有评论

What is WordPress

WordPress is the most popular blogging software in use on the web. It is in fact, one of the most used Content Management System (CMS) online.

It’s very easy to set up – it can be installed with Fantastico by one-click in a few seconds. Due to its popularity there is ample help online when you need it.

WordPress is written in a programming language called PHP which accesses the content from a MySQL database. As it is continually extracting packets of information from the server and elsewhere, WordPress can need more memory that a straightforward static HTML site.

WordPress and Hosting

To set up a WordPress site you need two things: a domain name and a web host.

Google rates speed very highly these days in its ranking algorithm, so it’s essential you pick a good host to make the most from your WordPress site.

You can find that certain plugins won’t work due to memory issues, servers can fail due to the host’s incompetence often causing a loss in Google rankings and sometimes WordPress’s features won’t work due to a poor host setup – so choosing a host not something to be hurried!

Most website owners when they start out will opt for a shared hosting package. This is the cheapest hosting option where your website will be sharing a server with hundreds or, sometimes, thousands of other sites.

Whereas a dedicated hosting service is one where you lease an entire server which isn’t shared with anyone.

What is VPS?

A virtual private server provides the features of a dedicated server on a machine that is shared by other customers. This is done by partitioning a physical computer into multiple servers such each with capabilities of running its own fully-fledged operating system, and each can be independently rebooted.

Customers therefore get hosting services that are similar to that of dedicated Web hosting without sacrificing performance and for a much reduced price.

Another benefit of VPS servers is scalability. Extra resources (RAM, other configurations) can be added at later dates as the website grows.

Which type of VPS host to use for WordPress?

The first thing to advise is to go for a Linux host over Windows as Linux takes much less resources and WordPress just runs better on it.

Managed VPS or Unmanaged VPS hosting?

You need to decide between purchasing a managed VPS or an unmanaged VPS hosting account.

With an unmanaged VPS site you are on your own. You control it. You install and run whatever software you want to run on it.

If you aren’t comfortable doing this then unmanaged hosting is obviously not for you. However, it does have the benefit of being slightly cheaper as hosts do not have to spend so much on support. You may have to pay extra for cPanel licenses, etc.

Managed VPS services include maintenance, monitoring, and repairs at a fixed cost – they also provide varying amounts of support.

Standard VPS hosting or VPS hosting in the cloud?

Cloud computing is generally run on a cluster of servers whereas standard VPS hosting will put your site on only one computer with backups.

With VPS cloud hosting your site will come back online immediately if any hardware fails.

Standard VPS can only offers a certain amount of RAM and CPU at any one time so you can still suffer from outages if your site become extremely busy. However, Cloud VPS can dynamically assign resources as your server needs them.

How to choose a new VPS host

This depends on the amount of traffic and the needs you have. You need to compare the hosts by price and the following criteria:

  • RAM: VPS servers are advertised with RAM values just like computers are in a computer store. Host are rather unforthcoming when you ask them how much RAM you need but I would say 500MB RAM would be satisfactory for a WordPress site that doesn’t get much more than 500 visitors a day.
  • CPU: The CPU (central processing unit) of the host is exactly the same as the CPU of your desktop or laptop computer. It is the central unit in a computer containing logic circuitry to perform instructions from the applications. If you wish it may be possible to buy a plan with more than one 1GB CPU for extra speed.
  • Band Width and Disc Space: VPS packages are sometimes sold with a finite band width and disc space. Calculate the bandwidth you site will need by calculating Average Page Views x Average Page Size x Average Daily Visitors. If you are just starting out it won’t be necessary to do this. Disc Space is the amount of Gigabytes of information you are allowed to put on the server. Ordinary websites don’t add up to much space but if you are using the server for file storage you need to take this into account.
  • Server Software: you may be used to certain server software, such as cPanel and Plesk in order to maintain your site. Some hosts use their own software which may be difficult to learn.
  • Quality of Support: Some companies have 24/7 support. It may be important to be able to get answer quickly if your VPS server stops working. Company Reputation: Google the company you want to use and see what people are saying about them. WordPress recommends a few hosts. Also, have a look and see if hosts have a good and functioning forum, this can be extra useful.

Conclusion

WordPress is one of the most common CMSs (Content Management Systems) so hosts should generally be good with it. But this is not always the case.

You should pick a host that knows how to host it and has shown that for a while already.

Rob Cubbon is a web designer from London and writes regularly about WordPress and VPS hosting on his blog.

Author: Rob Cubbon
Article Source: EzineArticles.com
Low Cost Prototype PCB

标签:

刷新DNS缓存(Ubuntu+Windows)

六 8th, 2011
486 views | 没有评论

Ubuntu下

sudo /etc/init.d/networking restart

Windows下

ipconfig /flushdns

Ubuntu下安装ibus-sunpinyin

六 8th, 2011
431 views | 没有评论

1安装编译依赖环境

sudo apt-get install build-essential sqlite3 libsqlite3-dev scons libibus-dev gettext

2下载软件包, 解压

wget http://sunpinyin.googlecode.com/files/ibus-sunpinyin-2.0.3.tar.gz
wget http://sunpinyin.googlecode.com/files/sunpinyin-2.0.3.tar.gz
tar zxvf ibus-sunpinyin-2.0.3.tar.gz
tar zxvf sunpinyin-2.0.3.tar.gz

3.编译安装sunpinyin和ibus-sunpinyin

cd sunpinyin-2.0.3
sudo scons --prefix=/usr
sudo scons install
cd ../ibus-sunpinyin-2.0.3
sudo scons --prefix=/usr
sudo scons install

4.重启输入法
鼠标左键点击输入法图标,在弹出菜单中点重新启动

Ubuntu Win7双系统时间不同步问题解决办法

六 8th, 2011
390 views | 没有评论

修改 Windows 使用时区的方法是在注册表:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\

下面增加一个名为 RealTimeIsUniversal 的REG_DWORD 键,并赋值为 1。

而让Ubuntu 使用本地时间的方法是:

 gedit /etc/default/rcS

把里面的 UTC=yes 改为 UTC=no

标签:

WordPress默认编辑器替换code按钮

六 8th, 2011
357 views | 没有评论

修改/wp-includes/js/quicktags.js
找到

edButtons[edButtons.length]=new edButton("ed_code","code","","","c");

将<code></code>替换为为<pre></pre>,各有两处

保存为utf8无bom格式上传覆盖
ok!
当然你也可以不替换添加其他按钮

标签:

安装Fedora15要做的工作

六 7th, 2011
357 views | 没有评论

1安装输入法,推荐sunpinyin
yum install ibus-sunpinyin

标签:

拿福能千人大挑战

五 25th, 2011
320 views | 1 条评论

拿福能是什么?

Nuffnang.com是亚太地区首家领先的博客广告社区。拿福能的在线平台将广告商的图文或者视频广告成功发布到超过100,000篇博客上,并通过他们传播到各种领域。”这是拿福能官方的介绍,说实话1年前,再近点6个月前,我都不知道他是什么东东。直到前不久拿福能组织过线下活动,通过其他的博友也才慢慢了解到了拿福能。

独立博主靠什么存活下来?靠什么来支付每年的域名费和稳定独立主机的消费?靠什么来维持写作的动力?所以我们需要放点广告,需要写点软文,需要赚点外快。网络上不乏有这样或那样的广告联盟,但是究竟有几个可以让博主放心投放呢?慢慢了解拿福能后,在博客圈中口碑也不错,现在尝试着放广告,如果你也去深入了解她,或许会有另一番收获哦!现在拿福能正在进行着“千人挑战”的线上活动,如果你是一个博主,那为什么还不行动呢?

“千人挑战”活动详情:
1、活动地址:http://www.nuffnang.com.cn/blog/2011/05/23/challenge-1000/
2、每名注册博主可绑定多个博客,但仅可通过一个博客参加此次活动。
3、参加活动的博客建立时间不可少于六个月,且博主最后一次发布博文时间距今不超过两周。
4、为避免误审及遗漏,请确保你已将拿福能广告位置于易于发现的位置。
5、对于不可抗力、不可预见、以及超出合理控制范围的情况,拿福能中国保留取消、修改、暂停或推迟活动的权利。
6、关于收益情况请登陆后参见收益页面,更多拿福能Nuffnang.com.cn条件条款请移步这里详细了解。

 

标签: