Convert web pages directly to PDF
Recently came across site which allows to convert any web page to PDF and download it. The site is http://www.pdfmyurl.com/. Did I tell that its FREE? yes its free.
Recently came across site which allows to convert any web page to PDF and download it. The site is http://www.pdfmyurl.com/. Did I tell that its FREE? yes its free.
Few days back had a problem where my php pages were working fine but had problem with response code it was sending. The page was returning “500 Internal server error” instead of “200 OK”. I recently had updated php and apache version so initially thought there must be some problem with it.
First I tried to match new php setting with old php. After about an hour, when I changed display_errors = On the response header was fixed. The issue was because I had error_reporting = E_ALL so there must be some warnings etc being thrown. My display_errors setting was Off so it was setting response code to “500 Internal Server Error”.
So simple fix is that you turn off error_reporting or turn on the display_errors.
Recently had to setup local domains for my php projects. Normally I use http://localhost/project_directory urls for normal project, but for a new project I had to setup few local domains. For existing projects I still need localhost (127.0.0.1) available along local domains like project.localhost.com. Setting up local domains and virtual hosts is easy and I found it worth sharing.
I am using Windows Vista Business with WampServer Version 2.0 installed. This method should also work for standalone apache installation.
First we need to add host entry in windows host. To do this, open file C:\Windows\System32\drivers\etc\hosts in some text editor, by using Open With menu from right click.
Note that C: represent your drive where windows is installed, in most cases it will be C: but it can be different.
You will see content smiler to
# Copyright (c) 1993-2006 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host127.0.0.1 localhost
::1 localhost
Now add this line
127.0.0.1 project.localhost.com
at the end. Here you can add any custom domain like projectname.local etc.
The line added tells windows to resolve to local IP when ever this domain name is requested by browser etc. Be sure not to add any live existing domains as they will be resolved to localhost instead of live host.
Now we need to add virtual host entry in Apache server so we can server our project files. For this apache config file which in this case is C:\wamp\bin\apache\Apache2.2.11\conf\httpd.conf. Open the file with text editor and find following lines
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
The second line tells conf file to include another configuration file which contains virtual host configurations. The line is commented by default so we have to enable it.
Now remove # sign from start of the second line and save file, so the line will look Include conf/extra/httpd-vhosts.conf.
Now open file C:\wamp\bin\apache\Apache2.2.11\conf\extra\httpd-vhosts.conf to add virtual host entries.
Add following lines to the file.
<VirtualHost 127.0.0.1>
DocumentRoot "C:/websites/myproject/public/"
ServerName project.localhost.com
ServerAlias project.localhost.com
</VirtualHost>
You may also need to remove any example virtual hosts.
After this restart your apache and test the url http://project.localhost.com/ in browser.
You all must be aware of browser cookies. Browser cookies allows site to store small amount of data on your PC.
These can be used to store visitor preferences etc. These cookies can be viewed and cleared easily.
There is another feature called “Flash Cookies” or in technical terms called “Local Shared Object”. This allows sites to store cookie like data on visitor PC. These cookies are created through adobe flash player. With the default settings, flash player does ask user’s permission to store this data.
Many sites like google, youtube etc use flash cookies. So next time you want to clear cookies, don’t forget to clear these. You can view and delete these cookies by visiting this page http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager07.html
It is very exciting to have your blog appearing in search results. Commonly the traffic received, includes a good number of visitors which promote spam. They commonly add comments on posts to get back links and may be visitors.
Percentage of spam comments can be very high. For example comments posted on this blog include 95% spam. Blogs hosted on WordPress.com get some protection by default, but blogs hosted else where using WordPress software are open for such spam by default.
It is really a headache to filter and remove such comments. Luckly following two WordPress plugins can make your life a lot easier.
In latest versions of WordPress this is installed by default. The plugin protects the blog against spam comments and deletes the obvious spam ones based on spam keywords and content. It significantly reduces the number of comments moderator have to filter. The plugin requires API key which can be attained simply by creating an account on WordPress.com. The API key is shown on edit profile page in admin area.
Spam comment posting is mostly done by automated software called “Bots” or “Robots”. They find specific fields on pages and fill them with predefined data. reCAPTCHA wordpress plugin provides protection against these bots this reducing the number of spam comments. The plugin requires two keys called Public and Private key. These can be obtained by creating free account at recaptcha.net.
Came across a project of key value database. It smiler to memcache but also provides lists and sets with atomic operations to push/pop elements. It is said to be fast 10000 SETs/second, 81000 GETs/second in an entry level Linux machine. More details can be found at http://code.google.com/p/redis.
Hello, I have moved my blog to my own domain and hosting. The main reason to move on own domain was restrictions applied by wordpress.com on advertising, plugins etc. So all new posts from now on will be posted on this domain. All of my old posts will be available on the previous blog and they eventually will be imported here or will get discarded.