Tech-Nexus


Announcing: Python based YouTube Video Uploader for Linux

Posted in Uncategorized by slayton on September 30, 2009

I’ve spent the last few weeks looking for a program to upload videos to YouTube from ubuntu. I wasn’t able to find anything so I decided to write it my self. This is my first real attempt at a program that is designed to be distributed freely to all.  You can check it out on launchpad: https://launchpad.net/linviduu/trunk

Subtitles and the Ushare – Xbox Combo

Posted in How To,Linux by Mark on September 8, 2009

When Stuart showed me how to stream video from my linux machine to my Xbox, thereby enabling a beautiful HD viewing experience, I was ecstatic. Who wants to watch 1080p on a laptop? I mean, seriously.

The problem was, many of the movies I had waiting to be watched on my computer were foreign films. And, as I quickly found out, the Xbox doesn’t look for .srt or other subtitles files. Ushare only streams one file at a time – the video file. So I was out of luck with those foreign films.

That is, until Stuart and I figured out how to encode subtitles directly into the video file. Then, of course, it was super easy. Here’s how to do it:

1. install mencoder and mplayer

sudo apt-get install mencoder mplayer

2. once installed, simply run the following:

mencoder -oac copy -ovc xvid -xvidencopts pass=1 -sub <sub_title.srt file> -subfont-text-scale 3 <video file> -o <name of output file>

so, for example:

mencoder -oac copy -ovc xvid  -xvidencopts pass=1  -sub Desktop/”Idi i Smotri 2.sub” -subfont-text-scale 3 Desktop/”Idi i Smotri 2.avi”  -o Desktop/”Idi i Smotri Pt2.avi”

3. Wait for the encoding to complete (takes about 40 minutes on my old Pentium 4 Laptop) and enjoy!

photo

Note: mencoder doesn’t fix terrible English in the subtitles, unfortunately.

Second note: I originally tried to do this without installing mplayer, and mencoder will act like it is encoding the files, but if you look at the output closely you’ll see this about the 30th line down:

New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.

It’s apparently looking for a font file that mplayer provides. If you absolutely don’t want to install mplayer, you can create a workaround via a link to the font file mencoder is looking for:

ln -s /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf  ~/.mplayer/subfont.ttf

If that doesn’t work, leave a comment and we’ll try to help you out.

Windows 7 install fiasco

Posted in Uncategorized by slayton on August 14, 2009

I just tried installing Windows 7 on my desktop, but the install failed. Why did it fail? Because the installation DVD apparently didn’t have drivers for my SATA DVD drive.  What I don’t get is how did the DVD boot up and get part way into the setup process before it realized it didn’t have drivers for the DVD drive it was running off of. Silly Microsoft.

You can read about the entire process on my other blog

Migrating from SVN to GIT, in a few simple steps

Posted in How To by slayton on July 29, 2009
Tags: , , , , , , , , ,

I have a lot of source code hosted in an off-site SVN repository. Recently I’ve been using git and wanted to migrate all my code from a svn repo hosted on webfactional to a public repository on GitHub.  I found the migration to be extremely easy.  Assuming you have SVN, GIT and, GIT-SVN installed and an account on GitHub the following steps should work for you.

Click to read on…

(more…)

Screen, a terminals best friend

Posted in How To,Linux by slayton on May 31, 2009
Tags: , , , ,

One of my favorite things about using linux is the terminal.  One thing that annoyed me when I started using linux was if I started an application in the terminal I had to leave the terminal running; if I closed the terminal the running application would also close. The simple solution to this problem is a little appliction called screen.

Next time you run an application in a terminal start it with screen:

screen <application_name>

(more…)

How to stream video to your XBox360 using Ubuntu + uShare

Posted in How To,Linux,Stick it to the man by slayton on April 26, 2009
Tags: , , , ,

I’ve known for a while that the newest Xbox 360 software supports streaming video from a computer running Window Media Center. What I didn’t know is that when Microsoft added the media center capabilities they decided to use someone else’s media server standard; UPnP to be precise.

This is really exciting because this means that anybody who implements this standard can stream video to an Xbox over the network.

I run Ubuntu Linux and discovered that there are several programs you can install that will setup a UPnP Media Server, the one I picked to use is uShare.  To install ushare I opened a terminal and ran:

sudo apt-get install ushare

After that I had to edit the ushare configuration file saved under /etc/ushare.conf

If you don’t feel comfortable editing the file you can run to help you setup the configuration file.

sudo dpkg-reconfigure ushare

Here is how I setup my file (I’ve removed the comments from the file for readability):

USHARE_NAME=Ubuntu_Media_Server

