Category Archives: Linux

Konfigurasi proxy di Ubuntu server 16.04

[1] Tambahkan konfigurasi proxy di /etc/profile

root@ubuntu:~# vi /etc/profile
MY_PROXY_URL="http://user:password@proxy_server:port/"
HTTP_PROXY=$MY_PROXY_URL
HTTPS_PROXY=$MY_PROXY_URL
FTP_PROXY=$MY_PROXY_URL
http_proxy=$MY_PROXY_URL
https_proxy=$MY_PROXY_URL
ftp_proxy=$MY_PROXY_URL
export HTTP_PROXY HTTPS_PROXY FTP_PROXY http_proxy https_proxy ftp_proxy

root@ubuntu:~# source /etc/profile

[2] Buat file baru apt.conf di /etc/apt/apt.conf

Acquire::http::proxy "http://proxy_server:port/";
Acquire::https::proxy "https://proxy_server:port/";
Acquire::ftp::proxy "ftp://proxy_server:port/";

[3] Untuk wget juga harus di tambahkan, agar bisa mendownload packet melalui wget

root@ubuntu:~# vi /etc/wgetrc

http_proxy = http://proxy_server:port/
https_proxy = http://proxy_server:port/
ftp_proxy = http://proxy_server:port/

#Aktifkan proxy on
use_proxy = on

Ok, cek sudo apt update

Cheers

Advertisements

Konfigurasi network interface di Ubuntu server 16.04 (Static)

[1] Pertama cek nama interface di ubuntu server

[2] Konfigurasi IP Static

root@ubuntu:~# more /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

#ens5
iface ens5 inet static
address 10.2.56.229
netmask 255.255.255.0
gateway 10.2.56.1
dns-nameservers 8.8.8.8 8.8.4.4

[3] Lakukan ifup interface ubuntu

ifup ens5
# ip add

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
valid_lft forever preferred_lft forever
2: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:01:a4:aa:cc:24 brd ff:ff:ff:ff:ff:ff
inet 10.2.56.229/24 brd 10.2.56.255 scope global ens5
valid_lft forever preferred_lft forever
inet6 fe80::201:a4ff:feaa:cc24/64 scope link 
valid_lft forever preferred_lft forever

[4] Lakukan ping ke gateway untuk memastikan network yang di konfigurasi sudah benar

root@ubuntu:~# ping 10.2.56.1
PING 10.2.56.1 (10.2.56.1) 56(84) bytes of data.
64 bytes from 10.2.56.1: icmp_seq=1 ttl=255 time=0.243 ms
64 bytes from 10.2.56.1: icmp_seq=2 ttl=255 time=0.352 ms

Cheers – Semoga bermanfaat

Install Chrome di Ubuntu 18.04

[1] Install prerequisites chrome

sudo apt install gdebi-core
[sudo] password for space: 
Reading package lists... Done
Building dependency tree 
Reading state information... Done
The following NEW packages will be installed:
gdebi-core
0 upgraded, 1 newly installed, 0 to remove and 21 not upgraded.
Need to get 116 kB of archives.
After this operation, 876 kB of additional disk space will be used.
Get:1 http://id.archive.ubuntu.com/ubuntu bionic/universe amd64 gdebi-core all 0.9.5.7+nmu2 [116 kB]
Fetched 116 kB in 4s (32,4 kB/s) 
Selecting previously unselected package gdebi-core.
(Reading database ... 196843 files and directories currently installed.)
Preparing to unpack .../gdebi-core_0.9.5.7+nmu2_all.deb ...
Unpacking gdebi-core (0.9.5.7+nmu2) ...
Setting up gdebi-core (0.9.5.7+nmu2) ...
Processing triggers for man-db (2.8.3-2) ...

[2] Download the Google Chrome package menggunakan wget

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

[3] Install Google Chrome

sudo gdebi google-chrome-stable_current_amd64.deb 
Reading package lists... Done
Building dependency tree 
Reading state information... Done
Reading state information... Done

The web browser from Google
Google Chrome is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier.
Do you want to install the software package? [y/N]:y
Selecting previously unselected package google-chrome-stable.
(Reading database ... 196915 files and directories currently installed.)
Preparing to unpack google-chrome-stable_current_amd64.deb ...
Unpacking google-chrome-stable (67.0.3396.99-1) ...
Setting up google-chrome-stable (67.0.3396.99-1) ...
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/x-www-browser (x-www-browser) in auto mode
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/gnome-www-browser (gnome-www-browser) in auto mode
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/google-chrome (google-chrome) in auto mode
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.1) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for man-db (2.8.3-2) ...

[4] Oke buka Google-Chrome

$ google-chrome

Cheers

Install sshpass di Ubuntu 18.04

[1] Install sshpass

$ sudo apt install sshpass
Reading package lists... Done
Building dependency tree 
Reading state information... Done
The following NEW packages will be installed:
sshpass
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 10,5 kB of archives.
After this operation, 30,7 kB of additional disk space will be used.
Get:1 http://id.archive.ubuntu.com/ubuntu bionic/universe amd64 sshpass amd64 1.06-1 [10,5 kB]
Fetched 10,5 kB in 1s (16,3 kB/s) 
Selecting previously unselected package sshpass.
(Reading database ... 196625 files and directories currently installed.)
Preparing to unpack .../sshpass_1.06-1_amd64.deb ...
Unpacking sshpass (1.06-1) ...
Setting up sshpass (1.06-1) ...
Processing triggers for man-db (2.8.3-2) ...

