Mysqldump命令errno:24的解决
经常是用mysqldump命令备份mysql数据库,突然遇到这个问题,解决之
njava@njava:~/sql$ mysqldump -unjava -pnjava --default-character-set=gbk njava>njava.sql mysqldump: Got error: 1016: Can't open file: './njava/db_xxyou.frm' (errno: 24) when using LOCK TABLES
是用参数
--lock-tables=false
来解决这个问题
njava@njava:~/sql$ mysqldump -unjava -pnjava --default-character-set=gbk --lock-tables=false njava>njava.sql njava@njava:~/sql$
在PHP中使用memcached
由于网站流量逐渐增大,而且有个新需求是需要实时更新文章的点击和回复。所以准备上memcached来做一个解决的办法。
在php中使用memcached
1 安装memcached
直接
njava:~ njava$ sudo apt-get install memcached
本地开发使用的是刚升级了的mac10.6.4,使用port安装
njava-MacPro:~ njava$ sudo port install memcached
当然也可以自己编译代码了,为了省事就这样用了
› Continue reading
由于Zend Optimizer的支持把ubuntu10.04下的php5.3降级到php5.2
因为Zend Optimizer 3.3.9都还没有开始支持php5.3,所以把ubuntu10.4的php5.3降级到php5.2
步骤
1 增加karmic源
njava@njava.com:~$sudo vi /etc/apt/sources.list.d/karmic.list deb http://archive.ubuntu.com/ubuntu/ karmic main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ karmic main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ karmic-updates main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ karmic-updates main restricted universe multiverse deb http://security.ubuntu.com/ubuntu karmic-security main restricted universe multiverse deb-src http://security.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
在Ubuntu 10.04 下安装Ispcp管理虚拟主机
一时大意,在服务器上装了ubuntu10.04,由于太新了,ispcp最新版本ispCP Omega 1.0.6 • 2010-08-04都不能直接安装,所以从svn check了最新的代码来安装
1. check ispCP
njava@njava.com:~$svn checkout http://www.isp-control.net:800/ispcp_svn/trunk/
2. update相关组件,监测安装脚本, 在ubuntu 10.04下将识别出ubuntu-packages-lucid的脚本
njava@njava.com:~$cd trunk njava@njava.com:~$aptitude update && aptitude safe-upgrade njava@njava.com:~$aptitude install $(cat ./docs/Ubuntu/ubuntu-packages-`lsb_release -cs`)
在PhpStorm中使用Xdebug来调试php断点
用PhpStorm有几个月的时间了,一直没找到一种好的调试断点的方法,今天突然看到这个东西,不错,记录下来
1 从http://code.activestate.com/komodo/remotedebugging/下载mac版本的Komodo-PHPRemoteDebugging-6.0.0-beta3-54627-macosx.tar.gz
2 提取相应php版本的xdebug.so
3 丢到 /usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/ 下面
4 在 /usr/local/php5/lib/php.ini里添加配置文件
[xdebug] zend_extension=/usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so xdebug.idekey=PhpStorm1 xdebug.remote_enable=On xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug.remote_handler=dbgp
5 重启apache
6 配置PhpStorm ,ok
在网页上显示淘宝旺旺图标和QQ在线状态图标
将您的淘宝旺旺状态发布在互联网上点击“旺旺图标” ,他人便可随时随地与您联系,买卖宝贝, 广交淘友,”旺遍天下”给您更便捷的淘宝体验。
链接:http://www.taobao.com/help/wangwang/wangwang_0628_04.php
在线生成QQ状态图标
scrapy
Scrapy ,这是一个用 Python 写的 Crawler Framework ,简单轻巧,并且非常方便,并且官网上说已经在实际生产中在使用了,因此并不是一个玩具级别的东西。http://scrapy.org/
Latest stable release: 0.8
The latest stable release is available from several sources:
- Download the source tarball: Scrapy-0.8.tar.gz
- Download the Windows installer: Scrapy-0.8.win32.exe
- Scrapy 0.8 on PyPI
- install with:
easy_install -U Scrapy
- install with:
- Ubuntu PPA for Scrapy 0.8 (maintained by Insophia, the company behind Scrapy)
- after adding PPA, install with:
apt-get install scrapy
- the PPA version also includes post-release bug fixes
- after adding PPA, install with:
python爬虫和数据挖掘
考虑用python做爬虫,需要研究学习的python模块
1内置的 urllib, urllib2 库用来爬取数据
2 使用BeautifulSoup做数据清洗
http://www.crummy.com/software/BeautifulSoup/
编码规则
Beautiful Soup tries the following encodings, in order of priority, to turn your document into Unicode:
1 An encoding you pass in as the fromEncoding argument to the soup constructor.
2 An encoding discovered in the document itself: for instance, in an XML declaration or (for HTML documents) an http-equiv META tag. If Beautiful Soup finds this kind of encoding within the document, it parses the document again from the beginning and gives the new encoding a try. The only exception is if you explicitly specified an encoding, and that encoding actually worked: then it will ignore any encoding it finds in the document.
3 An encoding sniffed by looking at the first few bytes of the file. If an encoding is detected at this stage, it will be one of the UTF-* encodings, EBCDIC, or ASCII.
4 An encoding sniffed by the chardet library, if you have it installed.
5 UTF-8
6 Windows-1252
可以用fromEncoding参数来构造BeautifulSoup
soup = BeautifulSoup(euc_jp, fromEncoding="gbk")
3 使用python chardet 字符编码判断
http://chardet.feedparser.org/download/
4 更加强大的 selenium
标签云
.htaccess 301 2010 Android apache cache cacti CSS date ddos discuz django fastcgi freebsd git google http iftop linux macos mysql nginx njava php pr python sed seo snmp ssh ubuntu ubuntu10.04 wordpress xdebug 优化 密码 文件 时区 用户 登录 监控 缓存 网站 脚本 颜色
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.
近期文章
近期评论
文章归档
链接表
QR Code
