私的AI研究会 > ソフトウェアTips
Linux ソフトウェア に関連する忘備録。
mizutu@ubuntu-vbox2:~$ ssh pi@192.168.0.7 The authenticity of host '192.168.0.7 (192.168.0.7)' can't be established. ECDSA key fingerprint is SHA256:HYWQLaMgsNnFvxvfIMsbTRE+ZOmfh**************. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '192.168.0.7' (ECDSA) to the list of known hosts. pi@192.168.0.7's password: Linux raspberrypi-mas 5.10.17-v7l+ #1403 SMP Mon Feb 22 11:33:35 GMT 2021 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: Mon May 17 09:03:57 2021 [setupvars.sh] OpenVINO environment initialized pi@raspberrypi-mas:~ $ exit ログアウト Connection to 192.168.0.7 closed. mizutu@ubuntu-vbox2:~$
$ ssh shinobu@mylinux 'cat > remote.txt' < local.txt
$ ssh shinobu@mylinux 'cat >> $HOME/.ssh/authorized_keys' < $HOME/.ssh/id_rsa.pub
sftp://username@server:portNo/
$ scp car.jpg 102.168.3.63:~/Images The authenticity of host '192.168.3.63 (192.168.3.63)' can't be established. ECDSA key fingerprint is SHA256:Z+n******+C6Wj6qy***********/jLbdnL5Cl1tPiY. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '192.168.3.63' (ECDSA) to the list of known hosts. mizutu@192.168.3.63's password: car.jpg 100% 39KB 1.4MB/s 00:00
$ ssh 192.168.3.63 ls ~/Images @192.168.3.63's password: car.jpg
$ sudo apt-get install ubuntu-restricted-extras
import imghdr def is_pict(filename): try: imgtype = imghdr.what(filename) except FileNotFoundError as e: imgtype = 'NotFound' return str(imgtype)
print(imagetype) → 「NotFound」と表示~
print(imagetype) → 「png」と表示~
print(imagetype) → 「png」と表示~
print(imagetype) → 「None」と表示~
import cv2 def scale_to_width(img, width): h, w = img.shape[:2] height = round(h * (width / w)) dst = cv2.resize(img, dsize=(width, height)) return dst
dst = scale_to_width(img, 250) print(f"{img.shape} -> {dst.shape}") imshow(dst)