moving!
The posts that are on this blog are moving to my main site!
http://www.rexroof.com/
see you there!
-Rex
I'm Rex. this is some news for my website. not my real blog. thats hidden away elsewhere.
The posts that are on this blog are moving to my main site!
creating an mpeg from a series of jpg images:
I was missing my eject button in the menu bar for my mac. This was causing me problems because I don't have a mac keyboard on it and so, if theres no cd in the drive, I had limited options for getting the drive open. Then I found out how to return the eject icon to my finder toolbar:
open /System/Library/CoreServices/Menu\ Extras/Eject.menu
/System/Library/CoreServices/Menu Extras/
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
slather -t `randomtag`
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.
#!/usr/bin/perl
use 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;
}
}
With over 33,000 songs in my library, my iTunes share here at work is very popular. iTunes has a built in connection limit that people often complain to me about hitting. So this is why I started looking into running a duplicate share on my FreeBSD server.
/Volumes/Music -mapall=rex shaolin
mogu:/Volumes/Music /music nfs ro,intr,noauto 0 0
# cd /usr/ports/multimedia/mpeg4ip-libmp4v2
# make install clean
# cd /usr/ports/multimedia/mpeg4ip
# make install
-I$(src_topdir)/lib/mp4v2to the INCLUDES= line. for some reason this was omitted someplace. I'll e-mail the maintainer, hopefully it'll be fixed when you go to build the port.
-Wall
portupgrade imake make. Hopefully anyone reading this won't have ports as old as mine and won't have issues with these.
FREEBSD SERVERNAME
_daap._tcp.
3689
# /usr/local/etc/rc.d/mdnsresponder.sh start
# /usr/local/etc/rc.d/daapd.sh start
I've written this script a half-dozen times at least, but this is the first one that doesn't use Mac::iTunes to create the playlist. I needed something that would add a directory of mp3s to a playlist in itunes with the same name as the directory, so I wrote this: