Bash script: convert FLAC to MP3

Requirements

  • lame (sudo apt-get install lame)
  • flac (sudo apt-get install flac)
  • directory with flac files

Script



#!/bin/bash
flac -d *.flac
find -name "* *.wav" -type f | rename 's/ /_/g'
for i in $( ls -b *.wav ); do
  lame -hV0 $i
  rm $i
done
find -name "*.mp3" -type f | rename 's/_/ /g'


This script will decompress the flac files to wav files, remove any spaces in the file name, it will then convert the wavs to mp3 using lame's highest variable bitrate setting, then finally replace the underscores back to spaces.  If you don't want spaces in your file names, you can remove the last line.

To use the script, create a new file on your system, copy the contents of the script inside, give it executable properties (sudo chmod +x scriptname), then run it in the directory containing the flac files, (./scriptname) where scriptname is the name of your script.

Enjoy!

Prevent removed videos from disappearing on Youtube playlists

Playlists are a great feature in Youtube.  Unfortunately, if the video owner removes their video from Youtube, although you get a warning message from YouTube



You are left with an empty space in your playlist that gives you no clue as to what had been in that slot.



The work around is to use the Add / Edit notes feature of the playlist.




Click [Add / edit notes], and in the dialog that pops up, highlight and copy the name of the video, then paste that text into the text description.



Now click Save.  Now, if the owner of the video deletes the video, even though the title of that removed slot in your playlist will still say "[Deleted Video]", now your custom text will still be there, telling you the name of the video that was removed.  In most cases, you can find another copy of the same video and re-attach it to your playlist.  Problem solved!

Enjoy!

Get rid of Android keyboard notification

If you're running ICS or higher version of Android, you may have noticed something annoying happen every time you open your keyboard, a tiny keyboard notification pops up in your notification tray.  


"Surprise you're using your keyboard!  Oh you'd noticed, did you? Oh the giant keyboard taking up 1/3 of the screen was a clue, was it?  I see.  Well, do you wanna change keyboards?  No?  Are you sure?  Really?  Okay, well I'm just gonna sit here and take up space anyway."  --Keyboard Notification


If you tap the notification, it will give you a pop up titled "Choose input method" where you can select from your installed keyboards.  However, since you can change your keyboard anytime from the Settings menu, unless you are in the habit of changing your keyboard often, this has very little value to you.


How to get rid of the persistent keyboard notification



  1. Open your Settings menu, select Language and input.
  2. Next to each installed keyboard there should be a checkbox.  Uncheck every keyboard but the one you are currently using.
  3. The last checkbox should become greyed out when it is the only one left. 

Now when you open a keyboard, you should no longer see the keyboard notification.


Enjoy!