Showing posts with label Tech Stuff. Show all posts
Showing posts with label Tech Stuff. Show all posts

Saturday, September 20, 2008

WMA to MP3 Script for Linux

I ran into a Rap artist who has his files as *.wma files for download.
So I created a bash/zenity script to convert those files to *.mp3s
#!/bin/bash
choice="`zenity --file-selection --directory --title="Select the directory with your wma files"`"
artist="`zenity --entry --title="Artist Name" --text="Enter Artist Name"`"
genre="`zenity --entry --title="Genre" --text="Enter Genre" --entry-text="Rap"`"
album="`zenity --entry --title="Album Name" --text="Enter Album Name"`"
year="$(zenity --entry --title="Album Year" --text="Enter Album Year" --entry-text="`date +%Y`")"


case $? in
0)
cd "$choice"
if [ $PWD = "$choice" ]; then
if [ ! -d 'workdir' ]; then
mkdir workdir
fi
if [ ! -d 'mp3s' ]; then
mkdir mp3s
fi
if [ ! -d 'wavs' ]; then
mkdir wavs
fi
zenity --info --text="This will take some time. Please be patient."

for file in *.wma
do cp "$file" ./workdir/`echo $file | sed -e 's/ */_/g' -e 's/[-]/_/g' -e 's/[.][.]//'`
done

