Coding Tips,Online Security,Programming
23 January 2011
Apache web servers offer a flexible way to control the server settings by using .htaccess file. This tiny is being read and translated by apache before serving the actual web pages or files. Here is a list of a few simple and useful .htaccess commands.
Changing the default index file
DirectoryIndex index.html
This code changes the default index file. An index file is the first page that will be loaded up hen visiting mywebsite.com or even mywebsite/foo/. In this case visiting mywebsite.com will load up mywebsite.com/index.html.
DirectoryIndex index.html index.php index.htm
You can also give a list of options such as shown in the snipper above. This command will search for index.html, index.php and index.htm in the exact order. If you have index.php and index.html sitting on the same folder, the one that will be loaded is index.html.
Custom error pages
ErrorDocument 404 errors/404.html
Author's Choice,Coding Tips,Exposure,Programming,Publishing
20 January 2011
If you have been maintaining a website or plan to maintain one, I am pretty sure that you have already known some of the trickiest part of being a webmaster. Everything starts on your work board where you plan and decide what the website will be, how people will find it and what audience you will aim to serve. Going online gives a few more hurdles such as picking the right webhosting service, for a starter, you won’t get a Linux webhosting service if you want to host ASP files and vice versa.
The hurdles gets on moving to securing your files, protecting the server, making sure that everything runs and that you have enough bandwidth or disk space to carry everything out flawlessly. Sooner or later you will hit a certain condition where uptime will be questioned. Are you 100% sure that your website is live 24 hours a day and 7 days a week?
Introducing the Robot.
Fortunately, you no longer need to sit in front of your computer checking at regular intervals to make sure that your website is live. “Uptime Robot” a web application from WebResourcesDepot & SSLmatic will dutifully alert you if your website suddenly went down so you can take an action at once.
Author's Choice,Coding Tips,Exposure
9 November 2010
Sometimes we need to change filenames or directory structures but simply can’t since this always results on being penalized by search engine ranking. If a file was moved or renamed, a search engine index will end up as an error 404 which only puts you down on ranking with search engines but also drive away your visitors thinking that your website ends up broken.
A common user will use script base forwarding by manipulating the headers, it will work but the robots will get confused and may mark your site as spam. The best way to redirect in a search engine friendly way is to utilize error 301 (Moved Permanently).
Here are the steps that you need to do:
Coding Tips,Online Security,Programming
30 October 2010
Today’s modern time, code can be easily shared and reuse specially those released as open source. From time to time, developers will try to protect their work by encoding their source codes. This can be a hindrance to a newbie but totally less effective to advance users.
The most favorite method of encoding the files was to encode them using base64 _encode() and applying gzdeflate(). This will prevent some users from reading the source code but it can be easily reversed by issuing the commands
gzinflate(base64_decode());
It may sound easy but in reality, there are nested encoding being performed in hopes that the user will stop decoding them or at least make it harder until they give up. An ordinary decoding human will try around 3-5 attempts, a persistent one will try at least around 20 attempts. Sadly, experienced developers do encode their source code more than 25 and some encode them more than 50 times.
Author's Choice,Coding Tips,Programming
30 October 2010
I started having problem with Disqus system showing “View Comments” on the comment count slot when it was upgraded to the latest version (2.52). Playing with the Disqus admin panel gives no good result and I am pretty sure that it is working properly on earlier versions of Disqus after version 2.42 and not it looks broken.
A trip to the official plugin website for Discus was made and it yields almost nothing. This problem seems to exist on earlier versions of Disqus and have affected people since October 2009 until around June 2010. I have been using Disqus since June but was unaware of the problem for the simple reason that I don’t display comments count.
Playing and digging around the Disqus code lead me to the file named disqus.php which seems to be the heart of the plugin. A quick search for the word “View Comments” brought me down to line 697 with the following code:
function dsq_comments_number($comment_text) {
global $post;
if ( dsq_can_replace() ) {
return 'View Comments';
} else {
return $comment_text;
}
}
Coding Tips,Database Systems
15 September 2010
There are times that we want to perform mathematical equations using MySQL, I am not saying that it is wise to directly apply mathematics inside your queries but they can be useful inside stored procedures.
(Note: you need to be on INNODB engine mode to use stored procedure)
This article will show you what mathematical functions you can use that was supported by MySQL. Please also take in caution that MySQL is a database engine and not a real calculator so please avoid performing complex equations on your database.
Modulus
select 87 % 9; +--------+ | 87 % 9 | +--------+ | 6 | +--------+
Coding Tips,Database Systems
14 September 2010
MySQL is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. MySQL is primarily an RDBMS and therefore ships with no graphic user interface (GUI) tools to administer the databases or manage the data inside it.
Users can readily use the included command-line tools or download MySQL frontends from various parties that have developed software and web applications to manage MySQL database. An administrator GUI pack also exists on the official MySQL website which may require extra java modules for connectivity.
This article assumes that you already have an idea on what MySQL databases are and how to use them. Please make sure that you already have a working backup copy of your current database when using the following tips.
When moving data between two tables which you already have structures intact, you can do them using Insert / Select pair.
INSERT INTO `userrecords` (`id`, `name`, `email`, `password`, `refferer`, `joindate`) SELECT `memberid`, `username`, `useremail`, `userpass`, `userrefferer`, SYSDATE() FROM `db.members`;
Author's Choice,Coding Tips,Database Systems,Programming
4 August 2010
I personally choose not to use Micro$oft products when it is possible, but sometimes the choice is not given. For these unfortunate who have to deal with SQL Server 2008 (or 2005), here is how to get around without too many swear words and avoid licensing costs.
Note: In order to download windows Power Shell, you need to pass the genuine windows checking. You can still google for alternative download locations preventing the need for the checking. Power Shell also comes preinstalled from windows 7 including .Net framework 3.5 but it wont eliminate the need to download the service pack.
Coding Tips,Programming,Publishing
13 July 2010
There are times that you want to keep your visitors and yet needs to have some kind of money generating revenue to keep your blog alive. Bloggers and almost all websites overcome this by adding new contents at shorter time span and adding a form of advertisement on the site. This website showcase an advertisement that I am trying to create to be non obtrusive and non-distracting as much as possible while giving effort to give contents that will drive interest.
This site is not yet perfect and as you can see, the ads change position a little bit at a time due to experimentation. I am clearly using adsense as a revenue provider since adsense not only targets the ads they deliver via Geo location, it also targets what the visitor was reading. It was kind of cool to see that I am give additional possible interesting site links appearing on the adsense.
Adsense approach was not perfect base on my point of view and I am writing this because when a visitor clicks your adsense link, they are taken away to another site. In my next article which I am currently writing is a guide on how to stop adsense from opening in the same window hijacking your site visitors. This is a legal method and no violation in any form with the agreement with Google adsense. Please visit again for I will be releasing a guide about managing adsense and rotating your other advertisements with adsense.
Adsense is great but why do we need to drop our other advertisements when we can just make them coexist on the same slice and space of our site.
Optimized by SEO Ultimate