Using Matroska - mkv - Media Containers 1

Posted by JD 05/22/2010 at 20:38

The Matroska container format for video has become popular over the last few years because it merges a number of good ideas and let’s a single file contain multiple video, audio and subtitle streams. No longer do you have to keep multiple .vob/.mpg/.avi.mp4, and multiple .sub/.srt/.idx files to have 3 different audio and subtitles. All of them can be placed into a single .mkv file. For me having the subtitles efficiently contained inside the same file is good, but the real, fantastic reason that MKV containers are brilliant is you can easily correct aspect ratio issues without re-encoding.

Here’s another article for why you should also use MKV if you’d like more specifics.

There’s another nice bonus. In my testing, the .mkv files are always smaller than the .avi files from which they are made.

Jumping into the How-To

Blog Spammers Hit 4

Posted by JD 04/17/2010 at 09:39

Blog Spam

I’ve noticed the number of blog spammers have increased significantly in the last 2 months. They use general “good job” or “nice work” comments, then leave their email and commercial weblink. I assume these are spam-bots – automatically doing it.

Moderated Comments

Since all comments are moderated here, I’ll do my best to weed them out if they aren’t related to the posted article. Only on-topic links will remain and generic posts will not be allowed. It isn’t like there are hundreds of spam posts daily. I know this will reduce the number of comments, but that is the price for non-spam comments today. Sorry. If you’re comment is on topic, it will be posted. Basically, any comment that is remotely on topic will be posted. Just those that are commercial or links to unrelated content will not be posted. For example, if the post is about virtualization and you provide a comment with links to an online vitamin store, that will not be posted. OTOH, if links in comments are to other articles on virtualization or even commercial virtualization products, then it will be allowed. The decision of moderators leans towards posting comments when in doubt.

Test Messages

I guess some people don’t want to bother writing a longer message if it won’t be posted. I get that, but a test message is not on topic either and won’t be posted. How does that comment add to the conversation?

Further, I’ve disabled comments for older articles. I don’t recall the actual cutoff day. It is probably 90 or 120 days, so it won’t impact the few, loyal, readers. Those articles do not have any way to enter any comments. If there is a comment field displayed, then your comment will be seen by the moderators.

Hello, Nice Article and other non-related comments were allowed previously, but are not going forward. Sorry. Those do not add to the conversation.

English Only Please

This is an English language blog. While we like worldwide viewers and understand that not everyone reads English, that is simply a limitation of our skills. I have translated some non-English comments previously. None were on-topic to the post. We may attempt to translate comments again, but you can visit translate.google.com just as easily as we can.

No Sign-up Required

We do not require any sign up to post comments. Heck, we don’t really want your email address either. An alias is preferred. If you leave an email address or web address, it will probably be included in the comment and publicly seen. That seems to be the way this software works. Our systems do log IP addresses, just like every other system out there does.

Example Blocks

A few of these spammers have been blocked at the router. Sure they can come from a different subnet, but I bet they won’t.

The financial planning and foreign internet diamond sellers are the funniest. Blocked.

Automatic Moderation

I’ve looked into viable solutions to allow non-moderated comments here and didn’t find one that I was willing to implement.
Here’s a site from 2005 with specific ideas to reduce, if not eliminate internet marketing on blogs. About a year ago, I came across another site where the blogger had placed a static Captcha with an simple arithmetic problem inside the image. The answer was always “42.” He never changed it, Never, yet it prevented 100% of the blog spam. I may introduce that here.

If I were running MT or blogger or some other highly popular blog tool, then I’d have a bigger issue. Since I’m running a little used Ruby blog with few internet users, I’m fairly safe just like Linux and Apple are safe compared to Microsoft.

Today, we are manually moderating comments about once a day.

Comment Edits

Occasionally, comments may be edited by a moderator to remove offensive content. We will say in the post that it was edited. Cuss words will probably be removed or exchanged for #$#%. Keep it clean, please.

Exceptions

We are people and regardless of the statements above, there will be exceptions for posting and not posting. Friends who post can say almost anything.

