Archive

Archive for the ‘General’ Category

Convert DVD to Windows Mobile AVI

December 24th, 2009

As part of my work, I occasionally travel, and often find myself getting stranded at either the airport, hotel, restaurant, etc.. With any travel there is down time, and Linux Journal will generally tide me over, once I have gotten caught up on Dave Yates’s LottaLinuxLinks(.com) podcast (no I don’t know Dave, but I am just a huge fan of his show). Well being both an AT&T customer, and corporate email user for my cell phone needs I am stuck with Windows Mobile as a my Phone of “choice” (though admittedly I would just soon skip corporate email if AT&T offered an Android). Nevertheless, the Windows Mobile Media Player doesn’t seem to support large AVI files, nor .OGG files (which means no lottalinuxlinks.com podcast), so I needed a solution. After a lot of digging I was able to find a successfully compiled version of TCPMP for my HTC pure. This is a good (not perfect) open source media player for anyone not familiar with it. Well back to the problem at hand I needed more to entertain me, so I did some digging and put together this quick (as in fast to write, no execute) script to convert a DVD movie into an AVI. This is by no means perfect, and could use some tweaking to keep the file size down and the scale more appropriate, but I thought this might be useful.
Pre-requisites:
TCPMP or some other pocket player that can handle larger AVI files     TCPMP
External storage (the end result is usually a couple of hundred MB).
mencoder (my initial experience of this encoding application, is that it has an insurmountable number of options, and that is specifically why it is incredibly powerful, and why I needed a script).     MPlayer and Mencoder Home

Next save this as a script appropriate to your OS. Mine is for Linux, but you can convert the lines to appropriate to any distribution. Just as a reminder prepare for this to take some time to run this is honestly a four pass encoding to allow for me to half the full video, and a mobile version.

