ホーム » 検索結果: opkg

検索結果: opkg

2024年9月
1234567
891011121314
15161718192021
22232425262728
2930  

カテゴリー

アーカイブ

ブログ統計情報

  • 92,222 アクセス


opkg install tree

以前 DS115j には tree コマンドを入れていたが,DS116 はまだだったので…

Iwao@DS116:/tmp/http$ sudo -i
Password:

root@DS116:~# opkg install tree
-ash: opkg: command not found

root@DS116:~# cd /var/services/homes/Iwao/
root@DS116:/var/services/homes/Iwao# source ./set_ds_inc.sh
root@DS116:/var/services/homes/Iwao# opkg -v
opkg version 0.1.8
root@DS116:/var/services/homes/Iwao# opkg install tree
Installing tree (1.7.0-1) to root...
Downloading http://pkg.entware.net/binaries/armv7/tree_1.7.0-1_armv7soft.ipk
Collected errors:
 * opkg_install_pkg: Package tree md5sum mismatch. Either the opkg or the package index are corrupt. Try 'opkg update'.
 * opkg_install_cmd: Cannot install package tree.
root@DS116:/var/services/homes/Iwao# opkg update
Downloading http://pkg.entware.net/binaries/armv7/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/packages
root@DS116:/var/services/homes/Iwao# opkg install tree
Installing tree (1.7.0-1) to root...
Downloading http://pkg.entware.net/binaries/armv7/tree_1.7.0-1_armv7soft.ipk
Configuring tree.
root@DS116:/var/services/homes/Iwao# tree
.
├── gcc_test
│   ├── 20170922.out
│   ├── a.out
│   ├── editad
│   ├── EditAd.cpp
│   ├── edit_ad.php
│   └── T_P_ini.cpp
├── set_ds_inc.sh
├── Temp
│   └── rc.local
└── www
    └── dmp_   .php

3 directories, 9 files
tree コマンド実行
Synology NAS tree
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

DS116 entware

localtime が正しく求められない ままの環境.
https://jml.mish.work/index.php/various/nas/synology-nas.html
ある程度 DS220+ に移行したので,SSH 接続環境の再設定.


CLI コマンドの導入.
DS220+ と同様
名前 :「SynoCommunity」
場所 :「https://packages.synocommunity.com/」
「SynoCli File Tools」をインストールして tree , mc , nano などを追加.
これで追加した tree は,localtime が正しく求められている.
DS116  tree -D


Entware のインストール.
Install on Synology NAS

Iwao@DS116:~$ sudo -i
Password:
root@DS116:~# mkdir -p /volume1/@Entware/opt
root@DS116:~# rm -rf /opt
root@DS116:~# mkdir /opt
root@DS116:~# mount -o bind "/volume1/@Entware/opt" /opt
root@DS116:~# uname -m
armv7l
root@DS116:~# wget -O - https://bin.entware.net/armv7sf-k3.2/installer/generic.sh | /bin/sh
--2022-06-15 14:51:04--  https://bin.entware.net/armv7sf-k3.2/installer/generic.sh

DS116  wget entware
ここまでで localtime はうまく求まる様になった.


タスクスケジューラの登録.
「作成」-「トリガーされたタスク」-「ユーザー指定のスクリプト」.
「Entware」「root」「ブートアップ」を指定.
「タスク設定」タブのスクリプトを記述するの所に,貼り付け.
NAS を再起動.


gcc のインストール.

Iwao@DS116:~$ sudo -i
root@DS116:~# opkg update
Downloading http://bin.entware.net/armv7sf-k3.2/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/entware
root@DS116:~# opkg install gcc
Installing gcc (7.4.0-7) to root...

DS116  gcc インストール

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

DS220+ セットアップ-4

前回の設定で PHP などが動作する様になったので,今度は opkg のインストール.


その前に,インストールしていない状態で,何か動作するかをチェック.
以前書いた,次のコード.

#include	"pref_ini.hxx"
#include	<iostream>
#include	"get_path.hxx"
#include	"i_Trace.hxx"

int	_tmain	(int argc,TCHAR* argv[])
{
	_tsetlocale(LC_ALL,_T("")) ;
	{
		std::tout <<::TGetEnv(_T("TEMP"))     	<< std::endl ;
		std::tout <<::TGetEnv(_T("USERNAME"))	<< std::endl ;
		std::tout <<::TGetEnv(_T("USER"))     	<< std::endl ;
		std::tout <<::TGetEnv(_T("HOMEPATH"))	<< std::endl ;
		}
	{
		tstring	iniPath = ::Path_AddLastSP(::GetCWD()) + _T("Test.ini") ;
		tstring	result = ::P_ini_Get(iniPath.c_str(),_T("Preference"),_T("server"),_T("")) ;
		std::tout << result << std::endl ;
		}
	return	0 ;
	}

以前コンパイルした a.out は動作した.
この頃はまだ他社 NAS の購入前なので,DS116 と,仮想マシンの Linux 環境で作成したものと思う.
他のものを幾つか試したが,ほとんど動作しない.

Iwao@DS220:~/gcc_test/Test/t_linux/t_mtime/t_m_time$ ./f.out
./f.out: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by ./f.out)
./f.out: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ./f.out)
Iwao@DS220:~/gcc_test/Test/t_linux/t_mtime/t_m_time$

以前 opkg のインストールは面倒だった と記憶している.
それで,新しい情報がないかと検索すると QNAP NAS と似た様なものがあった.
Packages for Synology NAS
Packages for Synology NAS
が,この中に Entware はなさそう?
更に検索すると,
Synology NAS DS213JへAria2をインストール
Community Package Hub
Community Package Hub
こちらの方かと思いやってみたが,エラーとなる.
DS220+   Easy Bootstrap Installer  エラー


結局以前と同じ方法で.
Install on Synology NAS

Iwao@DS220:~$ Iwao@DS220:~$ sudo -i
root@DS220:~# ll /opt
ls: cannot access '/opt': No such file or directory
root@DS220:~# mkdir -p /volume1/@Entware/opt
root@DS220:~# mkdir /opt
root@DS220:~# mount -o bind /volume1/@Entware/opt/ /opt
root@DS220:~# wget -O - https://bin.entware.net/x64-k3.2/installer/generic.sh | /bin/sh
Will not apply HSTS. The HSTS database must be a regular and non-world-writable file.

DS220+  wget -O - https://bin.entware.net/x64-k3.2/installer/generic.sh | /bin/sh
タスクスケジューラにスクリプトを登録.
DS220+ 自動起動のスクリプトの登録


NAS を再起動.
gcc のインストール.

Iwao@DS220:~$ Iwao@DS220:~$ sudo -i
root@DS220:~# opkg update
Downloading http://bin.entware.net/x64-k3.2/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/entware
root@DS220:~# opkg install gcc
Installing gcc (7.4.0-7) to root...

root@DS220:~#

DS220+  gcc インストール


共通のコードなどをコピーするために,Cloud Sync の設定.
DS220+  Cloud Sync  Google Drive

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

QNAP NAS 上のサイトが…

QNAP NAS 上の幾つかのページがうまく動作しなくなった.
静的なページや,WordPressJoomla! のページは問題ない.
いろいろと動きを見ると,C++ で書いたコードを呼出しているページがうまく動作していない様子.
SSH 接続して幾つかのコマンドを実行すると command not found となってしまう.
which gcc などで探すと,gcc が見つからない.
以前 gcc などは入れている ので,/opt/bin/gcc として存在するはず.
/opt/bin/ を見ると,perl 関係のものしか入ってない.
QNAP /opt/bin  perl
App Center で入れた Perl 5.26.1.0.1 がいけなかったみたい.


Entware-std 1.03 を入れ直すことでうまく動作する様になった.
AppCenter にある Perl のパッケージとは共存できない?

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

なんかおかしい? DS116 localtime

2020/12/02 0 時過ぎ,個人的に書いているコードがうまく動作していないことに気づいた.
全てではないが,日時の表示が GMT になってしまっている?
うまく動作しているものもあり,次のものは正しく表示される.
DrawNow アクセス日時を WebGL で表示する
この様になった心当たりはある.
昨日 opkg の update と upgrade ,opkg install gcc などを行ったことが影響している?
tree … -D や cal なども GMT になっている.


どこが影響しているかを調べるために少しコードを書いてみた.

#include	<clocale>
#include	<iostream>
#include	"_tdefine.hxx"
#include	"timefmt.hxx"

int	_tmain	(int argc,TCHAR* argv[])
{
	_tsetlocale(LC_ALL,_T("")) ;
	{
		tstring	now_time = ::Now_Format() ;
		std::tout << _T("::Now_Format()   \t") << now_time << std::endl ;
		}
	{
		tstring	gmt_time = ::Now_FormatGMT() ;
		std::tout << _T("::Now_FormatGMT()\t") << gmt_time << std::endl ;
		}
	return	0 ;
	}

Win10 環境では意図した動作.

Microsoft Windows [Version 10.0.18363.1198]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\Iwao>\\TestXP\C_Temp\Test_cpp\t_mtime\t_localt\Release.060\t_localt.exe
::Now_Format()          2020/12/02 10:22:34
::Now_FormatGMT()       2020/12/02 01:22:34

C:\Users\Iwao>  

Win10 で localtime


DS116 では localtime が正しく求まっていない.

Iwao@DS116:~/gcc_test/Test/t_linux/t_mtime/t_localt$ ll
total 44
drwxrwxrwx+ 2 Iwao users  4096 Dec  2 10:19 .
drwxrwxrwx+ 5 Iwao users  4096 Dec  2 10:03 ..
-rwxrwxrwx  1 Iwao users 14188 Dec  2 10:19 a.out
-rwxrwxrwx+ 1 Iwao users   892 Dec  2 10:02 t_localt.BAK
-rwxrwxrwx+ 1 Iwao users   917 Dec  2 10:17 t_localt.cpp
-rwxrwxrwx+ 1 Iwao users  4476 Dec  2 10:02 t_localt.dsp
Iwao@DS116:~/gcc_test/Test/t_linux/t_mtime/t_localt$ ./a.out
::Now_Format()          2020/12/02 01:24:30
::Now_FormatGMT()       2020/12/02 01:24:30
Iwao@DS116:~/gcc_test/Test/t_linux/t_mtime/t_localt$  

DS116 で localtime


上の WebGL で現在日時を表示ている .out は,2017/07/19 にコンパイルしたもの.
他の .out で,古いものは正しく動作し,2020/02 のものはうまくない.


どこかに設定などがあるのか?


2020/12/09
GMT と同じ扱いになり困っていたのは,個人的なコードの i_drawlg.hxx
今日のファイルを求める所で 24*60*60 を加えることで対応.

DS220+


2022/06/15 DS116 entware
entware の更新で正しく動作する様になった.

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

TS-253D 再セットアップ – 3

Entware のインストール.前回 と同様だが少し画像と説明を追加.


「App Center」を開き,右上の「設定(歯車マーク)」をクリック.「アプリリポジトリ」タブを選択.
QNAP NAS  AppCenter 設定
「追加」を押して「OPKG Store」の URL「 https://www.qnapclub.eu/en/repo.xml 」を入力.
ログイン情報は不要.
QNAP NAS  QPKG store の追加
https://www.qnapclub.eu/en/howto/1


左のアイコンに「OPKG Store」が増える.選択して「すべてのアプリ」.検索ボックスに「Entware」と入力.
QPKG store から Entware を検索
「Entware-std」をインストール.
QNAP NAS  Entware のインストール
これで opkg コマンドが使える様になる.
ASUSTOR NAS で作成した .out は,この段階で動作する様になるみたい.


gcc と python3 などのインストール
admin で入ったコンソール で,
opkg install gcc
opkg install python3
他に tree , mc なども.



ASUSTOR NAS
Synology NAS


https://jml.mish.work/various/nas/qnap-nas.html
https://jml.mish.work/various/nas.html


2023/01/11
//qnapclub.eu/ にうまく接続できないので…
https://www.qnapclub.eu/en/repo.xml
https://www.qnapclub.eu/en/howto/1

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

Python tkinter インストール

sudo apt install python3-tk
Debian 環境に tkinter インストール
Ubuntu 環境に tkinter インストール


Windows から Raspberry Pi 環境に接続できる様に samba を追加しようと…
検索して次の所を参考に設定.
https://qiita.com/fstyle/items/1670d260f58f77a43144
https://www.raspberrypirulo.net/entry/samba
この中で書かれている nano というエディタ.
CUI で使えるみたいで NAS などの幾つかの環境にインストール.
sudo opkg install nano


他に CUI のファイルマネージャ.
sudo opkg install mc
操作性など異なるが,エコロジーⅡを思い出す.
https://unilab.gbb60166.jp/T98Next/T98Next2.htm

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

TS-253D セットアップ – 7

幾つかの気づいたことをメモ.


SSH 接続 して python3 が動作しない.
python 2.7 は起動する.
App Center で Python3 はインストールしてある.
はっきりわからないが,App Center でインストールしたものと SSH 接続してのものとは異なるみたい.
admin で入って opkg install python3 でインストール.
QNAP NAS に Python 3 インストール
これで SSH 接続でも可能になった.


python3 がインストールできない場合,その前に entware のインストールが必要.
https://dev.mish.work/wordpress/2020/08/29/ts253d-setup-3-opkg/


インストールされている PHP は 7.3.7 .
アップロードできるファイルサイズはデフォルトで十分.


zip , unzip , 7z , convert は入っている.

[Iwao@TS253D prt_text]$ tree /mnt/ext/opt/ImageMagick/usr/local/
/mnt/ext/opt/ImageMagick/usr/local/
└── sbin
    ├── composite
    ├── convert
    └── identify

1 directory, 3 files
[Iwao@TS253D prt_text]$      

iconv コマンドは入ってなさそうだが iconv API は使える.


2020/08/18 pip の追加.

[~] # opkg install python3-pip
Installing python3-pip (19.2.3-4) to root...
Downloading http://bin.entware.net/x64-k3.2/python3-pip_19.2.3-4_x64-3.2.ipk
Installing python3-pkg-resources (41.2.0-3) to root...
Downloading http://bin.entware.net/x64-k3.2/python3-pkg-resources_41.2.0-3_x64-3.2.ipk
Installing python3-setuptools (41.2.0-3) to root...
Downloading http://bin.entware.net/x64-k3.2/python3-setuptools_41.2.0-3_x64-3.2.ipk
Installing python-pip-conf (0.1-1) to root...
Downloading http://bin.entware.net/x64-k3.2/python-pip-conf_0.1-1_x64-3.2.ipk
Configuring python-pip-conf.
Configuring python3-pkg-resources.
Configuring python3-setuptools.
Configuring python3-pip.
[~] #          

QNAP NAS に Flask のインストール


https://jml.mish.work/various/nas/qnap-nas.html
https://jml.mish.work/various/nas.html

Is this 投稿 useful? Useful Useless 1 of 1 people say this 投稿 is useful.

TS-253D セットアップ – 6

以前調べた時は,Synology NAS と同様に面倒だと思ったが…


検索すると
QNAPにEntware-stdをインストールする
QNAP NAS  QKPG Store の登録
QNAP NAS  Entware-std のインストール

Microsoft Windows [Version 10.0.18362.1016]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\Iwao>\\WDCloud\Public\Document\bat\ssh_ts253d.bat

C:\Users\Iwao>cd C:\Users\Iwao\AppData\Local\Temp

C:\Users\Iwao\AppData\Local\Temp>ssh -l Iwao -p 22 ts253d
Iwao@ts253d's password:
[Iwao@TS253D ~]$ gcc
-sh: gcc: command not found
[Iwao@TS253D ~]$ opkg
-sh: opkg: command not found
[Iwao@TS253D ~]$ /opt/bin/opkg
opkg must have one sub-command argument
usage: opkg [options...] sub-command [arguments...]
where sub-command is one of:

Package Manipulation:
        update                  Update list of available packages
        upgrade <pkgs>          Upgrade packages
        install <pkgs>          Install package(s)
        configure <pkgs>        Configure unpacked package(s)
        remove <pkgs|regexp>    Remove package(s)
        flag <flag> <pkgs>      Flag package(s)
         <flag>=hold|noprune|user|ok|installed|unpacked (one per invocation)

...

 regexp could be something like 'pkgname*' '*file*' or similar
 e.g. opkg info 'libstd*' or opkg search '*libop*' or opkg remove 'libncur*'
[Iwao@TS253D ~]$ 
[Iwao@TS253D ~]$ /opt/bin/opkg install gcc
Installing gcc (7.4.0-5) to root...
Downloading http://bin.entware.net/x64-k3.2/gcc_7.4.0-5_x64-3.2.ipk
Installing zlib (1.2.11-3) to root...
Downloading http://bin.entware.net/x64-k3.2/zlib_1.2.11-3_x64-3.2.ipk
Collected errors:
 * wfopen: //opt/lib/opkg/info/zlib.control: Permission denied.
 * extract_archive: Cannot create symlink from ./opt/lib/libz.so to 'libz.so.1': Permission denied.
 * extract_archive: Cannot create symlink from ./opt/lib/libz.so.1 to 'libz.so.1.2.11': Permission denied.
 * wfopen: /opt/lib/libz.so.1.2.11: Permission denied.
 * pkg_write_filelist: Failed to open //opt/lib/opkg/info/zlib.list: Permission denied.
 * opkg_install_pkg: Failed to extract data files for zlib. Package debris may remain!
 * opkg_install_cmd: Cannot install package gcc.
 * opkg_conf_write_status_files: Can't open status file //opt/lib/opkg/status: Permission denied.
 * opkg_conf_write_status_files: Can't open status file /opt/tmp//opt/lib/opkg/status: Permission denied.
[Iwao@TS253D ~]$ 

QNAP NAS ssh 接続 opkg
QNAP NAS opkg install gcc
sudo -i としても入れない.方法がわからなかったので admin で入ることに.

C:\Users\Iwao>ssh -l Iwao ts253d
Iwao@ts253d's password:
[Iwao@TS253D ~]$ sudo -i
Password:
Iwao is not in the sudoers file.  This incident will be reported.
[Iwao@TS253D ~]$
[Iwao@TS253D ~]$
[Iwao@TS253D ~]$ exit
logout
Connection to ts253d closed.

C:\Users\Iwao>ssh -l admin ts253d
admin@ts253d's password:
[~] #
[~] #
[~] #
[/opt/bin] # opkg install gcc  
Installing gcc (7.4.0-5) to root...
Downloading http://bin.entware.net/x64-k3.2/gcc_7.4.0-5_x64-3.2.ipk
Installing zlib (1.2.11-3) to root...
Downloading http://bin.entware.net/x64-k3.2/zlib_1.2.11-3_x64-3.2.ipk
Installing libiconv-full (1.11.1-4) to root...
Downloading http://bin.entware.net/x64-k3.2/libiconv-full_1.11.1-4_x64-3.2.ipk
Installing libintl-full (0.19.8.1-2) to root...
Downloading http://bin.entware.net/x64-k3.2/libintl-full_0.19.8.1-2_x64-3.2.ipk
Installing libbfd (2.27-1) to root...
Downloading http://bin.entware.net/x64-k3.2/libbfd_2.27-1_x64-3.2.ipk
Installing libopcodes (2.27-1) to root...
Downloading http://bin.entware.net/x64-k3.2/libopcodes_2.27-1_x64-3.2.ipk
Installing objdump (2.27-1) to root...
Downloading http://bin.entware.net/x64-k3.2/objdump_2.27-1_x64-3.2.ipk
Installing ar (2.27-1) to root...
Downloading http://bin.entware.net/x64-k3.2/ar_2.27-1_x64-3.2.ipk
Installing binutils (2.27-1) to root...
Downloading http://bin.entware.net/x64-k3.2/binutils_2.27-1_x64-3.2.ipk
Configuring zlib.
Configuring libiconv-full.
Configuring libintl-full.
Configuring libbfd.
Configuring libopcodes.
Configuring objdump.
Configuring ar.
Configuring binutils.
Configuring gcc.
There are no *-dev packages in Entware(with few exceptions)!
Please install headers as described in the wiki:
https://github.com/Entware/Entware/wiki
[/opt/bin] # 

QNAP NAS admin opkg install gcc

