The end of the Internet is near

Well, maybe not the end of the Internet, but the end of the IP Address space, as we know it, is near. You know, IP addresses are the 4 blocks of number separated by periods, i.e. 10.0.0.1; well, there are only 4 billion of them. Sometime next year, 2012, Internet Assigned Numbers Authority (IANA) will have no more IP addresses to give to the Regional Internet Registries (RIRs). About a year after that, the RIRs will have no more to give out to Internet Service Providers (ISPs), such as Cox Communication and Go Daddy.
Continue reading

Posted in IPv6, Research | Tagged , , , , , | 1 Comment

Making bp-events work on BuddyPress 1.2 (with invites working)

There is a lot of chatter about wanting the plugin creator to update bp-events to work with Buddypress version 1.2, and so far it hasn’t happened, however, this guy has ported it for us so kindly:

http://codewarrior.getpaidfrom.us/2010/04/21/buddypress-event-plugin-for-1-2/

Continue reading

Posted in Code, Linux, Research | Tagged , , | Leave a comment

My First Easy Database Data Widget

Just testing this new product out called Easy Database for Website – will be out soon.

All this does it put a table on my site. There are more interesting widgets, such as search and filter, and form widgets, just starting with the most simple list possible from the Music template. Here is the list of Genres that were pre-populated in the Genre table for me:
Continue reading

Posted in Reviews | Leave a comment

Test video in my WordPress

This let me just drop a JavaScript into my post. In other WordPress sites, I can’t do this. Is WordPress MU the difference?

Posted in Uncategorized | Leave a comment

swfobject force video when filename has missing extension

When a video won’t play and the video file doesn’t have valid extension, you may need to tell swfobject this is a video file.
provider=video

<html>
<head>
<title>Video Test</title>
<script type='text/javascript' src='swfobject.js'></script>
</head>
<body>

<!--div id="daVideo">
        <P>Alternate Text</P>
</div-->

<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='640' height='360' id='player1' name='player1'>
   <param name='movie' value='player.swf'>
   <param name='allowfullscreen' value='true'>
   <param name='allowscriptaccess' value='always'>
   <param name='flashvars' value='file=http://HOST/filename&image=http://HOST/imagename&provider=video&autostart=true'>
   <embed id='player1'
          name='player1'
          src='player.swf'
          width='640'
          height='360'
          allowscriptaccess='always'
          allowfullscreen='true'
          flashvars="file=http://HOST/filename&image=http://HOST/filename&provider=video&autostart=true"
   />
</object>

<!--script type="text/javascript" >
/*
// Baseline:
var poster = "http://HOST/filename";
var video = "http://HOST/filename";
var player = "http://HOST/video/player.swf";

if ((navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1) || (navigator.userAgent.indexOf('iPad') != -1))
        document.getElementById("daVideo").innerHTML = '<video width="640" height="360" poster="'+poster+'" src="'+video+'" controls />';
else
{
  var so = new SWFObject(player,'mpl','640','360','9');
  so.addParam('allowfullscreen','true');
  so.addParam('allowscriptaccess','always');
  so.addParam('wmode','opaque');
  so.addVariable('file', video);
  so.addVariable('image', poster);
  so.addVariable('provider','video');
  so.write('daVideo');
}
*/
</script-->
</body>
</html>
Posted in Uncategorized | Leave a comment

Hack to make vipers-video-quicktags detect iPad and use HTML5 Video Tag

I use this WordPress plugin, vipers-video-quicktag, in a couple sites I maintain. I use it to display FLV video. I’ve found if I create .mp4 videos with the H.262 video and AAC audio codecs, it’ll play in the Flash player, as well as on iPhone, iPad and iPod. This is neat, a single video format that works on all 3.

Problem is, with vipers-video-quicktag, it doesn’t detect iPhone/iPod/iPad on the Flash video option and just tries to display it with the Flash player, which we all know doesn’t work on iPhone/iPod/iPad.

The trick is to detect iPhone/iPod/iPad and instead of putting in the Flash video, instead put in a HTML5 Video tag.

WordPress: http://wordpress.org/extend/plugins/vipers-video-quicktags/
Author’s Page: http://www.viper007bond.com/wordpress-plugins/vipers-video-quicktags/

If you know how to read a diff file, here’s how I hacked it in. Remember, this is only going to work universally, if your videos are .mp4 with H.264/AAC encoding.

