MEDgle - search your symptoms
Interesting medical search engine. MEDgle - search your symptoms for everyone
Interesting medical search engine. MEDgle - search your symptoms for everyone
I created this little perl program that creates an RSS feed from a set of video files (.mp4). This is useful to wirelessly transfer files to the PSP. The files will be saved in the VIDEO folder of the PSP. You’ll need to install MP4::Info and HTTP::Daemon from CPAN first. #!/usr/bin/perl -w # this small program starts a http daeomon listening on port 1111 and provides a RSS feed # to all .mp4 files stored in the 'videos' folder. # This program is intended to transfer movie files via wireless. Using the sony psp RSS feed utility # 1. Start the server with ./rssstandaloneserver.pl # 2. Copy some video files on videos subfolder # 3. Point you PSP browser to the http://<address> :<port>/ and the psp browser will display a page to # 1. subscribe to the feed. # 4. Go to Psp~~<span style="text-align:right;">Network</span>~~>RSS Channel and select the new feed # 5. A list of items should appear and pressing X will download the video files to your VIDEO folder # on the PSP memory stick # Please note that depending of your firmware and the encoder you used on your files PSP may refuse # to play those files from the VIDEO folder. The VIDEO folder is not just like the MP_ROOT/100ANV01 # folder, it behaves a different way. So please first check and transfer some of your files via USB to the # VIDEO folder and check that the PSP is able to play them from there. # If you encode your files using the Media Manager for PSP software then those files will work in any folder. # If you use 3GP encoder and QVGA MPEG-4 then those also will work in the VIDEO folder. but if you use # another resolution or AVC codec then it won't work. use HTTP::Daemon; use HTTP::Status; use XML::RSS; use MP4::Info; use File::stat; use Time::localtime; use URI::Escape; use Encode; use LWP::MediaTypes; #configuration my $feedtitle = "Perl Video Feed"; my $feeddesc = "ecerulm perl video feed"; my $hostname = "192.168.1.3"; my $port = 1111; my $debug = 1; #end of configuration my $rootaddr="http://" . $hostname . ":" . $port; my $ct = "video/m4v"; LWP::MediaTypes::add_type($ct => qw(mp4 MP4)); my $d = HTTP::Daemon->new(LocalPort => $port) || die; print "Please contact me at: <URL:", $d->url, ">\n"; while (my $c = $d->accept) { while (my $r = $c->get_request) { my $url = URI::Escape::uri_unescape($r~~<span style="text-align:right;">url</span>~~>path); print $r->method . " " . "$url\n" if $debug; if ($r->method eq 'GET' and $url eq "/") { print "sending index.htm\n"; $c->send_file_response("index.htm"); } elsif ($url eq "/index.rss") { print "generating RSS content\n"; my $rss = new XML::RSS (version => '2.0'); $rss->channel(title => $feedtitle, link => $rootaddr, description => $feeddesc, ); $rss->image(title => 'Perl video feed', url => $rootaddr . "/images/feedimage.jpg", link => $rootaddr, width => 88, height => 115, description => 'feed logo' ); # videos my `fileList = <videos/*.MP4>; foreach $file (`fileList) { my $tag = get_mp4tag($file) or die "No TAG info"; $date_string = ctime(stat($file)->mtime); #my $enclosurelink = "http://192.168.1.3:1111/" . URI::Escape::uri_escape_utf8($file); my $enclosurelink = $rootaddr . "/" . URI::Escape::uri_escape_utf8($tag->{NAM}) . ".MP4"; #my $enclosurelink =~ s/videos%2F/videos\//; $rss~~<span style="text-align:right;">add_item(title => $tag</span>~~>{NAM}, enclosure => { url=>$enclosurelink, type=>$ct, }, description => $tag->{NAM}, pubDate=>$date_string ); } # or save it to a file my $rs = new HTTP::Response(RC_OK); $rs->header('Content-type', "application/rss+xml"); $rs~~<span style="text-align:right;">content($rss</span>~~>as_string) if $r->method eq 'GET'; $c->send_response($rs); print "RSS content sent\n" if $debug; } elsif (-e "." . $url) { print "the $url maps directly to a file in the filesystem\n" if $debug; if ($r->method eq 'GET') { print "sending " . $r->method . " " . $url . "\n"; $c~~<span style="text-align:right;">send_file_response("." . $url) if $r</span>~~>method eq 'GET'; } else { print "sending HEAD " . $url . "\n"; $c->send_basic_header; print $c "Content-type: $ct\n\n"; } } else { print "$url doesn't map to file directly. We assume the url is the movie title\n" if $debug; my $t = $url; $t = Encode::decode("UTF-8", $t); $t = substr($t,1,-4); #remove the ".mp4" part. print "looking for a file with movie title: $t\n" if $debug; my `files = <videos/*.MP4>; my $found = 0; foreach $f (`files) { my $tag = get_mp4tag($f) or next; if ($tag->{NAM} eq $t) { print "sending " . $f . " file\n"; $c->send_file_response($f); $found = 1; last; } } unless ($found) { print "cannot find " . $url . " using method " . $r->method . "\n"; $c->send_error(RC_NOT_FOUND); } } } $c->close; undef($c); } The code is also available as a gist
Jonathan Harris has just released a new version of MP4::Info adding support for Sony PSP title and encoder. Movie title and the encoder used are now accessible under $tag->{NAM} and $tag->{TOO} use MP4::Info; my $file = 'MAQ12331.MP4'; my $tag = get_mp4tag($file) or die "No TAG info"; printf "$file title:%s encoder: %s\n", $tag~~<span style="NAM;text-align:right;">, $tag</span>~~>{TOO}; see my related post
Today I opened a new feature request (http://rt.cpan.org/Ticket/Display.html?id=25178) on MP4::Info perl module to include my patch to read the title in a Sony PSP files. Read this post to know more about the way title is encoded in PSP Mp4 files. With the following patch mp4infopatch.txt (applied to Info.pm) you can read the title of an PSP MP4 file using the following code snippet: use MP4::Info; my $file = 'MAQ12033.MP4'; my $tag = get_mp4tag($file) or die "No TAG info"; printf "$file title is %s\n", $tag->{NAM}; my $info = get_mp4info($file); printf "$file title is %s\n", $info->{NAM}; my $mp4 = new MP4::Info $file; printf "$file title is %s\n", $mp4->title; UPDATE: Jonathan Harris has released a new version of MP4::Info with support for Sony’s PSP files. more info
If you live in Madrid this Google maps application will help you to check the status of the rings roads surrouding Madrid (Road M-40 and M-45 )before you take the car in the morning. Direct link to app Found via bbs keyhole
Today I faced a strange problem setting up CVS pserver as an xinetd service. I was getting “Permission denied” error on CVSROOT/config file. But cvs ran as root and config file permission were ok. Then I realized (by reading this post) that the problem was SELinux. setenforce 0 solved the problem. I have to dig a little more on restorecon and ls -Z to understand how to setup SElinux, xinetd and CVS in the right way.
Interesting post from Sam Ruby explaining how to make your blog or website OpenID-enabled.
If you are tired of the old “Graph Results” listener that JMeter provides and want better charts in your Jmeter test plan take a look at this JMeter plugin. This is how the old “Graph Results” look like: Click on the above image or here to see an enlarged version of the old Graph Results Checkout this new JMeter plugin that provides a new Statistical Aggregate Report listener. (see the screenshot) ...
UPDATE2:: It seems that my bugreport has been reviewed and the patch I submitted is merged into the JMeter svn tree. I also submitted a couple of patches dealing with COMMIT behavior that also have been included into the svn tree. so I strongly advise to use the standard JDBC Sampler as it includes alll features of the Enhanced JDBC Sampler plus other corrections UPDATE: It seems that the patch has been merged with the standard JMeter source code tree as SVN r528906. I think, however, that the change it’s not present yet in the 2.2 release you need to download the Nightly Build. ...
Firefox 2.0 RC1 is available here now. via Firefox 2.0 to Go Live Today