ホーム » Synology NAS (ページ 6)

Synology NAS」カテゴリーアーカイブ

2025年6月
1234567
891011121314
15161718192021
22232425262728
2930  

カテゴリー

アーカイブ

ブログ統計情報

  • 116,142 アクセス


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.

PHP 5.6 から 7.0 へ

以前調べた時,何かうまくない部分があったように思うが…
php.net PHP 5.6.x から PHP 7.0.x への移行
Synology NAS では簡単に戻せるので,7.0 に変更してみた.
設定は,DSM の「Web Station」.
ついでに,Apache も 2.4 に.

PHP 7 への設定
PHP 7 への設定

簡単に動作を確認していると,QR コードが表示されなくなっている.
この時と同じ現象,原因.
GD が動作していなかった.
gd を有効に
gd を有効に


2018/12/26
「Apache HTTP Server 2.4」では一部 500 となってしまうものがあり.
ちょっと調べる時間が取れないので 2.2 に戻すことに.
一部の .htaccess の中身がうまくなかった様で修正.
IndexIgnore となっていて,IndexIgnore * の様にファイルが指定されていなかった.

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

Joomla! インストール

ブログ形式ではなく,仕様書などマニュアルの様な構成の記述ができないかと調べてみた.
今までは,次の様な感じて記述している.
http://itl.mydns.jp/Iwao/Doc/spec/3d/iges/iges.html
WEBマニュアルをワードプレスと無料テーマで作る方法」を見つけたが,ちょっと違う?気がする.


以前 WD Cloud に入れていた Joomla を思い出し,検索してみた.
Joomla!の道しるべ」を参考にさせてもらっていじってみた.
WD Cloud の Joomla は外からアクセスできなさそう.wordpress も同様だった.


Synology NAS に Joomla! をインストール.
「パッケージ センター」から「Joomla」を選択して「インストール」.

「パッケージ センター」-「Joomla」
「パッケージ センター」-「Joomla」


サイトの設定.

サイトの設定
サイトの設定

データベースの設定.
データベースの設定
データベースの設定

確認が入るので「_Joomla….txt」を削除.
データベースの設定-エラー
データベースの設定-エラー

インストール終了.
インストール終了
インストール終了

instllation ディレクトリを削除.


このインストール方法では,サンプルデータの「日本語(JP)デフォルト」がなくインストールできなかった.
インストール先は https://itl.mydns.jp/joomla/

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

Synology NAS で zip

Synology NAS 内(SSH 接続)で,zip ファイルを扱えないかと…
検索すると,Linux 環境では zip や unzip があるらしい.
SSH で接続して確認すると,zip はあるが unzip は command not found .
さらに検索すると Synology Forum に情報があった.
 Unzip?
7z コマンドが利用できるみたい.

Iwao@DS116:~$ zip
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
Zip 3.0 (July 5th 2008). Usage:
zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list]
  The default action is to add or replace zipfile entries from list, which
  can include the special name - to compress standard input.
  If zipfile and list are omitted, zip compresses stdin to stdout.
  -f   freshen: only changed files  -u   update: only changed or new files
  -d   delete entries in zipfile    -m   move into zipfile (delete OS files)
  -r   recurse into directories     -j   junk (don't record) directory names
  -0   store only                   -l   convert LF to CR LF (-ll CR LF to LF)
  -1   compress faster              -9   compress better
  -q   quiet operation              -v   verbose operation/print version info
  -c   add one-line comments        -z   add zipfile comment
  -@   read names from stdin        -o   make zipfile as old as latest entry
  -x   exclude the following names  -i   include only the following names
  -F   fix zipfile (-FF try harder) -D   do not add directory entries
  -A   adjust self-extracting exe   -J   junk zipfile prefix (unzipsfx)
  -T   test zipfile integrity       -X   eXclude eXtra file attributes
  -y   store symbolic links as the link instead of the referenced file
  -e   encrypt                      -n   don't compress these suffixes
  -h2  show more help
  -yf  store files/directories that symbolic links point to in an archive
  -cp  codepage, ex: fre,ger,ita,spn,cht,chs,jpn,krn,ptb,rus,dan,nor,sve,nld,plk,ptg,hun,trk,csy

Iwao@DS116:~$ unzip
-sh: unzip: command not found
Iwao@DS116:~$ 7z

7-Zip 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
p7zip Version 9.20 (locale=en_US.utf8,Utf16=on,HugeFiles=on,2 CPUs)

Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...]
       [<@listfiles...>]