cd workdir
for j in *.wma
do mplayer -quiet -vo null -vc dummy -af resample=44100 -ao pcm:waveheader:file=../wavs/`basename $j .wma`.wav $j &> /dev/null
done
for k in ../wavs/*.wav
do lame -b 192 $k ../mp3s/`basename $k .wav`.mp3 2>&1 | (zenity --progress --auto-close --pulsate --percentage=0 --text=`basename $k .wav`)
done
curdir=`basename $PWD`
if [ $curdir = 'workdir' ]; then

cd ../
count=`ls -1 mp3s/*mp3|wc -l`
#rm -fR workdir
#rm -fR wavs
cd mp3s
for l in *.mp3;do mp3info -a "$artist" -g "$genre" -l "$album" -y "$year" -n "$(echo $l|awk -F'_' '{print $1}')" -t "$(echo $l|sed -e 's/.._//' -e 's/.mp3//g' -e 's/[_]/ /g')" $l ;done
zenity --info --text=$count" files converted"

fi

cd
fi


;;
1)
zenity --error --text "No Directory Selected"
;;
-1)
zenity --error --text "No Directory Selected"
;;
esac






Needed packages:
  • zenity
  • mplayer (with windows codecs/etc)
  • lame
  • mp3info

Monday, March 3, 2008

Dell Vostro 1500 Triple Boot XP Media Direct

I just got a new Dell Vostro Here are the specs:
  • Vostro 1500, Intel Core 2 Duo T5470, 1.6GHz, 800Mhz FSB, 2M L2 Cache
  • 15.4 inch Wide Screen XGA LCD display with TrueLife for Vostro 1500
  • 2GB, DDR2, 667MHz 2 DIMM
  • 128MB NVIDIA GeForce 8400M GS (specifically chose this for better Linux compat)
  • 250GB Hard Drive, 5400RPM, SA160, for Dell Vostro 1500 Notebook
  • Genuine Windows XP Home Edition, SP2 (either this or Vista YUCK!)
  • Integrated 10/100 Network Cardand Modem, for Inspiron (Detected from Installer)
  • 8X DVD+/-RW with double-layer DVD+R write capability
  • Intel 4965AGN Wireless-N Mini card (specifically chosen for Linux Compat, we shall see)
  • No Built in Camera 1500 (trust me , you don't wanna see my ugly mug)
  • Dell Wireless 355 BlueTooth Module, (2.0+EDR) (have no idea why I chose this, besides cool factor)
  • Factory Enable 20GB Primary Partition (just to make it easier fer me)
I blew away the Windows XP and Dell Media Direct partition, but then I decided I wanted to play
with Dell Media Direct.
Sadly Dell Media Direct requires Windows XP to be installed.

So I booted with the Dell Media Direct disc. It gave me the option of using all the space on the harddisk or specify a size of the c:\ drive. I used the "use entire disk" option.
When the Dell Media Direct finished its process, it requested the XP install disc.
I ejected the Dell Media Direct disc and inserted the XP install disc and pressed enter.
After the looooong XP install, I put the Dell Media Disc back in so it can finish installing.

After the install I shutdown the machine and pressed the "Home" button and Dell Direct Media did its first time config and all was set. I exited out of Dell Direct Media and booted into Windows.

I installed Partition Magic (I was too lazy to download a Knoppix or Gnoppix disc image)
I shrunk the c: drive to a mere 20 GigaBytes. I rebooted and upon reboot Partition Magic did the drive shrink operation. After Partition Magic finished , I booted into Windows XP and all seemed well. I shutdown the machine and pressed the "Home" button and Dell media Direct worked.

I turned on the laptop and pressed 'F2" to get into the BIOS (this gave me time to insert the Ubuntu CD). I exited out of the BIOS and the machine booted with the Ubuntu Studio CD.

Network:
The installer did not detect my Intel Wireless Network card, so I connected the machine via ethernet to my network. It grabbed an IP off of my DHCP server and the install proceeded.

Disk Partition:
This is my partition scheme:
  • /dev/sda1 FAT16 47 MB for Dell Utility
  • /dev/sda2 NTFS 20 GB for Windows XP
  • /dev/sda4 EXT3 100 MB for /boot for Ubuntu Studio
  • /dev/sda3 extended
  • /dev/sda7 LVM 60 GB for Ubuntu Studio
  • /dev/sda5 FAT32 for Dell Media Direct (I suspect)
  • /dev/sda6 NTFS for Shared Data (the rest of the space of the drive)

Logical Volumes:

LV VG Attr LSize
homelv rootvg -wi-ao 4.00G
rootlv rootvg -wi-ao 10.00G
swaplv rootvg -wi-ao 4.00G
I am using logical volumes to I can move space around as needed.

The install went well and these are the minor issues I faced after installing:

NVIDIA Card:
By Default Ubuntu uses the opensource driver.
I enabled the NVidia Driver by going to:
System Menu then -->Administration-->Restricted Drivers Manager
I enabled the NVidia Driver it did its thing and I rebooted and all was well.

Sound Issue:
Sound was not working so I had to do :
sudo apt-get install linux-backports-modules-rt
I rebooted and sound worked

Wireless Network:
The Wireless Device was recognized from first boot.
I installed kwlan and was able to setup wireless networking.
Good thing I chose the Intel Wireless Device.

Extra Software:
I installed extra software by first installing AutoMatix

Obligatory Screenshot

Tuesday, February 26, 2008

Ubuntu Studio Install Dell Vostro 1500

I just got a new Dell Vostro Here are the specs:
  • Vostro 1500, Intel Core 2 Duo T5470, 1.6GHz, 800Mhz FSB, 2M L2 Cache
  • 15.4 inch Wide Screen XGA LCD display with TrueLife for Vostro 1500
  • 2GB, DDR2, 667MHz 2 DIMM
  • 128MB NVIDIA GeForce 8400M GS (specifically chose this for better Linux compat)
  • 250GB Hard Drive, 5400RPM, SA160, for Dell Vostro 1500 Notebook
  • Genuine Windows XP Home Edition, SP2 (either this or Vista YUCK!)
  • Integrated 10/100 Network Cardand Modem, for Inspiron (Detected from Installer)
  • 8X DVD+/-RW with double-layer DVD+R write capability
  • Intel 4965AGN Wireless-N Mini card (specifically chosen for Linux Compat, we shall see)
  • No Built in Camera 1500 (trust me , you don't wanna see my ugly mug)
  • Dell Wireless 355 BlueTooth Module, (2.0+EDR) (have no idea why I chose this, besides cool factor)
  • Factory Enable 20GB Primary Partition (just to make it easier fer me)
I had an Ubuntu 7.04 alternate install CD lying around so I decided to use that , 'cause I'm too impatient to wait for a new CD download.

I booted and installed a "Command Line" install
after I installed and booted into the OS,
I followed the steps from This Article
After the upgrade finished and I rebooted I then started to install the Ubuntu Studio stuff as directed in these Instructions.

So far everything has installed without a hitch, yet the night is far from over ..

NVIDIA Card:
By Default Ubuntu uses the opensource driver.
I enabled the NVidia Driver by going to:
System Menu then -->Administration-->Restricted Drivers Manager
I enabled the NVidia Driver it did its thing and I rebooted and all was well (exccept for the Ubuntu Studio Splash lookin' kinda fuzzy).

Sound Issue:
Sound was not working so I had to do :
sudo apt-get install linux-backports-modules-rt
I rebooted and sound worked

Wireless Network:
The Wireless Device was recognized from first boot.
I installed kwlan and was able to setup wireless networking.
Good thing I chose the Intel Wireless Device.

Extra Software:
I installed extra software by first installing AutoMatix

Obligatory Screenshot

Wednesday, November 28, 2007

Simply Seth Update

Greetings brethren.
I have been quite busy doing nothing and everything.
I was involved with a youth event in Rochester and then another in Buffalo.
I'm still trying to build this program for a local barbershop.
I'm also quite busy with the House.

Rochester Housing Authority had me going back and forth with 3 inspections .. finally on the third inspection, I passed.
Just today I had to go back to submit paperwork and hopefully now they will leave me at peace and pay me my money.

I think of you guys often.
You guys are still very near and dear to my heart.
The many sided blessings that you brothers are to me, mere words cannot suffice.
I pray that all is well with you and your spouses (and future spouse for we know who).

What I wrote above was just the surface stuff.
Feel free to stop here.

What is going on beneath the surface.
Beneath the surface there is change going on.
With change there is uncertainty, doubts, new discoveries and a doing away with things.
There is brewing within me a seemingly insatiable desire for the word.
I long more and more to know intimately more about the object of my greatest affection.
The object of my greatest affection being the Lord Jesus the Christ.

I hunger to know about Him, to know Him and to know His word.
I am thankful that my new church does expository preaching (line by line explanation).
Its helped some and having my John MacArthur Study Bible also helps.
I've been learnin' some things and yet I have many questions.
This is one wild ride, exciting, frustrating and wonderful all in one.

I have a new relationship with sin as well.
Yep, I sure do.
The more I study the word of God the more I see how sinful and how needful of Christ I am.
Grace , sweet sweet grace. Grace is all the more sweeter when I see how how bad I am.

Well that is all for now.
Thanks for reading.
God bless you.

P.S.
Here are my projects:
http://hotgospel.net
http://gnomesalon.sourceforge.net