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......

Burning an ISO Image File with K3b

To burn an ISO Image File, you can use k3b, beside Nautilus File Manager. With k3b, you can check MD5SUM directly. To do this, follow these steps below.

To burn an ISO Image file to CD :

1. Insert a blank CD disc.
2. Open k3b with choose Menu Applications -> Sound & Video -> K3b.

3. Choose menu Tools -> Burn CD Image... -> until windows "Burn CD Image -
K3b" opened. On option Image to Burn -> choose : an ISO Image file, Speed
(better 24x), and Copies = 1 (depend on) -> Start.
4. Wait until process done.

To burn an ISO Image file to DVD :
1. Insert a blank DVD disc.
2. Open k3b with choose Menu Applications -> Sound & Video -> K3b.
3. Choose menu Tools -> Burn DVD ISO Image... -> until window "Burn
Iso9660 Image -K3b" opened. On option Image to Burn -> choose : an ISO
Image file, Speed (better 24x), and Copies = 1 (depend on) -> Start.
4. Wait until process done.

K3b can use to create ISO Image file.
by. msmunir@batan.go.id
Read More......

Viewing Open Port on openSUSE 11.0

[msmunir@msmunir1 ~]$ nmap 202.46.3.76

Starting Nmap 4.53 ( http://insecure.org ) at 2009-01-24 06:56 WIT
Interesting ports on 202.46.3.76:
Not shown: 1713 filtered ports
PORT STATE SERVICE
22/tcp open ssh

Nmap done: 1 IP address (1 host up) scanned in 58.661 seconds
[msmunir@msmunir1 ~]$ nmap 202.46.3.76

After port 80 is opened :

[msmunir@msmunir1 ~]$ nmap 202.46.3.76


Starting Nmap 4.53 ( http://insecure.org ) at 2009-01-24 13:28 WIT
Interesting ports on 202.46.3.76:
Not shown: 1712 filtered ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http

Nmap done: 1 IP address (1 host up) scanned in 29.024 seconds
[msmunir@msmunir1 ~]$

Tip to open port 80

[msmunir@msmunir1 ~]$ ssh msmunir@202.46.3.76
Last login: Sat Jan 24 11:47:39 2009 from 125.160.102.43
Have a lot of fun...
msmunir@linux-3ilu:~> yast
-bash: yast: command not found
msmunir@linux-3ilu:~> su -
Password:
linux-3ilu:~ # yast

Command sequences after YaST2 Control Center show up:

yast -> Security and users -> Firewall -> Allowed Services -> Advanced... -> TCP Ports = 80 -> OK
-> Next -> Finish -> Quit

Note : Use TAB to move between option.
by. msmunir@batan.go.id
Read More......

XAMPP for Web, Database & FTP Server

Beside use Apache, PHP, MySQL dan FTP Server bundle with Linux Operating System, you can install XAMPP. XAMMP Installation in 4 Steps :


Step 1: Download
Step 2: Installation

Step 3: Start
Step 4: Test


Step #1: Download (54 MB)
Try to use linux command line to download XAMMP. First you must copy teh exact location of
XAMMP Packet.
# wget -dc http://www.apachefriends.org/download.php?xampp-linux-1.7.tar.gz

Step #2: Installation

# tar xvfz xampp-linux-1.7.tar.gz -C /opt

XAMPP is now installed below the /opt/lampp directory.

Note :
Prompt # mean you must be root. Prompt $ mean, you as a regular user.

Step #3: Start
To start XAMPP simply call this command:

# /opt/lampp/lampp start

You should now see something like this on your screen:

Starting XAMPP 1.7...
LAMPP: Starting Apache...
LAMPP: Starting MySQL...
LAMPP started.

Ready. Apache and MySQL are running.

If you get any error messages please take a look at the Linux FAQ.

Step #4: Test
OK, that was easy but how can you check that everything really works? Just type in the following
URL at your favourite web browser:

http://localhost

Now you should see the start page of XAMPP containing some links to check the status of the
installed software and some small programming examples.

I tried this on openSUSE 11.0.

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

SSH without Password

Generally, every time you connect with ssh (secure shell) to a remote computer, you will be directed to fill out the password. You must enter your password on the remote computer. See description below :


[
msmunir@msmunir1 ~]$ ssh msmunir@202.46.3.xx
msmunir@202.46.3.xx's password:
Last login: Thu Jan 15 10:20:52 2009 from 202.46.3.yy
msmunir@serpong5:~ #


In fact, you can connect to a remote computer without a password. Because basically the remote computer is able to remember your password. The question is how is the remote computer is able to remember the password?

To do all this, you must create a key pair or key pairing. These keys will be placed on both site, your local computer and your remote computer. But you must remember your password on both computers must be the same.

Step #1 : make key pairing on local computer

[msmunir@msmunir1 ~]$ cd .ssh/
[msmunir@msmunir1 .ssh]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/msmunir/.ssh/id_rsa):
/home/msmunir/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/msmunir/.ssh/id_rsa.
Your public key has been saved in /home/msmunir/.ssh/id_rsa.pub.
The key fingerprint is:
13:9b:eb:a4:41:5e:28:46:3c:0a:f1:d3:34:da:6a:8d msmunir@msmunir1.batan.go.id
The key's randomart image is:
+--[ RSA 2048]----+
|. o |
| o * . |
|. + * . |
| . B . . + |
| E + o S |
| . . + . o |
| o o |
| = |
| . . |
+-----------------+
[msmunir@msmunir1 .ssh]$

Step #2 : Check out the content of id_ras.pub file

[msmunir@msmunir1 .ssh]$ more id_rsa.pub
ssh-rsa
AAAAB3NzaC1yc2EAAAABIwAAAQEA1nqwTFg3IoUoUdyAQ65R+26ipEX42L7C3NcBcYEEtY78
lT/qeSaPIPGyfiMXCOeGtghQ12Msrflott+AblAxizERwvNPjeI0DcxSXTbE15R7M5SjOSSKz1wCIyBi
IK5Bi5iIY36K3wqoGSfkekcbtGQKbf+vftwtlsTdrXVO0WMPxoTwJBNGxgljT45JaGyM7KiZpWMFTPBo
jGOiMJY6xV416ZnFlxpKUIMyoKvlysefxI3bw2LnbcDswadpYJInGfqp9pywaMPoA976C43dkmimTLfs
juTFHWSlv8AS4QWuMFev72y9vGVoZ21Fc0dSE3WJ7ovT7d14G6Tf75tBrw==
msmunir@msmunir1.ba
tan.go.id
[msmunir@msmunir1 .ssh]$

Step #3 : Export key (id_rsa.pub file) to remote computer

On remote computer use othername, like id_rsa.pub.lenovo. Use SCP command line to copy
between to host.

[msmunir@msmunir1 .ssh]$ scp id_rsa.pub msmunir@202.46.3.xx:/home/msmunir/id_rsa.pub.lenovo
Password:
id_rsa.pub 100% 410 0.4KB/s 00:00
[msmunir@msmunir1 .ssh]$

Step #4 : Try to connect to remote computer with SSH

[msmunir@msmunir1 .ssh]$ ssh msmunir@202.46.3.xx
Password:
Last login: Sat Jan 24 10:15:08 2009 from 125.160.111.198
Have a lot of fun...
msmunir@linux-3ilu:~> ls
bin Desktop Documents id_rsa.pub.lenovo public_html
msmunir@linux-3ilu:~>

Step #5 : Check the directory of .ssh. If doesn't exist, create it with SSH to other computer.

msmunir@linux-3ilu:~> ssh msmunir@202.46.3.yy
The authenticity of host '202.46.3.yy (202.46.3.yy)' can't be established.
RSA key fingerprint is d9:ca:72:a0:f9:5e:ab:1b:f7:ab:40:0e:b5:44:b0:2a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '202.46.3.yy' (RSA) to the list of known hosts.
msmunir@202.46.3.yy's password:
Last login: Fri Jan 23 05:02:43 2009 from 125.160.106.131
[msmunir@ppin-msmunir2 ~]$

Don't forget to exit

[msmunir@ppin-msmunir2 ~]$ exit
Connection to 202.46.3.yy closed.
msmunir@linux-3ilu:~>

Step #6 : Copy id_ras.pub to directory .ssh with othername, such as authorized_keys

msmunir@linux-3ilu:~> ls
bin Desktop Documents id_rsa.pub id_rsa.pub.lenovo public_html
msmunir@linux-3ilu:~> cp id_rsa.pub.lenovo /home/msmunir/.ssh/authorized_keys
msmunir@linux-3ilu:~> cd .ssh/
msmunir@linux-3ilu:~/.ssh> ls -l
total 8
-rwxr-xr-x 1 msmunir users 410 2009-01-24 10:29 authorized_keys
-rw-r--r-- 1 msmunir users 393 2009-01-24 10:26 known_hosts
msmunir@linux-3ilu:~/.ssh> exit
logout
Connection to 202.46.3.xx closed.
[msmunir@msmunir1 .ssh]$

Step #7 : Test SSH to remote computer

[msmunir@msmunir1 .ssh]$ ssh msmunir@202.46.3.xx
Last login: Sat Jan 24 10:25:45 2009 from 125.160.102.43
Have a lot of fun...
msmunir@linux-3ilu:~>

It's works.
by. msmunir@batan.go.id
Read More......

Managing Buffalo TeraStation Pro with mc

To copy or move file or directory on Buffalo TeraStation Pro (External Network Storage), you can use mc utility. mc utility is utility under Linux system. For instance, you want to move folder YouTube from folder /array1/VOL1/download/YouTube/ to /array1/VOL1/Youtube/.


Assumption :
Buffalo TeraStation Pro use IP Address : 202.46.3.77.
Local computer use IP Address : 202.46.3.71

Follow this steps :


1.SSH to computer on same local area network.

Code :

$ssh msmunir@202.46.3.71

2.Open mc utility, make two windows.

Code :

$ mc

3.On menu "Left" choose sub menu "FTP link..." than write down "admin@202.46.3.77"

4.On menu "Right" choose sub menu "FTP link..." than write down "admin@202.46.3.77"

To move between windows, you can use Tab button.

5.On left windows, choose folder /array1/VOL1/download/

6.On right windows, choose folder /array1/VOL1/

7.On left windows, mark folder Youtube than press F6 button. It's mean move or RenMov (rename or move). See bottom menu

8.Let's eveything done.

To open folder on Buffalo TeraStation Pro, use web browser and write at address bar :
ftp://202.46.3.77/
by. msmunir@batan.go.id
Read More......

Secure Shell on Linux System

A few years ago, telnet has used to connect with remote host or PC on another place. This utility or protocol didn't secure yet. Because the message that you sent did't encripted. Right now, linuxer use another protocol, such as SSH (secure shell). But, to connect with cisco router and other devices, peoples still use telnet. Telnet never die.

To use SSH, you must sure, SSH installed on both sides, local and remote computer. On remote computer, you need SSH server. And on local computer, you need SSH Client. To access remote computer with SSH from local computer, follow this syntax :



Code :
$ ssh user_name@ip_address

where user_name replace with your username on remote computer, and ip_address replace with IP Address on remote computer too.

Example :
[msmunir@msmunir1 ~]$ ssh nhc@202.46.3.75
nhc@202.46.3.75's password: *******
Last login: Mon Jan 12 13:51:04 2009 from 202.46.3.71
[nhc@psjumat4 ~]$

To disconnect from remote computer, just write "exit" than Enter.

[nhc@psjumat4 ~]$ exit
logout
Connection to 202.46.3.75 closed.
[msmunir@msmunir1 ~]$
by. msmunir@batan.go.id
Read More......

Secure Copy on Linux System

Beside SSH, every linux is completed with scp or secure copy. Secure copy use to transfer between local and remote computer. Local computer can send a file/s or a directory/s to remote computer and vice versa. To understand how scp work, assume :

Local computer
Name : PC-1
IP : 192.168.1.86 (Private IP)
Username : msmunir
Passwrod : *******

Remote computer
Name : PC-2
IP : 202.46.2.222 (Public IP)
Username : msmunir
Password : ******

Case #1 : PC-1 send a file to PC-2

Code :
$ scp local_file user@remote_host:remote_folder

Case #2 : PC-1 send a folder to PC-2

Code :
$ scp -r local_folder user@remote_host:remote_folder

Case #3 : PC-1 receive a file from PC-2

Code :
$ scp user@remote_host:remote_folder local_folder

Case #4 : PC-1 receive a folder from PC-2

Code :
$ scp -r user@remote_host:remote_folder local_folder

Examples : (All commands are executed from PC-1)

Case #1 : PC-1 send a file to PC-2

[msmunir@msmunir1 ~]$ cd Desktop/
[msmunir@msmunir1 Desktop]$ cd mp3
[msmunir@msmunir1 mp3]$ pwd
/home/msmunir/Desktop/mp3
[msmunir@msmunir1 mp3]$ scp kool_and_the_gang-cherish.mp3
msmunir@202.46.2.222:/home/msmunir/
kool_and_the_gang-cherish.mp3 100% 3772KB 12.7KB/s
04:56
[msmunir@msmunir1 mp3]$

Case #2 : PC-1 send a folder to PC-2

[msmunir@msmunir1 ~]$ scp -r /home/msmunir/Desktop/mp3/ msmunir@202.46.2.222:/home/
msmunir/mp3/
Christopher_Cross-Arthur's_Theme_(Best_That_You_Can_Do).mp3 100%
3640KB 12.9KB/s 04:42
Aerosmith-I_Dont_Want_To_Miss.mp3 100% 4674KB 12.3KB/s
06:20
[msmunir@msmunir1 ~]$

Case #3 : PC-1 receive a file from PC-2

[msmunir@msmunir1 ~]$ scp msmunir@202.46.2.222:/home/msmunir/mp3/Human_Nature-
Eternal_Flame.mp3 /home/msmunir/Desktop/
Human_Nature-Eternal_Flame.mp3 100% 896KB 40.7KB/s
00:22
[msmunir@msmunir1 ~]$

Case #4 : PC-1 receive a folder from PC-2

[msmunir@msmunir1 ~]$ scp -r msmunir@202.46.2.222:/home/msmunir/mp3/
/home/msmunir/mp3/
Human_Nature-Eternal_Flame.mp3 100% 896KB 42.7KB/s
00:21
Christopher_Cross-Arthur's_Theme_(Best_That_You_Can_Do).mp3 100%
3080KB 42.8KB/s 01:12
[msmunir@msmunir1 ~]$
by. msmunir@batan.go.id
Read More......

Monday, January 19, 2009

ISO image file validation with MD5SUM on Linux

Suppose you have an ISO image file. Validation is needed to make sure, your ISO image file in good condition or broken. To do this, you need a file, what we call it a "MD5SUM text file". Therefore, don't forget to download it too. To validate, please use this sintax below.

Code :

$ md5sum -c

Example :

First, check the file you need to validate and its MD5SUM file.

[msmunir@msmunir1 mandriva-one-2009-gnome]$ ls -l

total 621477

-rwxrwxrwx 1 root root 636389376 2008-10-17 07:57 mandriva-linux-one-2009-GNOME-int-cdrom-i586.iso

-rwxrwxrwx 1 root root 83 2008-10-26 16:51 MD5SUM-mandriva-linux-one-2009-GNOME-int-cdrom-i586.txt

[msmunir@msmunir1 mandriva-one-2009-gnome]$

Second, compare the ISO image file with MD5SUM file.

[msmunir@msmunir1 mandriva-one-2009-gnome]$ md5sum -c MD5SUM-mandriva-linux-one-2009-GNOME-int-cdrom-i586.txt


mandriva-linux-one-2009-GNOME-int-cdrom-i586.iso: OK

[msmunir@msmunir1 mandriva-one-2009-gnome]$


If the result is OK, it's mean your ISO image file in good condition and ready to burn.

The contents of the MD5SUM text file approximately as follows
73d2f33449af91e3af6cbe10b6a0c6cd mandriva-linux-one-2009-GNOME-int-cdrom-i586.iso

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

Saturday, January 17, 2009

Estimate disk usage of each folder on a Linux System

To estimate disk usage of each directory, you can use a command line such as du with a particular option. This tool is used when you feel something uncomfortable with your hard disk capacity. Or you want to know, which folder (or sub folder) that make your hard disk becomes full.

Code :
# du --max-depth=1 -h

Example :
[root@msmunir1 /]# du --max-depth=1 -h
8,5M ./root
15M ./sbin
76M ./opt
145M ./lib
4,3M ./repo
6,6M ./bin
du: cannot access `./proc/5822/task/5822/fd/4': No such file or directory
du: cannot access `./proc/5822/task/5822/fdinfo/4': No such file or directory
du: cannot access `./proc/5822/fd/4': No such file or directory
du: cannot access `./proc/5822/fdinfo/4': No such file or directory
0 ./proc
20K ./lost+found
4,0K ./srv
280K ./tmp
6,0G ./var
4,0K ./mnt
1,2G ./etc
13M ./boot
du: cannot access `./home/msmunir/.gvfs': Permission denied
9,0G ./home
0 ./sys
4,0K ./media
3,0G ./usr
4,0K ./selinux
100K ./dev
20G .
[root@msmunir1 /]#

From information above, you see, folder /home used 9.0 GB, folder /var used 6.0 GB, folder /usr used 3.0 GB, folder /etc used 1.2 GB, and etc.

“--max-depth=1” option, only first level from current directory will be shown. Therefor, it's better, if you use root account and from root directory.

This is screen display, when you don't use “-h” option. “h” mean human readable.

[root@msmunir1 /]# du --max-depth=1
8672 ./root
14492 ./sbin
77788 ./opt
147496 ./lib
4336 ./repo
6700 ./bin
du: cannot access `./proc/6749/task/6749/fd/4': No such file or directory
du: cannot access `./proc/6749/task/6749/fdinfo/4': No such file or directory
du: cannot access `./proc/6749/fd/4': No such file or directory
du: cannot access `./proc/6749/fdinfo/4': No such file or directory
0 ./proc
20 ./lost+found
4 ./srv
280 ./tmp
6217808 ./var
4 ./mnt
1258100 ./etc
13243 ./boot
du: cannot access `./home/msmunir/.gvfs': Permission denied
9415880 ./home
0 ./sys
4 ./media
3082848 ./usr
4 ./selinux
100 ./dev
20247787 .
[root@msmunir1 /]#

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

Friday, January 16, 2009

Scanning IP Address with nmap

Nmap or network mapper is linux utility based on command line. For me, this network tool is very usefull to explore my network status. Nmap usually is used by network admin, network security tester (Pen-test) and others. Please do not use to do something bad.

To know the number of alive computers in your Local Area Network :

Code :
# nmap -sP 192.168.1.0/24
or
# nmap -sP 192.168.1.*

Example :
[root@msmunir1 ~]# nmap -sP 192.168.1.*

Starting Nmap 4.53 ( http://insecure.org ) at 2009-01-16 04:38 WIT
Host 192.168.1.1 appears to be up.
MAC Address: 00:1E:40:B3:55:E9 (Shanghai DareGlobal Technologies Co.)
Host 192.168.1.2 appears to be up.
MAC Address: 00:02:6F:4A:14:06 (Senao International Co.)
Host 192.168.1.86 appears to be up.
Nmap done: 256 IP addresses (3 hosts up) scanned in 11.256 seconds
[root@msmunir1 ~]#

You see above, the number of host alive = 3 hosts up

To know the TCP ports status (open, closed or filtered) use in a computer :

Code :
# nmap -sS 192.168.1.1

Example :
[root@msmunir1 ~]# nmap -sS 192.168.1.1

Starting Nmap 4.53 ( http://insecure.org ) at 2009-01-16 04:40 WIT
Interesting ports on 192.168.1.1:
Not shown: 1711 closed ports
PORT STATE SERVICE
21/tcp open ftp
23/tcp open telnet
80/tcp open http
MAC Address: 00:1E:40:B3:55:E9 (Shanghai DareGlobal Technologies Co.)

Nmap done: 1 IP address (1 host up) scanned in 6.594 seconds
[root@msmunir1 ~]#

To know the UDP ports status (open, closed or filtered) use in a computer :

Code :
# nmap -sU 192.168.1.1

Example :
[root@msmunir1 ~]# nmap -sU 192.168.1.2

Starting Nmap 4.53 ( http://insecure.org ) at 2009-01-16 04:43 WIT
Interesting ports on 192.168.1.2:
Not shown: 1487 closed ports
PORT STATE SERVICE
69/udp open|filtered tftp
MAC Address: 00:02:6F:4A:14:06 (Senao International Co.)

Nmap done: 1 IP address (1 host up) scanned in 6.637 seconds
[root@msmunir1 ~]#

Other command :
# nmap -v -sS -sV -O -v
or
# nmap -v -sS -sV -O -v

Options :
-O = guess remote operating system
-sV = version scan = probes open ports determining service & app names/versions
-sS = TCP SYN stealth port scan (default if privileged (root))
-sU = UDP port scan
-v = verbose, use twice for greater effect
by.msmunir@batan.go.id
Read More......

Determining Hard Disk Space on Linux

The df (i.e. disk free) linux command line is used to displays information about your hard disks or your mount devices, such as the amount of available disk space.

Code :
$ df -h

Example :
[msmunir@msmunir1 ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
54G 20G 32G 39% /
/dev/sda1 190M 19M 162M 11% /boot
tmpfs 247M 48K 247M 1% /dev/shm
gvfs-fuse-daemon 54G 20G 32G 39% /home/msmunir/.gvfs
/dev/sdb1 7,5G 6,1G 1,5G 82% /media/MSMUNIR8
/dev/sdc1 150G 90G 60G 60% /media/MSMUNIR7
[msmunir@msmunir1 ~]$

Explanation :
Device /dev/mapper/VolGroup00-LogVol00 is my local hard disk. It has capacity around 60 GB.
Device /dev/sdb1 is my USB flashdrive. It has capacity around 8 GB.
Device /dev/sdc1 is my external hard disk. It has capacity around 160 GB.

Explore others related tool : du, ls, find
by.msmunir@batan.go.id
Read More......

Thursday, January 15, 2009

Determining RAM memory size and type on Linux

Sometime, you need to know about RAM memory size and type, number of RAM memory slots and capasity of every slot. This information is needed when you want to increase your RAM memory. Right now, too many RAM memory size, RAM memory type and memory clock rate in market. Memory type such as SoDIMM, DDR, DDR2, DDR3, SDRAM, etc (see http://home.pacbell.net/dbk4297/memory_what_kind.html)

Without open your computer casing, you can get detail information about your RAM memory. On Linux, you can use command line "dmidecode". And with special option, you can analyze information more easy.

Code :
# dmidecode --type memory

Example with Laptop Lenovo 3000 v100 :

[root@msmunir1 ~]# dmidecode --type memory
# dmidecode 2.9
SMBIOS 2.4 present.

Handle 0x0010, DMI type 16, 15 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: None
Maximum Capacity: 2 GB
Error Information Handle: Not Provided
Number Of Devices: 2

Handle 0x0011, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0010
Error Information Handle: No Error
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: SODIMM
Set: 1
Locator: M1
Bank Locator: Bank 0
Type: DDR2
Type Detail: Synchronous
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified

Handle 0x0012, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0010
Error Information Handle: No Error
Total Width: 32 bits
Data Width: 32 bits
Size: 512 MB
Form Factor: SODIMM
Set: 1
Locator: M2
Bank Locator: Bank 1
Type: DDR2
Type Detail: Synchronous
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified

[root@msmunir1 ~]#

In this example above, you will see :
Number of RAM Slot : 2
Number of slot used : 1 (on slot M2 or second slot)
Size of RAM memory : 512 MB
Type of RAM memory : SODIMM

Correlation between speed and type of RAM Memory :
133 Mhz = PC-133
333 Mhz = PC-2700
400 Mhz = PC-3200
533 Mhz = PC-4200
667 Mhz = PC-5300
800 Mhz = PC-6400

Type of RAM Memory :
DDR Memory for PC
SDRAM Memory for PC
DDR2 Memory for PC
SO-DIMM Memory for Notebook
SO-DIMM SDRAM for Notebook
DDR Memory for Server
SDRAM Memory for Server
DDR2 Memory for Server
FB DIMM DDR2 for Server

Capacity of RAM Memory : 128 MB, 256 MB, 512 MB, 1 GB, 2 GB
(Visit www.v-gen.web.id)
by.msmunir@batan.go.id
Read More......