Sunday, January 25, 2009

Ripping CD Audio to become MP3 from Terminal

To do this, you just need 2 steps, ripping and decoding. Ripping is doing a conversion of CD Audio into WAV Files. Encoding is doing a conversion of WAV Files into MP3, OGG or FLAC files.



Packet that you need are :


1.cdparanoia-10.0-2.fc9.i386.rpm

2.lame-3.98.2-2.fc9.i386.rpm


1. Install CDPARANOIA

For this situation, cdparanoia has been installed on my computer. To install, just run :

Code :

# yum install cdparanoia


2. Install LAME

Code :

# yum install lame


Example :

[root@msmunir1 ~]# yum install lame

Loaded plugins: refresh-packagekit

Setting up Install Process

Parsing package install arguments

Resolving Dependencies

--> Running transaction check

---> Package lame.i386 0:3.98.2-2.fc9 set to be updated

--> Finished Dependency Resolution


Dependencies Resolved


==============================================================================
Package Arch Version Repository Size
==============================================================================
Installing:

lame i386 3.98.2-2.fc9 rpmfusion-free-updates 138 k


Transaction Summary

==============================================================================
Install 1 Package(s)

Update 0 Package(s)

Remove 0 Package(s)


Total download size: 138 k

Is this ok [y/N]: y

Downloading Packages:

lame-3.98.2-2.fc9.i386.rpm | 138 kB 00:10

==================================== Entering rpm code =======================

Running rpm_check_debug

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : lame 1/1

=================================== Leaving rpm code =========================

Installed:

lame.i386 0:3.98.2-2.fc9

Complete!

[root@msmunir1 ~]#


3. Insert CD Audio and check it

Code :

# cdparanoia -vsQ


Example :

[root@msmunir1 ~]# cdparanoia -vsQ

cdparanoia III release 10.0 (June 10, 2008)


Checking /dev/cdrom for cdrom...

Testing /dev/cdrom for SCSI/MMC interface

SG_IO device: /dev/sr0

CDROM model sensed sensed: HL-DT-ST RW/DVD GCC-4244N 1.00


Checking for SCSI emulation...

Drive is ATAPI (using SG_IO host adaptor emulation)

Checking for MMC style command set...

Drive is MMC style

DMA scatter/gather table entries: 1

table entry size: 131072 bytes

maximum theoretical transfer: 55 sectors

Setting default read size to 13 sectors (30576 bytes).


Verifying CDDA command set...

Expected command set reads OK.


Table of contents (audio tracks only):

track length begin copy pre ch

===========================================================

1. 14753 [03:16.53] 32 [00:00.32] no no 2

2. 20405 [04:32.05] 14785 [03:17.10] no no 2

3. 15830 [03:31.05] 35190 [07:49.15] no no 2

4. 10215 [02:16.15] 51020 [11:20.20] no no 2

5. 16350 [03:38.00] 61235 [13:36.35] no no 2

6. 19507 [04:20.07] 77585 [17:14.35] no no 2

7. 20608 [04:34.58] 97092 [21:34.42] no no 2

8. 9610 [02:08.10] 117700 [26:09.25] no no 2

9. 16487 [03:39.62] 127310 [28:17.35] no no 2

10. 12160 [02:42.10] 143797 [31:57.22] no no 2

11. 12888 [02:51.63] 155957 [34:39.32] no no 2

12. 15862 [03:31.37] 168845 [37:31.20] no no 2

TOTAL 184675 [41:02.25] (audio only)

[root@msmunir1 ~]#


4. Try to ripping one track, suppose track # 5

Code :

# cdparanoia -w -- "5" waltzing_back.wav

Example :

[root@msmunir1 ~]# cdparanoia -w -- "5" waltzing_back.wav

cdparanoia III release 10.0 (June 10, 2008)

Ripping from sector 61235 (track 5 [0:00.00])

to sector 77584 (track 5 [3:37.74])


outputting to waltzing_back.wav


(== PROGRESS == [ | 077584 00 ] == :^D * ==)


Done.

[root@msmunir1 ~]# ls -l

total 37680

-rw------- 1 root root 1972 2008-12-26 18:11 anaconda-ks.cfg

drwxr-xr-x 2 root root 4096 2008-12-26 12:51 Desktop

drwxr-xr-x 2 root root 4096 2008-12-26 12:51 Documents

drwxr-xr-x 2 root root 4096 2009-01-24 06:36 Download

-rw-r--r-- 1 root root 35394 2008-12-26 18:11 install.log

-rw-r--r-- 1 root root 5222 2008-12-26 18:10 install.log.syslog

