Quick Conversion from m4a to mp3

With youtube-dl, I have a very handy solution to rip off some quick audio from youtube videos. I wanted to listen to the ripped audio files during my drive to work and back. But my car audio system refused to recognize the m4a file extension and begged me to feed it some mp3 files.

And so I was left looking for some solution to quickly convert m4a files to mp3 format. There are utilities available out there, but I thought it would be cool to use some command line for this. So I wrote a small script to help me out.

This uses the ffmpeg library to convert all m4a files in the current directory and encodes them into mp3. The script is shared below.

#! /bin/sh

if [ ! -d newfiles ]
then
mkdir newfiles
fi

filecount=`ls -1 *.m4a | wc -l`
currdir=`pwd`
echo “Batch converting “$filecount” m4a files in folder : “$currdir
read -p “Press any key to continue…”

for f in *.m4a; do ffmpeg -i “$f” -codec:v copy -codec:a libmp3lame -q:a 2 newfiles/”${f%.m4a}.mp3″; done
clear
echo “Done… check these files”
echo “**************************************************”
ls -1 newfiles/*.mp3
echo “**************************************************”

Porteus Strikes Back

I was all gaga over the fact that Slax saved my laptop and did what Porteus could not have done well. But I could not get over the fact that Porteus was in fact based on Slax and so I could expect it to do at least as good as Slax if not better.

I went back to the basics and started reading bit more about Porteus and why it was being dubbed as the best portable linux distro. Was it really better than Slax, did it borrow on the idea of having modular approach to Linux and make it better, much more easy to use? And if so, what was I doing wrong the first time around when I started looking into it.

The answers were easier to find than I had thought. Porteus pretty much follows the same approach to installing itself onto any pen drive or even a laptop hdd. You just need to copy the /boot and /porteus to wherever it is that you want to install it and execute the installer script to install the bootloader. Loading optional modules also works pretty much the same way. The only thing I had not figured out the last time was the use of USM or the Unified Slackware Package Manager. It is kind of a repository search tool which looks for packages across various package databases that are available. It downloads the selected package onto a tmp directory and it is up to the user to activate the packages. It is pretty good at managing dependencies as well and pull along the required modules.

The last time I was attempting to use the pen drive formatted as a FAT32 so that I could use it on windows and linux machines alike, but this was posing as a limitation since saving any changes made to Porteus required setting up a DAT container which could house the changes. This was limiting in the size of the DAT container that I could set up. Switching to ext4 filesystem has ruled out that option. Now I can make changes and let me file size grow to the maximum. It is now only limited by my 32GB pen drive, which I would think is enough for now, since the aim is not to have a mean machine but something which is just about functional.

But the biggest advantage I see is the variety of desktop environments that Porteus comes with. With Slax I was only stuck with KDE4, which I would admit I wasn’t comfortable working with. It has all got to do with my unfamiliarity with the KDE environment. Over time I felt it was really sluggish and limiting in the amount of customization I could do while using it. With Porteus, I was spoilt for choices. If you head to the Porteus download page, you have a choice among KDE, LXQt, MATE of XFCE. I settled for MATE with the idea to get myself familiar with it. I knew it was based on Gnome2 and so I knew what to expect and find my workarounds when I get to customizing it.

My choice paid off well and in no time I had a functional Porteus setup up and running on my machine. Replacing the Slax I was praising just a moment ago. It booted off quickly, found my wifi and got me onto a nifty desktop in no time. I spent some time tweaking its look and feel, some cosmetic touch up here and there to make it look like this.

Screenshot.png

It has a good set of default applications, all familiar to me. So getting productive on this setup was not much of an issue.

Here are some more snapshots of my setup.

The iconset is Aw0ken and Gtk2 theme is Siva Flat. Most themes designed for GTK 2.x and GTK 3.x will work with MATE and so I headed to gnome-look.org to check out my options.

Finally I got to using Porteus the right way and learnt it by going back to basics and trying to understand how it all works. Both Slax or Porteus are excellent choices for Linux on a pen drive. Porteus brings some more flavors along with it so users like me can indulge in the environment they like best.