Saturday
14Feb2009

Some handy bash commands

On Linux shells, I always feel pretty crummy about getting around quickly via cd. So, in the spirit of Daniel's up command, here's a few other quick-directory commands to add to your .bashrc:

# up somesubdir
# Find a directory below this that matches the word provided
# (locate-based)
function down() {
dir=""
if [ -z "$1" ]; then
dir=.
fi
dir=$(locate -n 1 -r $PWD.*/$1$)
cd "$dir";
}

# cdd someglobaldir
# quickly change to a directory anywhere that matches the word you typed.
# best if your locatedb is in good shape
function cdd() {
dir=""
if [ -z "$1" ]; then
dir=.
fi
dir=$(locate -n 1 -r $1$)
cd "$dir";
}

Other variations that I tried:


# Not breadth-first, so less fun sometimes
function down2()
{
dir=""
if [ -z "$1" ]; then
dir=.
fi
dir=$(find . -type d -iname $1 | head -n 1)
cd "$dir";

}

# Breadth-first, but really slow
function down3()
{
# create a list of all directories in the current folder
dirlist=( $(find . -maxdepth 1 -type d) )
dirlist=( ${dirlist[@]:1} ) # exclude .

# loop through the list
while [ $dirlist ]
do
# check the head of the list to see if it matches needle
val=${dirlist[0]}
found=`expr match "$val" ".*$1.*"`
if [ $found -gt 0 ]; then
# change dirs, we found the first match
cd "$val";
break # done
else
# not found!
# scan that new directory for subdirs
appendlist=( $(find $val -maxdepth 1 -type d) )
appendlist=( ${appendlist[@]:1} ) # exclude .
# add those subdirs to the tail of the dirlist
dirlist=( ${dirlist[@]:1} ${appendlist[@]} )

# rinse, repeat
fi
done

}

Posted via web from Imported from http://mattie.net/blog

Thursday
31May2007

Using Second Life to create movies

Here's a silly video I created for a contest at work:
     http://youdeliver.citrix.com/Play/tabid/79/pid/1112/Default.aspx

Feel free to vote for it, because the top submissions get an iPhone. 

Tools used:

I must have spent 15-20 hours on that video, primarily on sound effects. While working on this, I discovered that sound effects are very essential, but if they're good no one will really notice them. I.e., making something look and feel natural is a lot harder than it looks and isn't appreciated unless there are no sound effects.

If you notice, Helen's voice is distorted in a way as to make it sound as if she's coming through a digital line. My voice is distorted to reflect the environment I'm in, there are environment sounds like splashes and vehicles, etc. This all required a lot of work, but you can barely 'notice' it while watching the video. You just expect these things to be present.

Second Life is a great tool for creating the stage and environment. Inside its interface, I used existing Second Life places (e.g. the Midgar Final Fantasy Island) and dynamically created iPhone look-alikes (see if you can spot it). I also adapted an in-game laptop to display a fake webpage, and created a weird/fake server rack on the fly. I only scratched the surface, but you really can create just about any environment you imagine. This can be very helpful for fun videos.

I can't harp on Sony Vegas enough-- that tool is wonderful. I happen to have the $50 home version of the tool, but it's possible to get effect and codec plugins from the professional version and they work there, too. (The primary limitation being 3-4 video tracks, and 3-4 audio tracks, which I've always worked around. Professional versions allow unlimited tracks, I believe.) With Vegas, I was able to create overlays, manage sound effects, apply video rendering effects, pan/zoom, etc. If you enjoy video editing, I highly recommend it. I studied video editing in school for a few years (winning best editor awards, even), and I'm in awe of how far digital editing has come. I'm ten times more productive with this software than with a top-of-the-line editing deck from 8-10 years ago.

 

Posted via web from Imported from http://mattie.net/blog

Saturday
20Jan2007

I'm not the biggest fan of exclamation points.

Over on digg, I saw a very Mattie-like script for GreaseMonkey/Firefox-- it's used to eliminate extra exclamation points on webpages. Using this, now I never have to look at web sites with painful exclamations. This is a comforting thought.

Posted via web from Imported from http://mattie.net/blog

Saturday
20Jan2007

EventScripts Software "Box"

Over on digg recently I also saw a tutorial for creating a fake software box using Photoshop. I don't use Photoshop, but I do use Paint.NET. So I decided to try the same thing using that tool, which is one of my favorite free tools.

There are a few features different from Photoshop, so it wasn't 100% trivial to do, but I did manage to emulate it pretty well. I may write a similar tutorial for Paint.NET users to follow. Take a look:

 

Posted via web from Imported from http://mattie.net/blog

Saturday
21Jan2006

In which Mattie links a binary teaching exercise

Using the Socratic method, it seems that you can teach third-graders to do binary arithmetic. Very neat.

(Thanks to digg for the link.)

Posted via web from Imported from http://mattie.net/blog