Saturday, June 27, 2009

S/MIME for Windows Mobile

Some reading up to do.

http://www.jacco2.dds.nl/networking/windowsmobile-smime.html

Gmail has POP3 too?

I didn't know that. Guess I shouldn't have signed up for hotmail if I could POP using gmail...
Switching to IMAP, LiveMail POP3 has connection limitation, you can't poll every 5 mins for hotmail.

Ran into an issue with my CPAN as documented here

More Perl stuff

Done with the SMTP code for pidgin, now writing the script for checking live.com pop3 email.
Doing an upgrade to the CPAN module and then installing Mail::Message( yes to everything). I need this to read MIME messages.



CPAN install failed:
Appending installation info to C:\Perl\lib/perllocal.pod
PLOBBES/Mail-IMAPClient-3.19.tar.gz
nmake install -- OK
Running install for module 'IO::Scalar'
Running make for D/DS/DSKOLL/IO-stringy-2.110.tar.gz
Fetching with LWP:
http://ppm.activestate.com/CPAN/authors/id/D/DS/DSKOLL/IO-stringy-2.110.tar.g

Alert: While trying to 'parse' YAML file
'C:\Perl\cpan\FTPstats.yml'
with 'YAML::XS' the following error was encountered:
Usage: YAML::XS::LibYAML::Load(yaml_sv) at C:\Perl\lib/YAML/XS.pm line 70.

Going to snag a copy from:

Saturday, June 20, 2009

Treasure hunting for Perl Modules Part 2

Windows Live Mail has recently enabled Secured POP3 so you could connect using any normal modern email client to retrieve email. I've wrote a Perl script using Mail::POP3Client to retrieve email from my hotmail account. The script kept returning DEAD when I checked the connection status, the script completed way too early, indicating that it probably didn't perform any socket connections at all.

Dumping the Connect(); and Message(); calls to STDERR gave away the error:
IO:Sockets::SSL wasn't installed.

AS PPM doesn't have the required modules so it was off to http://cpan.uwinnipeg.ca/PPMPackages/10xx/ to grab the IO::Sockets::SSL and the dependancies.

ppm install http://www.bribes.org/perl/ppm/Net-SSLeay.ppd
install Scalar-List-Utils from default ActiveState PPM repo
ppm install http://cpan.uwinnipeg.ca/PPMPackages/10xx/IO-Socket-SSL.ppd

Works now :)
Off to grind on the warlock.

Treasure hunting Perl Modules

I'm trying to render HTML content output as plaintext much like Lynx, I found some posting suggesting to try HTML::FormatText.
Fired up ActiveState PPM to install it but the .pm apparently wasn't in the repo. Found a similar module on PPM :

HTML::FormatText::WithLinks.

Installed it, problem was that I couldn't figure out why I was getting this:

Can't locate object method "new" via package

Yes that's with the example from the module documentation. Grrr...

Had to install it via CPAN, which started to complain it didn't have a make tool.Download NMAKE 1.5. Wow it's been a long time since I had MS NMAKE on my system.
Finally the code works.

I'm off to play PVP to let off some steam.

Tuesday, June 16, 2009

iTunes under XP 64? Tough one

This isn't the first time I've encountered lack of device support for XP64. The recent one was my Huawei hsdpa stick. Works in xp32bit and Window 7 64bit rc hmmmm.

I had some problems with iTunes too, it kept insisting that it needed s 64bit Vista. Downloaded Orca from Microsoft and removed the restrictions from the iTunes64 msi. It... works now.
-posted via mobile while travelling on a crowded bus

How i wasted a tuesday evening

My old Dell XPS notebook runs at home while I go to work and I occasionally RDP back to it. I usually see some IMs on my Pidgin IM when I log in, thought it would be a good idea to script something in Python+ D-BUS to send mail to my gmail account once I get any new messages, so I can check them on my work desktop, or Wince mobile. Till I realized the Win32 Pidgin doesn't have D-BUS.

The next best alternative calls for a quick and dirty scripting using Perl(ActivePerl 5.10). Boy the documentation is pretty sparse. After googling around(http://sriunplugged.blogspot.com/2009/03/autoreminder-in-pidgin.html) I've managed to come up with a script that works. Phew. Todo: presense + stripping html tags from the messages.

Bedtime now.



use Purple;
use Pidgin;
use Net::SMTP;

%PLUGIN_INFO = (
perl_api_version => 2,
name => "Email New Message Plugin",
version => "0.3",
summary => "script to mail to user any message received",
description => "Sends an email when a new message is recieved",
author => "Alvin Ng (Rebooting at gmail) ",
url => "http://pidgin.im",
load => "plugin_load",
unload => "plugin_unload"
);
sub plugin_init {
return %PLUGIN_INFO;
}
sub plugin_load {
my $plugin = shift;
Purple::Debug::info("testplugin", "plugin_load() - Test Plugin Loaded.\n");
Purple::Signal::connect(Purple::Conversations::get_handle(),'received-im-msg',$plugin,\&im_received,

'received-im-msg');

}


sub im_received {
Purple::Debug::info('incoming', "im_received\n");
# SMTP details here
my $smtp_server="smtp server";
my $sender='sender@domain';
my $recp = 'recipient@domain';

my ($account, $imsender, $message, $conv, $flags) = @_;

#log it

#send it, TODO: mail it when the client is set to any other status but online

$smtp = Net::SMTP->new($smtp_server);
$smtp->mail($sender);
$smtp->to($recp);

$smtp->data();
$smtp->datasend("To: $recp \n");
$smtp->datasend("From: $imsender\n");
$smtp->datasend("Subject: New Message from $account::$imsender \n\n");
$smtp->datasend("$account : $imsender \n");
$smtp->datasend($message);
$smtp->dataend();
$smtp->quit;

}
sub plugin_unload {
my $plugin = shift;
Purple::Debug::info("testplugin", "plugin_unload() - Test Plugin Unloaded.\n");
}

Monday, June 15, 2009

Iron Python

Putting this posting to remind me to find out about iron python. can I use it for WMI?

Thursday, June 4, 2009

Umm.. I just remembered Kubuntu

Having some trouble compiling the VirtualBox Guest addons for Fedora. I'll just snag a copy of Kubuntu off bit torrent and see if this one's any better. What a pity, FC 10 really looked good.

Hello Fedora 10


It's certainly nice to try Fedora again, the version I last used was FC 3 and that was it. I'm getting tired of using Gnome on Ubuntu and wondered how the KDE version of Fedora looks like. Just got around installing it. I'm going to use it to develop stuff and see how it goes.