Automatic QuickStream Fix Processing for VideoRedo Plus 2

Posted by JD 04/02/2010 at 09:08

Here’s a little program that automates Video Redo Plus Quick Stream Fix, QSF, processing.

Perl CPAN Made Easy

Posted by JD 03/15/2010 at 11:10

CPAN, the Comprehensive Perl Archive Network, contains 10,000+ different Perl modules. All of these work just about the same to get installed on a system. That’s because Perl programmers use a standard package for distributing software that includes the code, tests, and manual. Below I’ll show the general way to build and install most perl modules, including those with external, non-perl, dependencies. Then I’ll show how to automate this with CPAN.

Best Articles Here on Technology, Finance, Investing

Posted by JD 03/04/2010 at 15:07

Over the years, I’ve been using this blog to help myself remember how to do things and to share some great tools and techniques with you. I figure it is time to recap some of those articles whether they are computer, financial/retirement, or just interesting things.

New Server Build - Part 2

Posted by JD 02/04/2010 at 17:03

So with all the equipment here, I began the server build. Refresh your memory for components by reading New Server Build – Part 1.

The Old Machine

Before beginning this build I booted the old machine; it was running FreeBSD previously. It had an Athlon 1800+XP CPU, 2GB DDR RAM and AGP graphics. It also had an S3-Virge PCI video card AND an SMC 1000base-tx GigE NIC. Both the NIC and video card were reused in the new server build.

The old machine also had (3) IDE devices – (1) DVD-RW and (2) WD 250GB disks. The motherboard only supports 1 IDE cable, so I’ve connected it to the DVD and 1 of the disks. At some point, I need to boot off USB or get/scrounge a SATA boot disk. I do have a spare 3.5" 1GB SATA, but that is used for weekly off site backups currently. I’ll probably try using a 2GB SDHC flash drive for boot since the host OS only runs the hypervisor.

Bad Parts

New Server Build - Part 1

Posted by JD 02/03/2010 at 09:23

I’ve needed to build a new server for about 6 months, but delayed spending the money as long as possible. I’ll be reusing many old components and have purchased the main new items listed below.

Server Purpose

Top Old School UNIX Tools I Can't Live Without

Posted by JD 01/27/2010 at 09:58

  1. tcsh – the one true shell (bash is workable)
  2. ssh
  3. perl
  4. locate
  5. vim
  6. cron / at
  7. aliases – mainly to correct common misspellings
  8. egrep
  9. pushd/popd
  10. find
  11. man

SysUsage 3.0 Installation Steps 1

Posted by JD 12/16/2009 at 15:34

We’ve been using SysUsage to monitor general performance of our Linux servers for a few years. Version 3 was released recently with a new web GUI and simpler installation, but not quite the trivial apt-get install that we’d all love. View a demo.

Anyway, go grab a copy of the source tgz and follow along.

 tar zxvf SysUsage-Sar-3.0.tar.gz
 cd Sys*0
 sudo apt-get install sysstat rrdtool librrds-perl
 perl Makefile.PL
 make
 sudo make install
 sudo crontab -e

Drop these lines into the root crontab.


*/1 * * * * /usr/local/sysusage/bin/sysusage > /dev/null 2>&1
*/5 * * * * /usr/local/sysusage/bin/sysusagegraph > /dev/null 2>&1

I performed these steps using Cluster SSH on almost all our Ubuntu 8.04.x servers; each installation worked.

If you have Apache running in the normal place, browse over to http://localhost/sysusage/ ,
If you don’t run a web server, try firefox /var/www/htdocs/sysusage/index.html to see the results.

Further, our simple rsync over ssh scripts to pull the SysUsage output back to a central performance server are still working. Some of the old data from the v2.12 of the program is still inside the RRD files. It isn’t clear at this point whether the data will be used in the new graphs or not. It takes about a day for the graphs to become useful.

Trivial Lifehacker Profile Monitoring Script

Posted by JD 12/16/2009 at 09:25

