Tuesday, December 24, 2013

Repo CentOS 6.5 X86_64 (latest updated) dari Kambing

# CentOS-Base.repo
# http://kambing.ui.ac.id/centos/6.5/
# /etc/yum.repos.d/CentOS-Base.repo

[SCL]
name=CentOS
baseurl=http://kambing.ui.ac.id/centos/6/SCL/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-6

[CentOSPlus]
name=CentOS
baseurl=http://kambing.ui.ac.id/centos/6/centosplus/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-6

[Contrib]
name=CentOS
baseurl=http://kambing.ui.ac.id/centos/6/contrib/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-6

[Extras]
name=CentOS
baseurl=http://kambing.ui.ac.id/centos/6/extras/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-6

[Fasttrack]
name=CentOS
baseurl=http://kambing.ui.ac.id/centos/6/fasttrack/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-6

[OS]
name=CentOS
baseurl=http://kambing.ui.ac.id/centos/6/os/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-6

[Updates]
name=CentOS
baseurl=http://kambing.ui.ac.id/centos/6/updates/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-6

Monday, December 23, 2013

Install Pacemaker on CentOS 5

Installing on RHEL-5 Compatible Distributions: CentOS, Scientific Linux, etc



1. Get Repo

wget -O /etc/yum.repos.d/pacemaker.repo http://clusterlabs.org/rpm-next/epel-5/clusterlabs.repo


yum install -y pacemaker corosync

2. Manual Add Repo
Files: /etc/yum.repos.d/pacemaker.repo
-------------------------------------------------------------------

[clusterlabs-next]
name=High Availability/Clustering server technologies (epel-5-next)
baseurl=http://www.clusterlabs.org/rpm-next/epel-5
metadata_expire=45m
type=rpm-md
gpgcheck=0
enabled=1
-------------------------------------------------------------------

Repo CentOS 5.9 (latest updated) dari Kambing

# /etc/yum.repos.d/CentOS-Base.repo

---------------------------------------------------------------
# CentOS-Base.repo
# http://kambing.ui.ac.id/centos/5.9/

[AddOns]
name=CentOS
baseurl=http://kambing.ui.ac.id/centos/5/addons/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-5

[CentOSPlus]
name=CentOS
baseurl=http://kambing.ui.ac.id/centos/5/centosplus/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-5

[Contrib]
name=CentOS
baseurl=http://kambing.ui.ac.id/centos/5/contrib/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-5

[Extras]
name=CentOS
baseurl=http://kambing.ui.ac.id/centos/5/extras/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-5

[Fasttrack]
name=CentOS
baseurl=http://kambing.ui.ac.id/centos/5/fasttrack/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-5

[OS]
name=CentOS
baseurl=http://kambing.ui.ac.id/centos/5/os/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-5

[Updates]
name=CentOS
baseurl=http://kambing.ui.ac.id/centos/5/updates/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-5
---------------------------------------------------------------


Semoga bermanfaat, :)

Friday, December 20, 2013

Menggunakan YUM dibelakang PROXY di CentOS

Walau trik ini sudah banyak yang tahu, namun saya hanya ingin meramaikan blog mengenai tutoriak/trik mengenai Linux. Bagi yang belum tahu atau sedang asyik-asyiknya bermain Linux berikut trik sederhananya yah.. :)

Konfigurasi 1 (cara pertama) 
Memasangkan proxy di dalam file /etc/yum.conf:

proxy=http://192.168.1.2:1
proxy_username=admin@rijalhanif.net
proxy_password=123password

Konfigurasi 2 (cara kedua)
Memasangkan proxy di variable environment

http_proxy="http://jaya@rijal.com:123456@192.168.1.187:8080"
export http_proxy

Wednesday, December 18, 2013

Ganti nama ethX di CentOS/RHEL

Adakalanya nama ethX anda berubah menjadi ethX dengan urutan yang tidak sesuai atau tidak bermula dari awal.

1. Buka file: /etc/udev/rules.d/70-persistent-net.rules

2. Ganti bagian eth, menjadi eth0 atau disesuaikan dengan keinginan Anda.

SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:50:56:b2:23:e0″, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth0

3. Buka file: /etc/sysconfig/network-scripts/ifcfg-eth0
Atau jika tidak ada, rename dari konfigurasi sebelumnya, mungkin dari nama ifcfg-eth3

*Thanks, Semoga bermanfaat.


Tuesday, December 17, 2013

Auto Login User on Ubuntu (Tested 10.04)

Buat file di: /etc/gdm/custom.conf

Isikan dengan:

[daemon]
TimedLoginEnable=true
AutomaticLoginEnable=true
TimedLogin=monitor
AutomaticLogin=monitor
TimedLoginDelay=10
DefaultSession=gnome

Lalu.. restart Ubuntu anda:
# shutdown -r now

Friday, September 6, 2013

Install SquidGuard Manager 1.12 on Red Hat X86_64

Persiapan:
1. Download file http://www.sourceforge.net/projects/squidguardmgr/
2. Kopi filenya ke direktori /usr/local/src/

Compile:
[root@tester src]# tar xfvz squidguardmgr-1.12.tar.gz
[root@tester src]# cd squidguardmgr-1.12
[root@tester squidguardmgr-1.12]# perl -v

This is perl, v5.8.8 built for x86_64-linux-thread-multi

Copyright 1987-2006, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

[root@tester squidguardmgr-1.12]# perl Makefile.PL
Path to squidGuard configuration file? [] /usr/local/squidGuard/squidGuard.conf
Do you use c-icap SquidClamav v6.x services? [no] no
Path to squidclamav program? [off] off
What is the user (uid) running Squid or SquidGuard? [squid] squid
Writing Makefile for squidguardmgr
Done...

Now type 'make && make install'

[root@tester squidguardmgr-1.12]# make && make install
cc -o squid_wrapper/squid_wrapper squid_wrapper/squid_wrapper.c
sh install_all.sh

-----------------------------------------------------------------------------

1. Modify Apache httpd.conf to change the running uid and gid to squid user.
2. Modify your httpd.conf to allow access to CGI scripts like follow:

        Alias /squidguardmgr /var/www/squidguardmgr/
       
            Options +ExecCGI
            AddHandler cgi-script .cgi
            DirectoryIndex squidguardmgr.cgi
            Order deny,allow
            Deny from all
            Allow from 192.168.1.24
       

3. If necessary, set additional grants to Squidguard Manager in httpd.conf.
   Restart and ensure that httpd is running.
4. Browse to http://proxy.host.dom/squidguardmgr/ to ensure that things are
   working properly.
For more information, see http://squidguardmgr.darold.net/.
-----------------------------------------------------------------------------


Thursday, September 5, 2013

Install SquidGuard 1.4 on Red Hat 6.4 X86_64

Persiapan:
1. Install Berkeley DB http://rijalbuntu.blogspot.com/2013/09/install-berkeley-db-4329-on-redhat-64.html
2. Download file http://www.squidguard.org/Downloads/squidGuard-1.4.tar.gz
3. Kopikan ke /usr/local/src

Compile:
[root@tester src]# tar xvfz squidGuard-1.4.tar.gz
[root@tester src]# cd squidGuard-1.4

[root@tester squidGuard-1.4]# ../configure --with-db=/usr/local/BerkeleyDB.4.3 --with-ldap
[root@tester squidGuard-1.4]# make
[root@tester squidGuard-1.4]# make install
Installing squidGuard
Done.
Installing configuration file
Created directory /usr/local/squidGuard
Assigned /usr/local/squidGuard to user squid
Created directory /usr/local/squidGuard/db
Assigned /usr/local/squidGuard/db to user squid
Created directory /usr/local/squidGuard/log
Assigned /usr/local/squidGuard/log to user squid
Copied sample squidGuard.conf
/usr/local/squidGuard/squidGuard.conf is now readable
The initial configuration is complete.

Congratulation. SquidGuard is sucessfully installed.

Pengecekan:
[root@tester local]# cd /usr/local/squidGuard
[root@tester squidGuard]# ls -l /usr/local/squidGuard
total 12
drwxr-xr-x 2 squid root 4096 Sep  5 11:19 db
drwxr-xr-x 2 squid root 4096 Sep  5 11:19 log
-rw-r--r-- 1 root  root 1240 Sep  5 11:19 squidGuard.conf

Convert textfile to db:
[root@tester squidGuard]# /usr/local/bin/squidGuard -C all

[root@tester squidGuard]# tail -f log/squidGuard.log
2013-09-05 11:31:58 [17227] New setting: dbhome: /usr/local/squidGuard/db
2013-09-05 11:31:58 [17227] New setting: logdir: /usr/local/squidGuard/log
2013-09-05 11:31:58 [17227] Added User: root
2013-09-05 11:31:58 [17227] Added User: foo
2013-09-05 11:31:58 [17227] Added User: bar
2013-09-05 11:31:58 [17227] destblock good missing active content, set inactive
2013-09-05 11:31:58 [17227] destblock local missing active content, set inactive
2013-09-05 11:31:58 [17227] init domainlist /usr/local/squidGuard/db/blacklists/adult/domains
2013-09-05 11:32:20 [17227] create new dbfile /usr/local/squidGuard/db/blacklists/adult/domains.db
2013-09-05 11:32:22 [17227] init urllist /usr/local/squidGuard/db/blacklists/adult/urls
2013-09-05 11:32:22 [17227] create new dbfile /usr/local/squidGuard/db/blacklists/adult/urls.db
2013-09-05 11:32:22 [17227] init expressionlist /usr/local/squidGuard/db/blacklists/adult/expressions
2013-09-05 11:32:22 [17227] squidGuard 1.4 started (1378355518.638)
2013-09-05 11:32:22 [17227] db update done
2013-09-05 11:32:22 [17227] squidGuard stopped (1378355542.671)

Cek hasilnya:
[root@tester squidGuard]# ls -l db/blacklists/adult/*.db
-rw-r--r-- 1 root root 44257280 Sep  5 11:32 db/blacklists/adult/domains.db
-rw-r--r-- 1 root root  3444736 Sep  5 11:32 db/blacklists/adult/urls.db


Install Berkeley DB 4.3.29 on Redhat 6.4 X86_64

Persiapan:
1. Download file http://download.oracle.com/berkeley-db/db-4.3.29.tar.gz
2. Kopikan ke /usr/local/src

Compile:
[root@tester src]# tar xvfz db-4.3.29.tar.gz
[root@tester src]# cd /usr/local/src/db-4.3.29/
[root@tester db-4.3.29]# cd build_unix

[root@tester build_unix]# ../dist/configure
[root@tester build_unix]# make clean
[root@tester build_unix]# make

[root@tester build_unix]# make install
Installing DB include files: /usr/local/BerkeleyDB.4.3/include ...
Installing DB library: /usr/local/BerkeleyDB.4.3/lib ...
cp -p .libs/libdb-4.3.so /usr/local/BerkeleyDB.4.3/lib/libdb-4.3.so
cp -p .libs/libdb-4.3.lai /usr/local/BerkeleyDB.4.3/lib/libdb-4.3.la
cp -p .libs/libdb-4.3.a /usr/local/BerkeleyDB.4.3/lib/libdb-4.3.a
ranlib /usr/local/BerkeleyDB.4.3/lib/libdb-4.3.a
chmod 644 /usr/local/BerkeleyDB.4.3/lib/libdb-4.3.a
cp -p libdb.a /usr/local/BerkeleyDB.4.3/lib/libdb.a
ranlib /usr/local/BerkeleyDB.4.3/lib/libdb.a
chmod 644 /usr/local/BerkeleyDB.4.3/lib/libdb.a
PATH="$PATH:/sbin" ldconfig -n /usr/local/BerkeleyDB.4.3/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/BerkeleyDB.4.3/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Installing DB utilities: /usr/local/BerkeleyDB.4.3/bin ...
cp -p .libs/db_archive /usr/local/BerkeleyDB.4.3/bin/db_archive
cp -p .libs/db_checkpoint /usr/local/BerkeleyDB.4.3/bin/db_checkpoint
cp -p .libs/db_deadlock /usr/local/BerkeleyDB.4.3/bin/db_deadlock
cp -p .libs/db_dump /usr/local/BerkeleyDB.4.3/bin/db_dump
cp -p .libs/db_load /usr/local/BerkeleyDB.4.3/bin/db_load
cp -p .libs/db_printlog /usr/local/BerkeleyDB.4.3/bin/db_printlog
cp -p .libs/db_recover /usr/local/BerkeleyDB.4.3/bin/db_recover
cp -p .libs/db_stat /usr/local/BerkeleyDB.4.3/bin/db_stat
cp -p .libs/db_upgrade /usr/local/BerkeleyDB.4.3/bin/db_upgrade
cp -p .libs/db_verify /usr/local/BerkeleyDB.4.3/bin/db_verify
Installing documentation: /usr/local/BerkeleyDB.4.3/docs ...

Install to System:
[root@tester BerkeleyDB.4.3]# vim /etc/ld.so.conf.d/BerkeleyDB.conf
Masukkan "/usr/local/BerkeleyDB.4.3/lib"

[root@tester BerkeleyDB.4.3]# ldconfig

[root@tester BerkeleyDB.4.3]# ldconfig -v | grep libdb-4
ldconfig: /etc/ld.so.conf.d/kernelcap-2.6.18-348.el5.conf:6: duplicate hwcap 0 nosegneg
        libdb-4.3.so -> libdb.so
        libdb-4.2.so -> libdb-4.2.so
        libdb-4.3.so -> libdb-4.3.so
        libdb-4.1.so -> libdb-4.1.so
        libdb-4.2.so -> libdb-4.2.so
        libdb-4.3.so -> libdb-4.3.so
        libdb-4.1.so -> libdb-4.1.so

        libdb-4.3.so -> libdb.so

Pengecekan:
[root@tester src]# cd /usr/local/BerkeleyDB.4.3/
[root@tester BerkeleyDB.4.3]# ls -l /usr/local/BerkeleyDB.4.3/
total 16
drwxr-xr-x  2 root root 4096 Sep  5 10:27 bin
drwxr-xr-x 12 root root 4096 Sep  5 10:27 docs
drwxr-xr-x  2 root root 4096 Sep  5 10:27 include
drwxr-xr-x  2 root root 4096 Sep  5 10:27 lib

Saturday, May 18, 2013

INSTALL XRDP ON REDHAT


[root@localhost ~]# ls -l |grep xrdp
-rw-r--r--   1 root root   285498 Jan 25 08:49 xrdp-0.5.0-0.13.el5.x86_64.rpm

[root@localhost ~]# rpm -ivh xrdp-0.5.0-0.13.el5.x86_64.rpm
warning: xrdp-0.5.0-0.13.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 217521f6
Preparing...                ########################################### [100%]
   1:xrdp                   ########################################### [100%]

[root@localhost ~]# chkconfig --list |grep xrdp
xrdp            0:off   1:off   2:off   3:off   4:off   5:off   6:off

[root@localhost ~]# chkconfig xrdp on

[root@localhost ~]# chkconfig --list |grep xrdp
xrdp            0:off   1:off   2:on    3:on    4:on    5:on    6:off

[root@localhost ~]# service xrdp start
Starting xrdp:                                             [  OK  ]
Starting xrdp-sesman:                                      [  OK  ]

[root@localhost ~]# service xrdp status
xrdp (pid  5019) is running...
xrdp-sesman (pid  5023) is running...

[root@localhost xrdp]# pwd
/etc/xrdp
[root@localhost xrdp]# ls -l
total 92
-rw-r--r-- 1 root root 8756 Nov 18  2010 km-0407.ini
-rw-r--r-- 1 root root 8655 Nov 18  2010 km-0409.ini
-rw-r--r-- 1 root root 8744 Nov 18  2010 km-040c.ini
-rw-r--r-- 1 root root 8732 Nov 18  2010 km-0410.ini
-rw-r--r-- 1 root root 9169 Nov 18  2010 km-0419.ini
-rw-r--r-- 1 root root 8760 Nov 18  2010 km-041d.ini
-rw------- 1 root root 1019 May 18 07:59 rsakeys.ini
-rw-r--r-- 1 root root  636 Nov 18  2010 sesman.ini
-rwxr-xr-x 1 root root 2009 Nov 18  2010 startwm.sh
-rw-r--r-- 1 root root  181 Nov 18  2010 xrdp.ini
-rwxr-xr-x 1 root root 2299 Nov 18  2010 xrdp.sh

[root@localhost xrdp]# vim xrdp.ini
####################
[globals]
bitmap_cache=yes
bitmap_compression=yes
port=3389
crypt_level=high
channel_code=1

[xrdp1]
name=sesman-Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1
####################

[root@localhost BACKUP]# netstat -tanp|grep xrdp
tcp        0      0 127.0.0.1:3350              0.0.0.0:*                   LISTEN      5023/xrdp-sesman
tcp        0      0 0.0.0.0:3389                0.0.0.0:*                   LISTEN      5019/xrdp
[root@localhost BACKUP]# netstat -tanp|grep :3389
tcp        0      0 0.0.0.0:3389                0.0.0.0:*                   LISTEN      5019/xrdp

Tuesday, January 22, 2013

Trash di Terminal

RM mungkin sudah banyak yang tahu, namun mungkin sedikit yang sadar bahwa RM dalam linux itu sama seperti SHIFT+DELETE dalam Win***.
Nah, gimana nih klo kita mau menghapus sementara yang artinya file/folder tersebut memang tidak kita butuhkan kembali namun mungkin sewaktu-waktu mau kita restore. Permasalah tersebut dapat kita atasi dengan cara trash (win: Recycle bin). Saya yakin bagi anda yang sudah kenal Linux, pasti gak asing dengan tempat penitipan sementara itu (baca Trash). Caranya yang simple dalam GUI Linux memang hanya dengan klik kanan, delete. Namun tahukan anda bahwa trash tersebut juga bisa kita operasikan via Terminal?? Woke berikut oprekannya,,

1. Instal paket trash-cli
# apt-get install trash-cli

2. Hapus file dengan trash 
# trash /home/rijalhanif/modul_igos_trainn2013.pdf

3. Tiga utilitas penting, list-trash, restore-trash, empty-trash

4. Cek file apa saja yang ada dalam KOTAK Trash,
# list-trash

2013-01-22 10:33:33 /home/jaya/modul_igos_trainn2013.pdf
2013-01-22 10:33:33 /home/jaya/sample
2013-01-22 10:33:33 /home/jaya/sample1
2013-01-22 10:33:33 /home/jaya/sample2


5. Restore file 
# restore-path


   0 2013-01-22 10:33:33 /home/jaya/modul_igos_trainn2013.pdf
   1 2013-01-22 10:33:33 /home/jaya/sample
   2 2013-01-22 10:33:33 /home/jaya/sample1
   3 2013-01-22 10:33:33 /home/jaya/sample2

What file to restore [0..3]:

Isikan nomor berapa file yang akan direstore [0..3]??

6. Mengosongkan KOTAK Trash
# empty-trash
# list-trash (hasilnya kosong)

--semoga bermanfaat