Redis implementation for Windows

Install Redis Server:

Download the redis client and server from below URL (download the latest 64 bit or 32 as applicable):

https://github.com/rgl/redis/downloads

Now after installing it start the redis service from the windows services list (service name will be redis).

Install Redis Interface Library:

http://pecl-win.googlecode.com/files/php_redis-2.1.3-5.3-ts.dll (for php 5.3)

https://github.com/nicolasff/phpredis/downloads ( php_redis-2.1.3-5.2-vc6-ts-4350b2a.zip – for php 5.2)

From the above link download the dll file for redis and add it to extension directory of PHP.

Now update the php.ini file to point this new extension.

Implementation:

The implementation is written in PHP code, I have made the changes to

/base/meditab/med_db.php (Right now it has been done for MEM and MOS)

These changes make sure that if there is any update in any table the query for that table will be read from database else it will be from Redis cache.

Redirect http to secure https url for a specific domain name

We had a wildcard certificate *.example.com. We have other website too hosted on the same server like http://www.newexample.com.
Now we don’t have a certificate for http://www.newexample.com so, we want to redirect when someone types http://test.example.com to https://test.example.com.

So when a user types http://test.example.com they should be redirected to https://test.example.com. But http://www.newexample.com should not redirect to https://www.newexample.com instead of the fact that they both are hosted on same server and share same .htaccess file.

Here is the solution: (add this in your main root .htaccess file)
RewriteCond %{HTTPS} !on
RewriteCond %{SERVER_NAME} ^(.*.suiterx.com)
RewriteCond %{REQUEST_URI} !^(.*.wsdl) ##bypass wsdl file calls
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

overlay div pop up not working in google chrome

Okay, here is the issue and solution

Problem: i found a java script across internet for div pop up using overlay, working fine with all browsers except chrome. In chrome it would execute to create a popup but its position was top left of the screen and was viewable less than 50%.

Solutions: here is the solution.

if (!window.ie6) {
this.overlay.setStyles({
position: ‘fixed’,
top: 0,
left: 0
});
this.window.setStyles({
position: ‘fixed’,
top: ’50%’,
left: ’50%’
});
} else if (navigator.userAgent.indexOf(‘Chrome’) !=1) {

this.overlay.setStyles({
position: ‘absolute’,
top: ’0%’,
left: ’0%’
//,marginTop: “expression(document.documentElement.scrollTop + ‘px’)”
});

this.window.setStyles({
position: ‘absolute’,
top: ’50%’,
left: ’50%’
//,marginTop: “(expression(0 – parseInt(this.offsetHeight / 2) + document.documentElement.scrollTop + ‘px’)”
});

}else {
this.overlay.style.setExpression(‘marginTop’, ‘document.documentElement.scrollTop + “px”‘);
this.window.style.setExpression(‘marginTop’, ’0 – parseInt(this.offsetHeight / 2) + document.documentElement.scrollTop + “px”‘);

this.overlay.setStyles({
position: ‘absolute’,
top: ’0%’,
left: ’0%’
//,marginTop: “expression(document.documentElement.scrollTop + ‘px’)”
});

this.window.setStyles({
position: ‘absolute’,
top: ’0%’,
left: ’0%’
//,marginTop: “(expression(0 – parseInt(this.offsetHeight / 2) + document.documentElement.scrollTop + ‘px’)”
});
}

facebook connect logout not working

just few days ago i needed to integrate “facebook Connect” to a website. With the documentation provided by facebook it was quite easy to integrate it. But i faced one issue that i was not able to find out solution.

The problem: There is a method provide in Facebook php library : “get_loggedin_user()”  Now this function returns the profile id of the user if the user is logged in using facebook before landing to the website or after coming to the website(through facebook connect). But if i logged out of facebook, this function still returned me the profile id of that user one or more time after refreshing the page. due to which i was not able to log out of the website.

Solution: I searched the web for the solution and found few, but none of them worked for me. I tried to delete facebook cookies through facebook library functions and manually too but in vain. Finally i thought of a solution myself and it worked for me. The solution is when i logged out of the website i logged out of facebook and set a special session variable to 1. Now i will check if that variable is one i will not log in the website despite of getting profile id through “get_loggedin_user()”. and once page is loaded i will set that special session variable to 0.

This solved the issue for me for now.

knowing your computer system configuration online for intel

Hi,

may be this link be helpful to those having intel mainboard and not having much technical knowledge about how to know your system configuration.

You can check know your system configuration online by going to this page of official intel website.

http://www.intel.com/support/siu.htm

click on “Identify the products on your computer ” link and you will get basic and advanced report of your system configuration.

much helpful to me :)