#!/bin/sh
# This requires two command line parameters this can be preset as appropriate.
if [ $# -eq 2 ];
then
# Audio stream is separated from the DVD.
# WARNING THIS IS SET TO THE CURRENT WORKING DIRECTORY, I WOULD DISCOURAGE THIS AND SET IT TO ANY DIRECTORY YOU WANT TO STORY THESE FILES IN.
    rm -f ./frameno.avi
    mencoder $1 -ovc frameno -o ./frameno.avi -oac mp3lame -lameopts vbr=3
# First Pass encoding
    mencoder $1 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o ./$2
# Second Pass encoding
    mencoder $1 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o ./$2
    ## Comment out the next line for standard AVI or non-mobile this also creates the mobile version with the name mob_xxxx
    mencoder ./$2 -vf scale=400:240 -oac mp3lame -ovc lavc -o ./mob_$2
else
    echo Usage:
    echo convertVideoToAVI.sh \(file or dvd:////dev/sr0\) \(outputfilename.avi - mob_ is tacked on for the mobile file\)
    echo “\t$0 FILE”
fi

As always thank you for reading, and happy holidays,
- - tekgnu - -

tekgnu General, OpenSource , , , ,

Pro - ble - bility

December 10th, 2009

I am sitting here at the tail end of the “C” concourse, in the Chicago’s O’hare airport, just surfing my
eyes across the flux of people droning by. Based on very very cursory estimates, it appears that there are about 150 people just milling around, coming and going. If an Oracle crept up (as they tend to do) and said, “if you wanted to know any probability here, what would you ask”?

So would you appeal to safety, or sick curiosity, and ask, how many here have committed a horrible crime?
Rape, or victims of, afflicted with some insidious ailment, etc..

Would you look for pedagogical data, as in, what percentage of X represents Y?
What is the wealth, race, or religion, in some sick probability census?

How about forward thinking, as in how many people here will win the lottery, die from cancer, heart attack, or build their own multinational corporation?

How about toilet throne data, such as, how many people with moustache’s live: in this country, this century, hide horses, homosexual, or are women?

How about more humanistic data, as in, how many people wish you didn’t exist, or would become euphoric if you would only ramble up and say ‘Hello’?

The true error in the probability may seem overt, but would you really want to know.
If knowing that 32% of all people that were there in that terminal at that given time,
would become ecstatic if only you said hello, while 5% would be become
infuriated, what would you do? How about if you found that the people with
moustaches seemed to react more harshly? Would you avoid them as a
statistic, how about if they had a Yarmulkes on? Was scratching a lottery
ticket? or had been featured on America’s Most Wanted?

The problem is without the event it’s all just probabilty.


Lesser known facts:
72% -     the number of Linuxers that are natural born leaders.
22% -     the number of key designers, and programming genius introverts.
6% -       the proverbial remainder of non-gnu eunuchs.


Sorry for the crazy post I was at the airport ALL DAY :) (hey its been awhile)

– tekgnu –

tekgnu General

IPConfig Output to CSV Tool

September 8th, 2009

Alright, so it has been a long, long, time since I have posted. Well that is why I am coming back with a bang (I guess that depends on how easily excite - able you really are). I am currently working on a project to perform some basic infrastructure cleanup. Nevertheless, part of this clean up is to validate that the servers are configured optimally for an impending DNS upgrade. Well that seems straight forward enough, except these are Windows 2000, and 2003 servers, and I need to validate the DNS Suffix List and DNS Search Order. So quickly looking out on the Internet, I found a common vb object, that honestly produced mixed results depending on the server. I just kept thinking all I need is the same data you get from ipconfig /all.
So after capturing the output from ipconfig /all, I decided I needed some way to parse the data. This quickly turned into a small programming opportunity. Amongst the limitless language possibilities, I wrote this program in java. My motivation was based on familiarity, and interest, as performance is not an issue, (give it a whirl you will see).

The Lessons (if you are not interested in the programming, skip to The Execution section)

The Reg Exp a very powerful tool, worthy of its own books (I believe there is an O’Reilly book out there). Regular Expressions, are really powerful, and surprisingly frustrating. That being said, they are a necessary evil, and can be used in most languages today. There gets to be a point of absurdness on traditional find functions, that requires too many conditional expressions. What’s nice, is that these kinds of conditionals can be performed within the Reg Exp, which, in theory, improves readability. My take on it, is you need to use tools. I use jedit as my normal text editor and it has plugins to help formulate the Reg Exp. I also discovered - http://www.regexplanet.com/simple/index.jsp, this site actually will help build out the Java Matcher class string.

The Enum is actually a really great programming enhancement (circa JDK 1.5). I never used it before (in java), and I thought it would be a good opportunity for exposure. It makes for a very clever way of organizing elements in an array. My only thought is it would have been more novel possibly to use a dynamic enum to allow for a variable number of adapters. The problem with that is I would have sacrificed the ability to change the output layout order by simply moving the elements of the enum around, which is quite simple and intuitive.

The Buffered Writer is a very common tool, that I have used many times. The problem is that as a hobbyist I had never really given any thought about the buffer, in the bufferedwriter class. Why, well I honestly didn’t really care, until magically I could only seem to get through 164 servers. After that clearly there was a lot of brain cells churning on the accursed number 165. Which of course there was no issue with. All I have to say is listen to your mom and flush (more appropriately BufferedWriter.flush()).

The Debugger I always figured was just another name for System.out.println :). Actually I have used one before, but I have perpetuated my hobby-ist status by using System.out.println, and as a matter of fact left almost all of mine in commented out. But the debugger truly is your friend. If I become extremely motivated, or more appropriately write something that warrants it, I will try the logging API.

If you are interested in this GPL v2.0 released code, it can be gleaned here. Shoot me an email and let me know where it evolves. Or if you have a need and no programming interest shoot me an email and I will look into it. As always, I am still tekgnu at this domain :).

The Execution

So I need to restate I have run this against Windows 2000, and 2003 servers (I did a cursory test of a vista laptop also with no issues). If there are any bugs or if you have any need for enhancements please let me know. Again, I am tekgnu at this domain.

You can download just the tool here.

To unleash this tool on a directory that contains your ipconfig /all files all you need to do is:

java -jar “/directory/path/to/this/jarfile/ipconfigParser.jar” “/Directory/To/Scan/” optional_output_file.csv

This should capture your data and dump it into your .csv file. If you don’t provide an output file then it gets dumped to standard out.

Good luck, and as always feel free to email!

- - tekgnu - -

tekgnu General, OpenSource, Programming ,

Revenge of the Power PC

July 9th, 2009

Well if you stumbled upon this page, then you were probably unscathed by THE migration, and hence you can skip ahead on to the article you accidented on in Google.  For those of you (namely I am talking about myself here) that subscribe to the feed, you may have noticed that the feed itself has been rather anomalous.  In fact it really didn’t work.  This is the effect of inheriting a Big Bubble Mac PowerPC, from my sister in law.  After some floundering I was going to go with installing Debian on the L’il guy, but looking back I had some issues (I can’t remember now, but I think I spent more then five minutes looking for a PowerPC repository or something).  Nevertheless, I decided to give Ubuntu server a whirl, and have pretty much a headless server (which is ironic considering it was the first of its kind where the computer is the monitor, but for sake of explanation, we’ll just say I poked they eyes out of this floating head).  Once built, it sat.  And it sat.  Until my wife asked for me to add Urban Baby Gourmet. I then proceeded to power the L’il guy on, but then it sat, and it sat. Eventually my wife was ready to go, and so I was in a scramble to get mibbit online, and all of our websites migrated over:

                http://www.urbanbabygourmet.com
                http://www.digitalanomaly.com
                http://www.avividdesign.com
                http://www.perrytribe.com
                http://www.nsgierer.com

            (Glib advertisement yes, but nonetheless true)

So to skip to the chase, there was some effort involved in getting everything off of my workstation, and onto this old machine. I just forgot to enable the mod_rewrite module on this server. No harm done, next I hope to create a semiautomatic fail over, just in case mibbit, should have any hiccups, I will keep you posted (right now I am looking at Monit as a possible solution, and running it from my workstation, hence the SSMTP article :) ).

Thanks again and pardon the dust,

- - tekgnu - -

tekgnu General

Simple Email (SMTP) Relay - Using Google

July 8th, 2009

Alright you can probably use a whole cornucopia of MTA’s (or Mail Transfer Agents), to allow you to proxy mail out on the Internet, but I wanted to mention a very simple one, SSMTP.  Why would anyone care to want to send email from some intermediary you ask.  Well simple, with SSMTP you can automatically send email via script or from the command line.  This is particularly useful if you want to use an application to monitor your server and send alerts, or if sending email from the command line is your fancy.  You could try to set up your own email server at home, but the problem with that is two fold: one SMTP (port 25) is often blocked by ISPs, and secondly, even with a static IP address most Email servers will have ISP IP Address ranges Black listed (that is the effect of the wonderful world of spam).

So now with your Gmail or Google for Domains email address you can simply use an application called sSMTP. There are excellent instructions on the Debian Website here. There is only one correction I wanted to make, (and I added the comment to the wiki), and that is to add in one missing parameter: AuthMethod=LOGIN to your ssmtp.conf file.

Once you have it setup, all you need to do is test your email forwarding by dropping me an email from the command like this:

user@digitalanomaly:~$ ssmtp tekgnu (this is the part where you can put in my email @ digitalanomaly.com) and hit enter.

subject: Testing SSMTP (or any subject you prefer followed by an enter).

The command line is clearly going replace my email client.  With SSMTP I can send emails without ever receiving them.

Thanks, from your anonymous user. (Or any such commentary to your liking :) , hit enter.)

(and finish her off with a Ctrl-D on a blank line).

Thanks again for reading,

- - tekgnu - -

tekgnu General

First Impressions

July 1st, 2009

the Story -
So my wife and I figured we were up for the challenge of going out to breakfast on Saturday.  Anyone with a ten month old knows all too well the adventure in eating out. Nevertheless, with so many choices out there we angled for some basic comfort food and ended up at a local “The Egg and I” restaurant. These places have the comfort of a Village Inn, Perkins, Big Boy, etc. wrapped in a single breakfast track like that of an IHOP (only better). Well our breakfast went uncommonly well, and my daughter spent most of the time hamming it up with the rest of the natives. After we finished our meal, that is when the seemingly innocuous event occurred.  I stood in line to pay, in my Saturday’s best, which for plot points, was jeans and a tee shirt. When, out of nowhere, a woman well in her early sixties darted out from the kitchen smiling, asked if she could see the back of my shirt. Confused, I obliged, and she went about reading the back of my shirt.  I said her, “Oh this is just a computer shirt”. I was in fact wearing a Sun Grid computing shirt that I got for free online.  I then went about my merry way, paying my bill.

the Judgement -
Yes the meal was good and what have you. While standing in line I stood there trying to groke what this lady, hinging on retirement, was gleaning from my back. And then it came to me. I think we all know full well these midnight tech junkies. I am no Columbo, but I could tell by the dent on her head and the dried drool on her chin that she spent the night like many of us, passed out on the keyboard. Yeah, I could see it, row upon row of servers stacked on ol’ doily covered coffee tables, and Window air conditioners sucking the air out of her musty basement. Clearly every dime she makes doesn’t go to some paltry knitting addiction, or to supplement social security, it goes directly to feed her babies. Naturally a discussion on Grid computing, open source, or common language search algorithms would be like asking Stephen Hawking about the origins of the earth. Nevertheless, I ducked out in time to save myself the indignation.

the Lesson -
Watch what you wear, and be either a good runner, or someone that can speak a second language as though you are a foreigner. For me I have mastered the perplexed, in a hurry, gaze, (or more appropriately, ‘deer caught in headlights’).

