Category: Mac OSX


Run multiple versions of Perl from your home directory using Perlbrew!

One thing to know:  Perl won’t compile if you have an encrypted home directory. :( Bug has been fixed but not exactly how and it hasn’t been put into the Ubuntu updates yet.
Thanks goes to Kang-min Liu for creating Perlbrew!!!! :)

The recommended way to install perlbrew is to run these statements in your shell:

    curl -LO http://xrl.us/perlbrew
    chmod +x perlbrew
    ./perlbrew install

After that, perlbrew installs itself to ~/perl5/perlbrew/bin, and you should follow the instruction on screen to setup your .bashrc or .cshrc to put it in your PATH.

When I purchased Foundations of Qt Development (Expert’s Voice in Open Source) by Johan Thelin a few months back, I hoped to get to it right away but work and life diverted my attention. Today at lunch I dived into it. Even though I’m still going through chapter 1, I think I can give a hint of it:

Foundations of Qt® Development (Expert’s Voice in Open Source) is well written. He assumes that you have a little bit of C++ knowledge, avoiding into the trap that so many other authors do. You wouldn’t believe how many technical books I have where the first half or more of the book is simply a rehash of the basics. Forget that!

What I really like is that when he shows you an example of code, he explains why you would want to write it this way and how it differs from the Standard Template Language (STL – see C++ Programming Language, The (3rd Edition)). Where there are performance gains or penalties of using Qt instead of STL, he demonstrates it.

I never realized just how easy it is to write C++ using the Qt framework! Just the Signals and Slots alone make it very very powerful and that’s just the beginning. I’m completely blown away :)

I’ve been wracking my brains over this for the past few weeks and it finally struck me how to create an m4b audiobook with chapters that is compatible with your iPod, iTunes, VLC, etc.  It was very simple once I figured it out:

Step 1:

encode the mp3 files to “aac” (mpeg4) using your favorite converter (I use ffmpeg):

ffmpeg -i "track1.mp3" -y -vn -acodec libfaac -ab 128k -ar 44100 -threads 3 -f mp4 track1.aac

Step 2:

Create a chapters file so that MP4Box can understand it:

* Common syntax : CHAPTERX=h:m:s[:ms or .ms] on one line and CHAPTERXNAME=name on the other – the order is not important but chapter lines MUST be declared sequencially (same X value expected for 2 consecutive lines).

$ cat track1.chapters
CHAPTER1=00:00:00.000
CHAPTER1NAME=Chapter 001
CHAPTER2=00:30:00.139
CHAPTER2NAME=Chapter 002
CHAPTER3=01:00:00.728
CHAPTER3NAME=Chapter 003
CHAPTER4=01:30:01.269
CHAPTER4NAME=Chapter 004
CHAPTER5=02:00:01.858
CHAPTER5NAME=Chapter 005
CHAPTER6=02:30:02.375
CHAPTER6NAME=Chapter 006
CHAPTER7=03:00:02.964
CHAPTER7NAME=Chapter 007
CHAPTER8=03:30:03.553
CHAPTER8NAME=Chapter 008
CHAPTER9=04:00:04.094
CHAPTER9NAME=Chapter 009
CHAPTER10=04:30:04.683
CHAPTER10NAME=Chapter 010
CHAPTER11=05:00:05.224
CHAPTER11NAME=Chapter 011
CHAPTER12=05:30:05.765
CHAPTER12NAME=Chapter 012
CHAPTER13=05:46:14.106
CHAPTER13NAME=Chapter 013
CHAPTER14=06:16:14.143
CHAPTER14NAME=Chapter 014
CHAPTER15=06:46:14.732
CHAPTER15NAME=Chapter 015
CHAPTER16=07:16:15.249
CHAPTER16NAME=Chapter 016
CHAPTER17=07:46:15.790
CHAPTER17NAME=Chapter 017
CHAPTER18=08:16:16.331
CHAPTER18NAME=Chapter 018
CHAPTER19=08:46:16.920
CHAPTER19NAME=Chapter 019
CHAPTER20=09:16:17.460
CHAPTER20NAME=Chapter 020
CHAPTER21=09:46:18.050
CHAPTER21NAME=Chapter 021
CHAPTER22=10:16:18.639
CHAPTER22NAME=Chapter 022

Step 3:

Add the chapters to the audio file (creates Nero format chapter markers):

MP4Box -add track1.aac -chap track1.chapters test.mp4

Step 4:

Convert the Nero chapter markers to Quicktime chapter markers using mp4chaps from the mp4v2 project (you will want v1.9.1 or higher):

mp4chaps –convert –chapter-qt test.mp4
converting chapters in file "test.mp4" from Nero to QuickTime

Step 5:

Rename the file from .mp4 to .m4b extension so iTunes will see it as an audiobook:

mv test.mp4 test.m4b

Proof that it works:

and VLC showing the chapters:

Of course, we aren’t putting in any tags such as “author” or “genre” in this example. Use your favorite tags editor to do so.

In iTunes 8, Apple has mentioned in their “What’s New in iTunes 8” that it is possible to upgrade your iTunes music to non-DRM’d for a small fee.  Great!

I purchased quite a bit of music from the iTunes store when I ran WinXP as my primary desktop.  Now I can legally convert them to something that Linux (and my Blackberry Storm) can read!

Let me just pull up iTunes and do that.  Can’t find how do upgrade my iTunes music from within iTunes.  Tried help but that didn’t give me any clue.

After much hunting on the apple.com website, I was able to figure out that while iTunes supports the upgrade, it appears that Apple really doesn’t want you to else they would have made it far less obscure on how to do it.  In Apple’s TechDoc HT1711, you will be directed to go to a special link that will activate the upgrade process in iTunes 8.

Excerpt from the Apple TechDoc:

Can I upgrade previously purchased music to iTunes Plus?

Yes. Any available upgrades will be shown on the Upgrade to iTunes Plus page. You can upgrade all of your items at once by using the Buy All button. This replaces all eligible previous purchases with iTunes Plus versions of the same items. You can also choose to make individual upgrades by clicking the Buy button to the right of each item. Song upgrades are available for 0.30 USD, video upgrades for 0.60 USD, and albums for 30 percent of the album price. The counter to the right of the “Upgrade to iTunes Plus” link in the Quick Links box will indicate when additional eligible content become available.

You can view your eligible iTunes Plus upgrade items by clicking here.

After you re-purchase *cough* upgrade your music, iTunes will download the music files (with the .M4a extension) and replace your old DRM encumbered music (with the .M4P extension).  Note that the non-DRM music files will contain enough information for you to identified easily if you should share your music with your friends.  The music files also contain water marks that will also survive if you should convert the non-DRM music files into mp3, ogg or flac files.  So, share your music at your own risk.

India’s National Programme of Technology Enhanced Learning provides technical lectures from all seven Indian Institutes of Technology and Indian Institute of Science, Bangalore.

The Video Courses are organised as PLAYLISTS under the following Categories:

  1. Core Sciences
  2. Civil Engineering
  3. Computer Science and Engineering
  4. Electrical Engineering
  5. Electronics and Communication Engineering
  6. Mechanical Engineering

Lecture 21 PERL – Part I from the Computer Science & Engineering’s Internet Technologies course is an excellent example of these training videos: