ホーム » Linux (ページ 5)

Linux」カテゴリーアーカイブ

2024年4月
 123456
78910111213
14151617181920
21222324252627
282930  

カテゴリー

アーカイブ

ブログ統計情報

  • 80,458 アクセス



GLUT インストール

ちょっと時間が空いたので,Linux 環境で GLUT を使える様にしてみた.
以前からお世話になっている次の所に詳しく書かれている.
GLUTによる「手抜き」OpenGL入門


Ubuntu , Debian ,Raspberry Pi では
  $ sudo apt install freeglut3 freeglut3-dev
Fedora では
  $ sudo yum install freeglut
  $ sudo yum install freeglut-devel


コンパイルは
  $ cc hello_gl.c -lglut -lGLU -lGL
GLUT を使用したサンプルのコンパイルと実行
https://jml.mish.work/index.php/cpp/install-glut.html


2019/08/17 本屋に寄ったらあったので購入.


opengl.jp
The OpenGL Utility Toolkit (GLUT) Programming Interface API Version 3 日本語翻訳版


2021/05 Win10 に GLUT インストール


https://itl.mish.work/Iwao/Doc/algo/to_thick/glut.htm

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

NAS でのコンパイルエラー

Iwao@DS116:~/gcc_test/Test/gons_to$ g++ gons_to.cpp
In file included from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/gonsa_to.hxx:24:0,
                 from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/Test/gons_to.hpp:11,
                 from gons_to.cpp:13:
/volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/ga_dae.hxx: In function 'Xml_E GonsA_ToDAE(const GonsA&, c_v_tstring&)':
/volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/ga_dae.hxx:180:95: error: invalid initialization of non-const reference of type 'Vd3& {aka Vector3<double>&}' from an rvalue of type 'Vd3 {aka Vector3<double>}'
      Xml_E nodeR = dae_out::node_lookat(ID_visual_scene_n_c_R,ID_camera_R_STD,stdR.GetEyePoint(),target) ;
                                                                               ~~~~~~~~~~~~~~~~^~
In file included from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/ga_dae.hxx:12:0,
                 from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/gonsa_to.hxx:24,
                 from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/Test/gons_to.hpp:11,
                 from gons_to.cpp:13:
/volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/fe_dae.hxx:596:15: note:   initializing argument 3 of 'static Xml_E dae_out::node_lookat(LPCTSTR, LPCTSTR, Vd3&, Vd3&)'
  static Xml_E node_lookat (
               ^~~~~~~~~~~
In file included from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/gonsa_to.hxx:24:0,
                 from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/Test/gons_to.hpp:11,
                 from gons_to.cpp:13:
/volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/ga_dae.hxx:181:95: error: invalid initialization of non-const reference of type 'Vd3& {aka Vector3<double>&}' from an rvalue of type 'Vd3 {aka Vector3<double>}'
      Xml_E nodeL = dae_out::node_lookat(ID_visual_scene_n_c_L,ID_camera_L_STD,stdL.GetEyePoint(),target) ;
                                                                               ~~~~~~~~~~~~~~~~^~
In file included from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/ga_dae.hxx:12:0,
                 from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/gonsa_to.hxx:24,
                 from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/Test/gons_to.hpp:11,
                 from gons_to.cpp:13:
/volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/fe_dae.hxx:596:15: note:   initializing argument 3 of 'static Xml_E dae_out::node_lookat(LPCTSTR, LPCTSTR, Vd3&, Vd3&)'
  static Xml_E node_lookat (
               ^~~~~~~~~~~
Iwao@DS116:~/gcc_test/Test/gons_to$ g++ gons_to.cpp
Iwao@DS116:~/gcc_test/Test/gons_to$ ./a.out

invalid initialization of non-const reference of type
node_lookat の 3 つ目の Vd3& を const とすることで対応.
invalid initialization of non-const reference of type” で検索するとわかりやすく書いてあった.

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

改行コード

デバッグ用で class の配列のデータのダンプのために次の様なコードを作成.

template	<class	T>	tstring	To_tstring(const std::vector<T>& vt)
{
	tstring	str ;
	for (size_t index=0 ; index<vt.size() ; index++) {
		T   	e1 = vt[index] ;
		tstring	s1 = e1.To_tstring() ;
		str +=	s1 + _T("\r\n") ;
		}
	return	str ;
	}

それで気になったのが,それぞれの OS での改行コード.
wiki 改行コード
mac も LF になっていた.


cat コマンドでは -e で改行コードの表示が可能.
cat --help

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

Anaconda3 が入っていた

以前購入した「Python で学び直す高校数学」.

読み進めていくと Anaconda が必要となっていて,そこで止まった状態に.


昨日 PC に入っている AP を見ていると Anaconda があった.
スタートメニュー Anaconda3
今回 PC 環境が新しくなって,開発環境なども VS 2005 ~ VS 2019 まで入れた.
その時インストールオプションをどの様に指定したか覚えてないが,VS 2017 のインストールで入った?


使い方があまりわかってないが,「Anaconda Prompt」を起動して python ~.py で動作するみたい.
Anaconda Prompt で  python ~.py

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

VirtualBox に Fedora

今度は Fedora
VirtualBox に Fedora
ダウンロードは次のところから可能.
https://getfedora.org/ja/workstation/


gcc なども含めて入っている.
Fedora zip unzip display コマンド


python3 も入っている.


2019/06/06 g++ は無かった.
Fedora で g++ を利用する

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

VirtualBox に Ubuntu

VirtualBox に Linux を入れようと思いやってみることに.
OS は「日経Linux 2019年 1月号」の付録 DVD を使用.


VirtualBox でストレージ 80 GB として確保.
光学ドライブに DVD を入れて仮想マシンを起動.
VirtualBox で Ubuntu のインストール
Ubuntu のダウンロードはこちらからできます.
https://www.ubuntulinux.jp/download


VBoxGuestAdditions をインストール.
Ubuntu に VirtualBox Guest Additions をインストール


幾つかのコマンドを試してみた.
zip,unzip,display などは入っている.
gcc はない.
Ubuntu で gcc と入力
検索すると次のコマンドで良さそう.
sudo apt install build-essential

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

Raspberry Pi リモート接続

以前に,設定などの流れの中で一度書いているがそれを整理.
IP アドレスは ifconfigip a で確認してください.
初期値のままであれば,ユーザ名とパスワードはそれぞれ pi と raspberry です.


VNC 接続
「Raspberry Pi の設定」-「インターフェイス」より「VNC」を有効化.
VNC の有効化
RealVNC のサイトからクライアント用ソフトをダウンロード,インストール.


リモートデスクトップ(RDP)
LXTerminal を起動して,xrdp をインストール.
xrdp のインストール
$ sudo apt-get update
$ sudo apt-get install xrdp
Windows リモートデスクトップ接続
xrdp ログイン

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

WordPress でエラーが表示される

自分のブログを見ているとエラーが…
Warning: mysqli_query(): (HY000/14): Can’t change size of file (Errcode: 28 “No space left on device”) in /…/wp-db.php on line 1924 Warning: mysqli_query(): (HY000/1021): Disk full (/tmp/#sql_27c2_0.MAI); waiting for someone to free some space… (errno: 28 “No space left on device”) in /…/wp-db.php on line 1924
wordpress disk full /tmp
原因は,画像変換で /tmp 以下を使用していて,70 MB 位のファイルが幾つも存在する様になってしまっていた.

Iwao@DS116:~/gcc_test/Test/t_linux/call_im$ ./a.out ~/gcc_test/Test/gons_to/data/dib/IMG_20180624_185921.vr.jpg
Iwao@DS116:~/gcc_test/Test/t_linux/call_im$ ./a.out ~/gcc_test/Test/gons_to/data/dib/IMG_20180624_185921.vr.jpg
Iwao@DS116:~/gcc_test/Test/t_linux/call_im$ ./a.out ~/gcc_test/Test/gons_to/data/dib/IMG_20180624_185921.vr.jpg
convert: ImproperImageHeader `/tmp/Iwao/i_Tools.tmp/20190201/20190201/IMG_20180624_185921.vr.jpg.004.bmp' @ error/bmp.c/ReadBMPImage/590.
convert: NoImagesDefined `/tmp/Iwao/i_Tools.tmp/20190201/20190201/IMG_20180624_185921.vr.001.jpg' @ error/convert.c/ConvertImageCommand/3258.
Iwao@DS116:~/gcc_test/Test/t_linux/call_im$ df
Filesystem      1K-blocks      Used  Available Use% Mounted on
/dev/sda1         2385592    946808    1320000  42% /
none               513436         0     513436   0% /dev
/tmp               515324    515320          4 100% /tmp
/run               515324      3312     512012   1% /run
/dev/shm           515324         4     515320   1% /dev/shm
none                    4         0          4   0% /sys/fs/cgroup
/dev/sda3      2879506904 518855752 2360532368  19% /volume1
Iwao@DS116:~/gcc_test/Test/t_linux/call_im$

rm -r /tmp/Iwao/i_Tools.tmp/20190201/* とすることで一先ず対応.
他に,/tmp なので再起動すれば消去される.
デバッグ用にファイルを残していることもあるが,コードとしてどの様に対応するか検討が必要.

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

Linux 上での画像情報の表示

先日 Linux 上での zip などを調べていて見つけた convert など.
その中の,画像情報を表示する identify .

pi@raspberrypi:~ $ identify 2019-01-29-234500_1360x768_scrot.png 
2019-01-29-234500_1360x768_scrot.png PNG 1360x768 1360x768+0+0 8-bit sRGB 338KB 0.000u 0:00.010
pi@raspberrypi:~ $ 

identify -format  ... ....png
コマンドオプションに -verbose を指定する方法はいろいろな所に書かれているが,欲しかったのは限られた情報.
例えば「幅」や「高さ」,「色数」など.
identify -help とすると,-format “string” と言うのがあった.
例えば -format “%w\n%h\n” と指定すると,幅と高さを 2 行に表示できる.

pi@raspberrypi:~ $ identify -format "%w\n%h\n"  2019-01-29-234500_1360x768_scrot.png 
1360
768
pi@raspberrypi:~ $ 
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

Linux で 32 ビット色の BMP に変換

3D データの相互変換を書き直していて,32 ビット DIB が必要になってきた.
Windows 環境では,自前の Image クラスがあるのでそれを利用している.
Linux 環境は,先日見つけた convert コマンドが使えそうと思って調べるとなかなか情報が少ない.
次の -depth 32 で行けそうと思うが,24 ビットのまま.
convert dib_24.png -depth 32 dib_32.bmp
それで検索して見つけたのが,Convert to 32-bit depth BMP
次の様に存在しないアルファの情報を指定(-alpha set)する必要があるみたい.
convert dib_24.png -depth 32 -alpha set dib_32.bmp

ImageMagick

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

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 *
Raspberry Pi zip スクリプト


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

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

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$

Synology NAS 7z コマンド


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 で,カレントを動かすことにより対応.

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

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$

確かに空いていない.
NAS を再起動して対応.
DS116 ログイン画面

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

Synology NAS で zip , unzip , 7z

以前調べた Synology NAS 上での zip ファイルの扱い.
今まで 3mfamf などは 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 コマンドで画像を表示できる.
Image Magick display


2019/01/18
Raspberry Pi のファイルマネージャの起動.
コンソールで pcmanfm
“pcmanfm /tmp/” とするとそこから開ける.

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

Raspberry Pi 再起動コマンド

ちょっと原因がわからないが「ジブン専用パソコンキット2」の HDMI 接続の画面が表示されなくなった.
リモートデスクトップや SSH では接続可能な状態.
Linux なので,端末から操作できるはずと思い検索すると
Raspberry Pi シャットダウンコマンド
shutdown -h now
sudo shutdown -h now を入力.
再起動は sudo shutdown -r now
起動すると,ちゃんと画面は表示されている.何だったのだろう?


「Raspberry Pi の設定」-「インターフェイス」に「VNC」の設定があったので,VNC 接続を試してみた.
設定を「有効」にして,RealVNC のサイトからダウンロード.
Raspberry Pi の VNC Viewer での表示
リモートデスクトップ(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>

Raspberry Pi reboot コマンド


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

Synology NAS で IP アドレス検索

先日の「IP 検索」をブラウザから利用できる様にしてみた.
“whois 27.92.169.109” としているので,他の検索サイトよりは情報が少ないが自分用なのでこれで十分.
IP アドレス 検索 whois

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.

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.

ジブン専用パソコンキット2 追加

KoKaジブン専用パソコンキット2 が届いた.

KoKaジブン専用パソコンキット2
KoKaジブン専用パソコンキット2

箱は 2つ.
ジブン専用パソコンキット2 本体
ジブン専用パソコンキット2 本体

今日は組み立てまで.
パイケース組立マニュアル」の手順通りやれば難しくはないが,カバーを外すのが少しわかり難い?
赤い所に突起がある.
パイケース組立 3
パイケース組立 3

小さい方のヒートシンクは,大人は指が大きいので取り付けが難しい.


2018/12/25
はじめようジブン専用パソコン」連載のバックナンバーから,組み立てと設定.
組み立てて OS 起動直後はシステム日付が正しくない.
ネットワークの設定を行うと自動的に設定される?


2018/12/26
そのままでは使い勝手が悪いので,リモート接続を可能にするための設定.
Windowsパソコンからraspberrypi3にリモートデスクトップで接続する」を参考にさせてもらい設定.
実際に入力したのは,
$ sudo apt-get update
$ sudo apt-get install xrdp
「日本語キーボードの配列を追加」はやっていない.
他に「Raspberry Pi の設定」で「SSH」を「有効」に.

リモート接続と SSH 接続
リモート接続と 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 .

pi SSH warning
pi SSH warning

自分でしか使わないので,そのままに.


WebGL で作成したページを表示すると,あまり綺麗に表示できない.

WebGL のページの表示
WebGL のページの表示


あると便利かも?

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