I haven’t written anything in some time, so I thought I would throw something of no technical merit out there. Be well and take care,

- - tekgnu - -

tekgnu General

Democracy NOW

May 14th, 2009

Amy Goodman at the Denver Convention Center
Alright another personal post, which I promise will be paused soon enough, and I will upload additional JavaFX goodness.  For the int

erim however, I had the opportunity to attend the, “Think of Green Festival” at the Colorado Convention Center on May 2nd.  I was hoping to have more time there, but I must admit I came with one goal in mind, to see Amy Goodman present.  For those that don’t know who Amy Goodman is, she is the reporter for Democracy Now.  For those unfamiliar with Democracy Now, I believe it can be best defined as the news that is

n’t reported, but profoundly impactful.  Amy Goodman is a no holds barred reporter, and passionate proponent of ethical journalism.  She has written several books, and is currently featured on New York Times best seller list under paperback nonfiction for her recent release, “STANDING UP TO THE MADNESS“.  Yes after her speech, or should I say rally I was itching to get my greedy little paws on it.  But I am ge

tting ahead of myself.  When I walked into the conference room where Amy was to give her impassioned speech, I became overwhelmed by the current speakers doom and gloom.  Albeit normally I would be transfixed, and sucking in all of the data from an author spelling out how man is proceeding to undo itself, but not today.  I am not sure if it was the monotone voice, the people cutting in to get a seat upfront waiting for Amy, or just the pure audacity of this guy to say that he was going to take an additional ten minutes, but I was getting a little itchy.  Nevertheless, the wait was tremendous, and instead of just calmly listening in on the beauty of the end of the world, all I could do was psychically bitch slap

this pompous ass off of the stage (once again the impertinent effect of impatience no fault of the author).  Once my telekinetic powers hit fruition and the man was gone, I looked up to see the crowd pulse to easily three times the size.

It was the beginning of amazing.   When Amy came out, she was immediately adored by quite a large following, (and even though I have never seen her outside of Democracy NOW, I too became a twelve year old choked up on several two leaders of Mountain Dew).  Amy was pretty zen, and I half expected her speech to roll out like her reporting, with calm thought provoking data.  That is not what happened.  For her size she beamed larger than life - she started with a little data, emotional appeal; then rolled into, hard hitting personal stories,  shocking video, sweet, sweet Data; then proceeded to finish the audience off with more stories of personal endeavor, ironic humor, and of course, her unparalleled and unrelenting hard hitting DATA.  Needless to say, she finished in a whirl wind, where the audience themselves were exalted, and pumping their fists.   It was well worth the wait.  I only wish I would have had the opportunity to stick around.  I can only encourage people to check out Democracy NOW and to take the opportunity to see Amy Goodman in person.  Take my word for it, as a strong advocate for human rights, the environment, and ethical reporting, ( why else would there be seven results for Amy Goodman in Facebook, including one title, Smart is sexy–i wanna marry Amy Goodman), it was well worth the trek downtown.

P.S.  The best photograph I could get was this comical little thumbnail on top (as though this validates that I was actually there and I didn’t take a picture of my television).

Be well

- - tekgnu - -

tekgnu General , ,

Bible Recycling

April 25th, 2009

Do you remember the good old days, when folks would compete over who was the better Christian.  For a while there I was hiking to church everyday, yodeling in tongues, and  advocating for a new inquisition, (who’s number one now ? :) ).  Oh wait, I am not a Christian, and it isn’t the 1950’s.  God bless those people knocking at your door today, with all of their tenacity, for they now are truly swimming against the current.  Now I have nothing against Christianity, and I can respect people fighting for their conviction; here in the United States Christianity has waned in popularity.  Today the new posh is Green, a value slow in the making, but as far as I am concerned much over do.  I love this concept of conservative, (even though conservatives will never agree with conserving the environment as true conservation), and trying to live in balance.  This is where my diatribe begins.  I am not sure where in our history we found it necessary to take a good thing, and see which one of us is willing to give just a little more; until ultimately someone is either flogging themselves or water boarding some one else.  Oddly enough this all spawned from a very very innocent email.  The email contained a simple message with one of those parenthetical abuses (yes I am an abuser, and this addiction has no end in sight).  The abuse was in putting in parenthesis their value, when it had no relevance.  Now I don’t really take issue with the message of the email, but I do find myself getting subtly inundated with values (like trying to tell a girl on the playground that you have a crush on her, and ultimately you just end up puching her).  It really is intriguing to me when someone shares that they rode their bike to work today, and stick it to you with a little, “I am just trying to have a smaller carbon foot print.”  Or “I saw this show on the Discovery Channel where I can save the polar bear by putting fry grease in my car”.  Where did that come from?  I whole heartedly believe in living in balance, recycling, and conserving, but for me the teeth gritting factor is overwhelming.  I really can’t justify my gut reaction, but I also don’t know how to respond.  Maybe I am off base here, or could it be that keeping up with the Jones’s has taken on a whole new meaning?  Will the leaders of this new posh be rifling through my garbage for compost-ables?  Or is there an opportunity here to flog people that aren’t in line with the regime (yes I can still be number one, obviously in my world the sadists seem to climb to the top of the heap :) ).

Let me know your thoughts, (but I would only respond in an environmentally sustainable way).

- - tekgnu - -

tekgnu General ,

Book Review - A Nation of Wimps: The High Cost of Invasive Parenting

March 24th, 2009

Let me start by pointing you to my About me page, so that you can get an understanding of my biases and background.  I just finished reading the book, “A Nation of Wimps: The High Cost of Invasive Parenting” by Hara Estroff Marano, and I wanted the opportunity to provide some insight. 
I would like to start by saying if you were alarmed by the title of the book, then you would do well to start with the introduction. I would encourage anyone, even those with out kids to take a look at this book. The facts are truly stunning, and it is reflective in how our perceptions have been changed. The media has sold us a lower quality of life from off-shoring, to germs, to child rapists. This new fear of the world is easy to perceive as untenable for a child, and a parents natural instinct is somewhat overreactive.
This book is more then just a single idea that pivots around a handful of points, that gets re-iterated chapter after chapter.  If that is something you are looking for, then I would point you to just read the covers of a book like “The Happiest Baby on the Block” by Dr. Harvey Karp (alright  you might need to thumb through the book, but it seems to me the thesis was covered in the first chapter, and repeated in the subsequent ones).
That being said, this book appeals to both the emotional and analytical brain.  The theses that are outlined throughout this book are not only intriguing but seem to be the direct reflection of our culture.  Hara Estroff Marano has not only captured the pulse of modern American parenting in witty stories, but also has forty pages in her notes section of supporting research. 
Admittedly, I was immediately captivated by this book, due to the fact that the information was not purely anecdotal.  With other books I have read (from a well known pediatrician), it seemed to me the behavioral aspect was like watching an episode of “The Dog Whisperer” and expecting to be able to dominate your neighbor’s rottweiller by tapping him on the neck (trust me don’t try this at home :) ); there was inherently data missing (by the way that was anecdotal).  This book contains a lot of real world examples, that I feel I can almost steal and reflect on personally. We have all seen these little parenting events and thought to ourselves, ‘wow that parent seems a little overly protective of their perfectly sterling child’, but this book clearly draws cause and effect relationships from these behaviors. Though in light of how much our lives have changed since we were children, it seems only natural to want to protect our kids from this new host of perceived threats. That being said, I would strongly recommend checking out, “A Nation of Wimps: The High Cost of Invasive Parenting”, and if given the opportunity I would like to sit in on a seminar of Hara Estroff Marano’s (if she does them). If you do get the opportunity to read the book, please stop by and let me know what you think of the book, as I am sure you will find it to be interesting reading.

- - tekgnu - -

tekgnu General , , , ,

Free Online Java Courses

February 18th, 2009

So it has been over a week since last I have posted.  I actually have been busy getting caught up on some of my home work from Sang Shin’s online courses.  I would strongly recommend any one interested in any of his online training to take a look at these classes.  I am currently enrolled in his Java Programming (with Passion!), and Java FX Programming (with Passion!), classes.  Admittedly, I have been using Java on and off for a few years to create tinkering tools as needed.  With Sang Shin’s courses,  I have found his exercises both interesting and challenging, and I have really been gaining a better core language understanding.  His class structure is quite simple, and open (perfect for someone like me), and if you have any issues there is an associated Google group.  I have been a quite monitor on this list, but you can find some very handy posts out there, (like this one, which I originally followed from Remi Emonet’s posting, but this looks very similar, Installing JavaFX 1.1 on Linux).

Nevertheless, I will get back to the JavaFX Gear article I was working on shortly.

On a personal note, Aramenda has updated our personal site (http://www.perrytribe.com) with links to updated pictures of Anaka (http://picasaweb.google.com/Perrytribe.com).   From the end of January, into the beginning of February, Anaka has transitioned to eating solid foods, which is always an event.

Take care,

- - tekgnu - -

tekgnu General, Programming