Wednesday, November 26, 2008

CLI Applications

Remembering those good old days when there are no GUI for us :-p I've collected several application to use in Linux/Unix terminal, without X-server. Maybe there are more, but I narrowed it down to only the most used :-)

  1. Internet Browser: lynx, links
  2. Email Client: mutt or alpine
  3. IM: centerim
  4. Torrent Client: libTorrent - rTorrent
  5. Document: antiword, catdoc, wvWare
  6. MP3: madplay
  7. FTP: lftp
  8. PDF Manipulator: pdftk

CCache

CCache (gentoo documentation)

ccache (see homepage here) is a fast compiler cache. When you compile a program, it will cache intermediate results so that, whenever you recompile the same program, the compilation time is greatly reduced. In common compilations this can result in 5 to 10 times faster compilation times.

# emerge ccache
# ccache -M 2G //only for 1st install
# nano -w /etc/make.conf
FEATURES="ccache"
CCACHE_SIZE="2G"
CCACHE_DIR="/var/temp/ccache"
# PATH="/usr/lib/ccache/bin:/opt/bin:${PATH}"

and to view ccache statistics, you can execute this command:
# CCACHE_DIR="/var/temp/ccache" ccache -s

Distribution Cross-Compiling

DistCC http://www.gentoo.org/doc/en/distcc.xml

1. Instal paket distcc

 # USE="gtk" emerge distcc

2. Edit file make.conf

 # nano -w /etc/make.conf
MAKEOPTS="-jn" -> n = (2 x CPU) + 1
FEATURES="distcc"

3. Setting host tempat proses akan dialihkan

 # /usr/bin/distcc-config --set-hosts "localhost host1 host2 ..."

4. Konfigurasi file distccd

 # nano /etc/conf.d/distccd
--allow [host1] [host2] -> IP PC yang diberi hak akses
--listen localhost -> PC yang bersangkutan
--log-file ...

5. Memasukkan link direktori distcc ke dalam default akses

 # export PATH="/usr/lib/ccache/bin: /usr/libdistcc/bin:${PATH}"

USB storage on Gentoo

USB Storage device on Gentoo:

1. Sebelum mem-plug usb device, sebaiknya cek dulu keberadaan device yg sudah ada di PC kita:
# cat /proc/partitions

   major minor   blocks  name
8 0 78150744 sda
8 1 104391 sda1
8 2 996030 sda2
8 3 52998435 sda3

2. Kemudian pasang usb device-nya, lalu cek dengan command 'dmesg' untuk memastikan bahwa device yang kita pasang sudah terdeteksi:
# dmesg | grep -i usb atau # dmesg

   scsi 2:0:0:0: Direct-Access     Kingston DT Elite HS 2.0  5.02 PQ: 0 ANSI: 0 CCS
SCSI device sdb: 2052607 512-byte hdwr sectors (1051 MB)
sdb: Write Protect is off
sdb: Mode Sense: 45 00 00 08
sdb: assuming drive cache: write through
SCSI device sdb: 2052607 512-byte hdwr sectors (1051 MB)
sdb: Write Protect is off
sdb: Mode Sense: 45 00 00 08
sdb: assuming drive cache: write through
sdb: sdb1 => menunjukkan partisi device ada di /dev/sdb1
sd 2:0:0:0: Attached scsi removable disk sdb => device baru terdeteksi sebagai /dev/sdb
sd 2:0:0:0: Attached scsi generic sg1 type 0
usb-storage: device scan complete

3. cek ulang dengan perintah berikut:
# cat /proc/partitions

   major minor   blocks  name
8 0 78150744 sda
8 1 104391 sda1
8 2 996030 sda2
8 3 52998435 sda3
8 16 1026303 sdb => sesuai dengan hasil dmesg
8 17 1025593 sdb1 => sesuai dengan hasil dmesg

6. membuat directory untuk mount device tsb:
# mkdir /mnt/usbdrive

7. mount device baru ke directory yang baru dibuat:
# mount /dev/sdb1 /mnt/usbdrive

8. setelah itu anda bisa mengakses isi dari usb device tersebut (read, write, execute) via directory /mnt/usbdrive