movie time
creating an mpeg from a series of jpg images:
ffmpeg -f image2 -i ‘%03d.jpg’ -sameq -f mpeg2video file.mpg
creating an mpeg from a series of jpg images:
ffmpeg -f image2 -i ‘%03d.jpg’ -sameq -f mpeg2video file.mpg
I’ve been toying around with flickr and downloading random images based on tags. I just wrote a one-liner that grabs a random popular flickr tag, it looks like this:
GET http://flickr.com/photos/tags/ | grep '/photos/tags/[a-z]' | cut -f4 -d/ | random -f - | head -1
note: the random command is something I’ve only found in FreeBSD. it could easily be replaced with a perl one-liner to shuffle.
this prints out a single, random, popular tag from flickr. used in combination with my perl script that picks a random picture based on tag, I can get some randomly awesome pictures:
slather -t `randomtag`
perhaps soon I’ll post slather.
I know this has been done dozens of times before, but it’s been a real headache for me lately. A full example of how to use IO::Socket::UNIX is not really available anywhere on the web. All of the socket info for perl seems to assume you’ve been doing socket programming in C for years, and theres very limited info on doing Unix Domain Sockets. it all seems to be about inet sockets. which, of course, relates a lot to Unix Sockets, but there are some differences.
okay, here is my working example. Its meant to be run twice, the first time it’s the server, the second time it’s the client.
#!/usr/bin/perluse strict; $|++;use IO::Socket;
my $socketfile = $ENV{HOME} . "/.sockettest";
if ( -S $socketfile ) { # client! my $client = IO::Socket::UNIX->new(Peer => $socketfile, Type => SOCK_STREAM ) or die $!; my $string = "this is some sent garbage.\n"; print $client $string; $client->flush; $client->close; exit;
} else { # server! unlink $socketfile; my $data; my $server = IO::Socket::UNIX->new(Local => $socketfile, Type => SOCK_STREAM, Listen => 32 ) or die $!; $server->autoflush(1); while ( my $connection = $server->accept() ) { my $data= <$connection>; print $data, $/;
sleep 5; }}