https://jml.mish.work/index.php/various/nas/qnap-nas.html

Is this 投稿 useful? Useful Useless 1 of 1 people say this 投稿 is useful.

NAS 環境に Flask のインストール

先ず Debian 環境に Flask をインストール.
pip3 install Flask
Debian Flask インストール
サンプルの hello.py を実行,ブラウザで表示.
hello.py を実行して,ブラウザで表示


AS5202T でも同様に Flask をインストール.
pip3 install Flask
AS5202T に Flask のインストール
AS5202T で実行,表示


Synology NAS では pip のインストールから.
suto opkg install python-pip
suto opkg install python3-pip
Synology NAS に pip のインストール
Flask をインストールしてみたが …

Iwao@DS116:~/pyt_test/t_flask$ pip3 install Flask
Collecting Flask
  Using cached https://files.pythonhosted.org/packages/f2/28/2a03252dfb9ebf377f40fba6a7841b47083260bf8bd8e737b0c6952df83f/Flask-1.1.2-py2.py3-none-any.whl
Collecting click>=5.1 (from Flask)
  Using cached https://files.pythonhosted.org/packages/d2/3d/fa76db83bf75c4f8d338c2fd15c8d33fdd7ad23a9b5e57eb6c5de26b430e/click-7.1.2-py2.py3-none-any.whl
Collecting itsdangerous>=0.24 (from Flask)
  Using cached https://files.pythonhosted.org/packages/76/ae/44b03b253d6fade317f32c24d100b3b35c2239807046a4c953c7b89fa49e/itsdangerous-1.1.0-py2.py3-none-any.whl
Collecting Werkzeug>=0.15 (from Flask)
  Using cached https://files.pythonhosted.org/packages/cc/94/5f7079a0e00bd6863ef8f1da638721e9da21e5bacee597595b318f71d62e/Werkzeug-1.0.1-py2.py3-none-any.whl
Collecting Jinja2>=2.10.1 (from Flask)
  Using cached https://files.pythonhosted.org/packages/30/9e/f663a2aa66a09d838042ae1a2c5659828bb9b41ea3a6efa20a20fd92b121/Jinja2-2.11.2-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from Jinja2>=2.10.1->Flask)
  Using cached https://files.pythonhosted.org/packages/b9/2e/64db92e53b86efccfaea71321f597fa2e1b2bd3853d8ce658568f7a13094/MarkupSafe-1.1.1.tar.gz
    Complete output from command python setup.py egg_info:
    /opt/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'project_urls'
    /opt/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'include_package_data'
    /opt/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'python_requires'
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: -c --help [cmd1 cmd2 ...]
       or: -c --help-commands
       or: -c cmd --help

    error: invalid command 'egg_info'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-dsqn65uh/MarkupSafe/
Iwao@DS116:~/pyt_test/t_flask$ 

DS116 に Flask インストール ... エラー?


「 Command python setup.py egg_info faild with error code 1 」で検索 をかけると pip などが古いとある.
次の様にして pip などを更新.
sudo pip install –upgrade pip setuptools
Synology NAS の pip の更新と Flask のインストール

Is this 投稿 useful? Useful Useless 1 of 1 people say this 投稿 is useful.

Python から C の呼出し – 2

先日 Python から C を呼び出す関係を調べていて Synology NAS に Python.h がなかった.
検索 をかけると DSM「パッケージ センター」-「Python3」では python-dev が入ってないらしい.


次の様な手順で python-dev をインストール.
# sudo -i
# cd /var/services/homes/Iwao/
# source ./set_ds_inc.sh
# opkg install python-dev
# opkg install python3-dev
Synology NAS に python-dev のインストール
コンパイルで必要なファイルは次の所に入った.
/volume1/@entware-ng/opt/include/python3.6/Python.h
/volume1/@entware-ng/opt/include/python2.7/Python.h
Synology NAS で Python から C の呼出し


Iwao@DS116:~/pyt_test/call_c/call_cpp/g3d_to$ g++ g3d_to.cpp -Wall -fPIC -o g3d_to.so -shared
g3d_to.cpp:9:20: fatal error: Python.h: No such file or directory

                    ^