# diff -Naur vipers-video-quicktags.php.orig vipers-video-quicktags.php
--- vipers-video-quicktags.php.orig     2010-05-23 22:15:11.000000000 -0700
+++ vipers-video-quicktags.php  2010-05-23 22:19:22.000000000 -0700
@@ -3663,7 +3663,9 @@
                //$content .= "// <![CDATA[\n";

                foreach ( $this->swfobjects as $objectid => $embed ) {
-                       $content .= '   swfobject.embedSWF("' . htmlspecialchars( $embed['url'] ) . '", "' . $objectid . '", "' . $embed['width'] . '", "' . $embed['height'] . '", "9", vvqexpressinstall, ';
+# dkhack, replace this line with HTML5 Video tag when it's iPhone, iPad, iPod:
+                       # $content .= ' swfobject.embedSWF("' . htmlspecialchars( $embed['url'] ) . '", "' . $objectid . '", "' . $embed['width'] . '", "' . $embed['height'] . '", "9", vvqexpressinstall, ';
+                       $content .= 'if ((navigator.userAgent.indexOf(\'iPhone\') != -1) || (navigator.userAgent.indexOf(\'iPod\') != -1) || (navigator.userAgent.indexOf(\'iPad\') != -1)) document.getElementById("'.$objectid.'").innerHTML = \'<video width="'.$embed['width'] .'" height="'.$embed['height'].'" poster="'.preg_replace("/\.[^\.]{3}$/", ".jpg",  $embed['flashvars']['file']).'" src="'. $embed['flashvars']['file'].'" controls />\'; else  swfobject.embedSWF("' . htmlspecialchars( $embed['url'] ) . '", "' . $objectid . '", "' . $embed['width'] . '", "' . $embed['height'] . '", "9", vvqexpressinstall, ';

                        if ( empty($embed['flashvars']) || !is_array($embed['flashvars']) ) {
                                $content .= 'vvqflashvars';

Basically, what it’s doing is detecting iPhone/iPod/iPad in JavaScript and writing this:

<video width="'710" height="400" poster="http://host.tld/path/to/video.jpg" src="http://host.tld/path/to/video.mp4" controls />

One more thing to note…. When I tested this with my iPad, it didn’t work at first. Something is wrong with the iPad – it doesn’t want to see the movie when it’s at it’s default location in WordPress after upload. Is there a 300 level redirect in there somewhere that iPad doesn’t like? Maybe something with .htaccess. Workaround: What fixed it for me was creating a new directory in my DOCUMENT_ROOT called “videos” and then I put symlinks in there to the physical files, and then used these http://host.tld/videos/my_video.mp4 URLs and it works fine.

Dave.

Posted in Code, Research, Video | Tagged , | Leave a comment

Make a Poster JPG for each MP4

Nifty command to take a list of MP4 videos and make a poster JPG for each one:

for i in `ls *.mp4`; do echo $i; j=`echo $i | sed -e 's/.mp4/.jpg/'`; echo $j; ffmpeg -i $i -r 1 -f image2 -t 1 $j; done

This takes each mp4 video in a directory and creates a .jpg for it. In the ffmpeg command, the -r 1 means 1 frame per second, and the -t 1 means stop after 1 second. The -f image2 means the output is an image.

This is useful when you have a bunch of videos to upload to say WordPress for use with, oh say, vipers-video-quicktags plugin that automatically looks for a file with the same name, but a .jpg extension, for the poster. In case it’s not obvious, the poster is the image that displays on a video before play.

Posted in Video | Tagged , | Leave a comment

Spirit Jailbreak for iPad

Download the Spirit Jailbreak here http://spiritjb.com/ run and presto, your iPad is JailBroken.

First problem, the MobileTerminal app in Cydia crashes. Good workaround: I already had the iSSH app installed from App Store. I think it was $10. I installed openSSH on my iPad from Cydia, then created a configuration in iSSH for localhost at 127.0.0.1. Now I can use iSSH as a Terminal, using username root and password alpine (first login). Works. I can also SSH to my iPad when my laptop and iPad are on the same WiFi network.

If you do this, make sure to change the default root password from alpine to something else. Don’t want some random person to break into your iPad when you’re on a public network. Also change the password for the “mobile” user:

Dave-Laptops-iPad:~ root# passwd
Changing password for root.
New password:
Retype new password:
Dave-Laptops-iPad:~ root# passwd mobile
Changing password for mobile.
New password:
Retype new password:
Posted in Research | Leave a comment