USHARE_IFACE=eth0 (the name of which ethernet adapter you’ll send the data over)

USHARE_PORT=49153

USHARE_TELNET_PORT=1337

USHARE_DIR=/home/slayton/Desktop/Shares (any dir will work just put your media there)

USHARE_OVERRIDE_ICONV_ERR=yes

ENABLE_WEB=no

USHARE_ENABLE_XBOX=yes (the USHARE_ is missing in the file you need to add it)

ENABLE_DLNA=no

uShare automatically starts a daemon upon boot, I don’t like this so I kill the daemon after boot with:

sudo /etc/init.d/ushare stop

Then I start uShare when I need it with:

ushare -x  (-x is for xbox compatible mode)

Start up your Xbox scroll the Video Library, select Ubuntu_Media_Server (or whatever name you picked) and begin the streaming goodness!


How I got my Verizon Contract cut in half!

This is how I got my verizon contract cut down by one year!

I signed a new contract back in January so I was locked in with verizon for 24 months (until Jan 2011).  I get discounted service through my work so I called up verizon to apply the discount. To get the discount however, the contract needed to be in my name (it was previously under my wife’s name). It was an easy switch to make, I had to provide social security number and and verbally recognize that if the bill doesn’t get paid its my credit that gets hit.

Here’s the trick, because I made the change over the phone I wasn’t able to sign a paper contract, rather I agreed to a verbal contract.  Verizon will only sign a 1 year if done verbally. My 2 year agreement got cut down to a 1 year agreement! My contract that should have expired Jan 2011 now expire April 2010.   I don’t qualify for a free phone until Jan 2011 but my contract is up May 2010!

If you want to do the same its simple, get someone who trusts you to accept the contract in their name. If you have a family plan like i do just switch the primary account holder to another person on the family plan!

How I got around Comcast's blockade of SSH

I have 2 computers a home computer and a work computer. I do a lot of work on both of them and being able to access files on one from the other is essential.  To do this securely I use SSH.  The only problem is that I can only SSH from my home computer to my work, but I can’t SSH in the other direction. I’ve done some reading around and it looks like comcast either blocks all incoming traffic that isn’t http related or actually has me sharing an IP with several people. Regardless, a lot of people have been having problems accepting incoming SSH connections with comcast.  I figured out how to get around this problem. All it takes is a little bit of reverse port forwarding, or reverse tunneling.

Here is how I did it.

(more…)

What are moments and products of inertia?

Posted in Uncategorized by Mark on April 8, 2009

I saw this question today on the internet at a forum, and nobody seemed to have an answer. Some people thought they knew what they were talking about, but had absolutely no clue. I have a clue, as I’m responsible for keeping track of these properties for over a hundred components on a developmental rocket program.

Question: Do the moments and products of inertia represent anything in the physical world?

Answer: In short, yes. But not intuitively.

It’s best to think of moments and products of inertia in terms of the inertia tensor, which is a mathematical concept – it’s a matrix of inertias for a given 3D object.

The moments are the diagonal values of the inertia tensor and the products are the off-axis values. Keeping the tensor in mind, you can think of an object’s moments of inertia to be the rotational equivalents of the general concept of inertia. Ie, as inertia is the resistance to change in motion, moment of inertia is an object’s resistance to change in rotational motion about some axis. As there are three dimensions, any physical object’s rotation can be defined about 3 axes. It is these axes that form the basis of the inertia tensor. If it took 4 axes to define rotation, the matrix would be 4×4, not 3×3.

In the real 3D world rotation is quite complex – for most real-life objects, you are not going to be able to find 3 axes about which the object will rotate in a stable manner. Ie, most objects don’t have mass distributed symmetrically about all 3 axes at once. Thus, you get off-axis moments of inertia, also known as products of inertia. POI’s can be thought of as measurements of dynamic imbalance of an object and basically represent asymmetrically distributed mass. Note that mass can be distributed symmetrically about one axis but not another, leaving you with products of inertia.

If you see an inertia tensor and the products are zero, there is no dynamic imbalance – the object will rotate perfectly about the defined axes. In such a case, you can call these the principle axes.

Ugh. This is complicated stuff and is often not covered in undergrad engineering or science. What I’ve written is only going to be a piece of the puzzle to understanding, but I hope it has helped. Let me know if any of you see errors in what I’m saying.

The Halloween Documents

Posted in Uncategorized by slayton on October 11, 2008

The following link contains a Microsoft Internal Memo about the real threat posed by Open Source Software (OSS) and more specifically Linux.  I’d suggest you read it as it points out from a very critical source the strengths of both Linux and the OSS development community.

http://www.catb.org/~esr/halloween/halloween1.html
Next Page »