drwxr-xr-x 2 root root 4096 2008-12-26 12:51 Music

drwxr-xr-x 2 root root 4096 2008-12-26 12:51 Pictures

drwxr-xr-x 2 root root 4096 2008-12-26 12:51 Public

drwxr-xr-x 2 root root 4096 2008-12-26 12:51 Templates

drwxr-xr-x 2 root root 4096 2008-12-26 12:51 Videos

-rw-r--r-- 1 root root 38455244 2009-01-24 20:45 waltzing_back.wav

[root@msmunir1 ~]#


Try to ripping all track :

Code :

# cdparanoia -B

Example :

[root@msmunir1 ~]# cdparanoia -B

cdparanoia III release 10.0 (June 10, 2008)

Ripping from sector 0 (track 0 [0:00.00])

to sector 184706 (track 12 [3:31.36])

outputting to track00.cdda.wav


(== PROGRESS == [ | 000031 00 ] == :^D * ==)


outputting to track01.cdda.wav

(== PROGRESS == [ | 014784 00 ] == :^D * ==)

outputting to track02.cdda.wav

(== PROGRESS == [ | 035189 00 ] == :^D * ==)

...

...

...

outputting to track12.cdda.wav

(== PROGRESS == [ | 184706 00 ] == :^D * ==)

Done.

[root@msmunir1 ~]# ls -l

total 462444

-rw------- 1 root root 1972 2008-12-26 18:11 anaconda-ks.cfg

drwxr-xr-x 2 root root 4096 2008-12-26 12:51 Desktop

drwxr-xr-x 2 root root 4096 2008-12-26 12:51 Documents

drwxr-xr-x 2 root root 4096 2009-01-24 06:36 Download

-rw-r--r-- 1 root root 35394 2008-12-26 18:11 install.log

-rw-r--r-- 1 root root 5222 2008-12-26 18:10 install.log.syslog

drwxr-xr-x 2 root root 4096 2008-12-26 12:51 Music

drwxr-xr-x 2 root root 4096 2008-12-26 12:51 Pictures

drwxr-xr-x 2 root root 4096 2008-12-26 12:51 Public

drwxr-xr-x 2 root root 4096 2008-12-26 12:51 Templates

-rw-r--r-- 1 root root 75308 2009-01-24 20:47 track00.cdda.wav

-rw-r--r-- 1 root root 34699100 2009-01-24 20:48 track01.cdda.wav

-rw-r--r-- 1 root root 47992604 2009-01-24 20:49 track02.cdda.wav

-rw-r--r-- 1 root root 37232204 2009-01-24 20:49 track03.cdda.wav

-rw-r--r-- 1 root root 24025724 2009-01-24 20:50 track04.cdda.wav

-rw-r--r-- 1 root root 38455244 2009-01-24 20:51 track05.cdda.wav

-rw-r--r-- 1 root root 45880508 2009-01-24 20:51 track06.cdda.wav

-rw-r--r-- 1 root root 48470060 2009-01-24 20:52 track07.cdda.wav

-rw-r--r-- 1 root root 22602764 2009-01-24 20:53 track08.cdda.wav

-rw-r--r-- 1 root root 38777468 2009-01-24 20:53 track09.cdda.wav

-rw-r--r-- 1 root root 28600364 2009-01-24 20:54 track10.cdda.wav

-rw-r--r-- 1 root root 30312620 2009-01-24 20:54 track11.cdda.wav

-rw-r--r-- 1 root root 37307468 2009-01-24 20:55 track12.cdda.wav

drwxr-xr-x 2 root root 4096 2008-12-26 12:51 Videos

-rw-r--r-- 1 root root 38455244 2009-01-24 20:45 waltzing_back.wav

[root@msmunir1 ~]#

The output of this ripping is WAV files. The size of this file is very big, around 40 MB until 70 MB. It's not efficient to save on your computer. Therefor, we need convert it to MP3 files.

5. Encoding to MP3 with LAME.

Code :

# lame track01.cdda.wav track01.mp3

Example :

[root@msmunir1 ~]# lame track01.cdda.wav track01.mp3

