Tag Archives: files

Convert m4a files to mp3 with this script.

Some of my library was in m4a files, which I have problems to play, furthermore I prefer having everything in mp3 format.

So I wrote the following script:

echo "Dependencies: mplayer and lame"
if [ $# -lt 1 ]; then
	echo "Usage: sh m4a2mp3.sh '/path/to/files'"
else 
	echo "This could take sometime. Converting to 320kbps MP3 files..."
	sleep 1
	cd "$1"
	for i in *.m4a; do mplayer -ao pcm "$i" -ao pcm:file="$i.wav"; done
	for i in *.wav; do lame -h -b 320 "$i" "$i.mp3"; done
	echo "Cleaning the house..."
	rm -rf *.m4a
	rm -rf *.wav
fi
echo "All files converted. Thank you."

Usage is pretty straightforward:

sh m4a2mp3.sh /path/to/your/songs

The only dependencies, as you can see also in the script are mplayer and lame

You can install them with the following command:

# Yum based (Fedora, CentOS, SuSE)
yum install mplayer lame
# Apt based (Debian, Ubuntu, Mint) (NOT TESTED)
apt-get install mplayer lame

As always, you also can find the script on my Github.

How to unlock files on Windows 7

It may happen that you are running several applications writing/reading on several files, then for example, you want to delete one of those files and you cannot because file is being used.

On Linux systems it allows you to know which application is using it, and close it. With Windows 7 (and Windows XP) you need to use a third-party software called Unlocker.

Using Unlocker is quite easy. When it is installed, it appears as an option in your context menu, so you just have to right click on the file and select Unlocker

Unlocker
Unlocker

You can download Unlocker from here

Enable “delete key” on GNOME3 (Fedora 15 and Ubuntu 11.04)

By default, we can’t delete files in Nautilus 3 with delete key, as we did always, because it’s deactivated.

For  enable this on Fedora 15, go to terminal and write this down:

$ gsettings set org.gnome.desktop.interface can-change-accels true

Then go to a nautilus window, click on Edit menu and put the mouse over (don’t press, only hover) ”Delete” and press delete key. You will see the new shortcut at the right.

Once you’ve done it, I recommend to turn it off again:

$ gsettings set org.gnome.desktop.interface can-change-accels false

If you use ubuntu you can use dconf-editor. Press ALT+F2 and write dconf-editor and then follow this path: org > gnome > desktop > interface and check can-change-accels.

Then, do the same as in Fedora, but you may have to hit the key twice.

Don’t forget to uncheck the box for preventing changing other shortcuts.