World of *Nix

by S. M. Ibrahim (lavluda)
May 19th, 2008

phpmailer for codeigniter (ci)

on our new server we was getting problem with mail sending. yahoo and some other mail server was not receiving our mails to there inbox. so i imported the most popular php class (phpmailer ) in codeigniter as plugin. it’s install and use is too simple. you have to download the zip file from here, then unzip it to your plugin (system\plugins) folder. then edit phpmailer_pi.php , and edit the default configuration as needed as your mail server (default configuration will work fine with gmail smtp, you only have to edit the user name and pass) .

download:

phpmailer for codeigniter

usage:

you can now use all the functions that phpmailer supported. here is a the example that you will get in phpmailer site, but in ci format.

 < ?php
/*
 * Created on May 19, 2008
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 
 class Action extends Controller {
 
	function Action()
	{
		parent::Controller();
	}
 
   function testMailer()
   {
	   error_reporting(E_ERROR);
 
	   $this->load->plugin('phpmailer');
	   $mail=new PHPMailer();
 
	/*$mail->IsSMTP();
	$mail->SMTPAuth   = true;                  // enable SMTP authentication
	$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
	$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
	$mail->Port       = 465;                   // set the SMTP port 
 
	$mail->Username   = "username@somedomain.com";  // GMAIL username
	$mail->Password   = "xxxxxx";            // GMAIL password
	*/
 
	$mail->From       = "username@somedomain.com";
	$mail->FromName   = "sender name";
	$mail->Subject    = "This is the subject";
	$mail->Body       = "Hi,This is the HTML BODY";                      //HTML Body
	$mail->AltBody    = "This is the body when user views in plain text format"; //Text Body
	//print_r($mail);
	$mail->WordWrap   = 50; // set word wrap
 
	$mail->AddAddress("someone@somedomain.com");
	$mail->AddReplyTo("username@somedomain.com","sender name");
	$mail->AddAttachment("/path/to/file.zip");             // attachment
	$mail->AddAttachment("/path/to/image.jpg", "new.jpg"); // attachment
 
	$mail->IsHTML(true); // send as HTML
 
	if(!$mail->Send()) {
	  echo "Mailer Error: " . $mail->ErrorInfo;
	} else {
	  echo "Message has been sent";
	}
 
   }
}
 
?>
Sphere: Related Content

April 4th, 2008

using ubunt ? need non-free software ?

today i passed some time tune my ubuntu gutsy (7.10). at the time of searching on the google i found www.medibuntu.org :). from that site:

Medibuntu (Multimedia, Entertainment & Distractions In Ubuntu) is a repository of packages that cannot be included into the Ubuntu distribution for legal reasons (copyright, license, patent, etc).

their package collection is so interesting. they have:

  • acrobat reader
  • w32codecs (also w64codecs)
  • googleearth
  • skype
  • etc :-)

isn’t it interesting  ?

before getting this site, i was really missing my favourite “w32codecs”

to use this repository you have to run these commands (it’s too simple)

first get the repository address:

sudo wget http://www.medibuntu.org/sources.list.d/gutsy.list -O /etc/apt/sources.list.d/medibuntu.list

then add the gpg key to trusted keyring (so that you will not get warning each time you do something with apt)

wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add - && sudo apt-get update

too simple !!

thanks www.medibuntu.org for there hard work , to make life more easy :) 
Sphere: Related Content

April 1st, 2008

just upgraded to wordpress 2.5

i just upgrade my blog to latest release of wordpress . it’s a major upgrade. so some part of my blog may not working ok, i am fixing it. thanks for your understanding.

Sphere: Related Content

March 23rd, 2008

my engagement party

last 14th march was my engagement date with tania sabnam. everything went fine. thanks to Allah.

i uploaded some pictures of the party on this server.

Sphere: Related Content

February 21st, 2008

মুক্তি চাই এই যন্ত্রনা থেকে

দিনে দিনে যন্ত্রনা বেড়েই চলছে।মাঝে মধ্যে খুব ইচ্ছা করে এদের বিরুদ্ধে সরাসরি সুপ্রিম কোডে মামলা ঠুকে দিতে। ক্ষমতা থাকলে তাই করতাম। তবে মোল্লার দৌড় মসজিদ পর্যন্ত , আর আমার দৌড় এই ব্লগ পর্যন্ত। তাই আপনাদের সাথেই এই সমস্যাটি শেয়ার করি।

হায় হায় সমস্যাটা কি তাই তো বল্লাম না। সমস্যাটা নতুন কিছু না। আমার আপনার সবার পরিচিত মোবাইল ফোন । না না, মোবাইল ফোন না, মোবাইলের মর্ধে আশা অনাকাঙ্খিত এস এম এস। যা পুরুটাই মোবাইল কোম্পানির বিজ্ঞাপনে ভর্তি থাকে।

কাজের সময় এই ধরনের এস এম এস আসলে মেজাজটা এত খারাপ হয় কি আর বলব। তবে মজা লেগে যখন অফিসে থাকি, কয়েক সেকেন্ডের ব্যবধানে সবার মোবাইলে সেইম এড্য (এসএমএস) আসে।

লেখাটি শুরু করলাম, কারণ একটু আগে খুব মন দিয়ে কাজ করছিলাম , এবং বড়াবড়ের মত একটা এসএমএস পেলাম।

পর সমাচার এই, কেও পারলে তাদের বিরুদ্ধে একটা মামলা করেন। আমি খাশ দিলে দোয়া করব তার লাইগা <img mce_tsrc=

Sphere: Related Content

February 17th, 2008

watch live steaming from softexpo 2008

can’t go to softexpo ? you can see the live steaming from somewherein pavilion . to see the live steaming visit http://www.somewhereinblog.net, on the right side bar you will get the link or open mmsh://206.222.3.106:1235 with vlc player.

and this totall system is made and maintained by me, thanks to morshed bhai for his help to design the web interface. :)

Sphere: Related Content

February 2nd, 2008

install imagemagick support to your debian/ubuntu server

imagemagick is one of the best library to work with image. recently i have to install it to our production server. here is what i did:

$ apt-get install imagemagick

it downloads the package and all it’s dependences from debian/ubuntu repository, and installed. now i have to install the support of php (as our product running on php)

$ apt-get install php5-imagick

then i restarted the apache server to take effect this new package installation. if your using php4 then the package name should be php4-imagick

$ /etc/init.d/apache2 restart

that’s all :)

if you need imagemagick for your ruby , you can install the librmagick-ruby package.

Sphere: Related Content

December 24th, 2007

wordpress bangla plugin 2.0

i just finished version 2.0 of wordpress bangla plugin. in this new version now you also use probhat layout.

you can download it from here

upgrade:

simple unzip this file and overright the old files.

Sphere: Related Content

December 20th, 2007

ব্লগ ভার্সন ৩ ও আমার কিছু কথা

সা.ইন. ব্লগ ভার্সন ৩ প্রকাশিত হল গতকাল, প্রায় ৩৪ ঘন্টা কাজ করার পর। এই দির্ঘ সময় কাজ করার সময় মিজান ভাই (ব্লগ ডেভলপার টিমের লিড) এবং মোর্শেদ ভাই ছিলেন আমাদের সাথে। এছাড়াও ব্লগ টিমের অন্যান সকল সদ্স্য তাদের সেরা কাজটি দেখিয়েছেন। ব্লগটিমের সবাইকে আমার পক্ষ থেকে আন্তরিক ধন্যবাদ তাদের স্ব স্ব আবদানের জন্য।

এবার আসা যাক আমার এই পোস্টটি লেখার মুল কারনে।

এই পোস্টে আমি ঐ ৩৪ ঘন্টা কাজের অভিজ্ঞতা শেয়ার করব। <img mce_tsrc=

ব্লগ ভার্সন প্রথমে রিলিজ হওয়ার কথা ছিল ১৬ই ডিসেম্বর রাতে। যা কিনা সম্ভব হয়নি বিদ্যুতের স্পেশাল পারফরমেন্সের কারণে। যার ফলে ১৫ই ডিসেম্বর রাত ৯ টায় সবাই যার যার বাসায় ফিরে যেতে হয় মন খারাপ করে। তারপর ১৭ই ডিসেম্বর সকাল ৮:৩৫ মিনিটে অফিসে পৌছালাম (আমি সাধারনত ১১ টার আগে আসি না)।

তার পর শুরু হয় ব্লগের অন্যান্য সদস্যদের জন্য অপেক্ষা। ঘন্টাখানিকের মধ্যেই মোটামোটি সকলে হাজির। এরপর চলতে থাকে কাজ। কোডের ফাইনাল টাচ (তখনো নতুন ডিজাইন হাতে আসে নি)।

