Thursday, December 7, 2017

Android Studio 3 on Debian Stretch: Fail to run AVD

Symptoms:
  1. Emulator: libGL error: unable to load driver: r600_dri.so
  2. Emulator: libGL error: driver pointer missing
  3. ...etc

To solve this issue:
  1. 1. backup your libstdc++ included in android sdk.
    ~/android-sdk-linux/emulator/lib64/libstdc++/libstdc++.so.6
    $ mv libstdc++.so.6 libstdc++.so.6.bak
  2. make link libstdc++.so.6 from debian stretch
    $ ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so.6
References:
  1. https://android.stackexchange.com/questions/145437/reinstall-avd-on-ubuntu-16-04
  2. https://stackoverflow.com/questions/36189393/android-studio-avd-error-launching

Thursday, November 16, 2017

Upgrade JDK 8 to JDK 9 and steps to fix your application in Eclipse Oxygen

To install JDK 9 in windows (tested on Windows 10)
  1. Download JDK 9 from http://www.oracle.com/technetwork/java/javase/downloads/index.html. Current version when this note created is JDK 9.0.1.
  2. Follow installation instruction.
  3. In window system environment, set JAVA_HOME to JDK 9
    for example: JAVA_HOME = JAVA_HOME=C:\Java\jdk-9.0.1\
  4. In window system environment, set to path to JDK 9 binary folder
    for example Path=...;C:\Java\jdk-9.0.1\bin;...
To Install JDK 9 in Debian Stretch
  1. Add Backport repository to /etc/apt/sources.list
    # BACKPORT
    deb http://ftp.de.debian.org/debian stretch-backports main
  2. Install JDK 9 straight forward
    # apt-get install openjdk-9-jdk openjdk-9-jdk-headless openjdk-9-jre openjdk-9-jre-headless
Note:
  1. You can remove your JDK 8
  2. Android Studio 3 and earlier does not work with JDK 9. You may used JDK 8 that bundled in Android Studio 3 (tested on Android Studio 3 in Windows 10).
Your Eclipse Oxygen (version >= 1a) may be find with JDK 9, but you need to migrating your application library from JDK 8 to JDK 9 with these steps (tested on Windows 10):
  1. "Package Explorer" right click -> Properties
  2. "Java Build Path" -> Library (tab)
  3. Remove JRE System Library [JavaSE-1.8]
  4. Click "Add Library" botton
  5. "Add JRE System Library" -> Next -> "Workspace default JRE (jre-9.0.1)" -> Finish
  6. Click Apply botton
  7. Click Apply and Close botton 

Reference:

  • http://wiki.eclipse.org/Configure_Eclipse_for_Java_9 



Tuesday, October 17, 2017

Centos 7: install epel and speedtest-cli

To install epel

# yum install epel-release

To install speedtest-cli

# yum install python2-speedtest-cli

To run speedtest-cli

# speedtest-cli
Retrieving speedtest.net configuration...
Testing from PT Media Andalan Nusa (103.253.113.233)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by CBN (Jakarta) [0.74 km]: 3.059 ms
Testing download speed................................................................................
Download: 236.99 Mbit/s
Testing upload speed....................................................................................................
Upload: 186.53 Mbit/s


References:
  • https://www.cyberciti.biz/faq/installing-rhel-epel-repo-on-centos-redhat-7-x/

Sunday, October 8, 2017

odoo 10: installing on Debian Stretch

Install from odoo repository not work

# wget -O - https://nightly.odoo.com/odoo.key | apt-key add -
# echo "deb http://nightly.odoo.com/10.0/nightly/deb/ ./" >> /etc/apt/sources.list.d/odoo.list
# apt-get update && apt-get install odoo
# apt-get install odoo
Reading package lists... Done
Building dependency tree     
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 odoo : Depends: python-pypdf but it is not installable
E: Unable to correct problems, you have held broken packages.

We install python-pypdf 1.13 using pip
# apt-get install python-pip
# pip install pyPdf


Instructions bellow may harm your system:
"The purpose of a fake package is to trick dpkg and apt into believing that some package is installed even though it's only an empty shell. This allows satisfying dependencies on a package when the corresponding software was installed outside the scope of the packaging system. Such a method works, but it should still be avoided whenever possible, since there is no guarantee that the manually installed software behaves exactly like the corresponding package would and other packages depending on it would not work properly."

We need to build fake debian package for python-pypdf. Install all requirement tools
# apt-get install equivs  dh-make

Create directory python-pypdf
# mkdir python-pypdf
# cd python-pypdf/

Optional to create default email dan full name for our fake python-pypdf
# export EMAIL="youremail@example.com"
# export DEBFULLNAME="your_full_name"

Create our fake python-pypdf configuration
# equivs-control python-pypdf

Edit file python-pypdf
# vi python-pypdf
### Commented entries have reasonable defaults.
### Uncomment to edit them.
# Source: <source package name; defaults to package name>
Section: python
Priority: optional
# Homepage: <enter URL here; no default>
Standards-Version: 3.9.2
Package: python-pypdf
Version: 1.13
Maintainer: your_full_name<youremail@example.com>
# Pre-Depends: <comma-separated list of packages>
# Depends: <comma-separated list of packages>
# Recommends: <comma-separated list of packages>
# Suggests: <comma-separated list of packages>
# Provides: <comma-separated list of packages>
# Replaces: <comma-separated list of packages>
# Architecture: all
# Multi-Arch: <one of: foreign|same|allowed>
# Copyright: <copyright file; defaults to GPL2>
# Changelog: <changelog file; defaults to a generic changelog>
# Readme: <README.Debian file; defaults to a generic one>
# Extra-Files: <comma-separated list of additional files for the doc directory>
# Files: <pair of space-separated paths; First is file to include, second is destination>
#  <more pairs, if there's more than one file to include. Notice the starting space>
Description: fake package to provide python-pypdf
 python-pypdf will need to be installed with pip
 .
 python-pypdf2 does not provide python-pypdf

