Linux での zip スクリプト
先日の zip の呼び出しを C の system 関数で呼出していたが,それだけではうまくなかった.
pushd などは一時的に機能するが,zip コマンドの時には効かなくなってしまっている.
次の様なコマンドをスクリプトファイルとして作成して,それを実行する方法で対応.
pushd /home/pi/Desktop/test_c/test/zip/t_which
zip /tmp/pi/i_Tools.tmp/20190124/t_which.zip -r *
2019/01/28
上のスクリプトファイルを Synology NAS 上で,php から system (“./call_zip.sh”) として呼び出し.
/…/zip/t_call_z /…/test
/…/t_call_z
updating: a.out (deflated 71%)
updating: bak/ (stored 0%)
updating: bak/a.out (deflated 71%)
updating: bak/zip_gnu.hxx (deflated 74%)
updating: bak/cdzip.sh (deflated 18%)
updating: bak/cdzip.BAK (deflated 17%)
updating: bak/t_call_z.BAK (deflated 78%)
updating: bak/le_crlf.BAK (deflated 18%)
updating: bak/t_call_z.cpp (deflated 78%)
updating: bak/le_crlf.sh (deflated 19%)
updating: cdzip.sh (deflated 18%)
updating: le_crlf.sh (deflated 19%)
updating: t_call_z.cpp (deflated 78%)
/…/test
2021/05
zip_gnu.hxx
zip_func.hxx
Linux での zip コマンド
先日から,zip 関連のコマンドの動作を調べている.
それで困っているのが,あるフォルダ以下を指定する方法.
例えば ~/Desktop/ 直下のファイルを指定する時,パスの home/pi/Desktop/ の部分を含めたくない.
pi@raspberrypi:~/Desktop $ ls bak myweb scratch1_20190107.sb scratch2_20181231.sb2 test_c 三角形.py 正方形.py pi@raspberrypi:~/Desktop $ zip /tmp/pi/aaa.zip * adding: bak/ (stored 0%) adding: myweb/ (stored 0%) adding: scratch1_20190107.sb (deflated 39%) adding: scratch2_20181231.sb2 (deflated 30%) adding: test_c/ (stored 0%) adding: 三角形.py (deflated 17%) adding: 正方形.py (deflated 16%) pi@raspberrypi:~/Desktop $ zip /tmp/pi/aa.zip ~/Desktop/* adding: home/pi/Desktop/bak/ (stored 0%) adding: home/pi/Desktop/myweb/ (stored 0%) adding: home/pi/Desktop/scratch1_20190107.sb (deflated 39%) adding: home/pi/Desktop/scratch2_20181231.sb2 (deflated 30%) adding: home/pi/Desktop/test_c/ (stored 0%) adding: home/pi/Desktop/三角形.py (deflated 17%) adding: home/pi/Desktop/正方形.py (deflated 16%) pi@raspberrypi:~/Desktop $ unzip /tmp/pi/aaa.zip -l Archive: /tmp/pi/aaa.zip caution: filename not matched: -l pi@raspberrypi:~/Desktop $ unzip -l /tmp/pi/aaa.zip Archive: /tmp/pi/aaa.zip Length Date Time Name --------- ---------- ----- ---- 0 2019-01-09 15:02 bak/ 0 2019-01-10 21:44 myweb/ 75455 2019-01-08 00:13 scratch1_20190107.sb 69629 2019-01-08 00:13 scratch2_20181231.sb2 0 2019-01-16 16:40 test_c/ 100 2019-01-04 15:13 三角形.py 99 2019-01-04 15:11 正方形.py --------- ------- 145283 7 files pi@raspberrypi:~/Desktop $ unzip -l /tmp/pi/aa.zip Archive: /tmp/pi/aa.zip Length Date Time Name --------- ---------- ----- ---- 0 2019-01-09 15:02 home/pi/Desktop/bak/ 0 2019-01-10 21:44 home/pi/Desktop/myweb/ 75455 2019-01-08 00:13 home/pi/Desktop/scratch1_20190107.sb 69629 2019-01-08 00:13 home/pi/Desktop/scratch2_20181231.sb2 0 2019-01-16 16:40 home/pi/Desktop/test_c/ 100 2019-01-04 15:13 home/pi/Desktop/三角形.py 99 2019-01-04 15:11 home/pi/Desktop/正方形.py --------- ------- 145283 7 files pi@raspberrypi:~/Desktop $
Synology NAS の 7z だと,ルートから指定?すれば省かれるっぽい.
Iwao@DS116:~/gcc_test/Test/T_zip/zip$ 7z a aa.zip t_call_z/* Scanning Creating archive aa.zip Total: 652420 Compressing t_call_z/a.out Compressing t_call_z/bak/a.out Compressing t_call_z/bak/l7z.out Compressing t_call_z/bak/t_call_z.BAK Compressing t_call_z/bak/t_call_z.cpp Compressing t_call_z/bak/t_call_z.dsp Compressing t_call_z/bak/zip.out Compressing t_call_z/t_call_z.cpp Everything is Ok Iwao@DS116:~/gcc_test/Test/T_zip/zip$ 7z a aaa.zip ~/gcc_test/Test/T_zip/zip/t_call_z/* Scanning Creating archive aaa.zip Total: 652420 Compressing a.out Compressing bak/a.out Compressing bak/l7z.out Compressing bak/t_call_z.BAK Compressing bak/t_call_z.cpp Compressing bak/t_call_z.dsp Compressing bak/zip.out Compressing t_call_z.cpp Everything is Ok Iwao@DS116:~/gcc_test/Test/T_zip/zip$ 7z l aa.zip Listing archive: aa.zip -- Path = aa.zip Type = zip Physical Size = 187879 Date Time Attr Size Compressed Name ------------------- ----- ------------ ------------ ------------------------ 2019-01-22 11:02:30 ..... 161544 46349 t_call_z/a.out 2019-01-22 09:38:18 D.... 0 0 t_call_z/bak 2019-01-21 16:33:02 ..... 158988 45396 t_call_z/bak/a.out 2019-01-21 16:18:56 ..... 158628 45292 t_call_z/bak/l7z.out 2019-01-21 15:15:12 ..... 2325 815 t_call_z/bak/t_call_z.BAK 2019-01-21 16:31:56 ..... 2802 962 t_call_z/bak/t_call_z.cpp 2019-01-21 14:02:06 ..... 4227 1141 t_call_z/bak/t_call_z.dsp 2019-01-21 15:44:20 ..... 158656 45303 t_call_z/bak/zip.out 2019-01-22 11:01:32 ..... 4569 1167 t_call_z/t_call_z.cpp 2019-01-22 14:41:22 D.... 0 0 t_call_z/tmp ------------------- ----- ------------ ------------ ------------------------ 651739 186425 8 files, 2 folders Iwao@DS116:~/gcc_test/Test/T_zip/zip$ 7z l aaa.zip Listing archive: aaa.zip -- Path = aaa.zip Type = zip Physical Size = 187609 Date Time Attr Size Compressed Name ------------------- ----- ------------ ------------ ------------------------ 2019-01-22 11:02:30 ..... 161544 46349 a.out 2019-01-22 09:38:18 D.... 0 0 bak 2019-01-21 16:33:02 ..... 158988 45396 bak/a.out 2019-01-21 16:18:56 ..... 158628 45292 bak/l7z.out 2019-01-21 15:15:12 ..... 2325 815 bak/t_call_z.BAK 2019-01-21 16:31:56 ..... 2802 962 bak/t_call_z.cpp 2019-01-21 14:02:06 ..... 4227 1141 bak/t_call_z.dsp 2019-01-21 15:44:20 ..... 158656 45303 bak/zip.out 2019-01-22 11:01:32 ..... 4569 1167 t_call_z.cpp 2019-01-22 14:41:22 D.... 0 0 tmp ------------------- ----- ------------ ------------ ------------------------ 651739 186425 8 files, 2 folders Iwao@DS116:~/gcc_test/Test/T_zip/zip$
bool linux_zip_create (LPCTSTR zip_name,LPCTSTR zip_root) { { tstring cmd_psd = _T("pushd ") + tstring(zip_root) ; _tsystem(cmd_psd.c_str()) ; } { tstring l_z_name = zip_name ; tstring l7z_name = ::Path_ChangeExt(l_z_name,_T("_7.zip")) ; tstring root_zip = _T("*") ; tstring root_7z_ = tstring(zip_root) + _T("/*") ; tstring cmd_zip = l_cmd_zip _T(" ") + l_z_name + _T(" -r ") + root_zip ; // zip zip_name -r zip_root tstring cmd_7z_ = l_cmd_7z_ _T(" a ") + l7z_name + _T(" ") + root_7z_ ; // 7z a zip_name zip_root if (which(l_cmd_zip)) { _tsystem(cmd_zip.c_str()) ; } if (which(l_cmd_7z_)) { _tsystem(cmd_7z_.c_str()) ; } _tsystem(l_cmd_popd) ; if (which(l_cmd_zip)) { return true ; } if (which(l_cmd_7z_)) { return true ; } } return false ; }
pushd で,カレントを動かすことにより対応.
Synology NAS /tmp の空き容量
次の様に /tmp 以下に zip を作成していたら,エラー(No space left on device)に.
Iwao@DS116:/tmp/Iwao/i_Tools.tmp/20190121/tst$ zip /tmp/Iwao/i_Tools.tmp/20190121/tst/zzzzzz.zip -r /volume1/homes/Iwao/gcc_test/Test/T_zip/zip/t_call_z/ adding: volume1/homes/Iwao/gcc_test/Test/T_zip/zip/t_call_z/ (stored 0%) adding: volume1/homes/Iwao/gcc_test/Test/T_zip/zip/t_call_z/a.out (deflated 71%) adding: volume1/homes/Iwao/gcc_test/Test/T_zip/zip/t_call_z/l7z.out (deflated 71%) adding: volume1/homes/Iwao/gcc_test/Test/T_zip/zip/t_call_z/zip.out (deflated 71%) adding: volume1/homes/Iwao/gcc_test/Test/T_zip/zip/t_call_z/bak/ (stored 0%) adding: volume1/homes/Iwao/gcc_test/Test/T_zip/zip/t_call_z/bak/t_call_z.dsp (deflated 73%) adding: volume1/homes/Iwao/gcc_test/Test/T_zip/zip/t_call_z/bak/t_call_z.BAK (deflated 65%) adding: volume1/homes/Iwao/gcc_test/Test/T_zip/zip/t_call_z/t_call_z.cpp (deflated 65%) adding: volume1/homes/Iwao/gcc_test/Test/T_zip/zip/t_call_z/tmp/ (stored 0%) adding: volume1/homes/Iwao/gcc_test/Test/T_zip/zip/t_call_z/tmp/tst_.zip.000._7.zip (stored 0%) adding: volume1/homes/Iwao/gcc_test/Test/T_zip/zip/t_call_z/tmp/tst_.zip_.000.zip (stored 0%) adding: volume1/homes/Iwao/gcc_test/Test/T_zip/zip/t_call_z/tmp/tst_.zip_.001.zip7.zip (stored 0%) adding: volume1/homes/Iwao/gcc_test/Test/T_zip/zip/t_call_z/tmp/t_call_z.001.zip zip I/O error: No space left on device zip error: Output file write failure (write error on zip file) Iwao@DS116:/tmp/Iwao/i_Tools.tmp/20190121/tst$
空き容量を表示する df コマンドで確認すると,
Iwao@DS116:/tmp/Iwao/i_Tools.tmp/20190121/tst$ df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 2.3G 920M 1.3G 42% / none 502M 0 502M 0% /dev /tmp 504M 501M 2.7M 100% /tmp /run 504M 4.9M 499M 1% /run /dev/shm 504M 4.0K 504M 1% /dev/shm none 4.0K 0 4.0K 0% /sys/fs/cgroup /dev/sda3 2.7T 495G 2.2T 19% /volume1 Iwao@DS116:/tmp/Iwao/i_Tools.tmp/20190121/tst$
Joomla! 本入手
先日から空いた時間で Joomla! 関係を触っているが,システムの考え方が理解できないでいる.
単にブログとしての利用は対応するテンプレートを利用すれば良さそうだが,それなら WordPress の方が簡単.
Joomla! のことが書かれている本を,近くの何軒かの本屋で探したがやはり置いていない.
昨日時間が空いたので,ちょっと離れた本屋にも行ったがやはりない.
その駅に着く前に BOOK OFF の看板が目に入っていたので,探すと,
10 年位前に書かれた Joomla! 1.5 の内容なので,あまり期待はできない.
まだ 60/430 しか読めてないが,購入金額相当の情報が得られればと思う.
2019/01/27
112 ページまででは,バージョンが異なるためかあまり有用な情報は得られなかった.
その中で「URLリライトの使用」があった.が,そこにあった方法とは異なるみたい.
検索すると,htaccess.txt を .htaccess にコピーらしい.
DS115j で試すとうまくいったが,DS116 ではなぜかエラーになってしまう.
2019/02/05
DS116 に入れた Joomla! をアンインストール.
再度インストールして「URLリライトの使用」の設定をしたらうまくいった.
Synology NAS で zip , unzip , 7z
以前調べた Synology NAS 上での zip ファイルの扱い.
今まで 3mf ,amf などは Windows 環境のみ(i_Zip.hxx)の対応としていた.
作成 | 展開 | |
zip , unzip | zip zip_name -r zip_root | unzip -d out_dir zip_path |
7z | 7z a zip_name zip_root/* | 7z x zip_path -oout_dir |
7z の作成時の a は add .つまり zip が存在すると,それに追加になるみたい.
もう一つ見つけたのは,convert コマンド.
Synology NAS ,Raspberry Pi 共に可能.
Synology NAS ではダメだが,display コマンドで画像を表示できる.
2019/01/18
Raspberry Pi のファイルマネージャの起動.
コンソールで pcmanfm .
“pcmanfm /tmp/” とするとそこから開ける.
Joomla! の更新
先日 Synology NAS に Joomla! をインストールした.
まだ使い方を理解できてないので,これでサイトを管理するには「ほど遠い」状態.
Synology NAS でのアップデートは,ここにある「更新のインストール」で行うのが簡単と思われる.
Raspberry Pi 再起動コマンド
ちょっと原因がわからないが「ジブン専用パソコンキット2」の HDMI 接続の画面が表示されなくなった.
リモートデスクトップや SSH では接続可能な状態.
Linux なので,端末から操作できるはずと思い検索すると
Raspberry Pi シャットダウンコマンド
sudo shutdown -h now を入力.
再起動は sudo shutdown -r now
起動すると,ちゃんと画面は表示されている.何だったのだろう?
「Raspberry Pi の設定」-「インターフェイス」に「VNC」の設定があったので,VNC 接続を試してみた.
設定を「有効」にして,RealVNC のサイトからダウンロード.
リモートデスクトップ(RDP)とは違い,VNC 接続では画面の表示状態を転送しているらしい.
RDP は,キーボードや画面などをつなぎ換えて利用している感じ.Raspberry Pi 本体の表示とは異なる.
それに対して VNC は,追加でキーボードや画面をつなげた様な感じ.本体の表示と同様.
VNC は,リモートアシスタンスの動作に近い?
VNC で,Scratch 1.4 は正しく起動し表示できる.
Minecraft Pi は,起動はするがウィンドウ内が表示されないみたい.
2020/05/07
他に reboot コマンド.
C:\Users\Iwao>ssh -l pi 192.168.1.36 pi@192.168.1.36's password: Linux raspberrypi 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Thu May 7 17:05:07 2020 Linux raspberrypi 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Thu May 7 17:05:07 2020 SSH is enabled and the default password for the 'pi' user has not been changed. This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password. pi@raspberrypi:~ $ reboot --help reboot [OPTIONS...] [ARG] Reboot the system. --help Show this help --halt Halt the machine -p --poweroff Switch off the machine --reboot Reboot the machine -f --force Force immediate halt/power-off/reboot -w --wtmp-only Don't halt/power-off/reboot, just write wtmp record -d --no-wtmp Don't write wtmp record --no-wall Don't send wall message before halt/power-off/reboot See the halt(8) man page for details. pi@raspberrypi:~ $ reboot Failed to set wall message, ignoring: Interactive authentication required. Failed to reboot system via logind: Interactive authentication required. Failed to open initctl fifo: 許可がありません Failed to talk to init daemon. pi@raspberrypi:~ $ sudo reboot Connection to 192.168.1.36 closed by remote host. Connection to 192.168.1.36 closed. C:\Users\Iwao>
xml の読込み – 2
昨日の xml 読込み で,データが大きい場合に比例ではなく極端に遅くなる?
それで,次の様なコードで計測してみた.
bool Test (c_tstring& str) { for (size_t index=0 ; index<str.size() ; index++) { ElapseTime et ; tstring s_str = ::Parse_xml_quot(str,_T('|'), &index) ; std::cerr << ::To_tstring_Ki(long(s_str.size())) << _T("\t") << et.GetElapse() << std::endl ; } return true ; } bool Test (void) { tstring outPath = ::Get_i_Tools_tmp_date() ; tstring now_hms = ::Now_Format(_T("%H%M%S")) ; tstring out_txt = ::Path_AddLastSP(outPath) + now_hms + _T(".txt") ; tstring outrtxt = ::Path_AddLastSP(outPath) + now_hms + _T("_.txt") ; tstring str ; { v_tstring strAry ; { tstring str_1000 ; { tstring str_10 = _T("0123456789") ; for (long indexS=0 ; indexS<100 ; indexS++) { str_1000 += str_10 ; } } for (long index=0 ; index<2000 ; index++) { strAry.push_back(str_1000) ; } } str = ::String_Join_Line(strAry) ; } str[0] = _T('|') ; str += _T('|') ; size_t len = str.length() ; while (len > 100) { len = len/2 ; str[len-0] = _T('|') ; str[len-1] = _T('|') ; } { tstring tmp = str ; v_tstring tmpAry = ::String_Split(tmp.c_str(),false) ; tmpAry = ::SkipEmpty(tmpAry) ; str = ::String_Join_Line(tmpAry) ; } { ::SaveUTF8(out_txt.c_str(),str) ; ::Test(str) ; } { tstring rev = str ; { std::reverse(rev.begin(),rev.end()) ; v_tstring revAry = ::String_Split(rev.c_str(),false) ; revAry = ::SkipEmpty(revAry) ; rev = ::String_Join_Line(revAry) ; } ::SaveUTF8(outrtxt.c_str(),rev) ; ::Test(rev) ; } return true ; }
DS116 では,比例と思われる.
login as: Iwao Iwao@DS116's password: Iwao@DS116:~$ source ./set_ds_inc.sh Iwao@DS116:~$ cd gcc_test/Test/T_P_xm_q/ Iwao@DS116:~/gcc_test/Test/T_P_xm_q$ g++ T_P_xm_q.cpp Iwao@DS116:~/gcc_test/Test/T_P_xm_q$ ll total 204 drwxrwxrwx+ 2 Iwao users 4096 Jan 8 14:10 . drwxrwxrwx+ 10 Iwao users 4096 Jan 8 14:09 .. -rwxrwxrwx 1 Iwao users 183528 Jan 8 14:10 a.out -rwxrwxrwx+ 1 Iwao users 3009 Jan 8 13:59 T_P_xm_q.cpp Iwao@DS116:~/gcc_test/Test/T_P_xm_q$ ./a.out 61 0.000384092 61 6.10352e-05 122 5.31673e-05 245 5.19753e-05 489 6.29425e-05 979 8.70228e-05 1.91 K 0.000140905 3.82 K 0.000212908 7.64 K 0.000381947 15.29 K 0.000729799 30.58 K 0.00145721 61.16 K 0.0028069 122.32 K 0.00562811 244.63 K 0.011224 489.26 K 0.0223849 978.52 K 0.0462639 0 5.38826e-05 0 3.91006e-05 978.52 K 0.045109 489.26 K 0.022413 244.63 K 0.0112309 122.32 K 0.00556397 61.16 K 0.00286198 30.58 K 0.00143504 15.29 K 0.000734806 7.64 K 0.000383139 3.82 K 0.000211 1.91 K 0.000123024 979 8.51154e-05 489 6.19888e-05 245 5.00679e-05 122 4.3869e-05 61 4.00543e-05 61 3.91006e-05 0 3.31402e-05 0 3.31402e-05 Iwao@DS116:~/gcc_test/Test/T_P_xm_q$
VC 6 は比例でなく,もっとかかっている.VC 14 では問題ない.VC 8 以降?は大丈夫だと思う.
C:\Users\Iwao>C:\Users\Iwao\AppData\Local\Temp\MICS.tmp\Temp\Test.exe\T_P_xm_q.exe 61 0 61 0 122 0 245 0 489 0 979 0 1.91 K 0 3.82 K 0 7.64 K 0 15.29 K 0 30.58 K 0.016 61.16 K 0.016 122.32 K 0.109 244.63 K 0.531 489.26 K 2.433 978.52 K 14.68 0 0 0 0 978.52 K 14.664 489.26 K 1.342 244.63 K 0.374 122.32 K 0.125 61.16 K 0.016 30.58 K 0.015 15.29 K 0 7.64 K 0 3.82 K 0 1.91 K 0 979 0 489 0 245 0 122 0 61 0 61 0 0 0 0 0 C:\Users\Iwao>
tstring Parse_xml_quot (c_tstring& str,const TCHAR qm,size_t* index) { tstring q_str ; if (*index < str.length()) { TCHAR c = str[*index] ; if (c == qm) { /* q_str += c ; for (size_t indexQ=*index+1 ; indexQ<str.size() ; indexQ++) { TCHAR cq = str[indexQ] ; q_str += cq ; if (cq == qm) { *index = indexQ ; break ; } } */ size_t pos = ::String__Find(str,qm,*index+1) ; if (pos == tstring::npos) { q_str = str.substr(*index) ; *index = str.length() ; } else { size_t q_len = pos+1 - *index ; q_str = str.substr(*index,q_len) ; *index = pos ; } } } return q_str ; }
2019/06/06
2019/01 のコードは属性の値のネスト(attr='”a” “b”‘)に対応できてないバグあり.
xml の読込み
幾つかの xml データを読んでみると,データにより msxml.dll を使用したときに比べて明らかに遅い.
bool Test (LPCTSTR pathName) { tstring outPath = ::Get_i_Tools_tmp_date() ; tstring now_hms = ::Now_Format(_T("_%M%S")) ; tstring out_xml = ::Path_AddLastSP(outPath) + ::Path_GetName(pathName) + now_hms + _T(".o.xml") ; tstring new_xml = ::Path_AddLastSP(outPath) + ::Path_GetName(pathName) + now_hms + _T(".n.xml") ; { ElapseTime eto ; Xml_E xml = ::Xml_Import(pathName) ; std::cerr << eto.GetElapse() << std::endl ; Xml_Out::Export(xml,out_xml.c_str()) ; } { ElapseTime etn ; Xml_E xml = ::Load_xml_2018_12(pathName) ; std::cerr << etn.GetElapse() << std::endl ; Xml_Out::Export(xml,new_xml.c_str()) ; } return true ; }
データは次の様な x3d で,5 倍くらいかかる.
x3d の場合は,属性の値が長い.
そのため次のコード部分( q_str+=cq )がうまくない.
tstring Parse_xml_quot (c_tstring& str,const TCHAR qm,size_t* index) { tstring q_str ; if (*index < str.length()) { TCHAR c = str[*index] ; if (c == qm) { q_str += c ; for (size_t indexQ=*index+1 ; indexQ<str.size() ; indexQ++) { TCHAR cq = str[indexQ] ; q_str += cq ; if (cq == qm) { *index = indexQ ; break ; } } } } return q_str ; }
ジブン専用パソコンキット2 Scratch
「はじめようジブン専用パソコン」連載のバックナンバーのスクラッチをやってみた.
第4回 スクラッチに挑戦!
第5回 猫を使ったゲームをつくろう!
第6回 ゲームを完成させて、ネットにアップしよう!
リモートデスクトップでは Scratch は起動できない?そのため Scratch 2 を利用.
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:~$
T5400 また青くなってしまった…
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 に.
簡単に動作を確認していると,QR コードが表示されなくなっている.
この時と同じ現象,原因.
GD が動作していなかった.
2018/12/26
「Apache HTTP Server 2.4」では一部 500 となってしまうものがあり.
ちょっと調べる時間が取れないので 2.2 に戻すことに.
一部の .htaccess の中身がうまくなかった様で修正.
IndexIgnore となっていて,IndexIgnore * の様にファイルが指定されていなかった.
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….txt」を削除.
インストール終了.
instllation ディレクトリを削除.
このインストール方法では,サンプルデータの「日本語(JP)デフォルト」がなくインストールできなかった.
インストール先は https://itl.mydns.jp/joomla/
ジブン専用パソコンキット2 追加
KoKaジブン専用パソコンキット2 が届いた.
箱は 2つ.
今日は組み立てまで.
「パイケース組立マニュアル」の手順通りやれば難しくはないが,カバーを外すのが少しわかり難い?
赤い所に突起がある.
小さい方のヒートシンクは,大人は指が大きいので取り付けが難しい.
2018/12/25
「はじめようジブン専用パソコン」連載のバックナンバーから,組み立てと設定.
組み立てて OS 起動直後はシステム日付が正しくない.
ネットワークの設定を行うと自動的に設定される?
2018/12/26
そのままでは使い勝手が悪いので,リモート接続を可能にするための設定.
「Windowsパソコンからraspberrypi3にリモートデスクトップで接続する」を参考にさせてもらい設定.
実際に入力したのは,
$ sudo apt-get update
$ sudo apt-get install xrdp
「日本語キーボードの配列を追加」はやっていない.
他に「Raspberry Pi の設定」で「SSH」を「有効」に.
DS116 とは違い,zip と unzip があることは確認.7z はない.
以前調べて知ってはいたが gcc はちゃんと入っている.
2018/12/28
今日起動すると,
SSH is enabled and the default password for the ‘pi’ user has not been changed .
This is a seurity risk – please login as the ‘pi’ user and run Raspberry Pi Configuration to set a new passowrd .
自分でしか使わないので,そのままに.
WebGL で作成したページを表示すると,あまり綺麗に表示できない.
include ファイルの大文字
Windows 上で動作しているコンソール AP の Synology NAS 上での動作テスト.
NAS 上でコンパイルすると include ファイルがないエラー.
今まで include する時,大文字と小文字を正しく指定できていた.
が,今回タイプミスで小文字となってしまっていたためのエラー.
g++ 時に大文字,小文字を無視する方法がないか調べたがわからず.
いろいろ考えたが,Linux 環境などでも互換性が取れるコードは小文字のファイル名とすれば都合が良さそう.
MFC や Windows.h を使用している時は,今まで通り大文字が混在するファイル名とする.
関連するファイルを全て編集するのは時間がかかるし間違いも増えそう.
そこで,新規のファイルと変更するファイルなどから徐々に修正することにする.
新規や変更時,include する所で lowname.hxx などとする.
LowName.hxx となっているファイルは,gcc でのみインクルードするディレクトリにコピー.
元のファイルは lowname.hxx にリネーム.
gcc にコピーした LowName.hxx は #include “lowname.hxx” の様に間接的にインクルードする様に変更する.
これでうまく機能することは確認した.
が,robocopy や Dropbox を使用している関係で lowname.hxx にならないことがある.
2019/04/16 追記
robocopy で lowname.hxx にならないことに関しては,一度コピー先を削除(実際は移動)して対応.
送信された URL に noindex タグ…
先日 All in One SEO の設定を変更して「送信された URL に noindex タグが追加されています」となってしまった.
All in One SEO の「XML サイトマップ」の「日別アーカイブページを含める」のチェックを外した状態に変更.