James Fishwick

  •  Minimal
  •  CSS Tomfoolery

Automating swfdump to bulk generate flash dimensions or other metadata

Code Snippet, linux, Note to Self, Production Automation

No Comments


Share this post

Using a MarkLogic application at work to manage and deploy content. We have almost no available metadata nearly any of our thousands and thousands of video and flash content. We’re generating it by hook or by crook, often repurposing editorial transmittal grids into csv for import. Needless to say, stuff like native dimensions or the like have been lost in the sands of time – existing html embeds are done in a multitude of slapdash ways, with height and width varying greatly per instance.

I should also say that this is all legacy content being shoehorned into “responsive” courseware. So there are width restrictions now, when before these activities were just popped up in new windows with “100%” widths.

Anyway, when trying to place said swfs into the product, the embed codes for an entire disciple were completely wrong. Things squished, white spaced abounded. Turns out the person who loaded the original metadata set all the widths to the max width for the product (595 px) and then grabbed heights from the questionable html wrappers. But they didn’t in turn adjust this grabbed height in light of a new width. Oooooof. A complete mess!

I needed to start from scratch, but I was looking at several hundred swfs. Grepping the dimensions from the html was out, as they were suspect. As was opening each in Flash, I refuse to do manual labor! I needed a csv with all the filenames and native dimensions. If the width is over 595px, I needed an aspect ratio calculation done.

So swfdump and bash to the rescue!

Read more

Get a list of recursive one-per-line paths

CLI, linux

No Comments


Share this post

just want a flat listing of files with their full paths?

No, no, no. Don’t use ls. Use find.

find . -type f

Get certain file types:

find . -name \*.txt

Even better, if you have it, is tree. So boss. In fact, install this now if you don’t have it. Check it.

tree -if .
tree -if directory/

For just files:

tree -if | grep -v \>

Of course, grep out any certain file types if you want.

Read more

adding last.fm scrobbler to Jolicloud

linux, media server

No Comments


Share this post

Currently, Jolicloud wants you to add Last.FM has a web app, meaning the unsatisfactory web player and experience. Of course, you want to use the desktop scrobbler! Let’s add it as a proper Local App (aka real software):

last.fm

1) Go in Terminal (in Apps > Add a local App > Terminal), and copy/paste :

wget -q http://apt.last.fm/last.fm.repo.gpg -O- | sudo apt-key add -

2) Then type :

sudo gedit /etc/apt/sources.list.d/ubuntu.list

3) A text file just opened. At the end of the document, add a new line, and paste :

deb http://apt.last.fm/ debian stable

Then save!

4) Go back in Terminal, and copy/paste :

sudo apt-get update

and

sudo apt-get install lastfm

Read more

jolicloud as music server

linux, media server, review

No Comments


Share this post

Got an old IBM Thinkpad T41, probably 6 or 5 six years old: Intel Pentium 1.6GHz, 748.8Mb RAM, 30GB harddrive. Had plans for some sort of media server: maybe VortexBox, maybe Plex, maybe XBMC (I didn’t really actually know much about any of these, just that they could run on old machines, and you know, stream shit). The machine has XP on it, completely wiped of any and all anything else than then day it was first turned on. So at first I just did some driver updates and installed iTunes and Chrome. iTunes was just playing our shared iTunes libraries via Home Sharing and I had Chrome for MOG. Whee, except even using MOG with the latest version of Chrome was horribly slow, and I realized more than ever what a sluggish, bloated POS iTunes has become.

So the laptop is old and slow, and we don’t really watch movies or TV or play video games. So these heavy duty media server installs are too much, clearly. We want to play music, and maybe be able to hop onto allmusic.com or wikipedia for some fact-checking. We want to use mainly web-based streaming apps like MOG, Spotify and last.fm, be able to listen to NPR and other podcasts, watch/listen to stuff on youtube, and play from our iTunes libraries remotely. Hmm, barring that last requirement, doesn’t it just sound like what I really need is a Chromebook (Google’s netbook? Say, can I install Chrome OS on my machine? No, but you can install Chromium OS and it might not work amazingly well. Read through that post and its one of those that keeps us all afraid of Linux. But check the comments and enter Jolicloud OS!

Read more