Fix for PHP code and SugarCRM for BD DST

Saturday, June 20, 2009 Posted by Md. Monjurul Hasan 0 comments
Although php date function should take the localtime of the server, seems it did not take last night. so I set the default timezone to "Asia/Dhaka" in my PHP code before calling the date function.

date_default_timezone_set("Asia/Dhaka");

also I needed to change the Asia/Dhaka timezone of SugarCRM in include/timezone/timezones.php file

'Asia/Dhaka' =>
array (
'gmtOffset' => 420, //previously it was 360
)

Tweaks for BD Daylight Saving

Friday, June 19, 2009 Posted by Md. Monjurul Hasan 0 comments
We are working on the timezones of our Linux servers (RHEL, CentOS and Ubuntu) to update them for upcoming BD Daylight Saving. Also some java application runs on its own tzdata. So we updated those too. We put necessary task steps (for both windows and linux) in our official website so that people get benefit from us. Here's the link:

http://www.mango.com.bd/bd-dst.php

A(n)ts - Applicant Tracking System (Open Source)

Thursday, June 4, 2009 Posted by Md. Monjurul Hasan 1 comments
I kept on looking for E-recruitment Software, ofcourse open source and finally I have decided to work on Ants - an open source Applicant Tracking System. Although I need to customize it a lot. Its simple and built on PHP and MySQL. I got a recruitment module in OrangeHRM, an open source HR management software, which has limited features and can't give a complete e-recruitment solution in my opinion. Lets see how Ants work for me!
Labels:

Help cyclone 'aila' affected ppl

Tuesday, June 2, 2009 Posted by Md. Monjurul Hasan 0 comments
We (Our office management) have decided to give our 1 day salary for the 'aila' sufferers through Prothom Alo. Also I have donated today 2000 tk in a NGO. But nothing seems adequate to me. Lots of ppl are suffering. How can I contribute bigger to get them back to their normal life????
Labels:

Binary backup of MySQL table

Monday, June 1, 2009 Posted by Md. Monjurul Hasan 0 comments
Usually we take mysql db/tables sql backup by mysqldump command or from phpmyadmin tool (my favorite). But if we need to take the binary backup, you can't do it . What you need to do, just simply copy all table files (*.frm, *.MYD, and *.MYI files). Usually these files are present in /var/lib/mysql directory in linux OS. If you want to check that you are getting the right data in tables you can use the following command
strings test.frm ,
say you are taking backup of test table. This command will show you all data in that table.

here's a useful link:
http://dev.mysql.com/doc/refman/5.0/en/backup.html
Labels:

Open source photo gallery - Plogger

Tuesday, May 26, 2009 Posted by Md. Monjurul Hasan 0 comments
I was in need of a photo gallery - ofcourse open source, and I got two choices - Plogger and Gallery. Gallery2 will give you many features while plogger is really simple and worth for my small requirements. It has easy admin panel and also gives the basic features including slideshow - so I decided to rely on Plogger. I have modified the default theme and it worked fine.
First I removed the footer-text ('Powered by Plogger') from page (for that I commented out this line - print plogger_link_back(); in ploggerdir/themes/default/footer.php)
and
modified the css to decrease the search box width (added this line

#jump-search-container input[type=text] {
width: 120px;
}

in ploggerdir/themes/default/gallery.css ).

Still working on it.

Debug Shell and Python Script from console

Tuesday, May 19, 2009 Posted by Md. Monjurul Hasan 0 comments
> When running Shell script, enable the debug mode with -x option.E.g. sh -x yourscript.sh
> When running Python script, import pdb - the Python debugger, call the set_trace() function and enter n in the console for next debug output. E.g.

#!/usr/bin/python
# epdb1.py -- experiment with the Python debugger, pdb
import pdb
def combine(s1,s2): # define subroutine combine, which...
s3 = s1 + s2 + s1 # sandwiches s2 between copies of s1, ...
s3 = '"' + s3 +'"' # encloses it in double quotes,...
return s3 # and returns it.
a = "aaa"
pdb.set_trace()
b = "bbb"
c = "ccc"
final = combine (a,b)
print final
Labels:

Email tips for PHP Pear

Posted by Md. Monjurul Hasan 0 comments
Email facility is required for almost every application. Hence these tips are helpful.

1. For datetime in proper format,
$headers["Date"] = date("r");

2. For both HTML and text mail,
 $headers["Content-Type"] = "multipart/alternative";

3. For sending mail with SMTP Authentication,
$mail = Mail::factory(
"smtp",
array ('host' => $host,
'auth' => 'true',
'username' => $username,
'password' => $password)
);


A quick helpful tutorial: http://email.about.com/od/emailprogrammingtips/qt/et073006.htm
Labels: , ,