Archive

Archive for September, 2007

SSH Error: Too Many Authentication Failures

September 25th, 2007 jesse No comments

If when attempting to log into a remote host via SSH you see the error message “Too many authentication failures” there is a problem on the connecting (client) side.

ssh logo

Typically it is because your SSH client has too many authentication types allowed (SSH v1, v2, GSS, etc.) Fix the problem by limiting SSH client options.

On Linux: Edit the file /etc/ssh/ssh_config and comment out the lines

# GSSAPIAuthentication yes
# GSSAPIDelegateCredentials no

On Windows: Check the config & preferences panels.

Problem solved.

Categories: Linux Misc Tags:

How to: Convert WMA to MP3 Audio

September 21st, 2007 jesse No comments

Here is a short BASH script for quickly and easily converting WMA files to MP3.

mplayer logo lame logo

As background, WMA and MP3 are container formats. Therefor, we first use mPlayer to extract the WAV audio content from he WMA file. Then we use lame to encode the WAV audio to mp3 format. The lame encoder has the added benefit of inserting the encoded audio into a proper MP3 file format

Here is the BASH script to convert WMA to MP3 audio formats.

#!/bin/bash
current_directory=$( pwd )

#remove spaces
for i in *.wma; do mv “$i” `echo $i | tr ‘ ‘ ‘_’`; done

#remove uppercase
for i in *.[Ww][Mm][Aa]; do mv “$i” `echo $i | tr ‘[A-Z]‘ ‘[a-z]‘`; done

#Rip with Mplayer / encode with LAME
for i in *.wma ; do mplayer -vo null -vc dummy -af resample=44100 -ao pcm -waveheader $i && lame -m s audiodump.wav -o $i; done

#convert file names
for i in *.wma; do mv “$i” “`basename “$i” .wma`.mp3″; done

rm audiodump.wav

Unfortunately, this process does not preserve any meta-information.

Here is a ruby script I wrote to do just that. It’s very basic and only writes v.1 tags. For v.2 tags use id3lib-ruby.

#!/usr/bin/ruby
require ‘wmainfo’

song = WmaInfo.new(ARGV[0])
mp3song = ARGV[0].gsub(/\.wma/,”.mp3″)

# Print what we found & make the mp3 tags
system(“mp3info”, “-a”, song.tags["AlbumArtist"], mp3song)
system(“mp3info”, “-g”, song.tags["Genre"] , mp3song)
system(“mp3info”, “-l”, song.tags["AlbumTitle"] , mp3song)
system(“mp3info”, “-y”, song.tags["Year"] , mp3song)
system(“mp3info”, “-n”, song.tags["TrackNumber"].to_s, mp3song)
system(“mp3info”, “-t”, song.tags["Title"] , mp3song)

 

References:

Categories: Linux Misc Tags: