Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Monday, April 15, 2024

Selenium on nethunter (pixel)

Make sure firefox is installed

$ firefox -V
Mozilla Firefox 115.5.0esr

Download geckodriver

$ wget https://github.com/mozilla/geckodriver/releases/download/v0.34.0/geckodriver-v0.34.0-linux-aarch64.tar.gz
$ tar xzvf geckodriver-v0.34.0-linux-aarch64.tar.gz

After this step "geckodriver" should be there

$ ./geckodriver -V
geckodriver 0.34.0 (c44f0d09630a 2024-01-02 15:36 +0000)
The source code of this program is available from testing/geckodriver in https://hg.mozilla.org/mozilla-central.
This program is subject to the terms of the Mozilla Public License 2.0. You can obtain a copy of the license
at https://mozilla.org/MPL/2.0/

Install 'selenium'

$ pip3 install selenium

Test code

import os
import sys
import logging
from selenium import webdriver
from selenium.webdriver.firefox.service import Service


THIS_DIR = os.path.dirname(os.path.abspath(__file__))
DRIVER = os.path.join(THIS_DIR, "geckodriver-v0.34.0-linux-aarch64", "geckodriver")

if not os.path.exists(DRIVER):
    print("Cannot find 'geckodriver'")
    sys.exit(1)


def main():
    print("Downloading web page...")

    s = Service(executable_path=DRIVER)

    options = webdriver.FirefoxOptions()
    options.add_argument("--headless")

    driver = webdriver.Firefox(service=s, options=options)
    
    driver.get("https://www.google.com")
    driver.save_screenshot("screenshot.png")

    print("Please check screenshot image")
    driver.quit()


if __name__ == '__main__':
    main()

After run this code "screenshot.png" should be generated

To show "screenshot.png" image in RLogin

$ sudo apt install libsixel-bin
$ img2sixel screenshot.png

Done.

Monday, January 29, 2024

Tmux startup script tempalte

 Tmux script template

#!/bin/bash

SESSION_NAME=dev

# new-session -c start-directory -n window-name -s session-name -t group-name -x width -y height [shell-command]
tmux has-session -t ${SESSION_NAME} 2>&1 >/dev/null

#if [ $? -ne 0 ];then
#	source /opt/.../export.sh
#	tmux new-session -s $SESSION_NAME -n main -d
#	tmux new-window  -c $SRC_DIR -n editor
#	tmux new-window  -c $BUILD_DIR -n build
#	tmux attach -t $SESSION_NAME
#	tmux select-windows -t $SESSION_NAME:0
#else
#	echo "Session is already started"
#fi
#

if [ $? -ne 0 ]; then
    # create new session
    tmux new-session -s ${SESSION_NAME} -n main -d
    tmux split-window -h
    tmux split-window -v
    tmux attach -t ${SESSION_NAME}
else
    echo "Tmux session is already created. Use 'tmux attach -t SESSION_NAME'"
fi

Saturday, June 03, 2023

Lubuntu 20.04で日本語入力

Lubuntu 20.04 は少し古い (・・・現時点(2023年)ではかなり古い?)Distroで日本語入力の設定(fcitx-mozc)で上手く動かすことができない.おそらく繰り返してupdate/upgradeしていたが,fcitxは開発が止まっているため,不具合が出ているかもしれない・・(この記事によれば)

上記の記事に従って fcitxではなくfcitx5とfcitx5-mozcをインストールしたら上手く日本語入力ができるようになった

実施手順:

下記のコマンドで表示される古いfcitx関連パッケージをすべて削除(apt remove)

% apt search "^fcitx" | grep installed

その後,上記の記事の手順に従ってfcitx5-mozcをインストール

% sudo add-apt-repository ppa:ikuya-fruitsbasket/fcitx5

% sudo apt install fcitx5 fcitx5-mozc

後は下記のようにmozcをInput Methodに追加しCtrl + Spaceで入力を切り替えれば日本語入力できるようになる




Monday, May 15, 2023

Wireshark does not work with Tightvncserver

Using kali linux on raspberry pi 4 but wireshark does not work with tightvnc server...  According to this issue report, it's the issue with Qt 

Version of Kali linux I'm using:

$ cat /etc/os-release                       

PRETTY_NAME="Kali GNU/Linux Rolling"

NAME="Kali GNU/Linux"

VERSION="2023.1"

VERSION_ID="2023.1"

VERSION_CODENAME="kali-rolling"

ID=kali

ID_LIKE=debian

HOME_URL="https://www.kali.org/"

SUPPORT_URL="https://forums.kali.org/"

BUG_REPORT_URL="https://bugs.kali.org/"

ANSI_COLOR="1;31"

To fix this issue, changing from "tightvnc" to "tigervnc-standalone-server" and confirmed that the issue is actually fixed

Steps to install and my config:

1. Fist install "tigervnc-standalone-server"
$ sudo apt install tighervnc-standalone-server
After this step, "update-alternatives" will change the link of "vncserver" from "/usr/bin/tightvncserver" to "/usr/bin/tigervncserver"

2. Generate password
$ vncpasswd

3. Then create "/etc/systemd/system/vnc-server.service" file as below:
$ cat /etc/systemd/system/vnc-server.service
[Unit]
Description=VNC Server

[Service]
ExecStart = sudo -u kali vncserver -geometry 1440x900 :1 -localhost=0
ExecStop = sudo -u kali vncserver -kill :1
Type = forking

[Install]
WantedBy = multi-user.target

After this just enable/start the service...

Note: "-localhost=0" option is intentionally used in my environment (not secured) because I just want to directly connect to the VNC service, without using a SSH tunnel. By default this option of "tigervncserver" is "-localhost=1"




Tuesday, April 18, 2023

termux on Android 5.x (in 2023 ... omg)

Download old termux for Android 5.x from this site:
https://archive.org/download/termux-repositories-legacy

Used 'adb' to install:
- termux-v0.79-offline-bootstraps.apk
- termux-api-git-debug.apk
- download 'termux-api_0.47-1_arm.deb' from "https://packages.termux.dev/apt/termux-main-21/pool/main/", then transfer it to /data/local/tmp
- Use 'pkg' to install termux-api_0.47-1_arm.deb

Notes about using 'adb'

Use 'adb' to send input
- adb shell input keyevent ENTER   
- adb shell input text "which%scurl"   --> '%s' is space char

List installed packages:
- adb shell pm list package

Show installed .apk package info:
- adb shell dumpsys package com.termux

Pre-build packages for termux
- https://packages.termux.dev/apt/termux-main-21/pool/main/

Wednesday, February 15, 2023

Dbus error after running Eclipse Oxygen

Error when running Eclipse Oxygen (with CDT) on lubuntu 20.04:

GLib-GIO-CRITICAL **: 16:15:43.425: g_dbus_proxy_new: assertion 'G_IS_DBUS_CONNECTION (connection)' failed

Fixed the sympthon by following command (see: here):

sudo apt purge fcitx-module-dbus


Monday, February 13, 2023

Import OVA which is created by VMWare to VirtualBox

Notes about the problem I had when trying to import OVA created by VMWare to VirtualBox...

My environment: 
  • Windows 10 pro + VirtualBox v7.0 
    • VirtualBox downgraded to 6.1.26 due to this issue with Wayland
      • Still not fixed with Wayland on old linux guest machine (kernel 2.x)
Failed to import OVA file, error when trying import OVA file (exported by VMWare) to VirtualBox:  
  • VBOX_E_INVALID_OBJECT_STATE (0x80bb0007)
OVA file is just a tar file, so extracted it using 7z, we can see these 3 files:
  • vm-disk1.vmdk: Virtual Disk file
  • vm.mf: checksum data
  • vm.ovf: OVF file, VM definition file
Use "qemu-img" to check "vm-disk1.vmdk" (need to install qemu tool to Windows ):
> qemu-img info vm-disk1.vmdk
image: vm-disk1.vmdk
file format: vmdk
virtual size: 22 GiB (23667847168 bytes)
disk size: 316 MiB
cluster_size: 65536
Format specific information:
    cid: 1377153543
    parent cid: 4294967295
    create type: streamOptimized
    extents:
        [0]:
            compressed: true
            virtual size: 23667847168
            filename: vm-disk1.vmdk
            cluster size: 65536
            format:
Probably  VirtualBox could not handle the "streamOptimized" type or compressed vmdk disk image format. 

