Updates 2012 jan 18:
Finally, got their attention from facebook fanpage. Talked to their support, and got my email replied.
They should check their offline chat message if its provided on their website...
-----------------------------------------------------------------
Well, i tried to be professional in judging them.
If it wasn't because the client bought the hosting with them, i might not have to face their shit.
First, they change their hosting without our notice.
Previously things which works, now doesn't work, and they claim they never change anything,
In php point of programmer view, they disable error log.
Fine, as programmer, i will use ini_set to enable it to see what went wrong.
so my surprise, it came out error 500 instead.
so defnitely it has been disabled ini_set function... wth..
Next, if you php code doesnt close with ?>, it will also come out error 500, isn't this a norm in php to have unclosed tag? its to avoid unwanted endline charactor in the end to avoid being output out.
3rd, fine, lets fill in the support form for help..
After filling in the contact form, its been 1+ weeks and no response.
Okay, lets try call their support fella, went to voice mail...
Okay, lets try again, their "live chat",
waiting for operator, waiting for operator, waiting for operator, waiting for operator, sorry operator not available..
Their website published they hosted CIMB, wth? do you think bank will host with them with this kind of SLA? LoL, what a joke..
Tuesday, January 17, 2012
Thursday, January 5, 2012
Facebook App session issue after user logout or close browser
It seems that Facebook PHP SDK does not properly check if user have logged out or close the browser.
When someone closes the browser or log out of facebook, the php sdk should detect the problem and automatically destroy the session, but it doesnt seems to be the case, even when we call $fb->destroySession();
One way to effectively check for problem is to use Facebook javascript sdk by subscribing to :
----------
FB.Event.subscribe('auth.logout', function(response) {
if (response.status=="unknown") {
//some weird session error
document.location.href="login.php";
return;
}
doTimerReload();
});
----------
The code effectively detect the logout with "unknown" status and redirect the user to a login screen.
Example of a login.php code:
Please <a href="javascript:">click here</a><br /> <script>
When someone closes the browser or log out of facebook, the php sdk should detect the problem and automatically destroy the session, but it doesnt seems to be the case, even when we call $fb->destroySession();
One way to effectively check for problem is to use Facebook javascript sdk by subscribing to :
----------
FB.Event.subscribe('auth.logout', function(response) {
if (response.status=="unknown") {
//some weird session error
document.location.href="login.php";
return;
}
doTimerReload();
});
----------
The code effectively detect the logout with "unknown" status and redirect the user to a login screen.
Example of a login.php code:
Please <a href="javascript:">click here</a><br /> <script>
function doFBLogin() {
FB.login(function(response) {
if (response.authResponse) {
FB.api('/me', function(response) {
});
} else {
alert("Please authorize app by refreshing to continue...");
}
}, {scope: 'email,user_likes'}); //additional parameter
}
</script><br />
----------
Wednesday, January 4, 2012
Setting up zimbra centos 6 64bits
#makesure to update first
yum update
#install java first
yum install java-1.6.0
yum install netc
yum install which
#change existing httpd port other port than 80
sudo vi /etc/httpd/conf/httpd.conf
#change line: Listen 80 to Listen 8080 (any other port)
#change existing sendmail port to other than port 25
sudo vi /etc/mail/sendmail.mc
#locate line:
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
#change to other port than 25 / smtp
DAEMON_OPTIONS(`Port=2525,Addr=127.0.0.1, Name=MTA')dnl
#locate line:
dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl
#change to other port than 25 / smtp
dnl DAEMON_OPTIONS(`port=2525,Addr=::1, Name=MTA-v6, Family=inet6')dnl
#run this to apply changes
m4 sendmail.mc > /etc/sendmail.cf
#temporary disable sudo tty requirement
su
visudo
#locate line Default requiretty and disable it with a #
#Defaults requiretty
yum update
#install java first
yum install java-1.6.0
yum install netc
yum install which
#change existing httpd port other port than 80
sudo vi /etc/httpd/conf/httpd.conf
#change line: Listen 80 to Listen 8080 (any other port)
#change existing sendmail port to other than port 25
sudo vi /etc/mail/sendmail.mc
#locate line:
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
#change to other port than 25 / smtp
DAEMON_OPTIONS(`Port=2525,Addr=127.0.0.1, Name=MTA')dnl
#locate line:
dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl
#change to other port than 25 / smtp
dnl DAEMON_OPTIONS(`port=2525,Addr=::1, Name=MTA-v6, Family=inet6')dnl
#run this to apply changes
m4 sendmail.mc > /etc/sendmail.cf
#temporary disable sudo tty requirement
su
visudo
#locate line Default requiretty and disable it with a #
#Defaults requiretty
/etc/init.d/httpd restart
/etc/init.d/sendmail restart
#double check to ensure both http / 80 and smtp / 25 is not used any longer
netstat -lp
#Go to zimbra website and download the respective package for your platform...
#if something went wrong, check the log.
#to resetup, run:
/opt/zimbra/libexec/zmsetup.pl
#when done, reboot the system
sudo reboot
#next, run netstat -lp to check if system is running
#try telnet localhost 25, telnet localhost 110 and try web browsing
#to restart the service, try:
/etc/init.d/zimbra restart
sudo -u zimbra /opt/zimbra/bin/zmcontrol status
#shows:
# mailbox Stopped
#check the log
tail -n 100 /opt/zimbra/log/mailbox.log
#if it shows
...Unknown table engine 'InnoDB'
#it meants that your innodb engine is not initiated , and most likely is memory issue.
#try changing innodb_buffer_pool_size to a lower value (below about 40% of your memory or vps memory)
sudo vi /opt/zimbra/conf/my.inf
#locate line innodb_buffer_pool_size
innodb_buffer_pool_size=400M
#restart zimbra mail
#when done, reboot the system
sudo reboot
#next, run netstat -lp to check if system is running
#try telnet localhost 25, telnet localhost 110 and try web browsing
#to restart the service, try:
/etc/init.d/zimbra restart
sudo -u zimbra /opt/zimbra/bin/zmcontrol status
#shows:
# mailbox Stopped
#check the log
tail -n 100 /opt/zimbra/log/mailbox.log
#if it shows
...Unknown table engine 'InnoDB'
#it meants that your innodb engine is not initiated , and most likely is memory issue.
#try changing innodb_buffer_pool_size to a lower value (below about 40% of your memory or vps memory)
sudo vi /opt/zimbra/conf/my.inf
#locate line innodb_buffer_pool_size
innodb_buffer_pool_size=400M
#restart zimbra mail
sudo -u zimbra /opt/zimbra/bin/mysql.server restart
sudo -u zimbra /opt/zimbra/bin/zmmailboxdctl restart
#to begin:
https://www.mydomain.com:7071
admin@mydomain.com
http://wiki.zimbra.com/wiki/Administration_Console
#If you forgotten your password, run this on server:
/opt/zimbra/bin/zmprov sp admin@mydomain.com [password]
If you get error in the admin ui with:
Message: system failure: server yourdomain.com zimbraRemoteManagementPrivateKeyPath (/opt/zimbra/.ssh/zimbra_identity) does not exist Error code: service.FAILURE Details:soap:Receive
Try this:
http://wiki.zimbra.com/index.php?title=Mail_Queue_Monitoring
If you are facing memory heap size problem with java, try following this link:
http://www.thatsmyview.net/2010/04/17/optimizing-performance-for-vps-and-low-ram/
and also set your default heap size in java by editing ~/.bash_profile
export _JAVA_OPTIONS=-Xmx100m
#If your mail have not been deliver, try check the que by running:
sudo mailq
#if you encounter some file(1) utils missing, install it by running:
sudo yum install file
#If you are running zimbra from a openvz vps, please ensure min 3Gb of burst memory. Or it wont run properly. The problem is due to missing swap in openvz. So it will need sufficient memory to run.
#references:
#to begin:
https://www.mydomain.com:7071
admin@mydomain.com
http://wiki.zimbra.com/wiki/Administration_Console
#If you forgotten your password, run this on server:
/opt/zimbra/bin/zmprov sp admin@mydomain.com [password]
If you get error in the admin ui with:
Message: system failure: server yourdomain.com zimbraRemoteManagementPrivateKeyPath (/opt/zimbra/.ssh/zimbra_identity) does not exist Error code: service.FAILURE Details:soap:Receive
Try this:
http://wiki.zimbra.com/index.php?title=Mail_Queue_Monitoring
If you are facing memory heap size problem with java, try following this link:
http://www.thatsmyview.net/2010/04/17/optimizing-performance-for-vps-and-low-ram/
and also set your default heap size in java by editing ~/.bash_profile
export _JAVA_OPTIONS=-Xmx100m
#If your mail have not been deliver, try check the que by running:
sudo mailq
#if you encounter some file(1) utils missing, install it by running:
sudo yum install file
#If you are running zimbra from a openvz vps, please ensure min 3Gb of burst memory. Or it wont run properly. The problem is due to missing swap in openvz. So it will need sufficient memory to run.
#references:
Saturday, December 31, 2011
MODx page not found on manager
This was a real trouble for me in the first place.
How am i suppose to fix this...
First, i did the throw exception as stated in my last post.
then next thing i know, i realize the $modx->config["modRequest.class"] wasn't declared...
so it uses modRequest instead of modManagerRequest class.
after digging for hours, ive finally noticed that the $modx->context->prepare() doesnt seems to return
proper config in $modx->context->config;
to fix it, add in true into the parameter:
$modx->context->prepare(true);
then, load the manager page. you should be able to see the manager page now.
next, remove the true (restore the code to its previous state).
then login into the manager.
and Site > Clear cache.
Now all your site should have the proper config loaded based on the respective context.
How am i suppose to fix this...
First, i did the throw exception as stated in my last post.
then next thing i know, i realize the $modx->config["modRequest.class"] wasn't declared...
so it uses modRequest instead of modManagerRequest class.
after digging for hours, ive finally noticed that the $modx->context->prepare() doesnt seems to return
proper config in $modx->context->config;
to fix it, add in true into the parameter:
$modx->context->prepare(true);
then, load the manager page. you should be able to see the manager page now.
next, remove the true (restore the code to its previous state).
then login into the manager.
and Site > Clear cache.
Now all your site should have the proper config loaded based on the respective context.
MODx page not found...
Stumble upon modx page not found?
MODx by default, will send an error page if any error found during the loading of the page.
its in modx/core/model/modx.class.php
want to see the actual error?
go to the line declaration of
public function sendError($type = '', $options = array()) {
throw new Exception($errorMessage); //after $errorMessage is defined
MODx by default, will send an error page if any error found during the loading of the page.
its in modx/core/model/modx.class.php
want to see the actual error?
go to the line declaration of
public function sendError($type = '', $options = array()) {
throw new Exception($errorMessage); //after $errorMessage is defined
Tuesday, December 27, 2011
more google Sucks?
Here lies the support forum:
http://www.google.com/support/ forum/p/Google+Apps?hl=en
and no way to post any topic.. yay!
updates: if you are a google app user, no way,
unless u r a gmail user...
http://www.google.com/support/
and no way to post any topic.. yay!
updates: if you are a google app user, no way,
unless u r a gmail user...
mysql select condition and sum select
When one select some records from a table, if the condition didnt meet, there will be 0 records returned..
But for a sum record, there will be min 1 record return, even if the record is not found.
SELECT * FROM `table` WHERE 1=2
#return 0 records;
SELECT id, sum(field1) FROM `table` WHERE 1=2
#return min 1 record, even if id is null
But for a sum record, there will be min 1 record return, even if the record is not found.
SELECT * FROM `table` WHERE 1=2
#return 0 records;
SELECT id, sum(field1) FROM `table` WHERE 1=2
#return min 1 record, even if id is null
Subscribe to:
Posts (Atom)