LAME 3.98.2 32bits (http://www.mp3dev.org/)

CPU features: MMX (ASM used), SSE (ASM used), SSE2

Using polyphase lowpass filter, transition band: 16538 Hz - 17071 Hz

Encoding track01.cdda.wav to track01.mp3

Encoding as 44.1 kHz j-stereo MPEG-1 Layer III (11x) 128 kbps qval=3

Frame | CPU time/estim | REAL time/estim | play/CPU | ETA

7532/7532 (100%)| 0:18/ 0:18| 0:19/ 0:19| 10.455x| 0:00

------------------------------------------------------------------------------
kbps LR MS % long switch short %

128.0 11.1 88.9 96.6 2.1 1.3

Writing LAME Tag...done

ReplayGain: -2.4dB

[root@msmunir1 ~]#


On this example, track01.cdda.wav convert to track01.mp3. If the command like this :

Code :

[root@msmunir1 ~]# lame track01.cdda.wav


The output file is track01.cdda.wav.mp3. If the command like this :

Code :

[root@msmunir1 ~]# lame track05.cdda.wav waltzing_black.mp3

The output file is waltzing_black.mp3.
Onfortunately, lame can not convert all WAV files to MP3 file at once. You must convert one by
one.
by. msmunir@batan.go.id
Read More......

Rename USB FlashDisk Label on Linux System

1. Install mtools packet
Code :
[root@msmunir1 ~]# yum install mtools
Loaded plugins: refresh-packagekit
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package mtools.i386 0:3.9.11-4.fc9 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================
Package Arch Version Repository Size
==============================================================================
Installing:
mtools i386 3.9.11-4.fc9 fedora 210 k

Transaction Summary
==============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 210 k
Is this ok [y/N]: y
Downloading Packages:
mtools-3.9.11-4.fc9.i386.rpm | 210 kB 00:04
============================== Entering rpm code =============================
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : mtools 1/1
=============================== Leaving rpm code =============================

Installed:
mtools.i386 0:3.9.11-4.fc9

Complete!
[root@msmunir1 ~]#

2. View device name of your USB FlashDisk
Code :
[root@msmunir1 ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
56443212 23057344 30518668 44% /
/dev/sda1 194442 18871 165532 11% /boot
tmpfs 252516 60 252456 1% /dev/shm
/dev/sdb1 7848956 4768636 3080320 61% /media/KINGSTON
[root@msmunir1 ~]#

3. Unmount your USB FlashDisk (/dev/sdb1)
Code :
[root@msmunir1 ~]# umount /dev/sdb1

4. Check old USB FlashDisk Label
Code :
[root@msmunir1 ~]# mlabel -i /dev/sdb1 -s ::
Volume label is KINGSTON
[root@msmunir1 ~]#

5. Change label from KINGSTON to MYFLASH
Code :
[root@msmunir1 ~]# mlabel -i /dev/sdb1 -s ::MYFLASH
Volume label is KINGSTON
[root@msmunir1 ~]#

Note :
No space between :: and MYFLASH

6. Check new USB FlashDisk label
Code :
[root@msmunir1 ~]# mlabel -i /dev/sdb1 -s ::
Volume label is MYFLASH
[root@msmunir1 ~]#

7. Unplug your USB FlashDisk directly, then plug again. See the label of your USB FlashDisk.

Code :
[root@msmunir1 ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
56443212 23023368 30552644 43% /
/dev/sda1 194442 18871 165532 11% /boot
tmpfs 252516 60 252456 1% /dev/shm
/dev/sdb1 7848956 4768636 3080320 61% /media/MYFLASH
[root@msmunir1 ~]#

by. msmunir@batan.go.id
Read More......

Mount Folder on Remote Computer with SSHFS

1. You must sure, on local computer and remote computer already have SSH.
2. Install SSHFS on local computer

Code :

# yum install sshfs


Example :

[root@msmunir1 ~]# yum install sshfs

Loaded plugins: refresh-packagekit

Setting up Install Process

Parsing package install arguments

Resolving Dependencies

--> Running transaction check

---> Package fuse-sshfs.i386 0:2.2-1.fc9 set to be updated

--> Finished Dependency Resolution


Dependencies Resolved



================================================================================================================
Package Arch Version Repository Size

================================================================================================================
Installing:

fuse-sshfs i386 2.2-1.fc9 updates-newkey 49 k


Transaction Summary

================================================================================================================
Install 1 Package(s)

Update 0 Package(s)

Remove 0 Package(s)


Total download size: 49 k

Is this ok [y/N]: y

Downloading Packages:

fuse-sshfs-2.2-1.fc9.i386.rpm | 49 kB 00:02

====================================================================== Entering rpm code
============================================
Running rpm_check_debug

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : fuse-sshfs 1/1

======================================================================= Leaving rpm code
===========================


Installed:

fuse-sshfs.i386 0:2.2-1.fc9


Complete!

[root@msmunir1 ~]#


3. Make sure, the fuse module already loaded on local computer. If did not, loaded with :

Code :

# modprobe fuse


Example :

[root@msmunir1 ~]# modprobe fuse


4. Chek the fuse module :

Code :

# lsmod


Example :

[root@msmunir1 ~]# lsmod

Module Size Used by

vfat 12672 1

fat 42912 1 vfat

usb_storage 86536 1

nf_conntrack_ftp 10660 0

nf_conntrack_irc 8868 0

xt_TCPMSS 7552 0

xt_owner 6400 0

xt_mac 5632 0

xt_length 5632 0

xt_state 5888 0

xt_limit 6020 0

xt_multiport 6784 0

xt_conntrack 7680 0

nf_conntrack 51424 4 nf_conntrack_ftp,nf_conntrack_irc,xt_state,xt_conntrack

ipt_ULOG 10632 0

ipt_ttl 5504 0

ipt_ecn 5760 0

ipt_REJECT 6656 0

ipt_LOG 8836 0

ipt_recent 10908 0

iptable_filter 6528 0

iptable_mangle 6656 0

ip_tables 13712 2 iptable_filter,iptable_mangle

x_tables 15236 15
xt_TCPMSS,xt_owner,xt_mac,xt_length,xt_state,xt_limit,xt_multiport,xt_conntrack,ipt_ULOG,ipt_
ttl,ipt_ecn,ipt_REJECT,ipt_LOG,ipt_recent,ip_tables

bridge 43668 0

stp 6148 1 bridge

bnep 14848 2

rfcomm 33936 4

l2cap 21504 16 bnep,rfcomm

vboxdrv 57856 0

fuse 49436 3

sunrpc 155924 3

cpufreq_ondemand 9868 2

acpi_cpufreq 12172 0

loop 17164 0

dm_multipath 17292 0

scsi_dh 9476 1 dm_multipath

ipv6 230260 30

snd_hda_intel 395800 4

snd_seq_dummy 6660 0

sr_mod 17064 0

cdrom 32664 1 sr_mod

snd_seq_oss 30364 0

snd_seq_midi_event 9600 1 snd_seq_oss

8139cp 21504 0

snd_seq 48320 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event

arc4 5760 2

snd_seq_device 9996 3 snd_seq_dummy,snd_seq_oss,snd_seq

ecb 6528 2

snd_pcm_oss 41600 0

firewire_ohci 22532 0

crypto_blkcipher 18052 1 ecb

sdhci_pci 10624 0

pata_acpi 7680 0

8139too 24708 0

snd_mixer_oss 16896 1 snd_pcm_oss

i915 86660 2

firewire_core 35616 1 firewire_ohci

video 20240 0

sdhci 17540 1 sdhci_pci

iwl3945 129756 0

output 6528 1 video

mii 8192 2 8139cp,8139too

mmc_core 43676 1 sdhci

ricoh_mmc 7552 0

rfkill 11288 2 iwl3945

ata_piix 24836 0

snd_pcm 64772 2 snd_hda_intel,snd_pcm_oss

crc_itu_t 5760 1 firewire_core

wmi 9640 0

drm 146404 3 i915

iTCO_wdt 13732 0

mac80211 173668 1 iwl3945

ata_generic 8452 0

i2c_i801 12048 0

i2c_algo_bit 8836 1 i915

iTCO_vendor_support 6916 1 iTCO_wdt

btusb 14360 2

snd_timer 21896 2 snd_seq,snd_pcm

i2c_core 21396 4 i915,drm,i2c_i801,i2c_algo_bit

joydev 12736 0

pcspkr 6272 0

bluetooth 48608 8 bnep,rfcomm,l2cap,btusb

serio_raw 8836 0

snd_page_alloc 11144 2 snd_hda_intel,snd_pcm

cfg80211 23816 2 iwl3945,mac80211

snd_hwdep 10372 1 snd_hda_intel

snd 51768 18 snd_hda_intel,snd_seq_dummy,snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_o
ss,snd_pcm,snd_timer,snd_hwdep

soundcore 9416 1 snd

sg 31028 0

dm_snapshot 19364 0

dm_zero 5632 0

dm_mirror 19968 0

dm_log 12164 1 dm_mirror

dm_mod 48692 10 dm_multipath,dm_snapshot,dm_zero,dm_mirror,dm_log

ahci 30604 2

libata 134892 4 pata_acpi,ata_piix,ata_generic,ahci

sd_mod 32408 5

scsi_mod 123772 6 usb_storage,scsi_dh,sr_mod,sg,libata,sd_mod

crc_t10dif 5632 1 sd_mod

ext3 109192 2

jbd 43284 1 ext3

mbcache 10244 1 ext3

uhci_hcd 23312 0

ohci_hcd 24336 0

ehci_hcd 32780 0

[root@msmunir1 ~]#



5. Create a folder on /media/remote directory.

Code :

# cd /media

# mkdir -p remote

Example :

[root@msmunir1 ~]# cd /media

[root@msmunir1 media]# mkdir -p remote


6. Run SSHFS to mount remote folder

Code :

# sshfs msmunir@202.46.3.71:/home/msmunir /media/remote


Example :

[root@msmunir1 media]# sshfs msmunir@202.46.3.71:/home/msmunir /media/remote

msmunir@202.46.3.71's password:

[root@msmunir1 media]#


7. Test your new folder

Code :

# df -h


Example :

[root@msmunir1 media]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/VolGroup00-LogVol00

54G 22G 30G 43% /

/dev/sda1 190M 19M 162M 11% /boot

tmpfs 247M 60K 247M 1% /dev/shm

/dev/sdb1 7,5G 4,6G 3,0G 61% /media/MSMUNIR8

msmunir@202.46.3.71:/home/msmunir

1000G 0 1000G 0% /media/remote

[root@msmunir1 media]#


Right now, you have new folder, /media/remote, where the content this folder is equal with the content of /home/msmunir folder on remote computer. This condition is very helpfull when you want to edit HTML or PHP script with gEdit.
by. msmunir@batan.go.id
Read More......

Bored with the look your MC's color?

MC (Midnite Commander) usually used as a file manager on Linux system. MC can be used both in the computer at the local and remote computer. Also, the MC can be used to transfer a file between two computers. You do not need to use ftp client, like gFTP.


To change the colors of your MC, edit the configuration file "ini" on folder /home/your_name/.mc/. To edit the file "ini", you can't use the mcedit editor, should use the vi editor. Basically, you just add 2 lines below to your the configuration file "ini".

Code :
[Colors]


base_color=gray,black:normal=yellow,black:menu=yellow,gray:viewunderline=balck,green:edi
tnormal=white,black:editmarked=black,white:menuhot=red,gray:directory=brightred,gray:exe
cutable=brightgreen,gray:device=white,gray:input=yellow,gray:link=brightcyan,gray:stalledlin
k=white,gray:reverse=brightmagenta,black:selected=black,yellow:marked=yellow,brown:mark
select=black,magenta

Code :

[msmunir@msmunir1 ~]$ pwd

/home/msmunir

[msmunir@msmunir1 ~]$ cd .mc

[msmunir@msmunir1 .mc]$ ls

cedit filepos history ini Tree

[msmunir@msmunir1 .mc]$

With vi editor, edit the configuration file "ini". Go to the last page.

Code :
[msmunir@msmunir1 .mc]$ vi ini

Example of MC "ini" configuration file after modification.

Code :
[Midnight-Commander]

show_backups=1

show_dot_files=1

verbose=1

mark_moves_down=1

pause_after_run=1

shell_patterns=1

...

...

[Misc]

ftpfs_password=anonymous@

ftp_proxy_host=gate

display_codepage=Other_8_bit

[Colors]

base_color=gray,black:normal=yellow,black:menu=yellow,gray:viewunderline=balck,green:edi
tnormal=white,black:editmarked=black,white:menuhot=red,gray:directory=brightred,gray:exe
cutable=brightgreen,gray:device=white,gray:input=yellow,gray:link=brightcyan,gray:stalledlin
k=white,gray:reverse=brightmagenta,black:selected=black,yellow:marked=yellow,brown:mark
select=black,magenta

[Panelize]

Find *.orig after patching=find . -name \*.orig -print

Find SUID and SGID programs=find . \( \( -perm -04000 -a -perm +011 \) -o \( -perm -02000 -a -
perm +01 \) \) -print

Find rejects after patching=find . -name \*.rej -print

by. msmunir@batan.go.id


Read More......

Running XAMMP Automatically on openSUSE 11.0

XAMPP is complete packet for Web, Database & FTP Server. Every time you star the computer, you must run XAMMP with manually with CLI "/opt/lampp/lampp start". How to make this running automatically every time you booting?. Follow these instruction:

1. Enter folder associated with your runlevel (GUI with network is runlevel5)


# cd /etc/init.d/rc5.d

if use runlevel3, change rc5 with rc3.

2. Type this comamnd line :

# ln -s /opt/lampp/lampp /etc/init.d/lampp

3. Check with yast -> System -> System Services (Runlevel) -> search lampp
service, if enable = No, change to Enable -> Finish -> Quit.

4. Please reboot your computer

# reboot

5. Test your web server with web browser and enter the address
http://localhost or http://ip_address


by. msmunir@batan.go.id

Read More......