ホーム » Linux (ページ 5)
「Linux」カテゴリーアーカイブ
Linux から Windows 環境への接続
先日は「ファイルマネージャ」での Windows 環境へのアクセスだったが,今度はマウント.
検索すると以下の所に詳しく書かれていた.
LinuxからWindowsの共有フォルダをマウントするには
実際に操作したのは,
$ sudo mkdir /mnt/_.src
$ sudo mount -t cifs -o username=pi,password=raspberry //Z170S0/Public/…/Develop/_.SRC /mnt/_.src
Fedora ではこれでうまくいったが,Ubuntu ではエラー.
Fedora 環境は先日いろいろ弄って Samba の関係を入れたが Ubuntu はまだだった.
$ sudo apt install samba
$ sudo apt install cifs-utils
* samba のインストールは不要?
Z170S0 ではエラーとなり IP アドレスで指定したらうまくいった.
$ sudo mount -t cifs -o username=pi,password=raspberry //192.168.1.169/Public/…/Develop/_.SRC /mnt/_.src
Linux から Windows 環境のファイル
先日 Linux 環境から NAS 環境のファイルアクセスの手順などはある程度分かった.
今度は Windows 環境のファイルへのアクセス.
「他の場所」を選んだ時「Z170S0」が表示されていた(表示されないこともあり).
表示されていない時は「サーバへの接続」欄に smb://z170s0/ で可能.
選択するとパスワードを求められるが,これがうまく入らなかった(何を指定すれば良いかがわからなかった).
Raspberry Pi 上からも同じ様な感じで見えていたので試すと「pi」で入れた.
Ubuntu や Fedora でも「pi」で入れることがわかった.
「pi」で入ることで「Everyone」として扱われているものと思われる.
Fedora yum と dnf
まだいろいろとわからないことが多い Linux .
今まで apt-get や yum ,opkg などをあまり意識しないで利用してきた.
Fedora に samba をインストールしようとして調べていると,dnf の記述が多い?
どうも最近は yum に代わって dnf になっているらしい.
ただ wiki によると,dnf にリダイレクトされるらしい.
2019/08/23
Ubuntu などでの apt-get も同様に,今は apt になっている.
2025/06/16
Iwao@B660M:~$ which yum
/usr/sbin/yum
Iwao@B660M:~$ which dnf
/usr/sbin/dnf
Iwao@B660M:~$ ll /usr/sbin/yum*
lrwxrwxrwx. 1 root root 4 Mar 18 09:00 /usr/sbin/yum -> dnf5
Iwao@B660M:~$ ll /usr/sbin/dnf*
lrwxrwxrwx. 1 root root 4 Mar 18 09:00 /usr/sbin/dnf -> dnf5
-rwxr-xr-x. 1 root root 1539296 Mar 18 09:00 /usr/sbin/dnf5
Iwao@B660M:~$
Linux から NAS へのアクセス
GLUT インストール
ちょっと時間が空いたので,Linux 環境で GLUT を使える様にしてみた.
以前からお世話になっている次の所に詳しく書かれている.
GLUTによる「手抜き」OpenGL入門
Ubuntu , Debian ,Raspberry Pi では
$ sudo apt install freeglut3 freeglut3-dev
Fedora では
$ sudo dnf install freeglut
$ sudo dnf install freeglut-devel
コンパイルは
$ cc hello_gl.c -lglut -lGLU -lGL
https://jml.mish.work/index.php/cpp/install-glut.html
opengl.jp
The OpenGL Utility Toolkit (GLUT) Programming Interface API Version 3 日本語翻訳版
2021/05 Win10 に GLUT インストール
2025/06/16
$ sudo apt install freeglut3-dev
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
node_lookat の 3 つ目の Vd3& を const とすることで対応.
“invalid initialization of non-const reference of type” で検索するとわかりやすく書いてあった.
改行コード
デバッグ用で 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 になっていた.
Anaconda3 が入っていた
VirtualBox に Fedora
今度は Fedora .
ダウンロードは次のところから可能.
https://getfedora.org/ja/workstation/
python3 も入っている.
2019/06/06 g++ は無かった.
Fedora で g++ を利用する
VirtualBox に Ubuntu
VirtualBox に Linux を入れようと思いやってみることに.
OS は「日経Linux 2019年 1月号」の付録 DVD を使用.
VirtualBox でストレージ 80 GB として確保.
光学ドライブに DVD を入れて仮想マシンを起動.
Ubuntu のダウンロードはこちらからできます.
https://www.ubuntulinux.jp/download
幾つかのコマンドを試してみた.
zip,unzip,display などは入っている.
gcc はない.
検索すると次のコマンドで良さそう.
sudo apt install build-essential
Raspberry Pi リモート接続
以前に,設定などの流れの中で一度書いているがそれを整理.
IP アドレスは ifconfig や ip a で確認してください.
初期値のままであれば,ユーザ名とパスワードはそれぞれ pi と raspberry です.
VNC 接続
「Raspberry Pi の設定」-「インターフェイス」より「VNC」を有効化.
RealVNC のサイトからクライアント用ソフトをダウンロード,インストール.
リモートデスクトップ(RDP)
LXTerminal を起動して,xrdp をインストール.
$ sudo apt-get update
$ sudo apt-get install xrdp
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
原因は,画像変換で /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 なので再起動すれば消去される.
デバッグ用にファイルを残していることもあるが,コードとしてどの様に対応するか検討が必要.
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:~ $
コマンドオプションに -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:~ $
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
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$
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/” とするとそこから開ける.
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>