Thursday, May 29, 2008

BASH Playlist handler and mpg123 interface

My First "somewhat" USeful BASH script
This small script scans your / directory and generates a playlist of mp3 files, and you can play your file by ./juke . You will get a list of songs matching your criteria.

Installation
Copy the source code,given below, to a new file named juke


# apt-get install mpg123
$ chmod 755 juke
$ ./juke west


Sample output and Controls

arun@XiO3:~/bash$ ./juke happy
1 happy birthday
2 Avril Lavigne - My Happy Ending
3 07_-_Happy_Days_-_Happy_Days
4 manasinu marayilla
Enter song number [MAX 4]: 2
./juke: line 13: [: -g: binary operator expected
Playing /media/disk/Songs/English/avril lavigne/Avril Lavigne - My Happy Ending.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 0.67; written and copyright by Michael Hipp and others
free software (LGPL/GPL) without any warranty but with best wishes

Directory: /media/disk/Songs/English/avril lavigne/
Playing MPEG stream 1 of 1: Avril Lavigne - My Happy Ending.mp3 ...
Title: My Happy Ending Artist: Avril Lavigne
Comment: Album: Under My Skin
Year: 2004 Genre: Rock
MPEG 1.0, Layer: III, Freq: 44100, mode: Stereo, modext: 0, BPF : 626
Channels: 2, copyright: No, original: Yes, CRC: No, emphasis: 0.
Bitrate: 192 kbits/s Extension value: 0
Audio: 1:1 conversion, rate: 44100, encoding: signed 16 bit, channels: 2
Frame# 520 [ 8762], Time: 00:13.58 [03:48.88], RVA: off, Vol: 100(100)

-= terminal control keys =-
[s] or space bar interrupt/restart playback (i.e. 'pause')
[f] next track
[b] back to beginning of track
[p] pause while looping current sound chunk
[.] forward
[,] rewind
[:] fast forward
[;] fast rewind
[>] fine forward
[<] fine rewind
[+] volume up
[-] volume down
[r] RVA switch
[v] verbose switch
[h] this help
[q] quit



v1.2
Usage
./juke <keywords separated by , (comma)>
input indexes separated by space

Source

#!/bin/bash
if [ ! -e mp3list.txt ]; then
echo "Listing all mp3 on your / "
find / -name *.mp3 > mp3list.txt
fi

echo -n > tpl.tmp
i=1
while true; do
l=`echo $1, | cut -d"," -f$i`
let i=i+1
if [[ -z "$l" ]]; then
break
fi
`cat mp3list.txt | grep -i $l >> tpl.tmp`
done



sed = tpl.tmp | sed 'N;s/\n/\t/;s/\/.*\///g;s/.mp3//' | more # number lines and strip of directories and extensions.
line=1;
max=`wc -l tpl.tmp | cut -s -d" " -f1`
if [ ! "$max" -eq 0 ] && [ ! "$max" -eq 1 ]
then
echo -n "Enter song number [MAX $max]: ";
read line
elif [ "$max" -eq 0 ]; then
exit 0
fi

for i in `seq 1 10`;
do
l=`echo "$line 0" | cut -s -d" " -f$i`
echo "Playin : $l";
if [ -z "$l" ] || [ "$l" -le 0 ]; then
exit 0 #Exit here
fi

filename=`more +$l tpl.tmp | head -n 1`
#echo "$filename"
if [ "$l" -gt "$max" ]; then
echo "Out of bounds $max "
else echo "Playing $filename"
mpg123 -Cv "$filename"
fi

done

echo "OveR"; #doesnt reach


Updates
+ Added multiple search and concatenation
+ Queue more than one mp3

v1.1
Source


#!/bin/bash
# v 1.1
if [ ! -e mp3list.txt ]; then
echo "Listing all mp3 on your / "
find / -name *.mp3 > mp3list.txt
fi
`cat mp3list.txt | grep -i $1 > tpl.tmp`
sed = tpl.tmp | sed 'N;s/\n/\t/;s/\/.*\///g;s/.mp3//' | more # number lines and strip of directories and extensions.
max=`wc -l tpl.tmp | cut -d" " -f1`
if [ ! "$max" -eq 0 ] && [ ! "$max" -eq 1]
then
echo -n "Enter song number [MAX $max]: ";
read line
elif [ "$max" -eq 0 ]; then
exit 0
fi

filename=`more +$line tpl.tmp | head -n 1`

if [ $line -gt $max ]; then echo "Out of bounds $max "
else echo "Playing $filename"
mpg123 -Cv "$filename" -E like.eq
fi

echo "OveR";


Equalizer Sample like.eq

2.5 2.5
2.0 2.0
2.0 2.0
2.0 2.0
2.0 2.0
2.0 2.0
2.0 2.0
1.9 1.9
1.9 1.9
1.9 1.9
1.9 1.9
1.9 1.9
1.0 1.0
1.0 1.0
1.0 1.0
1.0 1.0
1.0 1.0
1.0 1.0
2.4 2.4
2.5 2.5
2.5 2.5
2.5 2.5
2.5 2.5
2.6 2.6
2.7 2.7
2.7 2.7
2.8 2.8
2.9 2.9
3.0 3.0
3.0 3.0


Updates


  • 1.1 :
    + Added equalizer file "like.eq"
    + Removed input if only 1 selection
    + Exits automatically if no matches

  • 1.0 : Everything new

Sunday, May 4, 2008

Win32.Vundo adware manual removal

Intro

This is yet another adware that spies your computer and should be removed!
The AOL Active Virus Shield license has expired and sadly AOL isn't continuing the service. So its left to me to defend my sys against the world of viruses trojans and adwares or in short all other malwares.

Win32.Vundo as experts call it,
Symptoms

  • Often get popups

  • Microsoft Internet Explorer: Work Offline , Cancel window even when not browsing


  • Strange tabs on Firefox like
    http://82.98.235.210/go//?cmp=nm_firefox_rn
    &uid=565E335C0FAF11DD8105F67908CFFFFF&rid=ggthnks
    &guid=3CF72C3808684EFABBDA369C4C32ABAF&affid=67908
    &lid=http&url=http:%2F%2Fwww.kitiyo.com%2F



Apparently this virus is a spy, it sends information on sites you are visiting to the suspicious IP address.

Removal
The virus resides in the famous folder %SYSTEM_ROOT%\system32 (,for example C:\windows\System32). There are so many files in this folder, so the makers find it easier to hide'em in the system32 folder.

As usually you would need the help of regedit to get rid of the virus.
run regedit and go to the usual location

HKLM\Software\Microsoft\Windows\CurrentVersion\Run

Check for any anomalies in names like wierd combination of letters which doesn't mean anything. The virus names itself randomly for example (jmmjqusl.dll) a combination of 8 letters. Look for the RunDll32.exe XXXXXXXX.dll,X.
Thats where the virus is and XXXXXXXX is its name.

  • Now navigate to the System32 folder rename the virus to something say DELETEME.

  • Reboot your system.

  • Now a popup must appearing saying Rundll32: Cannot find XXXXXXX.dll

  • Now goto the regedit as before and delete the entry.

  • Repeat for the same in RunOnce in regedit.
    HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce


Now you must be free.
:)

Delete this registry folder
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IProxyProvider
if it contains an entry to one of the malware dll. Don't know what it stands for, but its better to be deleted.

Waiting for more viruses ...

Someone do something about 82.98.235.210

Related Pages
Vundo Removal Tool