[2] Di bawah ini cara menggunakan command sshpass

space@space:~/remote$ sshpass -p 'cobasaja' ssh root@10.10.1.10
Last login: Tue Jul 3 08:23:47 2018 from 10.10.1.10

[root@security ~]# exit

Kalau untuk di buat script agar mudah diingat seperti di bawah ini, buat file terlebih dahulu

vi server.sh

Masukkan command sshpass di file script yang sudah di buat di atas

sshpass -p 'cobasaja' ssh root@10.10.1.10

Jalankan script tersebut

./server.sh

[3] Untuk bypass host key checking bisa menambahklan command -o StrictHostKeyChecking=no option

sshpass -p 'cobasaja' ssh -o StrictHostKeyChecking=no root@10.10.1.10

Semoga bermanfaat, cheers

Install KVM di Ubuntu 18.04

[1] Install KVM dan paket – paket yang di perlukan

sudo apt update

sudo apt -y install qemu-kvm libvirt-bin virtinst bridge-utils libosinfo-bin libguestfs-tools virt-top virt-manager qemu

[2] Start dan Enable service libvirtd

sudo systemctl start libvirtd
sudo update-rc.d libvirtd enable

$ systemctl status libvirtd
● libvirtd.service - Virtualization daemon
Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset:
Active: active (running) since Fri 2018-06-01 10:04:55 WIB; 3h 18min ago
Docs: man:libvirtd(8)
https://libvirt.org
Main PID: 922 (libvirtd)
Tasks: 19 (limit: 32768)
CGroup: /system.slice/libvirtd.service
├─ 922 /usr/sbin/libvirtd
├─1250 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default
└─1251 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default

Enable vhost

sudo modprobe vhost_net

$ lsmod | grep vhost
vhost_net 24576 0
vhost 45056 1 vhost_net
tap 24576 1 vhost_net

$ more /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

echo vhost_net >> /etc/modules

more /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
vhost_net

[3] Tambahkan virtual machine

sudo virt-manager

Done, semoga bermanfaat..Cheers

Fix dpkg: error processing package lvm2 (–configure) di ubuntu 18.04

Ok welcome to “Bionic Beaver”

Ya masalah error ini muncul sewaktu saya install lvm2, errornya seperti ini :

$ sudo apt install lvm2

dpkg: error processing package lvm2 (--configure):
installed lvm2 package post-installation script subprocess returned error exit status 1
Processing triggers for initramfs-tools (0.130ubuntu3) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-22-generic
Errors were encountered while processing:
lvm2
E: Sub-process /usr/bin/dpkg returned an error code (1)

Langkah 1 adalah dengan remove lvm2

$ sudo apt remove lvm2

Install lvm2

$ sudo apt install lvm2

Jika masih gagal lakukan purge lvm2

$ sudo apt purge lvm2

Install lvm2

$ sudo apt install lvm2
Reading package lists... Done
Building dependency tree 
Reading state information... Done
Suggested packages:
thin-provisioning-tools
The following NEW packages will be installed:
lvm2
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 929 kB of archives.
After this operation, 3.391 kB of additional disk space will be used.
Get:1 http://id.archive.ubuntu.com/ubuntu bionic/main amd64 lvm2 amd64 2.02.176-4.1ubuntu3 [929 kB]
Fetched 929 kB in 5s (195 kB/s)
Selecting previously unselected package lvm2.
(Reading database ... 186578 files and directories currently installed.)
Preparing to unpack .../lvm2_2.02.176-4.1ubuntu3_amd64.deb ...
Unpacking lvm2 (2.02.176-4.1ubuntu3) ...
Processing triggers for ureadahead (0.100.0-20) ...
Setting up lvm2 (2.02.176-4.1ubuntu3) ...
update-initramfs: deferring update (trigger activated)
Created symlink /etc/systemd/system/sysinit.target.wants/blk-availability.service → /lib/systemd/system/blk-availability.service.
Created symlink /etc/systemd/system/sysinit.target.wants/lvm2-monitor.service → /lib/systemd/system/lvm2-monitor.service.
Created symlink /etc/systemd/system/sysinit.target.wants/lvm2-lvmetad.socket → /lib/systemd/system/lvm2-lvmetad.socket.
Created symlink /etc/systemd/system/sysinit.target.wants/lvm2-lvmpolld.socket → /lib/systemd/system/lvm2-lvmpolld.socket.
Processing triggers for systemd (237-3ubuntu10) ...
Processing triggers for man-db (2.8.3-2) ...
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for initramfs-tools (0.130ubuntu3) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-22-generic

Cheers

Install Minicom di Ubuntu 16.04

[1] Install Minicom

$ sudo apt-get install minicom

[2] Cari tty di dmesg sebagai Converter

$ dmesg | grep tty
[ 0.000000] console [tty0] enabled
[14033.650953] usb 3-3: pl2303 converter now attached to ttyUSB0

[3] Setting di micom

$ sudo minicom -s

Untuk Serial Device ubah dengan ttyUSB0, dan Bps/Par/Bits untuk perangkat Cisco biasanya menggunakan 9600, setelah settingan sudah seperti di atas tekan Enter lalu save setup as dfl.

Cheers. Semoga bermanfaat.