침대네서 낮잠을 자서인가...

낮잠을 자서인가?

낮에는 좀 컨디션이 괜찮네

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

피곤하다..  (0) 2021.10.05
빨간날 야근  (0) 2021.10.04
으아아아아 야근  (0) 2021.09.28
먼가 만들어 볼까  (0) 2021.09.22
피곤피곤  (0) 2021.09.20
Posted by 구차니
Programming/C++ STL2021. 10. 2. 23:17

아래의 함수가 가장 눈에 잘 들어 오는 듯?

fill(vec.begin(), vec.end(), value);

 

[링크 : https://hini7.tistory.com/66]

'Programming > C++ STL' 카테고리의 다른 글

cpp static_cast<type>  (0) 2023.02.09
::open()  (0) 2021.11.10
cpp 부모타입으로 업 캐스팅 된 객체의 원래 클래스 알기  (0) 2021.09.30
cpp string 관련  (0) 2019.06.10
cpp stringstream << 연산자  (0) 2019.05.24
Posted by 구차니
Linux2021. 10. 1. 21:05

여러창에서 하거나

여러 로그인을 통해서 하다 보면 bash 명령어가 정상적으로 쌓이지 않는다.

 

아래 변수가 정의 되도록 하면 된다는데.. 터미널 별로 그럼 history가 나오게 하려면 어떻게 하지?

export PROMPT_COMMAND='history -a'

[링크 : https://askubuntu.com/questions/80371/bash-history-handling-with-multiple-terminals]

 

+

2022.07.08

별도의 로그파일이 남기기.

export PROMPT_COMMAND='echo -e "$(tty)\t$(history 1)" >> ~/bash-history-$(date "+%Y-%m-%d").log' 

[링크 : https://unix.stackexchange.com/questions/348937/how-to-set-the-history-log-properly]

Posted by 구차니
게임/닌텐도 스위치2021. 9. 30. 23:42

조작이 쉽지 않으니

아내가 좋나해서 샀지만 시큰둥 ㅠㅠ

Posted by 구차니
Programming/C++ STL2021. 9. 30. 14:58

dynamic_cast<>() 를 통해 변환해보면 원래 타입을 알 수 있음.

[링크 : https://stackoverflow.com/questions/307765/how-do-i-check-if-an-objects-type-is-a-particular-subclass-in-c]

 

+

해보니 완벽하게 탐지하지는 못하는 듯..

'Programming > C++ STL' 카테고리의 다른 글

::open()  (0) 2021.11.10
vector 값 비우기  (0) 2021.10.02
cpp string 관련  (0) 2019.06.10
cpp stringstream << 연산자  (0) 2019.05.24
c++ 함수 인자 기본값  (0) 2017.11.08
Posted by 구차니

그냥 ssh id@hostname "commands" 하면 되는 듯

예전에 찾은적이 있던 것 같기도 한데...

 

[링크 : https://stackoverflow.com/questions/18502945/how-to-execute-a-remote-command-over-ssh-with-arguments]

'프로그램 사용 > ssh scp sftp' 카테고리의 다른 글

sshd 에서 ssh 로그인 끄고 sftp만 허용하기  (0) 2022.04.01
ssh 압축전송하기  (0) 2021.12.14
reverse ssh  (0) 2021.01.03
ssh blowfish  (0) 2019.09.24
ssh tunnel proxy  (0) 2019.09.20
Posted by 구차니
embeded/odroid2021. 9. 29. 17:50

ADC 제외하고는 3.3V

라즈베리와 동일한 전압레벨이니 ok

[링크 : https://wiki.odroid.com/odroid-c2/hardware/expansion_connectors]

 

이런저런 경고가 뜨지만 무시하고 설치!

$ sudo apt install software-properties-common
$ sudo add-apt-repository ppa:hardkernel/ppa
$ sudo apt update
$ sudo apt install odroid-wiringpi
$ gpio readall
 +-----+-----+---------+------+---+--- C2 ---+---+------+---------+-----+-----+
 | I/O | wPi |   Name  | Mode | V | Physical | V | Mode |  Name   | wPi | I/O |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3V |      |   |  1 || 2  |   |      | 5V      |     |     |
 | 205 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5V      |     |     |
 | 206 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0V      |     |     |
 | 249 |   7 |  IO.249 |   IN | 1 |  7 || 8  |   |      | TxD1    | 15  |     |
 |     |     |      0V |      |   |  9 || 10 |   |      | RxD1    | 16  |     |
 | 247 |   0 |  IO.247 |   IN | 1 | 11 || 12 | 1 | IN   | IO.238  | 1   | 238 |
 | 239 |   2 |  IO.239 |   IN | 1 | 13 || 14 |   |      | 0V      |     |     |
 | 237 |   3 |  IO.237 |   IN | 1 | 15 || 16 | 1 | IN   | IO.236  | 4   | 236 |
 |     |     |    3.3V |      |   | 17 || 18 | 1 | IN   | IO.233  | 5   | 233 |
 | 235 |  12 |  IO.235 |   IN | 1 | 19 || 20 |   |      | 0V      |     |     |
 | 232 |  13 |  IO.232 |   IN | 1 | 21 || 22 | 1 | IN   | IO.231  | 6   | 231 |
 | 230 |  14 |  IO.230 |   IN | 1 | 23 || 24 | 1 | IN   | IO.229  | 10  | 229 |
 |     |     |      0V |      |   | 25 || 26 | 1 | OUT  | IO.225  | 11  | 225 |
 |     |  30 |   SDA.2 |      |   | 27 || 28 |   |      | SCL.2   | 31  |     |
 | 228 |  21 |  IO.228 |   IN | 1 | 29 || 30 |   |      | 0V      |     |     |
 | 219 |  22 |  IO.219 |   IN | 1 | 31 || 32 | 1 | IN   | IO.224  | 26  | 224 |
 | 234 |  23 |  IO.234 |   IN | 0 | 33 || 34 |   |      | 0V      |     |     |
 | 214 |  24 |  IO.214 |   IN | 1 | 35 || 36 | 1 | IN   | IO.218  | 27  | 218 |
 |     |  25 |   AIN.1 |      |   | 37 || 38 |   |      | 1V8     | 28  |     |
 |     |     |      0V |      |   | 39 || 40 |   |      | AIN.0   | 29  |     |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | I/O | wPi |   Name  | Mode | V | Physical | V | Mode |  Name   | wPi | I/O |
 +-----+-----+---------+------+---+--- C2 ---+---+------+---------+-----+-----+

Err:3 http://deb.odroid.in/c2 bionic InRelease
  The following signatures were invalid: EXPKEYSIG 5360FB9DAB19BAC9 Mauro Ribeiro (mdrjr) <mauro.ribeiro@hardkernel.com>

Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://deb.odroid.in/c2 bionic InRelease: The following signatures were invalid: EXPKEYSIG 5360FB9DAB19BAC9 Mauro Ribeiro (mdrjr) <mauro.ribeiro@hardkernel.com>
W: Failed to fetch http://deb.odroid.in/c2/dists/bionic/InRelease  The following signatures were invalid: EXPKEYSIG 5360FB9DAB19BAC9 Mauro Ribeiro (mdrjr) <mauro.ribeiro@hardkernel.com>
W: Some index files failed to download. They have been ignored, or old ones used instead.

[링크 : https://wiki.odroid.com/odroid-c2/application_note/gpio/wiringpi]

'embeded > odroid' 카테고리의 다른 글

ordroid c2 - mrs 명령어 고찰  (0) 2023.09.05
wayland on odroid-c2  (0) 2021.11.22
g_mass_storage rpi - odroid c2  (0) 2021.09.28
g_mass_storage ins/rm 실패  (0) 2021.09.28
odroid c2 ubuntu 18.04, 20.04 kernel 버전 정보  (0) 2021.09.27
Posted by 구차니
embeded/raspberry pi2021. 9. 29. 16:43

1주일 정도 켜놨더니 USB HUB 가 맛이 가서 장치를 인식하지 않는데

원격접속은 문제가 없어서 의아해 하는 중.

 

rpi 2b는 USB 2.0 HUB에 랜 + USB 4port 허브로 구성된 녀석으로 알고 있었는데

3 이후로 바뀐건지 4부터 바뀐건진 모르겠지만

USB가 죽는다고 원격을 못하는 상황은 아니니 훨신 나은 듯?

 

 

+

전체 회로 공개 안하는걸로 정책이 바뀌었나?

[링크 : https://www.raspberrypi.org/documentation/computers/raspberry-pi.html]

[링크 : https://datasheets.raspberrypi.org/]

 

라즈베리 3b 까지는 USB lan 이었는지 랜포트도 그려져 있지 않은데

3b+ 이후 부터는 랜이 따로 나오는 듯?

rpi 4

GbE / TRD[0123]_[NP]

[링크 : https://datasheets.raspberrypi.org/rpi4/raspberry-pi-4-reduced-schematics.pdf]

bcm54213

https://www.hackster.io/news/meet-the-new-raspberry-pi-4-model-b-9b4698c284

 

rpi 3b+

ETH, PoE , TR[0123][np]

[링크 : https://datasheets.raspberrypi.org/rpi3/raspberry-pi-3-b-plus-reduced-schematics.pdf]

보드에서 방열판 떼어보니 LAN7515칩이 발견됨

Hi-Speed USB 2.0 to 10/100/1000 Gigabit Ethernet controller

[링크 : https://www.microchip.com/en-us/product/LAN7500]

 

rpi 3b

[링크 : https://datasheets.raspberrypi.org/rpi3/raspberry-pi-3-b-reduced-schematics.pdf]

 

rpi 2b

[링크 : https://datasheets.raspberrypi.org/rpi2/raspberry-pi-2-b-reduced-schematics.pdf]

'embeded > raspberry pi' 카테고리의 다른 글

라즈베리 파이 피코 한글 키 입력?  (0) 2021.11.16
rpi3 2초만에 부팅하기  (0) 2021.10.30
rpi zero otg  (0) 2021.09.27
스피커가 부실했군..  (0) 2021.09.26
rpi 2b g_mass_storage  (0) 2021.09.25
Posted by 구차니
embeded/odroid2021. 9. 28. 23:37

dd 해서 파일기반 파일시스템을 만들고 mkfs를 하지 않으면 g_mass_storage에 연결은 되어있지만

USB HOST 측에서 마운트를 할 수 없다(파일 시스템을 알 수 없어 마운트 불가)

// odroid c2 에서 작업
# dd if=/dev/zero of=otg.drive bs=1M count=128
# mkfs -t ext4 otg.drive
# modprobe g_mass_storage filename=otg.drive

 

USB HOST 측에서는 단순하게 마운트 해서 쓰면 되는데

// rpi 2b 에서 작업
$ sudo mount /dev/sda /mnt
$ sudo touch /mnt/tt
$ sudo umount /mnt

 

odroid의 mmcblk0p1을 연결했을 때는 sync 하면 쓰이는게 보였던 것 같은데

파일 기반 파일시스템이라 그런가 rpi 2b에서 파일을 생성하고 sync 해도 변화가 없고, umount를 해도 변화가 없었다.

odroid c2 에서 해당 파일을 umount 하고 mount 해야 변경점이 보이는데

물리 장칙 아니라 그런진 모르겠다.

 

[링크 : https://linuxconfig.org/how-to-create-a-file-based-filesystem-using-dd-command-on-linux]

[링크 : https://www.kernel.org/doc/Documentation/usb/mass-storage.txt]

'embeded > odroid' 카테고리의 다른 글

wayland on odroid-c2  (0) 2021.11.22
odroid c2 gpio 와 wiringpi  (0) 2021.09.29
g_mass_storage ins/rm 실패  (0) 2021.09.28
odroid c2 ubuntu 18.04, 20.04 kernel 버전 정보  (0) 2021.09.27
odroid c2 usb otg, libcomposite usb hid  (0) 2021.09.26
Posted by 구차니
embeded/odroid2021. 9. 28. 22:32

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?t=216810]

 

[링크 : https://linuxlink.timesys.com/docs/wiki/engineering/HOWTO_Use_USB_Gadget_File_Storage]

[링크 : https://www.kernel.org/doc/Documentation/usb/mass-storage.txt]

[링크 : https://linux-sunxi.org/USB_Gadget/Mass_storage]

 

 

# modprobe g_mass_storage file=/dev/mmcblk0p1 removable=y
# dmesg
[   41.197852] Mass Storage Function, version: 2009/09/11
[   41.197867] LUN: removable file: (no medium)
[   41.197950] LUN: removable file: /dev/mmcblk0p1
[   41.197956] Number of LUNs=1
[   41.197965] Number of LUNs=1
[   41.198085] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11
[   41.198092] g_mass_storage gadget: userspace failed to provide iSerialNumber
[   41.198097] g_mass_storage gadget: g_mass_storage ready
[   41.504544] USB RESET
[   41.583840] usb 1-1.3: new high-speed USB device number 3 using dwc_otg
[   41.587991] USB RESET
[   41.685839] g_mass_storage gadget: high-speed config #1: Linux File-Backed Storage
[   41.686316] usb-storage 1-1.3:1.0: USB Mass Storage device detected
[   41.686873] usb-storage 1-1.3:1.0: Quirks match for vid 0525 pid a4a5: 10000
[   41.686927] scsi0 : usb-storage 1-1.3:1.0
[   42.684797] scsi 0:0:0:0: Direct-Access     Linux    File-Stor Gadget 0316 PQ: 0 ANSI: 2
[   42.688020] sd 0:0:0:0: [sda] 262144 512-byte logical blocks: (134 MB/128 MiB)
[   42.688133] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process
[   42.696834] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   42.794589] sd 0:0:0:0: [sda] Write Protect is off
[   42.794603] sd 0:0:0:0: [sda] Mode Sense: 0f 00 00 00
[   42.794783] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process
[   42.904614] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[   42.906940] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process
[   43.014729] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process
[   43.125146]  sda:
[   43.127871] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process
[   43.235032] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process
[   43.344734] sd 0:0:0:0: [sda] Attached SCSI removable disk
# lsmod
Module                  Size  Used by
sg                     31094  0
g_mass_storage          2587  0
usb_f_mass_storage     35010  2 g_mass_storage
libcomposite           46311  2 usb_f_mass_storage,g_mass_storage
ir_lirc_codec           4934  3
lirc_dev               10879  1 ir_lirc_codec
ir_mce_kbd_decoder      3426  0
ir_rc6_decoder          2010  0
ir_sanyo_decoder        1657  0
ir_sony_decoder         1663  0
ir_jvc_decoder          1725  0
ir_rc5_decoder          1586  0
ir_nec_decoder          1789  0
meson_ir                3356  0
w1_gpio                 3801  0
wire                   28614  1 w1_gpio
gxbb_wdt                3395  0
meson_gpiomem           4040  0
sch_fq_codel            7827  2
ip_tables              17220  0
ipv6                  387317  18
autofs4                27592  2
# rmmod g_mass_storage
root@odroid:~# lsmod
Module                  Size  Used by
sg                     31094  0
usb_f_mass_storage     35010  0
libcomposite           46311  1 usb_f_mass_storage
ir_lirc_codec           4934  3
lirc_dev               10879  1 ir_lirc_codec
ir_mce_kbd_decoder      3426  0
ir_rc6_decoder          2010  0
ir_sanyo_decoder        1657  0
ir_sony_decoder         1663  0
ir_jvc_decoder          1725  0
ir_rc5_decoder          1586  0
ir_nec_decoder          1789  0
meson_ir                3356  0
w1_gpio                 3801  0
wire                   28614  1 w1_gpio
gxbb_wdt                3395  0
meson_gpiomem           4040  0
sch_fq_codel            7827  2
ip_tables              17220  0
ipv6                  387317  18
autofs4                27592  2
# modprobe g_mass_storage file=/dev/mmcblk0p1 removable=y
modprobe: ERROR: could not insert 'g_mass_storage': Device or resource busy

[링크 : https://developer.ridgerun.com/wiki/index.php?title=How_to_use_mass_storage_gadget]

Posted by 구차니