My New Apartment

I’ve recently moved to Westlake, OH to be closer to work. I took some pictures of the new place, before and after clean-up.

The den/office looks small in the photo but is actually big enough to be another bedroom. I didn’t photograph the bathroom, but it has a beautiful marble countertop. It also has a custom tapestry that my mom made. I would have photographed it but I think toilets are ugly. I also have a walk-in closet. Cool.

One of my favorite features is the patio, where I’ve got my grill and a table. I can access the patio from both the living room and my bedroom. It’s a pretty nice place to do some grilling, have parties, play cornhole (on the green space beyond the patio), etc. When the weather is nicer, I’ll photograph that too.

Here are the photos:

My New ApartmentMy New ApartmentMy New ApartmentMy New ApartmentMy New ApartmentMy New ApartmentMy New ApartmentMy New ApartmentMy New ApartmentMy New ApartmentMy New ApartmentMy New Apartment

Originals are on Flickr

Parallelized batch media transcoding using bash and ffmpeg

Thanks to Dave Matthews Band’s liberal taping policy, there are hundreds of DMB concerts available for free on the internet (see bt.etree.org for DMB and others). Most of these concerts are encoded in the lossless audio format FLAC. Unfortunately, iTunes (and consequently the iPhone or iPod) doesn’t read FLAC files. I have downloaded about 30 concerts and I was thinking of a way I could convert all of them from FLAC to something that iTunes can import, like AAC. Converting each song one at a time would take a while, so I also wanted to parallelize the process. Encoding a single file is, of course, completely independent.

A simple Bash script did the trick:

#!/bin/bash
for i in $(find . -type f -name "*.flac")
do
_basename=${i%.*}
if [[ ! -e ${_basename}.m4a ]]
then
ffmpeg -acodec mpeg4aac -ab 128000 -i "${_basename}.flac" "${_basename}.m4a"
fi
done

Just pass in a list of files and test to see if the destination file exists before converting the original. Run one instance for each CPU core that you have. When I did this a few months ago, I had four available cores between two machines (I've since purchased a dual core Macbook and a dual core Mac Mini), so instead of encoding one file at a time, I was able to do 4 files at a time.

Recipe: Heartburn Hotel Panini Sandwich

Don’t get me wrong – I like to cook – but a lot times I just want a quick meal that is filling and delicious.  Usually hot sandwiches meet that requirement.  And, I have a Foreman grill that I also use as a panini press.  One sandwich I like to make is what I call the Heartburn Hotel.

Ingredients:

  • Two slices of rye bread
  • Sara Lee Buffalo Turkey
  • Smoked Ham
  • Pepperoni
  • Spicy Mustard
  • Cheddar Cheese

I usually take each slice of turkey and ham and dry it off with a paper towel.  Then, I just stack the deli meats and top it off with the pepperoni and the cheddar cheese.  I let the Foreman heat up while I do this, so that my sandwich grills faster.  When the cheese is melted and looking delicious, it’s done.  Pry open one side and apply a generous amount of the spicy mustard.

Tip: Wrap your deli meats in paper towels once when you get home from the grocery store and then a second time about a day later.  It will keep them fresh a few days longer than usual.

Recipe: Tilapia in Panko Crumbs with Soy Sauce

Simple recipe that I just tried, takes just about 10 minutes or so to make…

Ingredients:

  • Two thawed Tilapia fillets
  • Panko Crumbs
  • Soy Sauce
  • Canola Oil
  • 1 egg

Instructions:

Start heating the skillet to medium heat.  Use enough oil to cover bottom with about 2mm of oil.  Beat egg in a small mixing bowl, adding maybe a tablespoon or two of water.  Once skillet is to temperature, bathe fillets in egg and roll in panko crumbs (in another container).  Then place fillet in skillet for about 5 minutes or until the panko crumbs are brown and the fish is thoroughly cooked.  Serve with soy sauce to taste.

I also made up some Bob Evans garlic mashed potatoes – I don’t have a stand mixer so I have to outsource my side dishes sometimes.

Randomizing A Table In MySQL

I’m working on a project right now where I want to collect a Network ID (for prize-drawing purposes) from a survey participant but I don’t want it to be able to be tied to their response.  Even if there’s no relational connection through keys or anything, just the fact that the order of the network IDs in the table matches the order of survey responses is enough for correlation.

I tried alter table netIDs order by rand(); but that gave me an error. I used the Google and found a decent solution which I modified for my purposes:

set autocommit=0;
begin work;
insert into netIDs values ('$netID');
create table netIDs_temp like netIDs;
insert into netIDs_temp (select * from netIDs order by rand());
truncate netIDs;
insert into netIDs (select * from netIDs_temp);
drop table netIDs_temp;
commit;

I wanted to wrap the whole operation in a transaction for atomicity – losing network IDs while keeping responses would be a nightmare, not to mention a violation of research ethics.

Now on FriendFeed

I’ve been hearing about FriendFeed on and off for the last few months and I decided to give it a try.  Friendfeed is a service that lets you aggregate your friends’ online presences.  I’m able to track what my friends upload to Flickr, post on Twitter, share in Google Reader, upmod on Reddit, and so on.

So why not just grab RSS feeds for these things and follow it all from Google Reader?  Well, for one, FriendFeed will automatically start showing me updates from services that my friends have just added. So, there’s no need for them to announce they’ve just joined X service.  And it will also let me comment on their updates as well.

I’ll be experimenting with the service for the next few weeks and see what I can do with it.  I’ve already replaced the Twitter Updates widget in my side bar with my FriendFeed widget.  I’m planning on changing my blog theme soon, so the widget won’t clash so much with the current theme (although you can customize it with CSS, but I don’t have the time to do that right now.)

And if you want to check out my page, here it is: http://friendfeed.com/alexhutnik.

P.S. I just found out/remembered that fellow Case student Ben Golub works for FriendFeed.  Nice work, Ben!