Lifehacker is a site that many of us watch daily for tips. If you join the community, you may find that the LH site can sometimes become … er … slow. The cause of this can be many things, but personally, I think they’ve gone overboard with all the javascript.

Someone mentioned they had written a real-time notification script to tell him about relies to his posts and he asked others what they would like of the script. I started thinking and determined it would be a fairly trivial script to do what I wanted – email a list of replies in simple HTML.

As with all scripts, they are never really done and prone to tweaks for the next year. I think the next tweak will be to try the feed.xml that LH provides. Perhaps it will be smaller, faster and easier to parse?

So I attempted to attach the script to this article using tools build into the blogging system. Both have failed.

  1. Upload – so RSS feed readers see an attachment link – no joy
  2. Excerpt – I’ve used this in previous versions of the blog successfully. No more. The issue is probably due to my theme.

Anyway, here’s the code


#!/usr/bin/perl

  1. #####################################################
  2. Display Lifehacker Profile data
  3. Recent Replies (first pg only)
  4. Followers
  5. Friends
    #
  6. Known Linux Dependencies:
  7. - perl and LWP and Getopt modules
  8. - sudo cpan -i LWP::Simple
    #
  9. Installation
  10. 1) Change the Your-LH-Profile-name-Here below to yours
  11. 2) chmod +x lh_profile_monitor.cgi
  12. 3a) Either run as is $0 > output.html
  13. Or
  14. 3b) Setup as a CGI on your web server
  15. Or
  16. 3c) Setup as a crontab entry which will automatically email the results
    #
  17. $Id: lh_profile_monitor.cgi,v 1.5 2009/12/16 14:32:55 jdfsdp Exp jdfsdp $
    #
  18. #####################################################
    use strict;
    use LWP::Simple;
    use Getopt::Long;
  1. #####################################################
    sub life_hacker_data();
  1. #####################################################
    my $profile_name=“Your-LH-Profile-name-Here”;
    my $doHelp = 0;
    my $download = 1;
    my $profile_page=“http://lifehacker.com/people/$profile_name/”;
  2. my $profile_page=“http://lifehacker.com/people/$profile_name/feed.xml”;
    my $date=`date +%r`;
    my $ret=GetOptions (“help|?” => \$doHelp,
    “profile=s” => \$profile_name,
    “download=i” => \$download);

my $html_header = “Content-type: text/html\n\n


”refresh\" CONTENT=\“600\”>
$profile_name-Recent LifeHacker
";
my $html_footer = “”;

  1. ########################################################
    sub Usage()
    {
    print “\nUsage:
    $0 [-download 0/1] -profile LifeHacker_Profile\n”;
    exit 1;
    }
  1. #####################################################
  2. main()
  3. The output is a filtered html file to stdout
    #
  4. Grab the new page
    Usage() if ( $doHelp );
  1. `/usr/local/bin/curl $profile_page > $profile_tmp_file` if ($download);
    my $content = get( $profile_page ) if ($download);
    my @lh_content = split(/\n/, $content);
    print “$html_header\n”;
    print “

    List of Recent Replied to Messages


    Pulled from ”$profile_page\“>$profile_page at $date
    1. ”;
      my $ret=life_hacker_data();
      print “$ret\n”;
      print “\n$html_footer\n\n”;
    1. #####################################################
      sub life_hacker_data()
      {
    2. Display the total count of
      1. Friends
      2. Followers
      3. Msgs with replies
        my $ret="";
        foreach (@lh_content){
        if (m#/friends/$profile_name|/followers/$profile_name|replied# ){
        $ret .= $_;
        }
        }
        $ret =~ s#
#
  • #g;
    $ret =~ s#href=“/friends#href=”http://lifehacker.com/friends#g;
    $ret =~ s#href=“/followers#href=”http://lifehacker.com/followers#g;
    $ret =~ s#

    #

  • \n

    #i;
    $ret =~ s#^[.]Click here to view all[.]$##ig; # Remove excess lines
    $ret =~ s#view all##ig; # Remove excess lines
    $ret =~ s#»##ig; # Remove excess lines return $ret;

    }