JQuery Check if Window is in iFrame

Simple JavaScript code snippet to check whether or not a window is in an iFrame. Very useful for some functions that may make use of the URL in the address bar of the page.

Install FFmpeg Mencoder on CentOS 5.10 64-bit

Install FFmpeg & Mencoder on CentOS 6 would be easy job. It cost me 2 days to install them and make script running on a client server which is CentOS 5.10 64-bit. If you have to install FFmpeg & Mencoder on a CentOS 5 like me, i hope this article can save you some time. Install FFmpeg You can follow those two links to prepare system, install codecs and ffmpeg: http://cumulusclips.org/docs/install-ffmpeg-x264-on-centos/ http://trac.ffmpeg.org/wiki/CentosCompilationGuide Err...

Linux命令之make, clean建立和删除文件夹技巧

makefile定义了一系列的规则来指定,哪些文件需要先编译,哪些文件需要后编译,哪些文件需要重新编译,甚至于进行更复杂的功能操作,因为 makefile就像一个Shell脚本一样,其中也可以执行操作系统的命令。 makefile带来的好处就是–“自动化编译”,一旦写好,只需要一个make命令,整个工程完全自动编译,极大的提高了软件开发的效率。make是 一个命令工具,是一个解释makefile中指令的命令工具,一般来说,大多数的IDE都有这个命令,比如:Delphi的make,Visual C++的nmake,Linux下GNU的make.可见,makefile都成为了一种在工程方面的编译方法。 make 根据Makefile文件编译源代码、连接、生成目标文件、可执行文件。 make clean 清除上次的make命令所产生的object文件(后缀为“.o”的文件)及可执行文件。 make install 将编译成功的可执行文件安装到系统目录中,一般为/usr/local/bin目录。 make dist 产生发布软件包文件(即distribut...
affiliate_link

Linux下动态库查找路径的问题

学习到了一个阶段之后,就需要不断的总结、沉淀、清零,然后才能继续“上路”。回想起自己当年刚接触Linux时,不管是用源码包编译程序,还是程序运行时出现的和动态库的各种恩恩怨怨,心里那真叫一个难受。那时候脑袋里曾经也犯过嘀咕,为啥Linux不弄成windows那样呢,装个软件那个麻烦不说,连运行软件都这么恼火呢?如果那样的话就不叫Linux了。借用小米公司CEO雷军一句话:小米,为发烧而生。我认为:Linux,为真理而在。特别是为那些喜欢折腾,热衷技术背后原理和实现细节的人们而生。 说到和动态库查找路径相关的问题,总体上可以分为两类: 第一类:通过源代码编译程序时出现的找不到某个依赖包的问题,而如果此时你恰好已经按照它的要求确确实实、千真万确、天地良心地把依赖库给装好了,它还给你耍混、犯二,有一股折腾不死人不偿命的劲儿,那让人真是气儿不打一处来,如果Linux此时有头有脸,你是不是特想抽它丫两大嘴巴; 第二类:就是在运行程序的时候,明明把那个程序需要的依赖包都已经安装的妥妥的了,可运行的时候人家就告诉你说“error while loading shared libra...

How to find spam sending php script on server

This article can help you to track down outgoing spam using PHP. From php version 5.3.0 we can use the directive mail.log to log who’s calling the function mail(). When someone calls the function mail() from a php script we can get some info about the sender in log. PHP mail.log entries include the full path of the script, line number, To address and headers. 1. Check email log 2. Edit php.ini 3. To enable mail.log, add following line in php.ini under 4. Create lo...

Netbeans 中文乱码 输入变方格

出现这个问题可能下面几个原因: 1、项目编码为utf-8,但是netbeans默认为gbk 打开netbeans安装目录,找到etc目录下的netbeans.conf文件,打开文件,可以看到netbeans_default_options这个配置选项,在后面加上“-J-Dfile.encoding=UTF-8”这个选项就可以了。 2、检查字体是否支持中文 有些字体不支持中文,输入中文,就会显示方格之类的符号,打开netbeans,工具->选项->字体和颜色 换一个支持中文的字体试试。

Install PhoneGap on Fedora 17

Download and Install Eclipse IDE Android offers a custom plugin for the Eclipse IDE, called Android Development Tools (ADT). Following steps in link to install ADT Plugin into Eclipse ** If you can not find Android SDK Manager in Window --> Android SDK Manager, go to Window --> Customize Perspective --> Tool Bar Visibility. Enable options in Android SDK and AVD Manager. Install NodeJS on Fedora NodeJS is currently not part of the standard repo's, you can not install dire...

Remove VirtualBox RPM Package in Fedora

First, you need to find the RPM package name, just run something like this: Remove the package Remove kmod related files If you plan to install a new version of VirtualBox, checkout this link: http://www.tecmint.com/install-virtualbox-on-redhat-centos-fedora/

Install Node.js on CentOS and Fedora

The install of Node.js is pretty straight forward, with on gotcha when it comes to installing node packages that I will detail at the end. If you haven’t already installed developer tools, you will need to do that now. Now install Node.js. Problem installing node packages with sudo To install node packages you have a little problem if you are using sudo. On Fedora and CentOS 6.2 (and probably versions less than this), sudo has a secure path set secure_path = /sbin:/bin:/usr/sbin:...

Change Domain and Keep All Links with .htaccess

The following RewriteRule lives in the .htaccess file at olddomain.com and tells any request coming in to that domain to swap olddomain.com out and replace it with newdomain.com. This includes ANYTHING after the trailing slash, like a direct link to a previous post. So http://olddomain.com/this/direct/link gets sent properly to http://newdomain.com/this/direct/link The important part is the [R=301] which sends a 301 (Permanent) Redirect header. That tells search engines that the page ha...