Quran module for Drupal

Alhamdulillah, I finally released one of Drupal module: Quran, or Koran. This is my first contribution to Drupal community and my second contribution to free CMS (previously, Mambo).

This module allows you to read Quran (Koran) on Drupal. You can also search for specific verses by keywords. There is also optional block for random verses. The module includes Quran in Arabic, and English for default translation.

For more information please visit the official site :D

Input any language in Kubuntu 7.10 (Gutsy)

Finally after several months away from writing Japanese in KDE since Edgy, I’m now able to write it even in openoffice.org (most people complaining about crash while writing in openoffice with scim, CMIIW).

Last night my experiment worked!!!

Scim is supported in Ubuntu and Kubuntu by default. I think it is suggested application for writing foreign languages. To enable Scim by default (without choosing input method for each application you want to write in) so that you can Shift+Space directly to activate scim, please follow this.

  1.  Install language for Japanese, Korean, Arabic and others.
    • apt-get install scim-anthy scim-hangul, scim-tables-additional
  2. Create an 644 permission file: /etc/X11/Xsession.d/75custom-scim_init which contains
    • GTK_IM_MODULE=xim
      QT_IM_MODULE=xim
      XMODIFIERS=@im=SCIM
  3. Run scim -d
  4. Logout
  5. Restart X (Ctrl+Alt+Backspace)

Have fun!

Debian Package Cacher With apt-cacher

I’m so proud of Linux world wide community, they know what people need, what Linux lack of, then they contribute a useful package for the community. Thanks to apt-cacher package, sharing debian packages in LAN is easy seamless and no longer bandwith consuming.

I suggest you check out the output of ‘apt-cache show apt-cacher’ command to get a brief description about what the package is for.

Before apt-cacher saved my life, I used to move packages found in /var/cache/archives into specific folder, create index manually, then share the directory across computers in my network. This of course forced me to edit source.list to point to the shared directory. Oh, this is inconvinient. Each time I need a specific package, I have to download to cache, reindex which is very time consuming, then apt-get update in each computers which need it.

When apt-cacher installed on a server, it works like Squid Proxy (apt-cache show squid). It intercepts apt request to it, then download packages or indexes for the requesting user while it keep a copy of them as cache in the server for later request. All client computers need to do to make this relationship works, is just by putting in /etc/apt/apt.conf:

Acquire::http::Proxy “http://192.168.1.1:3142″;

Yes, that’s all. You don’t need to change source.list. In this case, http://192.168.1.1 is the server.

Now, we’ll see how to setup the server:
1) Download the package
sudo apt-get install apt-cacher

2) Configure to make this service automatically started. Edit /etc/default/apt-cacher and please make sure you find this line

AUTOSTART=1

3) Optional. Configure main configuration /etc/apt-cacher/apt-cacher.conf

# To generate report daily
generate_reports=1

4) Start the service and verify that it is running
/etc/init.d/apt-cacher restart

Open in your browser to http://192.168.1.1:3142

5) Let apt-cacher cache your already-downloaded packages.

/usr/share/apt-cacher/apt-cacher-import.pl /var/cache/apt/archives

5) Want to see how seamless it works?
Watch it access log:
tail -f /var/log/apt-cacher/access.log

In a client computer which has a modified apt.conf, do apt-get update or apt-get install. You’ll see something in the log. If your request is already downloaded -just like Squid-, it will show HIT

Happy apt-get!

SquidGuard: Efficient Web Filterer

お久しぶり. It’s been a long time until I start this writing. This time is about Squid utilities: to filter porn sites efficiently with SquidGuard. I feel filtering with Squid acl feature is not efficient way to filter sites. SquidGuard has utilize database (Berkeley if I’m not mistaken) to make filtering fast.

Please follow the steps below to impelement SquidGuard to Squid.

1) Please make sure that Squid is already running perfectly except filtering porn sites.

2) Install SquidGuard

apt-get install squidguard

3) What should we define here?
Uncomment (remove the most left #) the following lines in SquidGuard configuration file /etc/squid/squidGuard.conf.

#dest adult {
#       domainlist      adult/domains
#       urllist         adult/urls
#       expressionlist  adult/expressions
#       redirect        http://admin.foo.bar.no/cgi-bin/squidGuard.cgi?clientaddr=%a+clientname=%n+clientident=%i+srcclass=%s+targetclass=%t+url=%u
#}

Those lines define a group of urls to redirect. Change to fit your taste (e.g. redirect http://porn-is-sin.com). Later we’ll see what is domainlist, urllist and the rest.

4) Put the group name into default acl. Edit snippets found in SquidGuard configuration file like the following lines.

default {
  pass     local !adult none

If there are some sites that are falsely judged as porn sites, we can make some exceptions by creating a group, say whitelist. So that, we have the following line instead of the previous one:

pass     local whitelist !adult none

5) Download periodically a free black list urls (You can use crontab) ftp://ftp.univ-tlse1.fr/pub/reseau/cache/squidguard_contrib/blacklists.tar.gz

6) It’s better to make each automatic update in it’s own group name, e.g. adult, cracks, etc. Please remember that the structure of redirected urls and domains is recommended to be like this:

