Tuesday, May 10, 2016

Advance Bash Command for Login Linux User

Data Login User
cat secure|grep "May  9"|grep "LOGIN ON" > /tmp/login_20160509.log

Jumlah yang Login
wc -l /tmp/login_20160509.log|cut -d' ' -f1

Seleksi Baris
sed -n '190 p' /tmp/login_20160509.log

Grep Data
DATETIME cat /tmp/login_20160509.log|cut -d' ' -f4
USER cat /tmp/login_20160509.log|cut -d' ' -f11
IP cat /tmp/login_20160509.log|cut -d' ' -f13
PTS cat /tmp/login_20160509.log|cut -d' ' -f9

Dari sini kita dapat melakukan import data ke Database seperti MySQL atau Oracle.
Selamat Ngoprek.

Thursday, June 11, 2015

SETUP LDAP on Ubuntu 12.04.03 LTS x86_64

Operating System: Ubuntu 12.04.03 LTS Server
Hostname             : ldap.ubuntu.co.id
IP Address            : 192.168.169.2

### Install openLDAP
root@ubuntu:~# apt-get install slapd ldap-utils
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following extra packages will be installed:
  libldap-2.4-2 libodbc1
Suggested packages:
  libmyodbc odbc-postgresql tdsodbc unixodbc-bin
The following NEW packages will be installed:
  ldap-utils libodbc1 slapd
The following packages will be upgraded:
  libldap-2.4-2
1 upgraded, 3 newly installed, 0 to remove and 434 not upgraded.
Need to get 2,423 kB of archives.
After this operation, 5,515 kB of additional disk space will be used.
Do you want to continue [Y/n]?

pada saat instalasi akan password untuk Administrator LDAP
Administrator password : cikarang

### Configure file /etc/ldap/ldap.conf
root@ubuntu:~# nano /etc/ldap/ldap.conf
...
BASE    dc=ubuntu,dc=co,dc=id
URI     ldap://192.168.169.2
...

### Run the Configuration Assistant
root@ubuntu:~# dpkg-reconfigure slapd

Omit OpenLDAP server configuration? NO
DNS domain name? ubuntu.co.id
Organization name? ubuntu
Administrator password? cikarang
Confirm password? cikarang
Database backend to use? HDB
Do you want the database to be removed when slapd is purged? YES
Move old database? YES
Allow LDAPv2 protocal? NO

LDAP server is up and running now.


### TESTING
root@ubuntu:~# ldapsearch -x
# extended LDIF
#
# LDAPv3
# base (default) with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# transvision.co.id
dn: dc=ubuntu,dc=co,dc=id
objectClass: top
objectClass: dcObject
objectClass: organization
o: ubuntu
dc: ubuntu

# admin, ubuntu.co.id
dn: cn=admin,dc=ubuntu,dc=co,dc=id
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
description: LDAP administrator

# search result
search: 2
result: 0 Success

# numResponses: 3
# numEntries: 2


### Troubleshoot
1. Cek Service
root@ubuntu:~# service slapd status
 * slapd is running

2 Cek port
root@ubuntu:~# nmap 192.168.169.2

Starting Nmap 5.21 ( http://nmap.org ) at 2015-06-10 23:23 UTC
Nmap scan report for 192.168.169.2
Host is up (0.0000040s latency).
Not shown: 999 closed ports
PORT    STATE SERVICE
389/tcp open  ldap

Nmap done: 1 IP address (1 host up) scanned in 0.55 seconds

3. Cek proses
root@ubuntu:~# ps aux|grep ldap
openldap  5883  0.0  0.1 275536  5092 ?        Ssl  23:20   0:00 /usr/sbin/slapd -h ldap:/// ldapi:/// -g openldap -u openldap -F /etc/ldap/slapd.d

Tuesday, May 19, 2015

Install VLC on CentOS 7

Sepertinya gak nyambung dengan Nama Blog Saya, tapi gak apa-apalah selama itu komunitas linux akan saya tulis apapun klo itu penting.

Kali ini saya akan berbagi bagaimana cara install VLC di CentOS 7

Install Repo VLC di:
[root@localhost ~]# rpm -ivh ~rijalhanif/Downloads/REPO_CENTOS7/nux-dextop-release-0-1.el7.nux.noarch.rpm

Install VLC:
[root@localhost ~]# yum install vlc


^0^ Semoga bermanfaat

Friday, May 1, 2015

Keep Cache Hasil Instal Aplikasi Ubuntu 15.04

Ternyata saat ini, Ubuntu (saya pakai 15.04) mengubah beberapa konfigurasi salah satunya adalah untuk menjaga file hasil instalasi software baik menggunakan apt-get atau synaptic package manager dengan menyediakan file sendiri.

Silahkan ikuti petunjuk dibawah:

rijalhanif@rijalhanif-Vostro-2420:~$ sudo su
root@rijalhanif-Vostro-2420:~# nano /etc/apt/apt.conf.d/20archive

Before:
APT::Archives::MaxAge "30";
APT::Archives::MinAge "2";
APT::Archives::MaxSize "500";

Change to:
APT::Archives::MaxAge "0";
APT::Archives::MinAge "0";
APT::Archives::MaxSize "0";


Dicoba install aplikasi apapun, kemudian cek di directory:

root@rijalhanif-Vostro-2420:~# apt-get install dosbox

root@rijalhanif-Vostro-2420:~# ls -l /var/cache/apt/archives/*.deb
-rw-r--r-- 1 root root 845028 Okt 13  2014 /var/cache/apt/archives/dosbox_0.74-4_amd64.deb
-rw-r--r-- 1 root root 110184 Okt 25  2014 /var/cache/apt/archives/libmikmod3_3.3.7-1_amd64.deb
-rw-r--r-- 1 root root 163052 Sep  9  2014 /var/cache/apt/archives/libopenal1_1%3a1.15.1-5_amd64.deb
-rw-r--r-- 1 root root   8840 Sep  9  2014 /var/cache/apt/archives/libopenal-data_1%3a1.15.1-5_all.deb
-rw-r--r-- 1 root root 162384 Jul  2  2014 /var/cache/apt/archives/libsdl1.2debian_1.2.15-10ubuntu1_amd64.deb
-rw-r--r-- 1 root root  11656 Des 23  2013 /var/cache/apt/archives/libsdl-net1.2_1.2.8-4_amd64.deb
-rw-r--r-- 1 root root  74718 Apr 28  2014 /var/cache/apt/archives/libsdl-sound1.2_1.0.3-7build1_amd64.deb

Dan.. source file .deb nya masih ada dan keep selamanya. :)