<Commands>
  a: Add files to archive
  b: Benchmark
  d: Delete files from archive
  e: Extract files from archive (without using directory names)
  l: List contents of archive
  t: Test integrity of archive
  u: Update files to archive
  x: eXtract files with full paths
<Switches>
  -ai[r[-|0]]{@listfile|!wildcard}: Include archives
  -ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
  -bd: Disable percentage indicator
  -i[r[-|0]]{@listfile|!wildcard}: Include filenames
  -m{Parameters}: set compression Method
  -o{Directory}: set Output directory
  -p{Password}: set Password
  -r[-|0]: Recurse subdirectories
  -scs{UTF-8 | WIN | DOS}: set charset for list files
  -sfx[{name}]: Create SFX archive
  -si[{name}]: read data from stdin
  -slt: show technical information for l (List) command
  -so: write data to stdout
  -ssc[-]: set sensitive case mode
  -t{Type}: Set type of archive
  -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
  -v{Size}[b|k|m|g]: Create volumes
  -w[{path}]: assign Work directory. Empty path means a temporary directory
  -x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
  -y: assume Yes on all queries
Iwao@DS116:~$    


Synology NAS で zip , unzip , 7z
Linux での zip コマンド


NAS で zip コマンドを使用したページ
https://itl.mydns.jp/i_Tools/up_bg_s/
up_bg_s
http://jml.mish.work/i-tools/360-panorama.html
http://jml.mish.work/i-tools/how-to-up-bg.html

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

WEB SQL Injection Attempt -87

ルータ RT-AC86U の AiProtection ではじかれているが,今日は Web サーバへの攻撃が多い?
2018-11-22 18:06:23  External Attacks  129.121.176.228  192.168.x.x WEB SQL Injection Attempt -87


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

ログが途中までしか表示されない

変なアクセスがあり,ログが途中までしか表示されなくなった.
‘\x0’ が含まれていて,そこを文字列の終わりと解釈しているためだった.

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

wordpress で更新できない

次の所を編集しようとして,「更新」を押しても反映されない.
https://mish.myds.me/wordpress/i-tools/about/
元に戻ってしまう.
一度ログアウトして,再度入ろうとすると入れない.
Synology NAS DS116 を再起動することで対応.


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

Let’s Encrypt certificate expiration …

Let’s Encrypt からのメール.
Let’s Encrypt certificate expiration notice for domain “itl.mydns.jp” (and 1 more)
Hello,
Your certificate (or certificates) for the names listed below will expire in 20 days (on 11 Aug 18 06:35 +0000). Please make sure to renew your certificate before then, or visitors to your website will encounter errors.
We recommend renewing certificates automatically when they have a third of their total lifetime left. For Let’s Encrypt’s current 90-day certificates, that means renewing 30 days before expiration. See https://letsencrypt.org/docs/integration-guide/ for details.
itl.mydns.jp
mish.myds.me
For any questions or support, please visit https://community.letsencrypt.org/. Unfortunately, we can’t provide support by email.
Regards,
The Let’s Encrypt Team


どうも Synology NAS に,最初に登録したものに対して期限が迫っているということみたい.
Synology NAS の DSM は自動で更新してくれるそうなので,このまま様子見.


2018/08/01 再度,Lets’ Encrypt から.
Hello,
Your certificate (or certificates) for the names listed below will expire in 9 days (on 11 Aug 18 06:35 +0000). Please make sure to renew your certificate before then, or visitors to your website will encounter errors.
We recommend renewing certificates automatically when they have a third of their total lifetime left. For Let’s Encrypt’s current 90-day certificates, that means renewing 30 days before expiration. See https://letsencrypt.org/docs/integration-guide/ for details.
itl.mydns.jp
mish.myds.me
For any questions or support, please visit https://community.letsencrypt.org/. Unfortunately, we can’t provide support by email.
If you are receiving this email in error, unsubscribe at http://mandrillapp.com/track/unsub.php?u=30850198&id=547c6b491faf4f03b0ecc8cb3871a0b2.RsjpgIgXcXbPKK4%2Fg4vK9vppkUw%3D&r=https%3A%2F%2Fmandrillapp.com%2Funsub%3Fmd_email%3Diwao.n%2540ae.auone-net.jp
Regards,
The Let’s Encrypt Team

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

https で鍵マークが…

https で鍵マークが消えてしまうことがあった.
最近アップロードしたページでは問題ない.

以前アップしてまだ修正が残っているページを見ると,
「このページの一部(画像など)は安全ではありません。」となる.

ここの画像を修正して OK になった.

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

DS115j と DS116 の熱状態

去年の夏は気付かなかったが,DS115j の本体の温度が高いので心配.

DS116 は気にならない.

実装しているハードディスクは,どちらも WD Red 3TB .
温度は,42 と 43 なので問題ない.

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

https 対応

サーバが対応していれば,http を https と書換えれば良さそう.

<script src="http://iwaomics.web.fc2.com/_lib/.../three.min.js"> </script>
            https://iwaomics.web.fc2.com/_lib/.../three.min.js

https: などを付けないと言う考え方もあるが,js を利用したローカルファイルでうまく動作しなくなる.
fc2 は「設定」-「基本設定」の「SSL暗号化通信(HTTPS)の設定」で「SSLの設定」を「有効にする」.


Synology NAS DS116 の「SSL 証明書」の取得は,次の所を参考にさせてもらいました.
ホームネットワーク研究所 Let’s Encryptの無償のSSL証明書の取得方法


2018/07/30
1ヶ月位経って,検索から https へのアクセスが半分程度の比率になった?
 google
 yahoo
 bing
 DuckDuckGo

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

DS115j の動作が…

DS115j の動作が何かおかしい.
パッケージが幾つも更新された影響か?
それとも,WSR-300HP を含む無線 LAN 環境が不安定なためか?
今日も,DS115j に接続した WLI-UC-AG300N が動作していなかった.
パッケージの更新が動作しているのに気づいてから,更新に 1 時間程度かかっていた.
WSR-300HP と DS115j を再起動させて様子見.


Synology NAS に NTP 機能があることに気が付いた.
WSR-300HP の時間が頻繁に変になってしまうので,この DS116 で NTP サービスを有効に.
DS116 NTP サービスを有効に


2018/06/13
今日 DSM が更新されて DSM 6.2-23739 となった.
これが入るために予め他のパッケージが更新されたのか?

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

Note Station の設定

Note Station をインストールはしていたが,使用していなかった.
Synology NAS をもっと使えないかと調べていたら,このツールが Evernote と似た用途とあった.
DSM の「メインメニュー」から「Note Station」を選択.
起動直後に表示されるリンク,または「設定」ダイアログ内からデスクトップ版を入手.
デスクトップ版入手のメッセージ
Note Station 設定
デスクトップ版 Note Station は,QuickConnect だと簡単に接続できた.
Note Station ログイン
モバイル版は,Synology サイトのここから入ってインストール.
同様に入ろうとするが,なぜか入れない.
モバイル版 ログイン エラー
この方法がわかり難かった.
「アプリケーション ポータル」で note を設定.
「アプリケーション ポータル」での設定
LAN 内であれば 192.168.x.xxx/note と指定することで開ける様になった.
モバイル版 ログイン


2018/05/13
「File Station」のスマートフォン版「DS File」.
PC からのアクセス(ブラウザで ds116/file)はうまく動作するのに,DS file ではログインできないでいた.
が,今日操作すると入れるようになっている.
その間に弄ったところで思いつくのは,AC86U の「ポートフォワーディング」の設定.
WebDAV http 5005 192.168.1.216 TCP
WebDAV https 5006 192.168.1.216 TCP
設定を外しても動作しているので詳細は不明.