/var/lib/squidguard/db
                      /adult
                      /domains
                      /expressions
                      /urls

- domains contains:
pornoabis.com
babeeheaven.com

- urls contains:
nicesites.com/relevance/search/pornhidden

7) SquidGuard works efficiently with database. Therefore, you’d better convert the 3 list files into db friendly version by doing this in command line:

squidGuard -C all
chown -R proxy /var/lib/squidguard/db/*

When it’s done proses you’ll find unempty files with extensions .db and you’ll find the following lines (more or less) in /var/log/squid/squidGuard.log:

2007-10-02 11:10:06 [10498] db update done
2007-10-02 11:10:06 [10498] squidGuard stopped (1191298206.833)

8) Test first
You need to test your configuration out of the box first. For example if the client who one to access is from 192.168.1.113, you should run

echo "http://www.pornsite.com 192.168.1.113/ - - GET" | squidGuard -c /etc/squid/squidGuard.conf -d

If it’s redirected, then you’ll find the redirect url. Misalnya:

2007-10-02 11:32:59 [10574] squidGuard ready for requests (1191299579.991)
http://porn-is-sin.com 192.168.1.111/- - -
2007-10-02 11:32:59 [10574] squidGuard stopped (1191299579.996)

Else:

2007-10-02 11:33:22 [10576] squidGuard ready for requests (1191299602.507) 2007-10-02 11:33:22 [10576] squidGuard stopped (1191299602.509)

9) It’s time to fight againts crime.
Put the following line into the last line of /etc/squid/squid.conf

redirect_program /usr/bin/squidGuard -c /etc/squid/squidGuard.conf

Don’t forget to reload Squid configuration:

/etc/init.d/squid reload

Have nice day! :)

Fancy Colorful Shell

Back in the past when I was in college in Fasilkom University of Indonesia. Most of my friends and I were used to play with Linux shell and its color feature to make shell more fun and enjoyable. I think I’ve already forgot how to make my shell colorful until I goggled and summarized from many sources how to make basic shell information colorful:

Try this:

  1. Do all of this as root
  2. Put this script Revision of Color Script to /root/script/color (or anything as you wish) and make sure it is executable by every users (chmod o+x /path/to/the/script)
  3. Include the file in your home $HOME/.bashrc by doing the following action
    • Comment all lines containing “PS1=…”. For example # PS1=’${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ‘
    • Put “source /root/script/color” below it (or for global affect, put it on /etc/bash.bashrc)
  4. Now, re-login!

Inconsistent NIC Identification

I hate when I found my Linux server changed the name of its cards. For example yesterday I found eth0 was mapped to the first card, but today (after the computer is rebooted) I found eth0 was mapped to the second card. Inconsistent!!!

I found tutorial that really works here . This is my conclusion:

You should make the mapping fixed. Please download wireless-tools package and edit manually the /etc/iftab file. The file contains mapping from a card name to its mac address (you can know it by executing “ip link show” from iproute package). Mac address is unique in our world. So don’t worry.

This are some examples of configuration of /etc/iftab file:

eth0 mac 00:12:17:90:88:3f arp 1
eth1 mac 00:90:22:fd:48:34 arp 1

Any to mp4, 3gp, etc converter

Last night, I searched over the net how to put my fav video to my phone cell with mplayer. Because I believe mplayer is the most powerful player and converter I’ve ever known. I found a website to make my wish come true. There I found that mencoder (which is usually bundled with mplayer installer) can solely convert to mp4, 3gp or anything (without additional ffmpeg program which is stated in most of tutorial I found).

Now, I want to share this how to by creating a script for Linux bash (because it’s my fav OS). Please post any enhancement or Porting for Windows or Mac.

Preresiquites: MPlayer with mencoder

Please download the script here (please rename to file name to sh if you don’t like current extension). I wish I can run this script instead, because it contains comment for curious user.

The Windows version is here. Yatto dekimashita neee. Please change it to bat. I mean, remove the .doc. Because it is actually a batch script.

Nampilin Subtitle Jepang

mplayerMau tau gimana cara yang gampang (menurut saya lho) untuk nampilin subtitle Jepang waktu nonton film Jepang atau sekedar PV Jepang (Promotional Video)?

Nah, saya ini kebetulan adalah pecinta berat MPlayer, multimedia player paling canggih sejagat dan gratis. MPlayer memiliki file konfigurasi yang bisa diedit. Untuk Linux adalah /etc/mplayer/mplayer.conf dan kalo di windows adalah mplayer/config.

Konfigurasi berikut perlu ditambahkan untuk mengaktifkan subtitle Jepang:

# font untuk karakter Jepang
font=/path/ke/alamat/fontjepang/mtsansdj.ttf

# Tampilkan teks subtitle sebagai format UTF-8 yakni format modern untuk multi bahasa
utf8=1

Font di atas bisa diambil dari JDK milik IBM. Atau untuk file ttf alternatif lainnya yaitu sazanami dari http://sourceforge.jp/projects/efont/ Konfigurasi berikut ini hanya tambahan saja biar seru.

# Ukuran teks agar enak di baca
subfont-text-scale=3

# Auto load subtitle file. Jika Test.avi dijalankan, maka Konayuki.srt, Konayuki.en.srt, Konayuki.jp.srt dan seterusnya akan diload sekalian sebagai subtitlenya yang bisa diganti-ganti dengan shortcut ‘j’.
sub-fuzziness=1

Yui - Life @mplayer-UTF8

Selamat mencoba :)

Nginstall Chat Server Jabber di (K)Ubuntu.

Ejabberd

Enak lho bisa chatting sama orang2 sekantor kalo lokal. Gak ngaruh sama lingkungan luar. Jadi kalo internet mati kayak waktu itu (kasus gempa Taiwan), gak bakal jadi masalah besar. Berikut ini adalah how to install ejabberd chat server yang mendukung banyak protokol termasuk jabber.

1) Install paket ejabberd

sudo apt-get install ejabberd

2) Edit domain di /etc/ejabberd/ejabberd.cfg. Pasang komen pada localhost dengan menggunakan % (PERHATIKAN ADA TITIK SETELAH “}”)

%{hosts, ["localhost"]}.
{hosts, ["kerenabis.com"]}.

3) Restart untuk mengaktifkan chat kerenabis.com

sudo /etc/init.d/ejabberd restart

4) Tambah user untuk mengatur segalanya (jika Anda memiliki sistem LDAP, langsung lompat ke tahap 5)

sudo ejabberdctl register penguasa kerenabis.com penguasaPassword

Untuk menjadikan ia admin, tambah edit file /etc/ejabberd/ejabberd.cfg. Tambahkan

{acl, admin, {user, “penguasa”}}

5) Jika Anda pakai LDAP.

% sancho21: kita pakai LDAP
%{auth_method, internal}.

% For LDAP authentication use these lines instead of above one:
{auth_method, ldap}.
{ldap_servers, ["localhost"]}. % List of LDAP servers
{ldap_uidattr, “uid”}. % LDAP attribute that holds user ID
{ldap_base, “ou=People,dc=kerenabis,dc=com”}. % Search base of LDAP directory
{ldap_rootdn, “cn=admin,dc=kerenabis,dc=com”}. % LDAP manager
{ldap_password, “password sang admin”}. % Password to LDAP manager

6) Buka web administrasi http://localhost:5280/admin. Masukkkan secara lengkap penguasa@kerenabis.com dan isi passwordnya

7) Untuk klien bisa memasukkan di Gaim sebagai Jabber. Servernya jangan lupa dioverride ke ip server. Karena kerenabis.com itu hanya nama virtual untuk chat saja.

Sebenarnya protokol lain juga didukung. Tapi saya belum tahu saja caranya. Oh, ya selamat mencoba!

Sharing File di Linux ke Windows dengan Samba

Terlalu banyak yang ngasih info mengenai sharing file dari Linux ke Windows dengan Samba. Tapi, inilah koleksi saya yang terbukti berhasil. Setidaknya di KDE :)

1) Pastikan paket samba sudah terinstall (cek dengan dpkg -l|grep samba). Jika belum pilih, jalankan

sudo apt-get install samba

2) Share folder di Linux ke Windows
KDE Start -> System Settings -> Sharing -> Administrator Mode -> File Sharing

2.1) Pilih file dengan mengklik Add. Jangan lupa untuk mencentang tanda share with samba

2.2) Untuk menset workgroup, lakukan edit pada file /etc/samba/smb.conf
tambahkan di bawah baris [global]

# Nama workgroup
workgroup = PENCINTALINUX

# Nama komputer yang dikenal di kalangan pengguna Windows
netbios name = sudoku

# Deskripsi komputer kita
server string = %h server (Samba, Ubuntu)

2.3) Untuk menambah user:

sudo adduser guest

(Ini menambah user di Linux. Passwordnya guestPwd aja)

sudo smbpasswd -a guest

(menambah user guest ke samba user table. Passwordnya dikosongkan saja)

sudo smbpasswd -e guest

(mengenable user guest )

Selamat mencoba!!!

Ikuti

Get every new post delivered to your Inbox.