We can build our fake python-pypdf and install it
# equivs-build python-pypdf
# dpkg -i python-pypdf_1.13_all.deb

Now you can install odoo 10
# apt-get install odoo
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  odoo
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 58.7 MB of archives.
After this operation, 401 MB of additional disk space will be used.
Get:1 http://nightly.odoo.com/10.0/nightly/deb ./ odoo 10.0.20171005 [58.7 MB]
Fetched 58.7 MB in 2min 32s (385 kB/s)
Selecting previously unselected package odoo.
(Reading database ... 64960 files and directories currently installed.)
Preparing to unpack .../odoo_10.0.20171005_all.deb ...
Unpacking odoo (10.0.20171005) ...
Processing triggers for systemd (232-25+deb9u1) ...
[144408.689602] systemd[1]: apt-daily.timer: Adding 4h 39min 11.670524s random time.
Setting up odoo (10.0.20171005) ...
[144409.728850] systemd[1]: apt-daily.timer: Adding 10h 55min 37.336482s random time.
[144409.893345] systemd[1]: apt-daily.timer: Adding 9h 24min 36.399757s random time.
Processing triggers for systemd (232-25+deb9u1) ...
[144410.109266] systemd[1]: apt-daily.timer: Adding 11h 22min 7.421289s random time.


References:
  • https://github.com/odoo/odoo/issues/17002
  • https://debian-handbook.info/browse/stable/sect.building-first-package.html
  • http://nightly.odoo.com/
  • https://www.odoo.com/documentation/10.0/setup/install.html

Wednesday, October 4, 2017

Debian Stretch: XEN configure & create DomU PV ubuntu xenial part 4

We will use xen-tools to make it easier to create guest. This steps are similiar with create domu pv debian

Configure /etc/xen-tools/xen-tools.conf
# vi /etc/xen-tools/xen-tools.conf
...
# lvm = vg0
lvm = volGroup1
...
install-method = debootstrap
...
debootstrap-cmd = /usr/sbin/debootstrap
...
size   = 80G       # Root disk, suffix (G, M, k) required
memory = 2G # Suffix (G, M, k) required
#maxmem = 2G      # Suffix (G, M, k) optional
swap   = 3G # Suffix (G, M, k) required
# noswap = 1      # Don't use swap at all for new systems.
fs     = ext4     # Default file system for any disk
dist   = `xt-guess-suite-and-mirror --suite`
                  # Default distribution is determined by Dom0's distribution
...
gateway = [your_ip_gateway]
netmask = [your_ip_netmask]
broadcast = [your_ip_broadcast]
...
nameserver = 8.8.8.8
...
bridge = br0
...
passwd = 1
...
pygrub = 1
...
mirror = `xt-guess-suite-and-mirror --mirror`
...


You can create your guest by command
# xen-create-image --hostname=ubuntu1601 --ip=[your_ip] --size=67gb --vcpu=4 --dist=xenial --mirror=http://kambing.ui.ac.id/ubuntu 
...
Setting up root password
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
All done
Logfile produced at:
          /var/log/xen-tools/ubuntu1601.log

Installation Summary
---------------------
Hostname        :  ubuntu1601
Distribution    :  xenial
MAC Address     :  00:16:3E:CC:B3:5E
IP Address(es)  : 
[your_ip]
SSH Fingerprint :  SHA256:lvyAvapyE6Z+NGghQrw2SbqanHuejwqhxpo7u38kw/s (DSA)
SSH Fingerprint :  SHA256:oSZgN9IdMdfQNeOy0pnPk/wcr0JouNEH+1hdvl8hpfM (ECDSA)
SSH Fingerprint :  SHA256:eY/7/FFhMLC6XV4Gk8RmMIbBJBaYLUkBr8yOHno/uXY (ED25519)
SSH Fingerprint :  SHA256:Zc2CIx8fadkEhUN/PXL8M+DADAFXa9g0YMcfBd0dQVE (RSA)
Root Password   :  N/A

Note: you can choose closest ubuntu mirror.

Start your guest
# xl create /etc/xen/ubuntu1601.cfg
# xl list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0 11815    24     r-----     653.2
ubuntu1601                                  23  2048     4     -b----      16.4

State:

  • r - running
  • b - blocked
  • p - paused
  • s - shutdown
  • c - crashed
  • d - dying


Connect to your guest
# xl connect ubuntu1601

To make your guest start after boot/restart
# mkdir /etc/xen/auto
# ln -s /etc/xen/ubuntu1601.cfg /etc/xen/auto/ubuntu1601.cfg


References:

  1. http://blog.noviantech.com/2010/06/23/debian-kernels-and-tigon-tg3-firmware/
  2. https://wiki.debian.org/Firmware
  3. https://wiki.debian.org/LVM
  4. https://wiki.debian.org/LinuxRaidForAdmins
  5. https://ycnrg.org/xen-install-os-from-iso-pv/
  6. http://hwraid.le-vert.net/