2019/10/25
ログイン方法がわからなくなったのでその画面をコピー.
Web Clipper ログイン画面

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

Synology NAS で文字色

別の事を調べていて,次の様な内容を見つけたので Synology NAS でやってみた.
C言語でターミナルで表示される文字をカラー表示させる
コードはそのまま拝借させてもらった.
ANSI escape code

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

RT-AC86U 追加 – 2

次に影響が少ない psc 2550 .
固定 IP を DHCP に変更して AC86U に接続したが,DHCP がうまく動作せず後回し.


AP の WN-AC1167R は,単純に繋ぎ変えだけで 192.168.1.xx に.
HDL-AH2W ,HVL-S3 を DHCP に.
DS115j ,DS116 を,DHCP に.
全てを AC86U に接続.BL190HW,AC86U,WR9500N などは何度か再起動.
PC なども ASUS Ruter アプリで確認しながら,必要に応じて再起動.
AP と子機の WR9500N も,繋ぎ変えだけで 192.168.0.2xx から 192.168.1.2xx になった.
何度か再起動が必要なものもあったが,DS11x を除いて移行できた.
psc 2550 も 192.168.1.x になり,固定 IP に設定.


DS115j と DS116 を固定 IP(192.168.1.216)に(以降 4 つ目の値は実際と異なります).
DS115j は公開してないので DHCP で良いが,IP で打つことが多いので固定にしている.
また,AC86U も WAN 側を固定(192.168.0.120)に.
27.92.169.109 — BL190HW — 192.168.0.120 — AC86U — 192.168.1.216
PC から tracert .

 1     1 ms     1 ms     1 ms  router.asus.com [192.168.1.1]
 2     1 ms     1 ms     1 ms  web.setup [192.168.0.1]
 3     *        *        *     要求がタイムアウトしました。
 4     5 ms     6 ms     6 ms  tmfACS001.bb.kddi.ne.jp [27.85.212.25]
 5    11 ms    12 ms    12 ms  27.80.241.61
 6    10 ms    10 ms    10 ms  27.80.241.238
 7    10 ms    10 ms    10 ms  jc-osa301.int-gw.kddi.ne.jp [113.157.227.82]
 8  ....

LAN 内から,エクスプローラなどではアクセスできるが,http でアクセスできない.
DSM コントロールパネルの「セキュリティ」-「ファイアウォール」-「custom」.
DS116 ファイアウォール設定
他に,Web アクセスの PHP も 192.168.1.x が有効となる様に変更.


この状態では,Web サーバとして外からアクセスできない.
BL190HW のポートマッピングの設定で,次のものを追加.
192.168.0.120 TCP any
Aterm BL190HW ポートマッピング設定
また DMZ の設定に 192.168.0.120 を.
AC86U の「ポートフォワーディング」の設定で次を追加.
HTTP DS116 80 192.168.1.216 TCP
RT-AC86U ポートフォワーディング設定
これで,外からは mish.myds.me にアクセスできる様になった.
この 5 時間程度,外からのアクセスは停止.


まだ LAN 内からは mish.myds.me でアクセスできない.
暫くわからず AC86U の IPv6 の関係と思い調べたが,あまり有用な情報は見つけられなかった.
試しに,「Passthrough」,自動接続を「有効」にすると,意図した動作となった.
RT-AC86U IPv6 設定


2018/11/13 ネットワークマップの表示
ネットワークマップ

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.

PHP $_FILES

やってないとすぐ忘れてしまうのでメモ.
PHP マニュアル POST メソッドによるアップロード


php 側での次の様な取り出し.
 $tempfile = $_FILES[‘fname‘][‘tmp_name’];
fname‘ にあたる部分は,input タグの name 属性.
 <input type=”file” name =”fname” accept=”.jpg,.png”>