compilation terminated.
Iwao@DS116:~/pyt_test/call_c/call_cpp/g3d_to$ g++ g3d_to.cpp -Wall -fPIC -o g3d_to.so -shared -I /volume1/@entware-ng/opt/include/python3.6/
Iwao@DS116:~/pyt_test/call_c/call_cpp/g3d_to$ ll
total 9568
drwxrwxrwx+ 3 Iwao users    4096 Aug  5 10:29 .
drwxrwxrwx+ 3 Iwao users    4096 Aug  5 09:50 ..
-rwxrwxrwx+ 1 Iwao users 3941375 May  7 18:03 3887.imo
-rwxrwxrwx+ 1 Iwao users 1241865 Jul  7 15:13 7801.imo
drwxrwxrwx+ 2 Iwao users    4096 Aug  5 10:29 bak
-rwxrwxrwx+ 1 Iwao users    1688 Aug  4 15:04 g3d_to.cpp
-rwxrwxrwx  1 Iwao users 2654136 Aug  5 10:29 g3d_to.so
-rwxrwxrwx+ 1 Iwao users    1644 Aug  7  2019 gons_to.cpp
-rwxrwxrwx  1 Iwao users 1931244 Aug  5 10:17 gons_to.out
Iwao@DS116:~/pyt_test/call_c/call_cpp/g3d_to$ python3
Python 3.6.2 (default, Jan 11 2018, 10:32:53)
[GCC 6.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import g3d_to
>>> dir(g3d_to)
['__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'gons_to', 'load', 'save']
>>> g3d_to.load("./7801.imo")
>>> g3d_to.save("./7801.stl")
>>> g3d_to.save("./7801.ac")
>>>
Iwao@DS116:~/pyt_test/call_c/call_cpp/g3d_to$ ll
total 10252
drwxrwxrwx+ 3 Iwao users    4096 Aug  5 10:31 .
drwxrwxrwx+ 3 Iwao users    4096 Aug  5 09:50 ..
-rwxrwxrwx+ 1 Iwao users 3941375 May  7 18:03 3887.imo
-rwxrwxrwx+ 1 Iwao users  438369 Aug  5 10:31 7801.ac
-rwxrwxrwx+ 1 Iwao users 1241865 Jul  7 15:13 7801.imo
-rwxrwxrwx+ 1 Iwao users  254784 Aug  5 10:31 7801.stl
drwxrwxrwx+ 2 Iwao users    4096 Aug  5 10:29 bak
-rwxrwxrwx+ 1 Iwao users    1688 Aug  4 15:04 g3d_to.cpp
-rwxrwxrwx  1 Iwao users 2654136 Aug  5 10:29 g3d_to.so
-rwxrwxrwx+ 1 Iwao users    1644 Aug  7  2019 gons_to.cpp
-rwxrwxrwx  1 Iwao users 1931244 Aug  5 10:17 gons_to.out
Iwao@DS116:~/pyt_test/call_c/call_cpp/g3d_to$ 

DS116 で Python から C++ の呼出し
コンパイル,実行など AS5202T より時間がかかる.


https://jml.mish.work/python/call-c-python.html

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

弦と矢と半径 – 4

先日の Python コードのバグ(整数で計算されてしまうため結果が異なる).
原因はすぐわかるが,対応は悩む所.
コードを分解して動作を確認してみた.

def	r_cs_o	(c , s)	:	return	(        ( c*c )  / ( 8 *s )  +  s/2  )
def	r_cs_n	(c , s)	:	return	(        ( c*c )  / ( 8.*s )  +  s/2. )

print   (6*6)
print   (8*1)

print   (36/8)
print   (36/8.)

print   (1/2)
print   (1/2.)

print	("")
print   (36/8 +1/2 )
print   (36/8.+1/2.)

print	("")
print	(r_cs_o(6,1))
print	(r_cs_n(6,1))

Python での「浮動小数点数」の動作テスト
https://docs.python.org/ja/3/howto/pyporting.html?highlight=除算


Synology NAS DSM では Python 2.7 が標準で入っているみたい.
「パッケージ センター」で Python3 を追加できる.

C:\Program Files\Microsoft Office\Office14>cd C:\Users\Iwao\AppData\Local\Temp

C:\Users\Iwao\AppData\Local\Temp>ssh -l Iwao -p 2200 192.168.1.116
Iwao@192.168.1.116's password:
Iwao@DS116:~$ python3
Python 3.5.1 (default, Jan 29 2018, 14:16:30)
[GCC 4.9.3 20150311 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Iwao@DS116:~$ python2
Python 2.7.12 (default, May 12 2020, 04:48:57)
[GCC 4.9.3 20150311 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Iwao@DS116:~$ python
Python 2.7.12 (default, May 12 2020, 04:48:57)
[GCC 4.9.3 20150311 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Iwao@DS116:~$

Synology NAS DS116  python コマンド
ASUSTOR NAS ADM では入ってない.「App Central」でインストール可能.
ASUSTOR NAS Python


2020/11/20
QNAP NAS での Python3 は,他の NAS と異なるみたい.
opkg install python3 でインストールしなければならなかった.
https://mish.myds.me/wordpress/dev/2020/08/29/ts253d-setup-3-opkg/
https://mish.myds.me/wordpress/dev/2020/08/17/ts-253d-setup-7-python3/

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

AS5202T 再セットアップ

やっとこの NAS 用の HDD が届いたのでもう一度最初からセットアップ.


今ある WD Red 1TB を外すために AS5202T をシャットダウン.
前回と同様 で「初期化されていません」を押して,画面の指示に従ってインストール.
今回は最初のインストールでは何も入れなかったので,Web サーバなども起動していない.
Web サーバの有効化
他に SSH なども有効になる様に設定.


SSH で接続しようとすると,

Microsoft Windows [Version 10.0.18362.720]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\Iwao>cd %TMP%

C:\Users\Iwao\AppData\Local\Temp>ssh -l Iwao -p 22 192.168.1.75
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:7Hi9lqmKbdEhkCwGwU4j0fjj/PQCNQBfnNCIHKMACZA.
Please contact your system administrator.
Add correct host key in C:\\Users\\Iwao/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in C:\\Users\\Iwao/.ssh/known_hosts:16
ECDSA host key for 192.168.1.75 has changed and you have requested strict checking.
Host key verification failed.

C:\Users\Iwao\AppData\Local\Temp>

c:\Users\Iwao\.ssh\known_hosts を編集(192.168.1.75 の行を削除)して対応.


ここまでやっていろいろ見ていると,間違いを発見.RAID 0 になっている.
AS5202T RAID0
「設定」-「工場出荷時設定」-「システム初期化」でもう一度やり直し.
システム初期化
「ワンクリックセットアップ」の画面で「バランスが取れている」を選択する必要があった.
ワンクリックセットアップ バランスが取れている
「最大容量」だと RAID 0 .RAID 1 は「バランスが取れている」にする.


退避しておいた VHD などをコピー.
VirtualBox と entware をインストール.
VirtualBox DevX
SSH 接続で gcc のインストール.
opkg install gcc
これで gcc も使える様になった.


2020/04/05
その後いろいろ試していて,また VirtualBox が止まる?現象があった.
同じファイルを PC から起動するのはうまくできる.
先日バックアップした DevX.vdi をコピーし直して起動させたらうまくいった.
VNC 接続で時刻を表示させて見ていると,少し止まったようになることがある.
VirtualBox VNC 時刻の更新が止まる?


昨日 RAID 1 で再セットアップした後,ディスクが動いていたのでそのグラフ.
AS5202T RAID 1 ディスク


https://jml.mish.work/various/nas/asustor.html

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

AS5202T セットアップ

先日届いていた AS5202T .それ用の HDD を注文したら納期がかかるみたい.
それで手元にあった WD Red 1TB を取り付けてセットアップしてみた.
NAS に取り付ける時,斜めになってしまうことがあるので注意が必要.


最初に ASUSTOR コントロールセンター をダウンロードして PC にインストール.
ASUSTOR Control Center
「初期化されていません」を押して,画面の指示に従って ADM をインストール.
AS5202T 初期化 1
AS5202T 初期化 2
AS5202T 初期化 3
AS5202T Portal
Web もセットアップされていた.
AS5202T web


NAS が動作することは確認できたので,メモリを 8GB に取り換え.
電源を入れると,一番上の青いランプが点灯,システムステータスのランプが点滅のままでうまく起動しない.
通常であればネットワークやハードディスクのランプが点滅や点灯するはず.
もう一度メモリを外して元の 2GB の状態にするとうまく起動する.
追加で 1 枚さして 6GB でもうまく起動.
2GB も交換して 4GB x 2 の状態で試すとうまく起動した.
メモリの挿し方が甘かった?


今回この機種を追加した目的の一つが VirtualBox .
App Central から VirtualBox と VirtualBox Extension Pack をインストール.
追加された VirtualBox アイコンをクリックすると新しくブラウザのウィンドウが開く.
AS5202T VirtualBox ログイン
この時のログインの ID がわからなかったが admin と admin で入れる.
https://www.asustor.com/en/online/College_topic?topic=249
https://forest.watch.impress.co.jp/docs/shseri/siranas/1023605.html
https://mdw-note.net/tips/setting-virtualbox-as3102t/
以前 PC で作成した Win10_LTSC.vdi を NAS の Public/VHD/Win10_LTSC にコピー.
それを使用する様に VirtualBox の仮想マシンを追加.
追加した仮想マシンを起動すると右上にプレビューが表示されている.
AS5202T VirtualBox
この仮想マシンは VNC サーバの設定がしてあるので,VNC ビューアから接続.
AS5202T VirtualBox VNC 接続


もう一つ確認したのが gcc .
App Central で entware を追加.
ASUSTOR NAS App Central 「entware」

C:\Users\Iwao\AppData\Local\Temp>ssh -l Iwao -p 22 192.168.1.75
Password:
Iwao@AS5202T:/volume1/home/Iwao $ gcc
-sh: gcc: not found
Iwao@AS5202T:/volume1/home/Iwao $ opkg
opkg must have one sub-command argument
usage: opkg [options...] sub-command [arguments...]
where sub-command is one of:

Package Manipulation:
        update                  Update list of available packages
        upgrade <pkgs>          Upgrade packages
        install <pkgs>          Install package(s)
        configure <pkgs>        Configure unpacked package(s)
        remove <pkgs|regexp>    Remove package(s)
        flag <flag> <pkgs>      Flag package(s)
         <flag>=hold|noprune|user|ok|installed|unpacked (one per invocation)

Informational Commands:
        ...

Iwao@AS5202T:/volume1/home/Iwao $ opkg install gcc
Installing gcc (7.4.0-5) to root...
Downloading http://bin.entware.net/x64-k3.2/gcc_7.4.0-5_x64-3.2.ipk
Installing zlib (1.2.11-3) to root...
Downloading http://bin.entware.net/x64-k3.2/zlib_1.2.11-3_x64-3.2.ipk
Installing libiconv-full (1.11.1-4) to root...
Downloading http://bin.entware.net/x64-k3.2/libiconv-full_1.11.1-4_x64-3.2.ipk
Installing libintl-full (0.19.8.1-2) to root...
Downloading http://bin.entware.net/x64-k3.2/libintl-full_0.19.8.1-2_x64-3.2.ipk
Installing libbfd (2.27-1) to root...
Downloading http://bin.entware.net/x64-k3.2/libbfd_2.27-1_x64-3.2.ipk
Installing libopcodes (2.27-1) to root...
Downloading http://bin.entware.net/x64-k3.2/libopcodes_2.27-1_x64-3.2.ipk
Installing objdump (2.27-1) to root...
Downloading http://bin.entware.net/x64-k3.2/objdump_2.27-1_x64-3.2.ipk
Installing ar (2.27-1) to root...
Downloading http://bin.entware.net/x64-k3.2/ar_2.27-1_x64-3.2.ipk
Installing binutils (2.27-1) to root...
Downloading http://bin.entware.net/x64-k3.2/binutils_2.27-1_x64-3.2.ipk
Configuring zlib.
Configuring libiconv-full.
Configuring libintl-full.
Configuring libbfd.
Configuring libopcodes.
Configuring objdump.
Configuring ar.
Configuring binutils.
Configuring gcc.
There are no *-dev packages in Entware(with few exceptions)!
Please install headers as described in the wiki:
https://github.com/Entware/Entware/wiki
Iwao@AS5202T:/volume1/home/Iwao $
Iwao@AS5202T:/volume1/home/Iwao $ gcc
/volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc/x86_64-openwrt-linux-gnu/7.4.0/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
Iwao@AS5202T:/volume1/home/Iwao $ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc/x86_64-openwrt-linux-gnu/7.4.0/lto-wrapper
Target: x86_64-openwrt-linux-gnu
Configured with: /media/ware3/Entware.2020.01/build_dir/target-x86_64_glibc-2.27/gcc-7.4.0/configure --target=x86_64-openwrt-linux --host=x86_64-openwrt-linux --build=x86_64-pc-linux-gnu --program-prefix= --program-suffix= --prefix=/opt --exec-prefix=/opt --bindir=/opt/bin --sbindir=/opt/sbin --libexecdir=/opt/lib --sysconfdir=/opt/etc --datadir=/opt/share --localstatedir=/opt/var --mandir=/opt/man --infodir=/opt/info --disable-nls 'CXXFLAGS_FOR_TARGET=-g -O2 -D_GLIBCXX_INCLUDE_NEXT_C_HEADERS' --build=x86_64-pc-linux-gnu --host=x86_64-openwrt-linux-gnu --target=x86_64-openwrt-linux-gnu --enable-languages=c,c++ --with-bugurl=https://dev.openwrt.org/ --with-pkgversion='OpenWrt GCC 7.4.0' --enable-shared --enable-__cxa_atexit --with-default-libstdcxx-abi=gcc4-compatible --enable-target-optspace --with-gnu-ld --with-specs='-Wl,-rpath=/opt/lib -Wl,--dynamic-linker=/opt/lib/ld-linux-x86-64.so.2' --with-boot-ldflags='static-libstdc++ -static-libgcc -Wl,-rpath=/opt/lib -Wl,--dynamic-linker=/opt/lib/ld-linux-x86-64.so.2' --disable-nls --disable-libsanitizer --disable-libvtv --disable-libcilkrts --disable-libmudflap --disable-libmpx --disable-multilib --disable-libgomp --disable-libquadmath --disable-libssp --disable-decimal-float --disable-libstdcxx-pch --with-host-libstdcxx=-lstdc++ --prefix=/opt --libexecdir=/opt/lib --with-local-prefix=/opt --with-stage1-ldflags='-lstdc++ -Wl,-rpath=/opt/lib -Wl,--dynamic-linker=/opt/lib/ld-linux-x86-64.so.2' --with-default-libstdcxx-abi=gcc4-compatible
Thread model: posix
gcc version 7.4.0 (OpenWrt GCC 7.4.0)
COMPILER_PATH=/volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc/x86_64-openwrt-linux-gnu/7.4.0/:/volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc/
LIBRARY_PATH=/volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc/x86_64-openwrt-linux-gnu/7.4.0/:/volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc/:/lib/../lib64/:/usr/lib/../lib64/:/volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc/x86_64-openwrt-linux-gnu/7.4.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
 /volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc/x86_64-openwrt-linux-gnu/7.4.0/collect2 -plugin /volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc/x86_64-openwrt-linux-gnu/7.4.0/liblto_plugin.so -plugin-opt=/volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc/x86_64-openwrt-linux-gnu/7.4.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccm1Y6FA.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc/x86_64-openwrt-linux-gnu/7.4.0/crt1.o /volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc/x86_64-openwrt-linux-gnu/7.4.0/crti.o /volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc/x86_64-openwrt-linux-gnu/7.4.0/crtbegin.o -L/volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc/x86_64-openwrt-linux-gnu/7.4.0 -L/volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc -L/lib/../lib64 -L/usr/lib/../lib64 -L/volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc/x86_64-openwrt-linux-gnu/7.4.0/../../.. -rpath=/opt/lib --dynamic-linker=/opt/lib/ld-linux-x86-64.so.2 -lgcc_s -lc -lgcc_s /volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc/x86_64-openwrt-linux-gnu/7.4.0/crtend.o /volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc/x86_64-openwrt-linux-gnu/7.4.0/crtn.o
/volume1/.@plugins/AppCentral/entware/opt/bin/../lib/gcc/x86_64-openwrt-linux-gnu/7.4.0/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
Iwao@AS5202T:/volume1/home/Iwao $
Iwao@AS5202T:/volume1/home/Iwao $ ll
total 12
drwxr-xr-x    2 Iwao     users       4.0K Mar 16 18:27 ./
drwxr-xr-x    4 root     root        4.0K Mar 16 15:19 ../
-rw-------    1 Iwao     users        100 Mar 16 18:43 .ash_history
Iwao@AS5202T:/volume1/home/Iwao $ mkdir test
Iwao@AS5202T:/volume1/home/Iwao $ cd test
Iwao@AS5202T:/volume1/home/Iwao/test $ cat > test.cpp
int     main    ()
{
        return  2 ;
        }
Iwao@AS5202T:/volume1/home/Iwao/test $ cat test.cpp
int     main    ()
{
        return  2 ;
        }
Iwao@AS5202T:/volume1/home/Iwao/test $ ls
test.cpp
Iwao@AS5202T:/volume1/home/Iwao/test $ g++ test.cpp
Iwao@AS5202T:/volume1/home/Iwao/test $ ./a.out
Iwao@AS5202T:/volume1/home/Iwao/test $ echo $?
2
Iwao@AS5202T:/volume1/home/Iwao/test $ echo $?
0
Iwao@AS5202T:/volume1/home/Iwao/test $


https://jml.mish.work/various/nas/asustor.html

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

Fedora yum と dnf

まだいろいろとわからないことが多い Linux .
今まで apt-get や yumopkg などをあまり意識しないで利用してきた.


Fedora に samba をインストールしようとして調べていると,dnf の記述が多い?
どうも最近は yum に代わって dnf になっているらしい.
ただ wiki によると,dnf にリダイレクトされるらしい.


2019/08/23
Ubuntu などでの apt-get も同様に,今は apt になっている.

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

Synology NAS で whois …

今まで,ログに残る変な IP を調べる時「IP 検索」のサイトを利用していた.
が,もう少し手軽に利用できないものかと…


検索すると,wiki WHOIS
さらに,【 whois 】コマンド――ドメイン情報を表示する


Linux のコマンドであれば,Synology NAS でも可能と思い試してみることに.

Iwao@DS116:~$ sudo -i
Password:
root@DS116:~# opkg update
-ash: opkg: command not found
root@DS116:~# cd /var/services/homes/Iwao/
root@DS116:/var/services/homes/Iwao# source ./set_ds_inc.sh
root@DS116:/var/services/homes/Iwao# opkg -v
opkg version 0.1.8
root@DS116:/var/services/homes/Iwao# opkg update
Downloading http://pkg.entware.net/binaries/armv7/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/packages
root@DS116:/var/services/homes/Iwao# opkg install whois
Installing whois (5.2.19-1) to root...
Downloading http://pkg.entware.net/binaries/armv7/whois_5.2.19-1_armv7soft.ipk
Installing libidn (1.33-2) to root...
Downloading http://pkg.entware.net/binaries/armv7/libidn_1.33-2_armv7soft.ipk
Configuring libidn.
Configuring whois.
root@DS116:/var/services/homes/Iwao# whois
Usage: whois [OPTION]... OBJECT...

-h HOST, --host HOST   connect to server HOST
-p PORT, --port PORT   connect to PORT
-H                     hide legal disclaimers
      --verbose        explain what is being done
      --help           display this help and exit
      --version        output version information and exit

These flags are supported by whois.ripe.net and some RIPE-like servers:
-l                     find the one level less specific match
-L                     find all levels less specific matches
-m                     find all one level more specific matches
-M                     find all levels of more specific matches
-c                     find the smallest match containing a mnt-irt attribute
-x                     exact match
-b                     return brief IP address ranges with abuse contact
-B                     turn off object filtering (show email addresses)
-G                     turn off grouping of associated objects
-d                     return DNS reverse delegation objects too
-i ATTR[,ATTR]...      do an inverse look-up for specified ATTRibutes
-T TYPE[,TYPE]...      only look for objects of TYPE
-K                     only primary keys are returned
-r                     turn off recursive look-ups for contact information
-R                     force to show local copy of the domain object even
                       if it contains referral
-a                     also search all the mirrored databases
-s SOURCE[,SOURCE]...  search the database mirrored from SOURCE
-g SOURCE:FIRST-LAST   find updates from SOURCE from serial FIRST to LAST
-t TYPE                request template for object of TYPE
-v TYPE                request verbose template for object of TYPE
-q [version|sources|types]  query specified server info
root@DS116:/var/services/homes/Iwao#


そのままでは Cannot open /opt/etc/whois.conf: Permission denied となる.

Iwao@DS116:~$ whois 27.92.169.109
Cannot open /opt/etc/whois.conf: Permission denied
Iwao@DS116:~$ sudo -i
Password:
root@DS116:~# cd /opt/etc/
root@DS116:/opt/etc# ll
total 28
drwxr-xr-x  3 root root 4096 Dec 28 10:55 .
drwxr-xr-x 11 root root 4096 Jan  4  2018 ..
drwxr-xr-x  2 root root 4096 Sep 25  2017 init.d
-rw-r--r--  1 root root    0 May 31  2017 ld.so.conf
-rw-r--r--  1 root root  282 May 31  2017 nsswitch.conf
-rw-r--r--  1 root root  142 Aug 16  2016 opkg.conf
-rwxr-xr-x  1 root root  471 May 31  2017 profile
-rw-------  1 root root  526 Jan  4  2018 whois.conf
root@DS116:/opt/etc# chmod 644 whois.conf
root@DS116:/opt/etc# exit
logout
Iwao@DS116:~$ whois 27.92.169.109
% [whois.apnic.net]
% Whois data copyright terms    http://www.apnic.net/db/dbcopyright.html

% Information related to '27.80.0.0 - 27.95.255.255'

% Abuse contact for '27.80.0.0 - 27.95.255.255' is 'hostmaster@nic.ad.jp'

inetnum:        27.80.0.0 - 27.95.255.255

...

last-modified:  2011-03-01T18:11:04Z
source:         JPNIC

% This query was served by the APNIC Whois Service version 1.88.15-46 (WHOIS-JP4)


Iwao@DS116:~$
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

球が作成できない

背景画像のアップロードで,球を生成してそれに貼り付ける.
コード自体はそれほど難しくないので,1 日位でできると思ってた.
Windows のコンソール AP で,次の様なコードを書いてテスト.
MakeBG.cpp
make_bg.hxx


#include "MessBar.hxx"
#include "i_Trace.hxx"
#include "gonsprm2.hxx"
#include "Htm_thrj.hxx"

//*******************************************************************************
// make bg files imo and html
// Create : 2018/04/19
//*******************************************************************************
inline bool MakeBG (c_tstring& dibPath)
{
    tstring ext = ::Path_GetExtLow(dibPath) ;
    if      (ext == _T("bmp")) { ;              }
    else if (ext == _T("jpg")) { ;              }
    else if (ext == _T("png")) { ;              }
    else                       { return false ; }
    {
        tstring imoPath = ::Path_ChangeExt(dibPath,_T(".imo")) ;
        tstring htmName = ::Path_ChangeExt(dibPath,_T(".html")) ;
        tstring dmpName = ::Path_ChangeExt(dibPath,_T(".ipl")) ;
        {
            long div = 90/5 ;
            v_Vd3A pntsAry = ::BuildSphere(div) ;
            {
                std::tout << pntsAry.size() << std::endl ;
                if (pntsAry.size() > 0) {
                    Vd3A pnts = pntsAry[0] ;
                    std::tout << pnts.size() << std::endl ;
                    }
                tstring str = ::v_V3_To_tstring(pntsAry,_T(",")) ;
                {
                    std::tout << str << std::endl ;
                    }
                ::SaveText(dmpName.c_str(),str) ;
                }
            v_Vd2A  txuvAry = ::SetTextureUV(pntsAry) ;
                    pntsAry = ::V3_Scale (pntsAry,Vd3(20.)) ;
            Gons1   gons1 = ::Gons_BuildFace(pntsAry,txuvAry,dibPath.c_str()) ;
            GonsA   ga ;
                    ga.push_back(gons1) ;
            Ed3     es = ::GonsA_GetExtent(ga) ;
            {
                std::tout << imoPath << _T("\t") ;
                std::tout << ::V3_To_tstring(es.Volume()) << std::endl ;
                }
            if (es.Volume() != Vd3(0)) {
                es = Ed3(es.L*0.01,es.G*0.01) ;
                ::GonsA_ToOBJ(ga,imoPath.c_str()) ;
                ::HT_Make_three_js_html(imoPath.c_str(),es) ;
                }
            }
        }
    return true ;
    }

//*******************************************************************************
// Make BG
// Create : 2018/04/19
//*******************************************************************************
int _tmain (int argc,TCHAR* argv[])
{
    _tsetlocale(LC_ALL,_T("")) ;
    {
        double s = sin(rad(30)) ;
        double c = cos(rad(30)) ;
        std::tout << ::To_tstring(rad(30)) << _T("\t") << ::To_tstring(s) << _T("\t") << ::To_tstring(c) << std::endl ;
        }
    if (argc > 1) {
        v_tstring argAry ;
        for (int index=1 ; index<argc ; index++) {
            tstring av = argv[index] ;
            ::MakeBG(av) ;
            }
        }
    else {
        tstring buf ;
        buf.resize(1000) ;
        {
            while (std::terr << _T("dib ? =") , std::tin.getline(&buf[0],buf.size()))
            {
                tstring str = buf.c_str() ;
                if      (str == _T("q"))   { break ; }
                else if (str == _T("Q"))   { break ; }
                str = ::QuotM_Del_All(str) ;
                if (str.empty())           { continue ; }
                if (::File_IsNothing(str)) { continue ; }
                tstring dib_file = str ;
                ::MakeBG(dib_file) ;
                }
            }
        }
    return 0 ;
    }

#include "MessBar.cxx"

今度は,DS116 でビルドして実行すると,

Iwao@DS116:/var/.../Test/up_bg/data$ ./a.out
0.523599        98314745853377985068733249901357667205561433229409406145971019710277043155206326909160297391588106447153156445277590513896008090831662627743743127151181611161993303763348552511914898438567008016612049817143085994563143448055356356529593034366351316506187159487365573007925410016860727208738652774465536.000000  98321247861193438769252981549279948821735544950351014769381393881588573259178110828643912278175146924986161470094082713103803921735703931192359519739047155548857037547932930737608178537416409042994283830606984599100883034181136178714087912736395732787698542049681305006129736011480288874859116047106048.000000
dib ? =

本当は,

C:\Users\Iwao\...\i_Tools.tmp>\\DevXP\C_Drive\Temp\DS11x\MakeBG\Release.060\MakeBG.exe
0.523599        0.500000        0.866025
dib ? =

cmath が使えない様で,検索すると「-lm でコンパイルが通る」と言うのは見つかる.
が,コンパイルの問題ではなく,実行でうまくない.


当然ではあるが,DS115j でも同様.
試しに,opkg update と opkg install gcc .
root@DS116:/var/…/Iwao# opkg update
Downloading http://pkg.entware.net/binaries/armv7/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/packages
root@DS116:/var/…/Iwao# opkg install gcc
Upgrading gcc on root from 6.3.0-1 to 6.3.0-1a…
Downloading http://pkg.entware.net/binaries/armv7/gcc_6.3.0-1a_armv7soft.ipk
Configuring gcc.
root@DS116:/var/…/Iwao#
もう一度,ビルドして実行すると,
Iwao@DS116:/var/…/Test/up_bg/data$ g++ MakeBG.cpp
Iwao@DS116:/var/…/Test/up_bg/data$ ./a.out
0.523599 0.500000 0.866025
dib ? =
予想以上に時間がかかってしまったが,何とか…
daikoku_edit.html


2019/02/13 リンクなどを修正

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

DSM 更新で…

DSM を更新した影響か? g++ などが通らなくなってしまった.


sudo -i
 
mkdir -p /volume1/@entware-ng/opt
ln -sf /volume1/@entware-ng/opt /opt
 
wget -O - http://pkg.entware.net/binaries/armv7/installer/entware_install.sh | /bin/sh
 
root@DS115j:/etc# cat rc.local
#!/bin/sh
#
/bin/ln -sf /volume1/@entware-ng/opt /opt
/opt/etc/init.d/rc.unslung start
#
 
/root/.profile
. /opt/etc/profile
 
reboot

sudo -i
opkg -v


また,更新してしばらく?は,何か動作が安定していない気がする.
php や c++ での動作が何か変?

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

Synology NAS で gcc

2022/06
https://dev.mish.work/wordpress/2022/06/15/ds116-entware/


2022/03
https://dev.mish.work/wordpress/2022/03/13/ds220-setup-4-opkg/


ssh などで接続した DS115j 上で, gcc などを使える様にするために…
ipkg や Opkg が必要らしい.
Install on Synology NAS
日本語で説明されている所があったので,参考にさせてもらった.
 2016/06/29 Synology DS216j Entware-ng 導入


次の様なコードを g++ でコンパイルして ./a.out を生成.

#include <iostream>

int main() {
	std::cout << "hello c++ php" << std::endl ;
	return 0 ;
	}

exec.php を開くと,
php から a.out の呼び出し


ASUSTOR NAS
QNAP NAS

Synology NAS DS223j

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.