Tried  use "qemu-img" to convert it to non-compressed disk image:
> qemu-img convert -f vmdk vm-disk1.vmdk -O vmdk vm-disk1-decompressed.vmdk
    
> qemu-img info vm-disk1-decompressed.vmdk
image: vm-disk1-decompressed.vmdk
file format: vmdk
virtual size: 22 GiB (23667847168 bytes)
disk size: 709 MiB
cluster_size: 65536
Format specific information:
    cid: 3421777080
    parent cid: 4294967295
    create type: monolithicSparse
    extents:
        [0]:
            virtual size: 23667847168
            filename: vm-disk1-decompressed.vmdk
            cluster size: 65536
            format:
Ok, now it is "monolithicSparse" and not-compressed disk image type.

Because we just created a new disk, old checksum in file "vm.mf" cannot be used so just delete this file before trying to import again

Replace the  original "vm-disk1.vmdk" with "vm-disk1-decompressed.vmdk"(or edit the "vm.ovf" to make it point to "vm-disk1-decompressed.vmdk", no need to correct the disk size information in this case)

Now try to import again "vm.ovf" and we should be able to import it to VirtualBox. After this step, we can modify the config of the imported VM (cpu numer, memory size, etc., just check the "vm.ovf" and try to set the same config)

After this step, we can run the imported virtual machine, but if you see the error No bootable medium found! System halted , you should enable the "Enable EFI" config:


Done.

Monday, May 30, 2022

xargsコマンドのオプション -n[number]

findコマンドとxargsの組み合わせで,-n[number]オプションの使用のメモ... xargsコマンドに-n1を指定すると1つの引数だけを指定したコマンド(下記のecho)に渡すようになる
$ ls
fileA  fileB  fileC  fileD
$ find . -type f | xargs echo
./fileA ./fileC ./fileD ./fileB
$ find . -type f | xargs -n1  echo
./fileA
./fileC
./fileD
./fileB
$

Friday, May 20, 2022

Bring back taskbar to the default one after accidentally changed it in Lubuntu

Default lxpanel setting: /usr/share/lxpanel/profile/Lubuntu/panels/panel 

So just need to copy it to: ~/.config/lxpanel/Lubuntu/panels/panel

Friday, March 27, 2020

Termux - Buidl and Install OpenCV (opencv-python) / opencv ビルド & インストール

Build and install OpenCV in Termux

1. Install "python"
    % pkg install python

2. Try to install "numpy"
    2.1 Prepare "libm.so"
        Check if you have libm in $PREFIX/lib
            % ls -al $PREFIX/lib | grep libm
        
        If you could not find "libm.so" in $PREFIX/lib, bring it from /system/lib to $PREFIX/lib
        (this step is needed for building opencv later on also)
            % ln -s /system/lib/libm.so $PREFIX/lib/libm.so

    2.2 Install "numpy"
        % LDFLAGS="-lm -lcompiler_rt" pip install --no-cache-dir numpy
        
        Note: without "LDFLAGS=..." part, you might get the following error