CHttpFile でのアップロード の場合は,汎用的になる様に処理している.

	function  uf_upload_files  ()  {
		$d_dir =  uf_get_upload_folder() ;
	//	echo	$d_dir	.  "<br/>\r\n" ;
		$up_status = false ;
		foreach	($_FILES as  $keys => $values) {
			$file_e	= $values ;
			$tempfile =         	$file_e['tmp_name'] ;
			$filename = $d_dir .	$file_e['name'] ;
			$filename = uf_get_up_file_name($filename) ;
			if (is_uploaded_file($tempfile)) {
				$up_status = move_uploaded_file($tempfile,$filename) ;
				}
			}
		return	$up_status ;
		}
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

アップロード先のアクセス権

次の様な htm と php で,画像をアップできる所を用意.


up.htm

<!DOCTYPE html>
<html lang="ja" >
  <head >
    <meta charset="UTF-8" />
    </head>
  <body >
    <form action="http:./up.php" method="post" enctype="multipart/form-data">
      <input type="file" name ="fname" accept=".jpg,.png">
      <input type="submit" value="upload">
      </form>
    </body>
  </html>

up.php

<?php
  $tempfile = $_FILES['fname']['tmp_name'];
  $fileName = './data/' . $_FILES['fname']['name'] ;
  $up_status = false ;
  if (is_uploaded_file($tempfile)) {
    $up_status = move_uploaded_file($tempfile , $fileName ) ;
    }
  $frm_src = './' ;
  if ($up_status) {
    $frm_src = $fileName ;
    }
  header("Location: {$frm_src}") ;
  ?>

これらのファイルとアップ先のフォルダを用意しただけでは,アクセス権がないのでアップロードできない.
以前は,DSM に入り「File Station」で「権限」を設定していた.
今まで面倒と思いつつ,試しに Windows 環境からアクセス権を「読み取り(RX)(RX)」から「変更」に.

File Station で設定したものと少し異なるが,それなりに動作してそう.


up.htm と up.php

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

あなたのサイト … を読み込めません

メールを確認していると,
あなたのサイト http://mish.myds.me/wordpress/dev を読み込めませんでした。
iwaoodn さん、こんにちは。
2018年3月29日 (木) 10:55 AMに確認しましたが、あなたのサイト http://mish.myds.me/wordpress/dev を読み込めませんでした。
Your site is returning a 403 error, which normally indicates that your host’s security measures are blocking our monitoring requests. Please have them confirm that they are not blocking any requests from our user agent.
引き続きサイトが停止しているようであれば、ホスティング事業者に助けを求めた方がよいでしょう。サイトが再び稼働してオンラインになれば、もう一度お知らせします。
View your site’s activity to investigate when and perhaps why it went down.
モニターについてもっと詳しく
このメールが届いた理由
You are receiving this email because you have activated Jetpack Monitor on your site. If you need to contact support, please include this reference: [136721373/blocked].
Manage your email settings
Automattic, Inc., 60 29th Street #343, San Francisco, CA 94110, USA
Automattic は Jetpack、WordPress.com、WooCommerce などの運営会社です。600名以上の従業員が50以上の都市で働いており、常時社員募集中です。


LAN 内からアクセスは特に問題がない.
Moto G5 で外からアクセスすると 403 .

WSR-300HP が不安定なことが影響したのか?


Aterm BL190HW,WSR-300HP,DS116 を再起動して,うまく動作する様になったことを確認.

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

QR コードが表示されない?

いつからなのか不明だが,DS116 上の qr_img.php を使用している所で正しく表示されなくなっていた.
気付いたのは昨日の昼頃.

DS115j 上や,//itools.hp2.jp/Test/qr/ のものはうまく動作している.
//itools.hp2.jp/ は DS116 上のものを利用しているのでうまく表示されない.


「Web Station」-「PHP 設定」で,「PHP エラーメッセージ表示…」にチェック.

すると,次の様なエラー.
 Fatal error: Call to undefined function ImageCreate() in /…/php/qr_img.php on line 609
検索すると GD が動作していないとのこと.
gd にチェックを付けてうまく動作する様になった.
OFF にした覚えはないので,DS116 上の何かの更新で無効になってしまったのか?

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