বিকাল ৪টায় ব্লগ সার্ভার ডাউন করার ঘোষনা দেওয়া হল। কিন্তু বিভিন্ন কারণে শেষ পর্যন্ত ৪:৫০ মিনিটে ব্লগ ডাউন করে শুরু হল মুল কাজ। সাধারনত সার্ভার রিলেটেড কাজ গুলি আমি করে থাকি। তো বসে গেলাম আমি আমার প্রিয় ডেল ল্যাপটপ নিয়ে নতুন সার্ভার + পুরান সার্ভার মধ্যে সকল ডাটা ট্রান্সফারের জন্য। সার্ভারে ডাটা ট্রান্সফারের কাজ চলতে চলতে আমরা ২ গেইম টেবিল টেনিস মেরে আসলাম। রাত ৮টার দিকে আমি , মিজান ভাই, মোর্শেদ ভাই ও রাশেদ ভাই ছাড়া সবাই চলে গেল।

রাত ৯:৩০ এর দিকে রাশেদ ভাই ওনার গাড়ির ড্রাইভারকে দিয়ে পুরান ঢাকা থেকে মামা বিরানি আনতে পাঠালেন। কিন্তু ড্রাইভার তার মিশনে ব্যার্থ হয়ে অন্য মোরগ পোলাও নিয়া আসল। কি আর করা <img mce_tsrc= । তবে পেটে প্রচন্ড খিদা থাকায় খেতে বড়ই ভাল লেগেছে , (এমনকি আমি একলাই ২ টা শাবার করেছি)।

এর পর রাত ১২ শুরু হল সব চেয়ে ঝামেলার কাজ, পুরানো ডাটাবেইসের সকল ডাটা ইউনিকোডে কনভার্ট করার। কাজ ভালই চলছিল , রাত ২ টার দিকে মিজান ভাই আবিষ্কার করল আমি ডাটাবেইস ভুলটায় কাজ করছি। এটা হল গত সপ্তাহে ব্যাকাপ নেওয়া ডাটাবেইস, কারেন্টটা না <img mce_tsrc= । বুঝেন অবস্থা । আরেকটু হলেই দিত মাইর <img mce_tsrc=। কি আর করা ২ টা ঘন্টা পুরা মাটি।
তো ডাটা বেইস চেইন্জ কইর আবার কাজ শুরু হল। এর মধ্যে বাধা সৃষ্টি করল শ্রদ্ধেয় গুগল বট, মামু আর টাইম পায়নাই ইনডেক্সিং কারার জন্য। তার ফলে কনভার্টের গতি গেল কমে। ৩ ঘন্টার কাজ শেষ হল ৫-৬ ঘন্টায়। হইল সকাল , কিন্তু কাজ তখনো অনেক বাকি। আমাদের সবচেয়ে বড় ঝামেলা হল আপনার খুশি হয়ে যে ইমেইজ গুলি আপলোড করেন সেগুলো। তার সংখ্যা ৫০ হাজারেরও বেশি। নতুন ভার্সনে ইমেইজ হেন্ডলের পদ্ধতি ভিন্ন। সব গুলি ইমেইজের ২ টি করে অন্য সাইজের কপি তৈরি করতে হবে। সেই কাজ চলতে থাকল।

ইমেইজের কাজ শেষ হলে ব্লগ টিম সেটার উপর টেস্টিং শুরু করল। তারপর ১ টা ৪০ মিনিটের দিকে গ্রিন সিগ্যনাল পেলাম। সো আমি ওয়েব সার্ভারের সেটিং চেইন্জ করে দিলাম রিস্টার্ট। ব্লগ আপ <img mce_tsrc= সম্পুর্ন অফিস যুরে হুররে বলে চৎকার উঠল। সেই এক মজার অনুভুতি <img mce_tsrc=

তারপর জানা ভাবী কেক নিয়ে আসল। এবার কেক খাওয়ার পালা। <img mce_tsrc=

কেক খাইয়া ফটোসেশন হইল, মোই পোজ দিলাম <img mce_tsrc=। কিছু ছবি শেয়ার করলাম।

আরো ছবি দিমু পরে । আপতত এই দুইটা দেখতে থাকেন। <img mce_tsrc=

Sphere: Related Content