Archive for : September, 2016

How do I fix the GPG error “NO_PUBKEY”?

By far the simplest way to handle this now is with Y-PPA-Manager (which now integrates the launchpad-getkeys script with a graphical interface).

To install it, first add the webupd8 repository for this program:

sudo add-apt-repository ppa:webupd8team/y-ppa-manager

Update your software list and install Y-PPA-Manager:

sudo apt-get update
sudo apt-get install y-ppa-manager

Run y-ppa-manager (i.e. type y-ppa-manager then press enter key).
When the main y-ppa-manager window appears, click on “Advanced.”
From the list of advanced tasks, select “Try to import all missing GPG keys” and click OK.

You’re done! As the warning dialog says when you start the operation, it may take quite a while (about 2 minutes for me) depending on how many PPA’s you have and the speed of your connection.

(http://askubuntu[.]com/questions/13065/how-do-i-fix-the-gpg-error-no-pubkey)

Mudah Instalasi Firebird di Linux Mint

Instalasi

00. Persiapan instalasi

$ sudo add-apt-repository ppa:mapopa
$ sudo apt-get updat

01. Instal paket firebird

$ sudo apt-get install firebird2.5-super

02. Lakukan konfigurasi server

$ sudo dpkg-reconfigure firebird2.5-super

03. Instal examples dn file-file dev

$ sudo apt-get install firebird2.5-examples firebird2.5-dev
Arsip employee.fdb berada di dalam direktori "/usr/share/doc/firebird2.5-examples/examples/empbuild/".
$ cd /usr/share/doc/firebird2.5-examples/examples/empbuild/
$ sudo gunzip employee.fdb.gz
$ sudo chown firebird.firebird employee.fdb
$ sudo cp employee.fdb employee.fdb.bak (membuat file cadangan dari employee.fdb)
$ sudo mv employee.fdb /var/lib/firebird/2.5/data/

04. Konek ke database menggunakan isql-fb console

$ isql-fb
 SQL> connect "/var/lib/firebird/2.5/data/employee.fdb" user 'SYSDBA' password 'SYSDBApassword';

05. Koneksi pada langkah 4 akan gagal jika konfigurasi pada “/etc/firebird/2.5/firebird.conf” ada pembatasan akses database seperti baris pertama pada konfigurasi berikut:

DatabaseAccess = Restrict /opt/firebird_data
RemoteAccess = true
RemoteServicePort = 3050
RemoteBindAddress = localhost
ServerMode = Super

06. Jika menggunakan pilihan “Classic” atau “Superclassic” pada versi 2.5 maka Anda harus selalu menggunakan “localhost:” di depan db path. Dengan demikian maka “lock files” dan “shared memory segment” akan menjadi milik ‘firebird’ user. Alternatif lainnya adalah dengan menambahkan “User_Anda” ke dalam “firebird group”.

$ sudo adduser `id -un` firebird
Kemudian connect ke database di superclassic or classic
$ isql-fb
SQL> connect "localhost:/var/lib/firebird/2.5/data/employee.fdb " user 'SYSDBA' password 'SYSDBApassword';

07. Apabila semua OK, Anda akan mendapatkan pesan “database apa yang terkoneksi” dan “siapa user yang siap menggunakan sql prompt”.

$ isql-fb 
Use CONNECT or CREATE DATABASE to specify a database
SQL> connect "/var/lib/firebird/2.5/data/employee.fdb" user 'SYSDBA' password 'SYSDBApassword';
Database: "/var/lib/firebird/2.5/data/employee.fdb", User: SYSDBA

08. Sekarang Anda dapat melihat table apa saja yang ada di database dan melihat versi server

SQL> show tables;
COUNTRY CUSTOMER 
DEPARTMENT EMPLOYEE 
EMPLOYEE_PROJECT JOB 
PROJECT PROJ_DEPT_BUDGET 
SALARY_HISTORY SALES 
SQL> show version;
ISQL Version: LI-V2.5.5.26952 Firebird 2.5
Server version:
Firebird/linux AMD64 (access method), version "LI-V2.5.5.26952 Firebird 2.5"
Firebird/linux AMD64 (remote server), version "LI-V2.5.5.26952 Firebird 2.5/tcp (juwarto-Dell39)/P12"
Firebird/linux AMD64 (remote interface), version "LI-V2.5.5.26952 Firebird 2.5/tcp (juwarto-Dell39)/P12"
on disk structure version 11.2

09. Mencoba membuat database baru di “/opt/firebird_data/”

SQL> create database "/opt/firebird_data/coba.fdb" user 'SYSDBA' password 'SYSDBAPASSWORD';
SQL> connect "/opt/firebird_data/coba.fdb" user 'SYSDBA' password 'SYSDBAPASSWORD';
Commit current transaction (y/n)?y
Committing.
Database: "/opt/firebird_data/coba.fdb", User: SYSDBA

10. Mencoba membuat sebuah table sederhana, kemudian insert 1-2 rows dan select data dari tabel tersebut

SQL> CREATE TABLE TEST (ID INT NOT NULL PRIMARY KEY, NAME VARCHAR(20));
SQL> show tables;
       TEST
SQL> INSERT INTO TEST VALUES (1, 'Juwarto');
SQL> INSERT INTO TEST VALUES (2, 'Juragan');
SQL> select * from test;
   ID           NAME 
   ============ ==================== 
             1  Juwarto 
             2  Juragan

11. Untuk keluar dari isql-fb console, ketik “quit”

SQL> quit
CON>;

 

Konfigurasi Penting

1. Buat direktori baru di “/opt” untuk menyimpan database, misal beri nama “firebird_data”.

2. Buat direktori baru di “/opt” untuk menyimpan backup, misal beri nama “firebird_backup”.

3. Create/Edit file “/etc/firebird/2.5/firebird.conf” dan pastikan baris berikut telah diset:

DatabaseAccess = Restrict /opt/firebird_data
RemoteAccess = true
RemoteServicePort = 3050
RemoteBindAddress = localhost
ServerMode = Super

4. Jangan lupa restart service firebird!

$ sudo service firebird2.5-super restart

5. Pastikan service firebird telah benar-benar running!

$ sudo ps -aux | grep firebird
[sudo] password for juwarto: 
firebird 7333 0.0 0.0 28580 2400 ? S 13:03 0:00 /usr/sbin/fbguard -daemon -forever -pidfile /var/run/firebird/2.5/fbserver.pid
firebird 7334 0.0 0.1 184308 12548 ? Sl 13:03 0:00 /usr/sbin/fbserver
juwarto 7580 0.0 0.0 11752 2152 pts/4 S+ 13:38 0:00 grep --colour=auto firebird

 

Catatan Penting

1. Hasil instalasi dapat dicek di direktori/file berikut

/usr/lib/firebird/2.5 (direktori)
/usr/bin/isql-fb (file, untuk masuk ke SQL command)
/usr/sbin (direktori, tempat file-file fbguard, fb_lock_print, dan fb_smp_server)

2. Direktori tempat data firebird:

/var/lib/firebird/2.5/data

 

SQL Commands

1. Create user

SQL> create user juwarto password '060084390';
Use CONNECT or CREATE DATABASE to specify a database
SQL> _

2. Memberi hak/grant admin ke user

SQL> grant rdb$admin to juwarto;
Use CONNECT or CREATE DATABASE to specify a database
SQL> _

 

Command line

01. Konfigurasi server (masuk ke environtment GSEC):

$ gsec -user "sysdba" -password 'SYSDBApassword'

02. Lihat user:

GSEC> display
GSEC> quit

03. Ubah password (lewat gsec):

GSEC> modify SYSDBA -pw <password_baru>

Ubah password (lewat command line linux):

$ gsec -user "sysdba" -pass 'SYSDBApassword' -mo sysdba -pw <password_baru>

04. Menambah user (lewat gsec):

GSEC> add juwarto -pw juwpass

Menambah user (lewat command line linux):

$ gsec -user "sysdba" -pass 'SYSDBApassword' -add "juragan" -pw 'jurpass'

05. Keluar dari lingkungan gsec

GSEC> quit

 

Firebird Clients

  • Flamerobin

Flamerobin adalah aplikasi client firebird berbasis desktop.

$ sudo apt-get install flamerobin (akan menambahkan paket libwxbase2.8-0 dan libwxgtk2.8-0)
  • Firebird Web Admin

Flamerobin adalah aplikasi client firebird berbasis web.

[*] Untuk menggunakan firebird dengan php, Anda harus memasang driver php5

$ sudo apt-get install php5-interbase libapache2-mod-php5
$ sudo php5enmod interbase
$ sudo /etc/init.d/apache2 restart

Enable module interbase dapat dilakukan juga dengan cara manual sbb:

1. Pastikan ada file "interbase.ini" di direktori "/etc/php5/mods-available".
2. Buat symbolic link untuk interbase.ini di direktori "/etc/php5/apache2/conf.d" dengan nama "20-interbase.ini"
   $ cd /etc/php5/apache2/conf.d 
   $ sudo ln -s ../../mods-available/interbase.ini 20-interbase.ini

[*] Kemudian install “php administration tool” semisal “Firebird Web Admin”

Firebird Web Admin dapat diunduh di “https://github.com/mariuz/firebirdwebadmin”

[-] Ekstrak file unduhan firebirdwebadmin, kemudian letakkan di webserver misal di “/var/www/html/devju/firebirdwebadmin”

[-] Konfigurasi yang perlu diperhatikan

a. Buat link isql dan isql-fb dari /usr/bin ke /usr/sbin

$ cd /usr/sbin
$ sudo ln -s /usr/bin/isql isql
$ sudo ln -s /usr/bin/isql-fb isql-fb
$ ls -al | grep isql
lrwxrwxrwx 1 root root 13 Sep 19 14:38 isql -> /usr/bin/isql
lrwxrwxrwx 1 root root 16 Sep 19 14:38 isql-fb -> /usr/bin/isql-fb

b. Edit file “firebirdwebadmin/inc/configuration.inc.php” sbb:

define('BINPATH', '/usr/sbin/'); // path to the interbase tools (isql, etc.)
define('DEFAULT_DB', 'employee.fdb');
define('DEFAULT_PATH', '/opt/firebird_data/');
define('DEFAULT_HOST', 'localhost');
define('BACKUP_DIR', '/opt/firebird_backup'); // define this to restrict the location for backup files

SELESAI!
Alhamdulillah

APT-GET Error

Tips untuk mengasi error pada apt-get, dengan error message kurang lebih sbb:

Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_trusty_main_i18n_Translation-en
E: The package lists or status file could not be parsed or opened.

Berikut adalah solusi atas permasalahan tersebut di atas:

sudo rm /var/lib/apt/lists/* -vf
sudo rm /var/lib/apt/lists/lock -vf
sudo apt-get update

Semoga bermanfaat!

Mudah Instalasi Oracle-XE 11g di CentOS

Berikut catatan kecil saya saat melakukan instalasi Oracle 11g-XE di Linux CentOS 7.

Paket yang harus diinstall terlebih dahulu sebelum proses instalasi:

  1. tuned-profiles-oracle
  2. kmod-oracleasm
  3. bc
  4. gcc
  5. glibc
  6. make
  7. binutils
  8. libaio
  9. libaio-devel
  10. libstdc++
  11. libstdc++-devel
  12. libgcc
  13. compat-libstdc++
  14. ksh
  15. libXext
  16. libXtst
  17. libX11
  18. libXau
  19. libxcb
  20. libXi
  21. sysstat
  22. unixODBC
  23. unixODBC-devel
  24. zlib-devel
  25. elfutils-libelf-devel

Lakukan setting /etc/hostname sebagai berikut:

[root@centos]# cat /etc/hostname
 centos.joe

Lakukan setting /etc/hosts sebagai berikut:

[root@centos]# cat /etc/hosts
127.0.0.1       localhost localhost.localdomain localhost4 localhost4.localdomain4
::1             localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.101  centos.joe centos
192.168.84.20   centos.joe centos

Mulai proses instalasi:

A. Created a new user ‘oracle’ under the group dba:

[root@centos ~]# usermod -a -G dba oracle
[root@centos ~]# grep dba /etc/group
dba:x:1000:oracle,root

B. Download paket installer “oracle-xe-11.2.0-1.0.x86_64.rpm.zip”, simpan di direktori “/tmp”.

C. Extract file tersebut

[root@centos tmp]# unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip

Akan terbentuk direktori “Disk1” sebagai hasil extract file installer.

D. Masuk ke direktori hasil extract tersebut di atas, dan jalankan instalasi dengan rpm

[root@centos tmp]# cd Disk1
[root@centos Disk1]# rpm -iv oracle-xe-11.2.0-1.0.x86_64.rpm
Preparing packages...
 /var/tmp/rpm-tmp.OA9b17: line 257: [: 18446744073692774399: integer expression expected
 /var/tmp/rpm-tmp.OA9b17: line 271: [: 18446744073692774399: integer expression expected
 oracle-xe-11.2.0-1.0.x86_64
 Executing post-install steps...
You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.

[root@centos Disk1]# /etc/init.d/oracle-xe configure
Oracle Database 11g Express Edition Configuration
 ------------------------------------------------------------
 This will configure on-boot properties of Oracle Database 11g Express
 Edition.  The following questions will determine whether the database should
 be starting upon system boot, the ports it will use, and the passwords that
 will be used for database accounts.  Press <Enter> to accept the defaults.
 Ctrl-C will abort.
Specify the HTTP port that will be used for Oracle Application Express [8080]: 8080
Specify a port that will be used for the database listener [1521]: 1521
Specify a password to be used for database accounts.  Note that the same
 password will be used for SYS and SYSTEM.  Oracle recommends the use of
 different passwords for each database account.  This can be done after
 initial configuration: _  (isikan password Anda)
 Confirm the password: _  (isikan password Anda, untuk konfirmasi)
Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]: y
Starting Oracle Net Listener...Done
 Configuring database...Done
 Starting Oracle Database 11g Express Edition instance...Done
 Installation completed successfully.

E. Pengaturan service

  • Aktifkan service
[root@centos ~]# systemctl start oracle-xe.service
[root@centos ~]# /sbin/chkconfig oracle-xe on
  • Start dan Stop service
[root@centos ~]# service oracle-xe start
[root@centos ~]# service oracle-xe stop
  • Enable service
[root@centos ~]# service oracle-xe start
[root@centos ~]# service oracle-xe enable

F. Konfigurasi environment

Konfigurasi dapat diletakan di file .bash_profile atau .bashrc (dalam direktori home user).
Konfigurasi dapat pula diletakkan dalam sebuah file pada direktori “/etc/profile.d/” misal dengan nama “envora.sh”, agar berlaku untuk semua user.

[root@centos ~]# cd /etc/profile.d/
[root@centos profile.d]# touch envora.sh
[root@centos profile.d]# vim envora.sh
[root@centos profile.d]# cd
[root@centos ~]# cat /etc/profile.d/envora.sh
# Konfigurasi untuk Oracle
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/xe
export ORACLE_SID=XE
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export LISTENER=$ORACLE_HOME/bin/lsnrctl
export PATH=$PATH:$ORACLE_HOME/bin
[root@centos ~]# reboot
[root@centos ~]# chown -R oracle:dba /var/tmp/.oracle
[root@centos ~]# chmod -R 755 /var/tmp/.oracle
[root@centos ~]# chown -R oracle:dba /tmp/.oracle
[root@centos ~]# chmod -R 755 /tmp/.oracle

Pastikan path oracle telah tersetup dengan benar:

[root@centos ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/u01/app/oracle/product/11.2.0/xe/bin:/root/bin

G. Masuk ke oracle

[root@centos ~]# sqlplus
SQL*Plus: Release 11.2.0.2.0 Production on Wed Sep 7 11:19:40 2016
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Enter user-name: SYSTEM
Enter password: _  (password yang telah dibuat saat instalasi)
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
SQL> _
SQL> exit (keluar dari PL/SQL)

H. Setting password for user (“oracle” )

[root@centos ~]# passwd oracle
 Changing password for user oracle.
 New password: _
 Retype new password: _
 passwd: all authentication tokens updated successfully.

I. Setting network

[root@centos ~]# cd /u01/app/oracle/product/11.2.0/xe/network/admin
[root@centos admin]# cat listener.ora 
 # listener.ora Network Configuration File:
 SID_LIST_LISTENER =
 (SID_LIST =
   (SID_DESC =
     (SID_NAME = PLSExtProc)
     (ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
     (PROGRAM = extproc)
   )
  )
 LISTENER =
 (DESCRIPTION_LIST =
   (DESCRIPTION =
     (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
     (ADDRESS = (PROTOCOL = TCP)(HOST = centos.joe)(PORT = 1521))
   )
 )
 DEFAULT_SERVICE_LISTENER = (XE)
[root@centos admin]# cat tnsnames.ora 
 # tnsnames.ora Network Configuration File:
 XE =
 (DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP)(HOST = centos.joe)(PORT = 1521))
   (CONNECT_DATA =
     (SERVER = DEDICATED)
     (SERVICE_NAME = XE)
   )
 )
 EXTPROC_CONNECTION_DATA =
 (DESCRIPTION =
   (ADDRESS_LIST =
   (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
   )
 (CONNECT_DATA =
   (SID = PLSExtProc)
     (PRESENTATION = RO)
   )
 )

J. Cek apakah listener berjalan normal

[root@centos ~]# lsnrctl status
 LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 13-SEP-2016 11:25:54
 Copyright (c) 1991, 2011, Oracle. All rights reserved.
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
 STATUS of the LISTENER
 ------------------------
 Alias LISTENER
 Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
 Start Date 13-SEP-2016 11:18:42
 Uptime 0 days 0 hr. 7 min. 12 sec
 Trace Level off
 Security ON: Local OS Authentication
 SNMP OFF
 Default Service XE
 Listener Parameter File /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
 Listener Log File /u01/app/oracle/diag/tnslsnr/centos/listener/alert/log.xml
 Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centos.joe)(PORT=1521)))
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centos.joe)(PORT=8080))(Presentation=HTTP)(Session=RAW))
 Services Summary...
 Service "PLSExtProc" has 1 instance(s).
 Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
 Service "XE" has 1 instance(s).
 Instance "XE", status READY, has 1 handler(s) for this service...
 Service "XEXDB" has 1 instance(s).
 Instance "XE", status READY, has 1 handler(s) for this service...
 The command completed successfully

K. Logging In to Application Express Administration Services

1. In a Web browser, go to the Oracle Application Express Administration Services application.
   http://hostname:port/apex/apex_admin
2. On the Login page:
   a. Username - Enter admin
   b. Password - Enter the SYS or SYSTEM database account password you created during the installation process.
   c. Click Login.
3. If prompted, change your password and click Apply Changes.
4. Enter you new login credentials and click Login.

L. Sukses! Alhamdulillah!

Semoga bermanfaat!