工具
Linux下文件差异比较工具
最近做android源代码移植,需要在linux下比较很几个版本的源代码,找了几个文件差异比较工具
1 KDiff3
KDiff3 是一款用来对文件或目录进行比较/合并的工具,在比较时它可以同时针对两个或者三个文件/目录而进行。通过比较,它将文件/目录的差异按行加以显示。同时,KDiff3 提供有自动化的合并工具,方便使用者进行有关合并的操作。
此外,KDiff3 支持 Unicode 编码,集成了编辑器,可以自动合并版本控制历史。虽然 KDiff3 主要为 KDE 桌面而开发,但是仍然可以运行于其他的 Linux 环境。甚至对于 Windows、Mac OS X,KDiff3 也有相应的版本
2 Diffuse
可视化比较,非常直观。
支持两相比较和三相比较。这就是说,使用 Diffuse 你可以同时比较两个或三个文本文件。
支持常见的版本控制工具,包括 CVS、subversion、git、mercurial 等。你可以通过 Diffuse 直接从版本控制系统获取源代码,以便对其进行比较和合并。
支持像 C++、Python、Java、XML 等语言的语法高亮显示。
能够直接在 Diffuse 中编辑文件。
支持 UTF-8 编码。
可以使用快捷键轻松导航。 › Continue reading
ubuntu下多版本java,javac支持Android源码编译
最近需要分别编译Android2.1,Android2.2,Android2.3.ubuntu10.10只有Sun-JDK1.6,所以安装了1.5.记录一下
1 添加apt源
deb http://archive.ubuntu.com/ubuntu/ jaunty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jaunty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jaunty-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jaunty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty-backports main restricted universe multiverse
在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
ubuntu上用gitosis来管理 git服务
Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的分布式版本控制软件(Distributed SCM)。Git 汲取了 Torvalds 在维护大型的分布式项目开发方面的经验和对文件系统性能的丰富知识,正如其文档所描述的,“是一个快速、可扩展的分布式版本控制系统,它具有极为丰富的命令集,对内部系统提供了高级操作和完全访问。”目前,Linux 内核、X.org 服务器和 Ruby on Rails 等开源项目的版本控制系统都已经切换到 Git。
Gitosis 是 Tommi Virtanen 为了更方便和安全的辅助 Git 架设和管理软件版本库 (Software Repository) 而开发的工具软件。虽然 Git 本身也提供 git-daemon 以架设版本库,但在用户访问控制上做的并不严格。而 Gitosis 允许单个用户帐号管理多个版本库,使用 SSH keys 管理用户认证,不需要 shell 帐号就可以解决多用户访问集中版本库的问题。
使用DDoS deflate防御DDos攻击
1 命令行判断连接服务器客户端IP的连接数
bear@njava:~$ netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
2 安装medialayer给我们带来的防止ddos攻击的免费软件DDoS deflate
地址 :http://deflate.medialayer.com/
DDoS deflate是一款免费的用来防御和减轻DDoS攻击的脚本。它通过netstat监测跟踪创建大量网络连接的IP地址,在检测到某个结点超过预设的限 制时,该程序会通过APF或IPTABLES禁止或阻挡这些IP.
Installation
bear@njava:~$wget http://www.inetbase.com/scripts/ddos/install.sh bear@njava:~$chmod 0700 install.sh bear@njava:~$./install.sh
Uninstalling
bear@njava:~$wget http://www.inetbase.com/scripts/ddos/uninstall.ddos bear@njava:~$chmod 0700 uninstall.ddos bear@njava:~$./uninstall.ddos
Version 0.6 | Change Log
whitelisting possible by adding IPs in /usr/local/ddos/ignore.ip.list
it uses this file to avoid banning the ip again (it was handling this differently and was a bit slower too)
Google PR值预测
推荐一个Google PR值预测的网站 http://link.ezer.com/tools/pagerank_prediction_tool_code.asp
标签云
.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 tcp ubuntu ubuntu10.04 wordpress 优化 密码 文件 用户 登录 监控 缓存 网站 脚本 连接 颜色
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.
最近文章
最近评论
- njava 在 在PhpStorm中使用Xdebug来调试php断点 上的评论
- 工仔 在 在PhpStorm中使用Xdebug来调试php断点 上的评论
- 潍坊seo 在 Wordpress All in one seo插件生成NoIndex对百度爬虫影响的解决方法 上的评论
- 猪立业 在 由于Zend Optimizer的支持把ubuntu10.04下的php5.3降级到php5.2 上的评论
- lazyducker 在 由于Zend Optimizer的支持把ubuntu10.04下的php5.3降级到php5.2 上的评论
文章索引模板
链接表
QR Code