Python 3.8.0 (default, Dec  5 2019, 10:21:08)
[Clang 8.0.7 (https://android.googlesource.com/toolchain/clang b55f2d4ebfd35bf6 on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/numpy/__init__.py", line 142, in
    from . import core
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/numpy/core/__init__.py", line 104, in
    from . import _add_newdocs
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/numpy/core/_add_newdocs.py", line 4441, in
    add_newdoc('numpy.core._multiarray_tests', 'format_float_OSprintf_g',
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/numpy/core/function_base.py", line 506, in add_newdoc
    new = getattr(__import__(place, globals(), {}, [obj]), obj)
ImportError: dlopen failed: cannot locate symbol "tanh" referenced by "_multiarray_tests.cpython-38.so"...
>>>

    2.3 Test if we can import numpy to make sure it's installed correctly

3. Build "opencv"

    3.1 Install some libraries
        % pkg install cmake pkg-config libjpeg-turbo libpng
 
    3.2 Clone source code of opencv
        % cd storage/external-1
        % git clone https://github.com/opencv/opencv.git
        % cd opencv
        % git checkout -b tag4.2.0 refs/tags/4.2.0

        Then apply the following changes to opencv/modules/python/CMakeLists.txt

 
    3.3 Run cmake to config before building
        % cd opencv
        % mkdir build && cd build

        % LDFLAGS=" -L$PREFIX/lib/ -llog -lm -lpython3.8 " \
        cmake \
        -DOPENCV_SKIP_PYTHON_LOADER=OFF \
        -DCMAKE_BUILD_TYPE=RELEASE \
        -DCMAKE_INSTALL_PREFIX=$PREFIX \
        -DOPENCV_ENABLE_NONFREE:BOOL=ON \
        -DBUILD_opencv_python3:BOOL=ON \
        -DBUILD_opencv_python2:BOOL=OFF \
        -DPYTHON_EXECUTABLE=$PREFIX/bin/python3 \
        -DPYTHON_DEFAULT_EXECUTABLE=$PREFIX/bin/python3 \
        -DPYTHON3_EXECUTABLE=$PREFIX/bin/python3 \
        -DPYTHON3_INCLUDE_DIR=/$PREFIX/include/python3.8 \
        -DPYTHON3_INCLUDE_DIR2=/$PREFIX/include/python3.8 \
        -DPYTHON3_LIBRARIES=$PREFIX/lib/python3.8.so \
        -DPYTHON3_INCLUDE_PATH=$PREFIX/include/python3.8 \
        -DPYTHON3_LIBRARY=$PREFIX/lib/libpython3.8.so \
        -DPYTHON3LIBS_VERSION_STRING=3.8 \
        -DPYTHON3_PACKAGES_PATH=$PREFIX/lib/python3.8/site-packages \
        -DPYTHON3_NUMPY_INCLUDE_DIRS=$PREFIX/lib/python3.8/site-packages/numpy/core/include \
        -DPYTHON3_NUMPY_VERSION=1.18.2\
        -DBUILD_JAVA=OFF \
        -DBUILD_ANDROID_PROJECTS=OFF \
        -DBUILD_ANDROID_EXAMPLES=OFF \
        -DWITH_QT=OFF \
        -DWITH_GTK=OFF \
        -DWITH_TEST=OFF \
        -DBUILD_TESTS=OFF \
        -DBUILD_EXAMPLES=OFF ..

    After the step above, you should get the following result, check if "python3" is included in "to be built" module list...

-- The CXX compiler identification is Clang 9.0.0
-- The C compiler identification is Clang 9.0.0
-- Check for working CXX compiler: /data/data/com.termux/files/usr/bin/c++
-- Check for working CXX compiler: /data/data/com.termux/files/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /data/data/com.termux/files/usr/bin/cc
-- Check for working C compiler: /data/data/com.termux/files/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Detected processor: x86_64
-- sizeof(void) = 4 on 64 bit processor. Assume 32-bit compilation mode
-- Found PythonInterp: /data/data/com.termux/files/usr/bin/python3 (found suitable version "3.8", minimum required is "2.7")
CMake Warning at cmake/OpenCVDetectPython.cmake:81 (message):
  CMake's 'find_host_package(PythonInterp 2.7)' founds wrong Python version:

  PYTHON_EXECUTABLE=/data/data/com.termux/files/usr/bin/python3

  PYTHON_VERSION_STRING=3.8

  Consider specify 'PYTHON2_EXECUTABLE' variable via CMake command line or
  environment variables

Call Stack (most recent call first):
  cmake/OpenCVDetectPython.cmake:271 (find_python)
  CMakeLists.txt:585 (include)


-- Found Python2: /data/data/com.termux/files/usr/bin/python2.7 (found version "2.7.17") found components:  Interpreter
-- Found PythonInterp: /data/data/com.termux/files/usr/bin/python2.7 (found version "2.7.17")
-- Found PythonInterp: /data/data/com.termux/files/usr/bin/python3 (found suitable version "3.8", minimum required is "3.2")
-- Looking for ccache - not found
-- Performing Test HAVE_CXX_FSIGNED_CHAR
-- Performing Test HAVE_CXX_FSIGNED_CHAR - Success
-- Performing Test HAVE_C_FSIGNED_CHAR
-- Performing Test HAVE_C_FSIGNED_CHAR - Success
-- Performing Test HAVE_CXX_W
-- Performing Test HAVE_CXX_W - Success
-- Performing Test HAVE_C_W
-- Performing Test HAVE_C_W - Success
-- Performing Test HAVE_CXX_WALL
-- Performing Test HAVE_CXX_WALL - Success
-- Performing Test HAVE_C_WALL
-- Performing Test HAVE_C_WALL - Success
-- Performing Test HAVE_CXX_WERROR_RETURN_TYPE
-- Performing Test HAVE_CXX_WERROR_RETURN_TYPE - Success
-- Performing Test HAVE_C_WERROR_RETURN_TYPE
-- Performing Test HAVE_C_WERROR_RETURN_TYPE - Success
-- Performing Test HAVE_CXX_WERROR_NON_VIRTUAL_DTOR
-- Performing Test HAVE_CXX_WERROR_NON_VIRTUAL_DTOR - Success
-- Performing Test HAVE_C_WERROR_NON_VIRTUAL_DTOR
-- Performing Test HAVE_C_WERROR_NON_VIRTUAL_DTOR - Success
-- Performing Test HAVE_CXX_WERROR_ADDRESS
-- Performing Test HAVE_CXX_WERROR_ADDRESS - Success
-- Performing Test HAVE_C_WERROR_ADDRESS
-- Performing Test HAVE_C_WERROR_ADDRESS - Success
-- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT
-- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT - Success
-- Performing Test HAVE_C_WERROR_SEQUENCE_POINT
-- Performing Test HAVE_C_WERROR_SEQUENCE_POINT - Success
-- Performing Test HAVE_CXX_WFORMAT
-- Performing Test HAVE_CXX_WFORMAT - Success
-- Performing Test HAVE_C_WFORMAT
-- Performing Test HAVE_C_WFORMAT - Success
-- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY
-- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY - Success
-- Performing Test HAVE_C_WERROR_FORMAT_SECURITY
-- Performing Test HAVE_C_WERROR_FORMAT_SECURITY - Success
-- Performing Test HAVE_CXX_WMISSING_DECLARATIONS
-- Performing Test HAVE_CXX_WMISSING_DECLARATIONS - Success
-- Performing Test HAVE_C_WMISSING_DECLARATIONS
-- Performing Test HAVE_C_WMISSING_DECLARATIONS - Success
-- Performing Test HAVE_CXX_WMISSING_PROTOTYPES
-- Performing Test HAVE_CXX_WMISSING_PROTOTYPES - Success
-- Performing Test HAVE_C_WMISSING_PROTOTYPES
-- Performing Test HAVE_C_WMISSING_PROTOTYPES - Success
-- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES
-- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES - Success
-- Performing Test HAVE_C_WSTRICT_PROTOTYPES
-- Performing Test HAVE_C_WSTRICT_PROTOTYPES - Success
-- Performing Test HAVE_CXX_WUNDEF
-- Performing Test HAVE_CXX_WUNDEF - Success
-- Performing Test HAVE_C_WUNDEF
-- Performing Test HAVE_C_WUNDEF - Success
-- Performing Test HAVE_CXX_WINIT_SELF
-- Performing Test HAVE_CXX_WINIT_SELF - Success
-- Performing Test HAVE_C_WINIT_SELF
-- Performing Test HAVE_C_WINIT_SELF - Success
-- Performing Test HAVE_CXX_WPOINTER_ARITH
-- Performing Test HAVE_CXX_WPOINTER_ARITH - Success
-- Performing Test HAVE_C_WPOINTER_ARITH
-- Performing Test HAVE_C_WPOINTER_ARITH - Success
-- Performing Test HAVE_CXX_WSHADOW
-- Performing Test HAVE_CXX_WSHADOW - Success
-- Performing Test HAVE_C_WSHADOW
-- Performing Test HAVE_C_WSHADOW - Success
-- Performing Test HAVE_CXX_WSIGN_PROMO
-- Performing Test HAVE_CXX_WSIGN_PROMO - Success
-- Performing Test HAVE_C_WSIGN_PROMO
-- Performing Test HAVE_C_WSIGN_PROMO - Success
-- Performing Test HAVE_CXX_WUNINITIALIZED
-- Performing Test HAVE_CXX_WUNINITIALIZED - Success
-- Performing Test HAVE_C_WUNINITIALIZED
-- Performing Test HAVE_C_WUNINITIALIZED - Success
-- Performing Test HAVE_CXX_WINCONSISTENT_MISSING_OVERRIDE
-- Performing Test HAVE_CXX_WINCONSISTENT_MISSING_OVERRIDE - Success
-- Performing Test HAVE_C_WINCONSISTENT_MISSING_OVERRIDE
-- Performing Test HAVE_C_WINCONSISTENT_MISSING_OVERRIDE - Success
-- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR
-- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR - Success
-- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR
-- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR - Success
-- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
-- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Success
-- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
-- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Success
-- Performing Test HAVE_CXX_WNO_COMMENT
-- Performing Test HAVE_CXX_WNO_COMMENT - Success
-- Performing Test HAVE_C_WNO_COMMENT
-- Performing Test HAVE_C_WNO_COMMENT - Success
-- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION
-- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION - Success
-- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION
-- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION - Success
-- Performing Test HAVE_CXX_QUNUSED_ARGUMENTS
-- Performing Test HAVE_CXX_QUNUSED_ARGUMENTS - Success
-- Performing Test HAVE_C_QUNUSED_ARGUMENTS
-- Performing Test HAVE_C_QUNUSED_ARGUMENTS - Success
-- Performing Test HAVE_CXX_MSSE (check file: cmake/checks/cpu_sse.cpp)
-- Performing Test HAVE_CXX_MSSE - Success
-- Performing Test HAVE_CXX_MSSE2 (check file: cmake/checks/cpu_sse2.cpp)
-- Performing Test HAVE_CXX_MSSE2 - Success
-- Performing Test HAVE_CXX_MSSE3 (check file: cmake/checks/cpu_sse3.cpp)
-- Performing Test HAVE_CXX_MSSE3 - Success
-- Performing Test HAVE_CXX_MSSSE3 (check file: cmake/checks/cpu_ssse3.cpp)
-- Performing Test HAVE_CXX_MSSSE3 - Success
-- Performing Test HAVE_CXX_MSSE4_1 (check file: cmake/checks/cpu_sse41.cpp)
-- Performing Test HAVE_CXX_MSSE4_1 - Success
-- Performing Test HAVE_CXX_MPOPCNT (check file: cmake/checks/cpu_popcnt.cpp)
-- Performing Test HAVE_CXX_MPOPCNT - Success
-- Performing Test HAVE_CXX_MSSE4_2 (check file: cmake/checks/cpu_sse42.cpp)
-- Performing Test HAVE_CXX_MSSE4_2 - Success
-- Performing Test HAVE_CXX_MF16C (check file: cmake/checks/cpu_fp16.cpp)
-- Performing Test HAVE_CXX_MF16C - Success
-- Performing Test HAVE_CXX_MAVX (check file: cmake/checks/cpu_avx.cpp)
-- Performing Test HAVE_CXX_MAVX - Success
-- Performing Test HAVE_CPU_BASELINE_FLAGS
-- Performing Test HAVE_CPU_BASELINE_FLAGS - Success
-- Performing Test HAVE_CPU_DISPATCH_FLAGS_SSE4_1
-- Performing Test HAVE_CPU_DISPATCH_FLAGS_SSE4_1 - Success
-- Performing Test HAVE_CPU_DISPATCH_FLAGS_SSE4_2
-- Performing Test HAVE_CPU_DISPATCH_FLAGS_SSE4_2 - Success
-- Performing Test HAVE_CPU_DISPATCH_FLAGS_FP16
-- Performing Test HAVE_CPU_DISPATCH_FLAGS_FP16 - Success
-- Performing Test HAVE_CPU_DISPATCH_FLAGS_AVX
-- Performing Test HAVE_CPU_DISPATCH_FLAGS_AVX - Success
-- Performing Test HAVE_CXX_MFPMATH_SSE
-- Performing Test HAVE_CXX_MFPMATH_SSE - Success
-- Performing Test HAVE_C_MFPMATH_SSE
-- Performing Test HAVE_C_MFPMATH_SSE - Success
-- Performing Test HAVE_CXX_FVISIBILITY_HIDDEN
-- Performing Test HAVE_CXX_FVISIBILITY_HIDDEN - Success
-- Performing Test HAVE_C_FVISIBILITY_HIDDEN
-- Performing Test HAVE_C_FVISIBILITY_HIDDEN - Success
-- Performing Test HAVE_CXX_FVISIBILITY_INLINES_HIDDEN
-- Performing Test HAVE_CXX_FVISIBILITY_INLINES_HIDDEN - Success
-- Performing Test HAVE_C_FVISIBILITY_INLINES_HIDDEN
-- Performing Test HAVE_C_FVISIBILITY_INLINES_HIDDEN - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Looking for malloc.h
-- Looking for malloc.h - found
-- Looking for memalign
-- Looking for memalign - found
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Found ZLIB: /data/data/com.termux/files/usr/lib/libz.so (found suitable version "1.2.11", minimum required is "1.2.3")
-- Performing Test HAVE_C_WNO_UNUSED_PARAMETER
-- Performing Test HAVE_C_WNO_UNUSED_PARAMETER - Success
-- Performing Test HAVE_C_WNO_SIGN_COMPARE
-- Performing Test HAVE_C_WNO_SIGN_COMPARE - Success
-- Performing Test HAVE_C_WNO_SHORTEN_64_TO_32
-- Performing Test HAVE_C_WNO_SHORTEN_64_TO_32 - Success
-- Performing Test HAVE_C_WNO_IMPLICIT_FALLTHROUGH
-- Performing Test HAVE_C_WNO_IMPLICIT_FALLTHROUGH - Success
-- libjpeg-turbo: VERSION = 2.0.2, BUILD = opencv-4.2.0-libjpeg-turbo
-- Check size of size_t
-- Check size of size_t - done
-- Check size of unsigned long
-- Check size of unsigned long - done
-- Performing Test HAVE_BUILTIN_CTZL
-- Performing Test HAVE_BUILTIN_CTZL - Success
-- Looking for include file locale.h
-- Looking for include file locale.h - found
-- Looking for include file stdlib.h
-- Looking for include file stdlib.h - found
-- Looking for include file sys/types.h
-- Looking for include file sys/types.h - found
-- Looking for assert.h
-- Looking for assert.h - found
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for io.h
-- Looking for io.h - not found
-- Looking for limits.h
-- Looking for limits.h - found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for search.h
-- Looking for search.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Performing Test C_HAS_inline
-- Performing Test C_HAS_inline - Success
-- Check size of signed short
-- Check size of signed short - done
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Check size of signed int
-- Check size of signed int - done
-- Check size of unsigned int
-- Check size of unsigned int - done
-- Check size of signed long
-- Check size of signed long - done
-- Check size of signed long long
-- Check size of signed long long - done
-- Check size of unsigned long long
-- Check size of unsigned long long - done
-- Check size of unsigned char *
-- Check size of unsigned char * - done
-- Check size of ptrdiff_t
-- Check size of ptrdiff_t - done
-- Check size of INT8
-- Check size of INT8 - failed
-- Check size of INT16
-- Check size of INT16 - failed
-- Check size of INT32
-- Check size of INT32 - failed
-- Looking for floor
-- Looking for floor - found
-- Looking for pow
-- Looking for pow - found
-- Looking for sqrt
-- Looking for sqrt - found
-- Looking for isascii
-- Looking for isascii - found
-- Looking for memset
-- Looking for memset - found
-- Looking for mmap
-- Looking for mmap - found
-- Looking for getopt
-- Looking for getopt - found
-- Looking for memmove
-- Looking for memmove - found
-- Looking for setmode
-- Looking for setmode - not found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for strchr
-- Looking for strchr - found
-- Looking for strrchr
-- Looking for strrchr - found
-- Looking for strstr
-- Looking for strstr - found
-- Looking for strtol
-- Looking for strtol - found
-- Looking for strtol
-- Looking for strtol - found
-- Looking for strtoull
-- Looking for strtoull - found
-- Looking for lfind
-- Looking for lfind - found
-- Performing Test HAVE_SNPRINTF
-- Performing Test HAVE_SNPRINTF - Success
-- Check if the system is big endian
-- Searching 16 bit integer
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Performing Test HAVE_C_WNO_UNUSED_BUT_SET_VARIABLE
-- Performing Test HAVE_C_WNO_UNUSED_BUT_SET_VARIABLE - Failed
-- Performing Test HAVE_C_WNO_MISSING_PROTOTYPES
-- Performing Test HAVE_C_WNO_MISSING_PROTOTYPES - Success
-- Performing Test HAVE_C_WNO_MISSING_DECLARATIONS
-- Performing Test HAVE_C_WNO_MISSING_DECLARATIONS - Success
-- Performing Test HAVE_C_WNO_UNDEF
-- Performing Test HAVE_C_WNO_UNDEF - Success
-- Performing Test HAVE_C_WNO_UNUSED
-- Performing Test HAVE_C_WNO_UNUSED - Success
-- Performing Test HAVE_C_WNO_CAST_ALIGN
-- Performing Test HAVE_C_WNO_CAST_ALIGN - Success
-- Performing Test HAVE_C_WNO_SHADOW
-- Performing Test HAVE_C_WNO_SHADOW - Success
-- Performing Test HAVE_C_WNO_MAYBE_UNINITIALIZED
-- Performing Test HAVE_C_WNO_MAYBE_UNINITIALIZED - Failed
-- Performing Test HAVE_C_WNO_POINTER_TO_INT_CAST
-- Performing Test HAVE_C_WNO_POINTER_TO_INT_CAST - Success
-- Performing Test HAVE_C_WNO_INT_TO_POINTER_CAST
-- Performing Test HAVE_C_WNO_INT_TO_POINTER_CAST - Success
-- Performing Test HAVE_C_WNO_MISLEADING_INDENTATION
-- Performing Test HAVE_C_WNO_MISLEADING_INDENTATION - Failed
-- Performing Test HAVE_CXX_WNO_MISSING_DECLARATIONS
-- Performing Test HAVE_CXX_WNO_MISSING_DECLARATIONS - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_PARAMETER
-- Performing Test HAVE_CXX_WNO_UNUSED_PARAMETER - Success
-- Performing Test HAVE_CXX_WNO_MISSING_PROTOTYPES
-- Performing Test HAVE_CXX_WNO_MISSING_PROTOTYPES - Success
-- Performing Test HAVE_CXX_WNO_UNDEF
-- Performing Test HAVE_CXX_WNO_UNDEF - Success
-- Performing Test HAVE_C_STD_C99
-- Performing Test HAVE_C_STD_C99 - Success
-- Performing Test HAVE_C_WNO_UNUSED_VARIABLE
-- Performing Test HAVE_C_WNO_UNUSED_VARIABLE - Success
-- Performing Test HAVE_C_WNO_UNUSED_FUNCTION
-- Performing Test HAVE_C_WNO_UNUSED_FUNCTION - Success
-- Performing Test HAVE_C_WNO_IMPLICIT_FUNCTION_DECLARATION
-- Performing Test HAVE_C_WNO_IMPLICIT_FUNCTION_DECLARATION - Success
-- Performing Test HAVE_C_WNO_UNINITIALIZED
-- Performing Test HAVE_C_WNO_UNINITIALIZED - Success
-- Performing Test HAVE_C_WNO_UNUSED_BUT_SET_PARAMETER
-- Performing Test HAVE_C_WNO_UNUSED_BUT_SET_PARAMETER - Failed
-- Performing Test HAVE_C_WNO_STRICT_OVERFLOW
-- Performing Test HAVE_C_WNO_STRICT_OVERFLOW - Success
-- Performing Test HAVE_C_WNO_POINTER_COMPARE
-- Performing Test HAVE_C_WNO_POINTER_COMPARE - Failed
-- Performing Test HAVE_C_WNO_ABSOLUTE_VALUE
-- Performing Test HAVE_C_WNO_ABSOLUTE_VALUE - Success
-- Performing Test HAVE_C_WNO_STRICT_PROTOTYPES
-- Performing Test HAVE_C_WNO_STRICT_PROTOTYPES - Success
-- Looking for semaphore.h
-- Looking for semaphore.h - found
-- Performing Test HAVE_CXX_WNO_SHADOW
-- Performing Test HAVE_CXX_WNO_SHADOW - Success
-- Performing Test HAVE_CXX_WNO_UNUSED
-- Performing Test HAVE_CXX_WNO_UNUSED - Success
-- Performing Test HAVE_CXX_WNO_SIGN_COMPARE
-- Performing Test HAVE_CXX_WNO_SIGN_COMPARE - Success
-- Performing Test HAVE_CXX_WNO_UNINITIALIZED
-- Performing Test HAVE_CXX_WNO_UNINITIALIZED - Success
-- Performing Test HAVE_CXX_WNO_SWITCH
-- Performing Test HAVE_CXX_WNO_SWITCH - Success
-- Performing Test HAVE_CXX_WNO_PARENTHESES
-- Performing Test HAVE_CXX_WNO_PARENTHESES - Success
-- Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS
-- Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS - Success
-- Performing Test HAVE_CXX_WNO_EXTRA
-- Performing Test HAVE_CXX_WNO_EXTRA - Success
-- Performing Test HAVE_CXX_WNO_DEPRECATED_DECLARATIONS
-- Performing Test HAVE_CXX_WNO_DEPRECATED_DECLARATIONS - Success
-- Performing Test HAVE_CXX_WNO_MISLEADING_INDENTATION
-- Performing Test HAVE_CXX_WNO_MISLEADING_INDENTATION - Failed
-- Performing Test HAVE_CXX_WNO_DEPRECATED
-- Performing Test HAVE_CXX_WNO_DEPRECATED - Success
-- Performing Test HAVE_CXX_WNO_SUGGEST_OVERRIDE
-- Performing Test HAVE_CXX_WNO_SUGGEST_OVERRIDE - Failed
-- Performing Test HAVE_CXX_WNO_INCONSISTENT_MISSING_OVERRIDE
-- Performing Test HAVE_CXX_WNO_INCONSISTENT_MISSING_OVERRIDE - Success
-- Performing Test HAVE_CXX_WNO_IMPLICIT_FALLTHROUGH
-- Performing Test HAVE_CXX_WNO_IMPLICIT_FALLTHROUGH - Success
-- Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_COMPARE
-- Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_COMPARE - Success
-- Performing Test HAVE_CXX_WNO_REORDER
-- Performing Test HAVE_CXX_WNO_REORDER - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_RESULT
-- Performing Test HAVE_CXX_WNO_UNUSED_RESULT - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_LOCAL_TYPEDEFS
-- Performing Test HAVE_CXX_WNO_UNUSED_LOCAL_TYPEDEFS - Success
-- Performing Test HAVE_CXX_WNO_SIGN_PROMO
-- Performing Test HAVE_CXX_WNO_SIGN_PROMO - Success
-- Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_UNDEFINED_COMPARE
-- Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_UNDEFINED_COMPARE - Success
-- Performing Test HAVE_CXX_WNO_IGNORED_QUALIFIERS
-- Performing Test HAVE_CXX_WNO_IGNORED_QUALIFIERS - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_FUNCTION
-- Performing Test HAVE_CXX_WNO_UNUSED_FUNCTION - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_CONST_VARIABLE
-- Performing Test HAVE_CXX_WNO_UNUSED_CONST_VARIABLE - Success
-- Performing Test HAVE_CXX_WNO_SHORTEN_64_TO_32
-- Performing Test HAVE_CXX_WNO_SHORTEN_64_TO_32 - Success
-- Performing Test HAVE_CXX_WNO_INVALID_OFFSETOF
-- Performing Test HAVE_CXX_WNO_INVALID_OFFSETOF - Success
-- Performing Test HAVE_CXX_WNO_ENUM_COMPARE_SWITCH
-- Performing Test HAVE_CXX_WNO_ENUM_COMPARE_SWITCH - Success
Android: Projects builds are DISABLED
-- Looking for dlerror in dl
-- Looking for dlerror in dl - found
-- OpenCV Python: during development append to PYTHONPATH: /data/data/com.termux/files/home/storage/external-1/opencv/build/python_loader
-- Excluding from source files list: modules/imgproc/src/imgwarp.avx2.cpp
-- Excluding from source files list: modules/imgproc/src/resize.avx2.cpp
-- Excluding from source files list: modules/imgproc/src/sumpixels.avx512_skx.cpp
-- Registering hook 'INIT_MODULE_SOURCES_opencv_dnn': /data/data/com.termux/files/home/storage/external-1/opencv/modules/dnn/cmake/hooks/INIT_MODULE_SOURCES_opencv_dnn.cmake
-- opencv_dnn: filter out ocl4dnn source code
-- opencv_dnn: filter out cuda4dnn source code
-- Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx2.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx512_skx.cpp
-- Excluding from source files list: modules/features2d/src/fast.avx2.cpp
-- Performing Test HAVE_CXX_WNO_OVERLOADED_VIRTUAL
-- Performing Test HAVE_CXX_WNO_OVERLOADED_VIRTUAL - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_PRIVATE_FIELD
-- Performing Test HAVE_CXX_WNO_UNUSED_PRIVATE_FIELD - Success
-- Android OpenCV Manager is ignored
--
-- General configuration for OpenCV 4.2.0 =====================================
--   Version control:               4.2.0-dirty
--
--   Platform:
--     Timestamp:                   2020-03-24T10:54:58Z
--     Host:                        Android 3.10.20-x86_64_byt x86_64
--     CMake:                       3.15.5
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /data/data/com.termux/files/usr/bin/make
--     Configuration:               RELEASE
--
--   CPU/HW features:
--     Baseline:                    SSE SSE2
--       requested:                 SSE2
--     Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX
--       requested:                 SSE4_1 SSE4_2 AVX FP16
--       SSE4_1 (13 files):         + SSE3 SSSE3 SSE4_1
--       SSE4_2 (1 files):          + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2
--       FP16 (0 files):            + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
--       AVX (4 files):             + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 AVX
--
--   C/C++:
--     Built as dynamic libs?:      NO
--     C++ Compiler:                /data/data/com.termux/files/usr/bin/c++  (ver 9.0.0)
--     C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments  -msse -msse2 -mfpmath=sse -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments  -msse -msse2 -mfpmath=sse -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /data/data/com.termux/files/usr/bin/cc
--     C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments  -msse -msse2 -mfpmath=sse -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments  -msse -msse2 -mfpmath=sse -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):      -L/system/lib/ -L/data/data/com.termux/files/usr/lib/ -llog -lm -lpython3.8
--     Linker flags (Debug):        -L/system/lib/ -L/data/data/com.termux/files/usr/lib/ -llog -lm -lpython3.8
--     ccache:                      NO
--     Precompiled headers:         NO
--     Extra dependencies:          z dl m log
--     3rdparty dependencies:       libcpufeatures ittnotify libprotobuf libjpeg-turbo libwebp libpng libtiff libjasper IlmImf quirc
--
--   OpenCV modules:
--     To be built:                 calib3d core dnn features2d flann highgui imgcodecs imgproc ml objdetect photo python3 stitching ts video videoio
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 gapi java js python2
--     Applications:                perf_tests
--     Documentation:               NO
--     Non-free algorithms:         YES
--
--   Android NDK:                   location:
--     Android ABI:
--     STL type:
--     Native API level:
--   Android SDK:                   not used, projects are not built
--
--   GUI:
--
--   Media I/O:
--     ZLib:                        z (ver 1.2.11)
--     JPEG:                        build-libjpeg-turbo (ver 2.0.2-62)
--     WEBP:                        build (ver encoder: 0x020e)
--     PNG:                         build (ver 1.6.37)
--     TIFF:                        build (ver 42 - 4.0.10)
--     JPEG 2000:                   build (ver 1.900.1)
--     OpenEXR:                     build (ver 2.3.0)
--     HDR:                         YES
--     SUNRASTER:                   YES
--     PXM:                         YES
--     PFM:                         YES
--
--   Video I/O:
--
--   Parallel framework:            pthreads
--
--   Trace:                         YES (with Intel ITT)
--
--   Other third-party libraries:
--     Eigen:                       NO
--     Custom HAL:                  NO
--     Protobuf:                    build (3.5.1)
--
--   Python 3:
--     Interpreter:                 /data/data/com.termux/files/usr/bin/python3 (ver 3.8)
--     Libraries:                   /data/data/com.termux/files/usr/lib/python3.8.so (ver 3.8)
--     numpy:                       /data/data/com.termux/files/usr/lib/python3.8/site-packages/numpy/core/include (ver 1.18.2-DBUILD_JAVA=OFF)
--     install path:                /data/data/com.termux/files/usr/lib/python3.8/site-packages/cv2/python-3.8
--
--   Python (for build):            /data/data/com.termux/files/usr/bin/python3
--
--   Java:                          export all functions
--     ant:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
--
--   Install to:                    /data/data/com.termux/files/usr
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /data/data/com.termux/files/home/storage/external-1/opencv/build


    3.4 Make and install
 
        % make
        % make install
     
    3.5 Check
        After all these steps, you should be able to "import cv2" in Python


Thursday, March 19, 2020

Termux - Pillow installation / Pillow インストール

Install dependencies:
apt install libjpeg-turbo libjpeg-turbo-progs
apt install ndk-sysroot  --> 180 MB
apt install python clang fftw libcrypt libzmq
apt install freetype libpng pkg-config

pip install wheel
pip install pillow

You might need to upgrade pip first, then do the following step:
pip install --upgrade pip

If there's a build error, we can try the following also:

LDFLAGS="-L/system/lib/" CFLAGS="-I/data/data/com.termux/files/usr/include/" pip install wheel
LDFLAGS="-L/system/lib/" CFLAGS="-I/data/data/com.termux/files/usr/include/" pip install pillow

Thursday, May 22, 2014

Ubuntu Android sdk install memo

Androidの開発環境を lubuntuに入れる。
Eclipseはインストールする必要がなく、"adt-bundle-linux-x86-20140321.zip"をGoogleからダウンロードし、unzipしたらeclipseとSdkが入っている。eclipseはそのまま実行すれば、すべてADTなどが入っている。

sdkをPATHに入れる.bashrc:

export PATH=${PATH}:~/.../sdk/tools
export PATH=${PATH}:~/.../sdk/platform-tools
Opengles emulator:
sudo apt-get install libgles2-mesa-dev

Thursday, January 23, 2014

Ubuntu, Lubuntu 12.04 with VirtualBox

Proxy設定for apt-get:はapt.conf.dの中に設定ファイル(例えばここでは80proxy)を追加

% export http_proxy="http://x.x.x.x:8080"
% export ftp_proxy="..."
% export https_proxy="..."

% sudo vim /etc/apt/apt.conf.d/80proxy
Acqurire::http::proxy "http://x.x.x.x:8080";
Acqurire::https::proxy "http://x.x.x.x:8080";
Acqurire::ftp::proxy "http://x.x.x.x:8080";

これでProxyを通してupdateできる 上記はapt-get用のプロキシの設定で,システムのプロキシ設定は/etc/environmentファイルを編集して追加する.
/etc/environment

http_proxy=http:// myproxy.server.com:8080/ 
https_proxy=http:// myproxy.server.com:8080/
ftp_proxy=http:// myproxy.server.com:8080/
no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"

VirtualBoxのネットワーク設定
(http://nwing.knowd.co.jp/yamazaki/index.php?q=node/169) このページはとてもわかりやすい
VirtualBoxの3Dアクセラレーションを有効にする方法

Thursday, October 17, 2013

xubuntu 12.04.3 alternate i386 インストールメモ

■ xubuntu 12.04.3 alternate i386 インストールメモ

% sudo apt-get update
% sudo apt-get upgrade
% sudo apt-get install xubuntu-desktop

これで軽量のデスクトップ環境ができる

■ キーボード配列が英語になっていたため、日本語配列に

% vim /etc/default/keyboard
------------------
#XKBMODEL="pc101"
#XKBLAYOUT="us"

XKBMODEL="jp109"
XKBLAYOUT="jp"
XKBVARIANT=""
XKBOPTIONS=""
------------------

■ Install vim
$ sudo apt-get install vim

■ Google input method
$ sudo apt-get install ibus-mozc
$ ibus-setup # <- p="">

■ Build tools
$ sudo apt-get install build-essential
$ sudo apt-get install subversion git ssh
$ sudo apt-get install cmake cmake-gui

■ java SDKインストール

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update

$ sudo apt-get install oracle-java6-installer
$ sudo apt-get install oracle-java7-installer

○Java 6, 7の切り替えするには
$ sudo update-alternatives --config java
■ Install cross-compiler
$ sudo apt-get instal g++-arm-linux-gnueabi
$ sudo apt-get instal g++-arm-linux-gnueabihf

■ Install acrobat reader
$ sudo vim /etc/apt/source.list
...
# deb http://archive.canonical.com/ubuntu precise partner
上の行をコメントアウト

$ sudo apt-get update
$ sudo apt-get install adobereader-jpn


■ LaTeX
$ sudo apt-add-repository ppa:texlive-backports/ppa
$ sudo apt-get update

$ sudo apt-get install texlive-lang-cjk
$ sudo apt-get install texlive-fonts-recommended

ここまでで、texを使用できるが日本語のフォントがでない

○解決方法:
フォントmapの場所を調べ方
$ kpsewhich ptex-ipa.map
/usr/share/texlive/texmf-dist/fonts/map/dvipdfmx/jfontmaps/ptex-ipa.map

上のようにパスが通っていればOK。dvipdfmxでPDFを作成するときはフォント埋め込み指定する

$ dvipdfmx -f ptex-ipa.map Sample.dvi
$ acroread Sample.pdf で確認

これで日本語のPDFを作成できる。しかし、xdvi、evinceでフォント化けている。

○xdviの設定を書き換える
$ fc-list | grep IPA -> フォントIPAがあるかどうかを確認、あれば下記のように実行
$ cd /etc/texmf/vfontmap.d
$ sudo cp 20xdvik-ja.map 20xdvik-ja.map.org

$ sudo vim 20xdvik-ja.map

@IPAMincho-Regular@
rml  JIS-H % ASCII pTeX
rmlv JIS-V % ASCII pTeX
dm   JIS-H % NTT jTeX

@IPAGothic-Regular@
gbm  JIS-H % ASCII pTeX
gbmv JIS-V % ASCII pTeX
dg   JIS-H % NTT jTeX

$ sudo update-vfontmap
$ xdvi Sample.dvi で確認、これで日本語がちゃんと出ている

○evinceで日本語が出ない。poppler-dataパッケージがインストールされていないことが原因
$ sudo apt-get install poppler-data
$ evince Sample.pdf で確認、日本語OK


■ インストールされているフォントの確認
$ fc-list | grep IPA
IPAexGothic,IPAexゴシック:style=Regular
IPAGothic,IPAゴシック:style=Regular
IPAPGothic,IPA Pゴシック:style=Regular
IPAexMincho,IPAex明朝:style=Regular
IPAMincho,IPA明朝:style=Regular
IPAPMincho,IPA P明朝:style=Regular

Thursday, November 08, 2012

Beagleboard/Beaglebone AM335X SDK

Beagleboard/Beaglebone AM335X linux SDK [ original page ]

■仮想環境
基本は、Ubuntu 10.04だけをサポートするが、他のバージョンも使用出来る事を確認した。(SDKのOSバージョンチェックのシェルを書き換えればOk)。仮想マシーンの構築はこのページを参照。

■SDKのインストール
このページから"ti-sdk-am335x-evm-x.x.x.x-Linux-x86-Install"ファイルをダウンロード。
実行すると、インストール先を聞いてくるので、下記Dirを指定
$HOME/ti-sdk-am335x-evm-...-linux-x86 (以降 $TI_SDK_PATH とする)
これで、SDKファイルが展開される。続いては、SDKのセットアップは下記の順番で行う
  • ホストPCのUbuntuバージョンチェック
  • ホストPCに必要なパッケージのインストール
  • ターゲットファイル・システムインストール
  • NFS設定
  • TFTP設定
  • Minicom設定
  • U-boot設定
  • ロードブードスクリプト作成
●1.SDK設定シェルの実行
$ cd $TI_SDK_PATH; ./setup.sh
ここでもし、Ubuntu 10.04を使用しなければエラーが出る。別のバージョンのubuntuにインストールしたい場合は、シェールスクリプトのOSバージョンチェックを書き換える必要がある。

2.ホストPCに必要なパッケージインストール
下記のパッケージがホストPCになければ、自動的にインストールされる
  • telnet
  • menuconfig, kernel configuration tool
  • mounting filesystem via nfs
  • tftp
  • minicom
  • rebuild u-boot
手動でパッケージを事前にインストールしたい場合は下記を実行
$ sudo apt-get install xinetd tftpd nfs-kernel-server minicom build-essential libncurses5-dev uboot-mkimage autoconf automake
3.ターゲットファイルシステムのインストールターゲットファイル・システムはデフォルトで下記の場所に作成される
$TI_SDK_PATH/targetNFS
4.tftp設定
tftpの設定で、ホストPCのルートDirに "/tfptboot"が作成され、tftpの設定は"/etc/xinetd.d/tftp"に保存される

5.minicom設定
Usb-to-Serialケーブルを使用する場合は、"/dev/ttyUSBx"、そうでない場合は"/dev/ttyS0"を指定する

6.uboot設定
  • ホストのIPアドレス確認
  • カーネルロケーションの指定
    -TFTPを選択する場合は、"/tftpboot"のDirを適切に指定
    -SD cardを選択する場合は、SDカードの最初のパーティション("boot"という名前)になる
  • ファイル・システムの指定

■ PowerVR SGX SDKインストール [ページ1、ページ2]
BeagleBoneのハードウェア

  • SOC : AM335x
  • SGX Core : SGX530
  • SGX Core rev. : 1.2.5
  • SDK folder suffix : es8.x
  • Max SGX Core Freq : 200 Mhz
●Graphic SDKのインストール:
SDKのインストール時、展開されたパッケージの中に既に"Graphic_SDK_setuplinux_[version].bin"が入っているので、これを実行すれば、Graphic SDKをインストールできる。

また、ウェブからGraphic SDKをダウンロードしてインストールする場合はこのページから"Graphics_SDK_setuplinux_4_08_00_01.bin"をダウンロードしてくる。

ターゲットボードに入れる必要があるのは、
  • Kernel Modules
  • Graphic SDK (examples, headers, lib ...)

■U-bootビルド

$ cd $TI_SDK_PATH
$ make u-boot-spl O=am335x

O=am335xを指定すると、"$TI_SDK_PATH/board-support/u-boot-[version]/am335x"が作成され、make結果がここに格納される(推奨方法)

上の実行結果で、"u-boot.img"と"MLO"という2つのファイルが作成される($TI_SDK_PATH/board-support/u-boot-[version]/am335xの中)、SDカードからブートする場合は、これらのファイルをSDカードに入れる必要がある。UART経由でロードしたい場合は、spl/u-boot-spl.binを利用する。

■SDカードのフォーマット
SDカードの作成で、ブート用のFat32、ファイル・システムのext3を作成する。作成方法は難しくないので省略(参考ページのre-partition SD cardの部分)


■Master Makefile
linux_install:
 @echo ===================================
 @echo     Installing the Linux Kernel
 @echo ===================================
 install -d $(DESTDIR)/boot
 install $(LINUXKERNEL_INSTALL_DIR)/arch/arm/boot/uImage $(DESTDIR)/boot
 install $(LINUXKERNEL_INSTALL_DIR)/vmlinux $(DESTDIR)/boot
 install $(LINUXKERNEL_INSTALL_DIR)/System.map $(DESTDIR)/boot
 $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) INSTALL_MOD_PATH=$(DESTDIR) modules_install

DESTDIR=$TI_SDK_PATH/targetNFS
LINUXKERNEL_INSTALL_DIR=$TI_SDK_PATH/board-support/linux-[version].sdk

下記:U-boot のprintenv

U-Boot# printenv
autoload=yes
baudrate=115200
bootargs=console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=7,2048 noinitrd rootfstype=ubifs rootwait=1 ip=none
bootargs_defaults=setenv bootargs console=${console} ${optargs}
bootcmd=if mmc rescan; then echo SD/MMC found on device ${mmc_dev};if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run mmc_load_uimage; then run mmc_args;bootm ${kloadaddr};fi;fi;run nand_boot;
bootdelay=3
bootenv=uEnv.txt
bootfile=uImage
console=ttyO0,115200n8
ethact=cpsw
ethaddr=00:18:31:e1:37:6a
importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
ip_method=none
kloadaddr=0x80007fc0
loadaddr=0x82000000
loadbootenv=fatload mmc ${mmc_dev} ${loadaddr} ${bootenv}
mmc_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${mmc_root} rootfstype=${mmc_root_fs_type} ip=${ip_method}
mmc_boot=run mmc_args; run mmc_load_uimage; bootm ${kloadaddr}
mmc_dev=0
mmc_load_uimage=fatload mmc ${mmc_dev} ${kloadaddr} ${bootfile}
mmc_root=/dev/mmcblk0p2 rw
mmc_root_fs_type=ext3 rootwait
nand_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${nand_root} noinitrd rootfstype=${nand_root_fs_type} ip=${ip_method}
nand_boot=echo Booting from nand ...; run nand_args; nandecc hw 2; nand read.i ${kloadaddr} ${nand_src_addr} ${nand_img_siz}; bootm ${kloadaddr}
nand_img_siz=0x500000
nand_root=ubi0:rootfs rw ubi.mtd=7,2048
nand_root_fs_type=ubifs rootwait=1
nand_src_addr=0x280000
net_args=run bootargs_defaults;setenv bootargs ${bootargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
net_boot=echo Booting from network ...; setenv autoload no; dhcp; tftp ${kloadaddr} ${bootfile}; run net_args; bootm ${kloadaddr}
nfsopts=nolock
nor_args=run bootargs_defaults;setenv bootargs ${bootargs} root={nor_root} rootfstype=${nor_root_fs_type} ip=${ip_method}
nor_boot=echo Booting from NOR ...; run nor_args; cp.b ${0x08080000} ${kloadaddr} ${nor_img_siz}; bootm ${kloadaddr}
nor_img_siz=0x280000
nor_root=/dev/mtdblock3 rw
nor_root_fs_type=jffs2
nor_src_addr=0x08080000
rootpath=/export/rootfs
script_addr=0x81900000
spi_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${spi_root} rootfstype=${spi_root_fs_type} ip=${ip_method}
spi_boot=echo Booting from spi ...; run spi_args; sf probe ${spi_bus_no}:0; sf read ${kloadaddr} ${spi_src_addr} ${spi_img_siz}; bootm ${kloadaddr}
spi_bus_no=0
spi_img_siz=0x380000
spi_root=/dev/mtdblock4 rw
spi_root_fs_type=jffs2
spi_src_addr=0x62000
static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
stderr=serial
stdin=serial
stdout=serial

Environment size: 2777/8188 bytes
U-Boot#

-----------------
■BeagleboneをXPマシーンに接続する時のTrouble shooting
USBの認識トラブルはこのページを参考にドライバをインストールする




1. Learning embedded linux system through the file system: a top-down approach [pdf]
2. Labs instructions for Enabling BeagleBone with TI SDK 5.x [pdf]
3. Introduction to BeagleBoard [pdf]
4. u-bootのマニュアル [pdf]
5. AM335x u-boot user's guide
6. AMSDK u-boot user's guide
7. Building the Arago Linux Kernel for Beaglebone

__END__

Sunday, September 23, 2012

Ubuntu on BeagleBone/BeagleBoard

BeagleBone/BeagleBoard

参考文献:
0. Beaglebone hardware PDF file
1. Ubuntu 12.04をBeagleboneに入れる方法
2. Beagleboard initializaiton (1)
3.
X. Quake 3 git (used for demo)
X. Quake 3 on Raspberry Pi (1)

■Ubuntu 12.04 をBeagleBone入れる
VMwareで構築したUbuntu PCマシーン+Toolchainで作業
$ mkdir Ubuntu_on_beagle
$ cd Ubuntu_on_bealge
$ wget http://rcn-ee.net/deb/rootfs/precise/ubuntu-12.04-r6-minimal-armhf-2012-09-10.tar.xz

$ tar xJf ubuntu-12.04-r6-minimal-armhf-2012-09-10.tar.xz
$ cd  ubuntu-12.04-r6-minimal-armhf-2012-09-10
$ sudo ./setup_sdcard.sh --mmc /media/usb?? --uboot bone ※??は適当にSDカードのドライブを指定

Beagleboneに電源 + USBケーブル接続し、PCからTeratermでシリアル接続(Baudrate: 115200

login: ubuntu
pass: temppwd

ログイン後の結果:

Ubuntu 12.04.1 LTS arm ttyO0

arm login: ubuntu
Password:
Welcome to Ubuntu 12.04.1 LTS (GNU/Linux 3.2.28-psp21 armv7l)

 * Documentation:  https://help.ubuntu.com/

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To run a command as administrator (user "root"), use "sudo ".
See "man sudo_root" for details.

ubuntu@arm:~$


■ Lubuntuをインストール
$ sudo shutdown -h now
電源を抜いて、HDMI-Cape, HDMI-DVI変換をモニタにつないでから再度、電源を入れる

$ sudo apt-get -yV install lubuntu-core
$ sudo apt-get -yV install lubuntu-desktop
$ sudo apt-get -yV install lxde-common
$ sudo apt-get -yV install lxde-core
$ sudo apt-get -yV install lxde

これでlubuntuが無事画面に出ることを確認


Saturday, September 08, 2012

Ubuntu 12.04 on VMware

Ubuntu 12.04 on vmware

■UI変わりすぎて使いにくい。なんとか戻すことにする

sudo apt-get install gdm
sudo apt-get install gnome-shell gnome-session-fallback

テキストログイン→GUIログインにしたい場合は
sudo start gdm

これでとりあえずOK

■日本語環境
sudo add-apt-repository ppa:japaneseteam/ppa
sudo apt-get update
sudo apt-get install ubuntu-defaults-ja

なんか日本語を対応させたいが、今英語バージョンで、もう一度ここから日本語バージョンのイメージをダウンロードし直すか、英語バージョンを日本語にするかを迷う。とりあえず後者で、手順はページの説明通り

Ubuntu 12.04 LTSの場合:
wget -q https://www.ubuntulinux.jp/ubuntu-ja-archive-keyring.gpg -O- | sudo apt-key add - wget -q https://www.ubuntulinux.jp/ubuntu-jp-ppa-keyring.gpg -O- | sudo apt-key add - sudo wget https://www.ubuntulinux.jp/sources.list.d/precise.list -O /etc/apt/sources.list.d/ubuntu-ja.list sudo apt-get update
sudo apt-get upgrade
sudo apt-get install ubuntu-defaults-ja
sudo fontconfig-voodoo --force -s ja_JP

■Google日本語入力
sudo add-apt-repository ppa:ikoinoba/ppa
sudo apt-get update
sudo apt-get install ibus-mozc
sudo reboot

■ディレクトリを日本語にする
LANG=C xdg-user-dirs-gtk-update

■GVim
sudo apt-get install vim-gnome ubuntu-restricted-extras

■ Build
sudo apt-get install build-essential
sudo apt-get install svn git ssh
sudo apt-get install cmake
sudo apt-get install freeglut3 freeglut3-dev

make a small test:
g++ test.cpp -lGL -lglut -o test ※test.cppをリンクオプションの後に置くとエラー!

■ARMクロスコンパイルビルドチェーン 参考:ここ
sudo apt-get install g++-arm-linux-gnueabi
sudo apt-get install g++-arm-linux-gnueabihf

arm-linux-gnueabi-addr2line    arm-linux-gnueabihf-gcov
arm-linux-gnueabi-ar           arm-linux-gnueabihf-gcov-4.6
arm-linux-gnueabi-as           arm-linux-gnueabihf-gprof
arm-linux-gnueabi-c++filt      arm-linux-gnueabihf-ld
arm-linux-gnueabi-cpp          arm-linux-gnueabihf-ld.bfd
arm-linux-gnueabi-cpp-4.6      arm-linux-gnueabihf-ld.gold
arm-linux-gnueabi-elfedit      arm-linux-gnueabihf-nm
arm-linux-gnueabi-g++          arm-linux-gnueabihf-objcopy
arm-linux-gnueabi-g++-4.6      arm-linux-gnueabihf-objdump
arm-linux-gnueabi-gcc          arm-linux-gnueabihf-ranlib
arm-linux-gnueabi-gcc-4.6      arm-linux-gnueabihf-readelf
arm-linux-gnueabi-gcov         arm-linux-gnueabihf-size
arm-linux-gnueabi-gcov-4.6     arm-linux-gnueabihf-strings
arm-linux-gnueabi-gprof        arm-linux-gnueabihf-strip
arm-linux-gnueabihf-addr2line  arm-linux-gnueabi-ld
arm-linux-gnueabihf-ar         arm-linux-gnueabi-ld.bfd
arm-linux-gnueabihf-as         arm-linux-gnueabi-ld.gold
arm-linux-gnueabihf-c++filt    arm-linux-gnueabi-nm
arm-linux-gnueabihf-cpp        arm-linux-gnueabi-objcopy
arm-linux-gnueabihf-cpp-4.6    arm-linux-gnueabi-objdump
arm-linux-gnueabihf-elfedit    arm-linux-gnueabi-ranlib
arm-linux-gnueabihf-g++        arm-linux-gnueabi-readelf
arm-linux-gnueabihf-g++-4.6    arm-linux-gnueabi-size
arm-linux-gnueabihf-gcc        arm-linux-gnueabi-strings
arm-linux-gnueabihf-gcc-4.6    arm-linux-gnueabi-strip


■Eclipseをインストールして、Proxy設定
Eclipseをインストールすると、設定ファイルなどはすべてrootが所有者になり、一般ユーザから設定を変更しても反映されない。Proxy設定はひとつの例。解決方法は
下記を /etc/eclipse.ini に追加すること

-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient
-Dhttp.proxyPort=8080
-Dhttp.proxyHost=XXX
-Dhttp.proxyUser=XXX
-Dhttp.proxyPassword=XXX
-Dhttp.nonProxyHosts=localhost|127.0.0.1

Friday, September 16, 2011

gmail pop imap 受信 (kuroboxから)

送信は先日できたが、こんどは受信。

use Mail::IMAPClient;
use IO::Socket::SSL;

2つのモジュールを入れて、受信できました。 問題があったのはメールのSubjectの部分で、エンコード、デコードしない場合、

=?ISO-2022-JP?B?Base64でエンコードされたSubject?=

になるので、まず、

Base64でエンコードされたSubjectの部分をDecodeして、そのあと ISO-2022-JPからutf8にDecodeすればよい。具体的には
use Encode;
use MIME::Base64;
$subject =~ s/=\?ISO-2022-JP\?B\?([A-Za-z0-9\+\/=]*)\?=/ decode_base64($1)/eg;
print decode("ISO-2022-JP", $subject), "\n"; 

Sunday, September 11, 2011

KuroBox Gmail (3)

Sep 11 01:23:45 KURO-BOX postfix/cleanup[2860]: 47D0A8785: message-id=
Sep 11 01:23:45 KURO-BOX postfix/qmgr[2708]: 47D0A8785: from=, size=363, nrcpt=1 (queue active)
Sep 11 01:23:46 KURO-BOX postfix/smtp[2862]: certificate verification failed for smtp.gmail.com: num=20:unable to get local issuer certificate
Sep 11 01:23:46 KURO-BOX postfix/smtp[2862]: certificate verification failed for smtp.gmail.com: num=27:certificate not trusted
Sep 11 01:23:49 KURO-BOX postfix/smtp[2862]: 47D0A8785: to=, relay=smtp.gmail.com[74.125.127.109]:587, delay=4.6, delays=0.26/0.24/1.5/2.6, dsn=2.0.0, status=sent (250 2.0.0 OK 1315671829 z1sm28490831pbz.6)

Gmail経由で送信できたが、証明書の認証は失敗している

Gmailの証明書を追加

http://stevejenkins.com/blog/2011/06/fixing-postfix-certificate-verification-failed-for-gmail-untrusted-issuer-error-message/
mail.cfに次の設定を追加
smtp_tls_CAfile=/etc/postfix/certs/cacert.pem

Saturday, September 10, 2011

時間あわせ ntpd, ntpdate

時間あわせ

# hwclock;date
Sat Sep 10 00:25:49 2011  -0.204517 seconds
Sat Sep 10 00:27:03 JST 2011

ハードウェアクロックとシステムクロックの時間に誤差があり、
合わせる必要がある

# hwclock --systohc
# hwclock;date
Sat Sep 10 00:28:33 2011  -0.670399 seconds
Sat Sep 10 00:28:32 JST 2011

同じになった。


-----------------------------------------------------------------------------
# ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 210.173.160.27  210.173.160.86   2 u    5   64    7   25.119  71299.2   0.310
 210.173.160.57  210.173.176.4    2 u    3   64    7   27.898  71298.9   0.047
 210.173.160.87  210.173.176.4    2 u    5   64    7   25.001  71298.8   0.483

# ntpq -pd
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*ntp1.jst.mfeed. 210.173.160.86   2 u   43   64  377   24.471    0.349   0.508
+ntp2.jst.mfeed. 210.173.160.86   2 u   41   64  377   27.768   -0.081   0.395
+ntp3.jst.mfeed. 210.173.160.56   2 u   36   64  377   24.733    0.051   4.143