[카테고리:] 생활코딩

  • linux usb driver xbox360(1)

    집에서 놀고 있던 8년 전에 구매한 xbox 360 유선 usb 패드를 raspberry pi4에 등록하여 사용하고 싶다. 나온 지 오래되어 이미 xpad 리눅스 드라이버가 공개되어 있다. 그러나 usb, input을 한번에 사용하여 잘 이해되지 않는다. 남은 출장 기간 중 천천히 공부 하기로 했다.

    usb를 등록하려면 vendor id, product id, 연결되면 실행되는 call back probe, disconnect 등 을 알아야 한다. 인터넷에 공개된 좋은 자료, 소스를 공부했다. 관련 코드는 여기에 저장했다.

    usb-devices로 xbox 패드를 확인하면 (I가 interface 인듯하다) 0, 1, 2, 3인터페이스가 등록되지 않았다.

    pi@raspberrypi:~/rasp/xbox_driver $ usb-devices 
    T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
    D:  Ver= 2.00 Cls=ff(vend.) Sub=ff Prot=ff MxPS= 8 #Cfgs=  1
    P:  Vendor=045e ProdID=028e Rev=01.14
    S:  Manufacturer=©Microsoft Corporation
    S:  Product=Controller
    S:  SerialNumber=0C59FC4
    C:  #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=500mA
    I:  If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=5d Prot=01 Driver=(none)
    I:  If#=0x1 Alt= 0 #EPs= 4 Cls=ff(vend.) Sub=5d Prot=03 Driver=(none)
    I:  If#=0x2 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=5d Prot=02 Driver=(none)
    I:  If#=0x3 Alt= 0 #EPs= 0 Cls=ff(vend.) Sub=fd Prot=13 Driver=(none)

    usb_register_dev로 interface 0, 1을 등록했다.

    pi@raspberrypi:~/rasp/xbox_driver $ usb-devices 
    T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
    D:  Ver= 2.00 Cls=ff(vend.) Sub=ff Prot=ff MxPS= 8 #Cfgs=  1
    P:  Vendor=045e ProdID=028e Rev=01.14
    S:  Manufacturer=©Microsoft Corporation
    S:  Product=Controller
    S:  SerialNumber=0C59FC4
    C:  #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=500mA
    I:  If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=5d Prot=01 Driver=xbox360
    I:  If#=0x1 Alt= 0 #EPs= 4 Cls=ff(vend.) Sub=5d Prot=03 Driver=xbox360
    I:  If#=0x2 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=5d Prot=02 Driver=(none)
    I:  If#=0x3 Alt= 0 #EPs= 0 Cls=ff(vend.) Sub=fd Prot=13 Driver=(none)
    
    pi@raspberrypi:~/rasp/xbox_driver $ dmesg 
    [48226.848081] xpad is 0c15d4e5, xpad->udev is 14758ec9
    [48226.848101] interface is 913f883f
    [48226.848126] xbox360 1-1.1:1.0: interrupt in, out found. 55429370, 0119bb5d
    [48226.848528] xbox360 1-1.1:1.0: usb xbox360 driver was registerd
    [48226.848710] xpad is a5c87389, xpad->udev is 14758ec9
    [48226.848726] interface is f687e098
    [48226.848746] xbox360 1-1.1:1.1: interrupt in, out found. efcdcd2e, 2fcb2b2f
    [48226.849000] xbox360 1-1.1:1.1: usb xbox360 driver was registerd
    [48226.849162] xpad is 5c5394a1, xpad->udev is 14758ec9
    [48226.849178] interface is 7fa06804
    [48226.849196] xbox360 1-1.1:1.2: Could not find both interrupt-in and interrpt-out endpoints
    [48226.849211] error -6
    [48226.849304] xpad is 5c5394a1, xpad->udev is 14758ec9
    [48226.849320] interface is c9ea30ca
    [48226.849337] xbox360 1-1.1:1.3: Could not find both interrupt-in and interrpt-out endpoints
    [48226.849352] error -6
    [48226.849490] usbcore: registered new interface driver xbox360

    참조 사이트.

  • raspberry pi4 bluetooth pairing with cli

    살다 보면 터미널로 블루투스 페이링을 할 필요가 있다. bluetoothctl가 제공하는 scan on, pair, trust, connect로 가능하다.

    [bluetooth]# pair 34:88:5D:5C:C2:65
    Device 34:88:5D:5C:C2:65 not available
    [bluetooth]# scan on
    Discovery started
    [CHG] Controller AA:AA:AA:AA:AA:AA Discovering: yes
    [CHG] Device 74:31:32:C6:8F:67 RSSI: -72
    [CHG] Device 74:31:32:C6:8F:67 TxPower: 12
    [CHG] Device 00:17:55:B0:CF:2E RSSI: -84
    [CHG] Device 5F:B7:26:83:54:58 RSSI: -73
    [CHG] Device 5F:B7:26:83:54:58 TxPower: 26
    [CHG] Device 75:CB:B4:32:0F:29 RSSI: -85
    [CHG] Device 5F:5C:FD:38:FC:36 RSSI: -84
    [CHG] Device 5F:5C:FD:38:FC:36 TxPower: 6
    [CHG] Device 68:47:92:B1:39:9C RSSI: -73
    [CHG] Device 68:47:92:B1:39:9C TxPower: 8
    [CHG] Device 58:7B:3E:E0:3F:F5 RSSI: -72
    [CHG] Device 58:7B:3E:E0:3F:F5 TxPower: 7
    [CHG] Device 42:39:EF:80:06:A0 RSSI: -71
    [CHG] Device 42:39:EF:80:06:A0 TxPower: 12
    [CHG] Device 00:17:55:B0:CF:2C RSSI: -89
    [CHG] Device 00:17:55:B0:CC:14 RSSI: -79
    [CHG] Device 7D:72:08:EE:56:18 RSSI: -72
    [CHG] Device 7D:72:08:EE:56:18 TxPower: 24
    [CHG] Device 42:39:EF:80:06:A0 AdvertisingFlags:
      00                                               .               
    [CHG] Device 00:17:55:B0:C3:AA RSSI: -88
    [CHG] Device 43:AF:C1:01:A4:9E RSSI: -73
    [CHG] Device 43:AF:C1:01:A4:9E TxPower: 7
    [CHG] Device 00:17:55:B0:CF:27 RSSI: -89
    [CHG] Device 00:17:55:B0:CC:16 RSSI: -91
    [CHG] Device 43:AF:C1:01:A4:9E AdvertisingFlags:
      00                                               .               
    [CHG] Device 00:17:55:B0:CC:16 AdvertisingFlags:
      00                                               .               
    [CHG] Device 00:17:55:B0:CF:27 AdvertisingFlags:
      00                                               .               
    [CHG] Device 53:02:B7:C1:DA:EF RSSI: -90
    [CHG] Device 00:17:55:B0:CF:2C AdvertisingFlags:
      00                                               .               
    [CHG] Device 53:02:B7:C1:DA:EF AdvertisingFlags:
      00                                               .               
    [NEW] Device 34:88:5D:5C:C2:65 Keyboard K480
    [CHG] Device DC:B5:4F:0A:1B:C7 RSSI: -79
    [bluetooth]# pair 34:88:5D:5C:C2:65
    Attempting to pair with 34:88:5D:5C:C2:65
    Failed to pair: org.bluez.Error.ConnectionAttemptFailed
    [CHG] Device 42:39:EF:80:06:A0 AdvertisingFlags:
      1a                                               .               
    [CHG] Device 00:17:55:B0:CC:16 AdvertisingFlags:
      06                                               .               
    [CHG] Device 2E:23:6D:1E:EC:1A RSSI: -85
    [CHG] Device 43:AF:C1:01:A4:9E AdvertisingFlags:
      1a                                               .               
    [CHG] Device 00:17:55:B0:CF:27 AdvertisingFlags:
      06                                               .               
    [CHG] Device 70:4A:71:F9:0C:89 RSSI: -92
    [CHG] Device 70:4A:71:F9:0C:89 TxPower: 7
    [CHG] Device 70:4A:71:F9:0C:89 AdvertisingFlags:
      1a                                               .               
    [CHG] Device 53:02:B7:C1:DA:EF AdvertisingFlags:
      02                                               .               
    [CHG] Device 68:47:92:B1:39:9C RSSI: -86
    [CHG] Device 75:CB:B4:32:0F:29 RSSI: -97
    [NEW] Device 00:17:55:B0:CE:F5 44881938.01000222
    [CHG] Device 53:02:B7:C1:DA:EF AdvertisingFlags:
      00                                               .               
    [CHG] Device 00:17:55:B0:CF:2C AdvertisingFlags:
      06                                               .               
    [bluetooth]# pair 34:88:5D:5C:C2:65
    Attempting to pair with 34:88:5D:5C:C2:65
    [CHG] Device 34:88:5D:5C:C2:65 Connected: yes
    [agent] Passkey: 091237
    [agent] Passkey: 091237
    [agent] Passkey: 091237
    [agent] Passkey: 091237
    [agent] Passkey: 091237
    [agent] Passkey: 091237
    [agent] Passkey: 091237
    [CHG] Device 34:88:5D:5C:C2:65 Modalias: usb:v046DpB33Cd2802
    [CHG] Device 34:88:5D:5C:C2:65 UUIDs: 00001000-0000-1000-8000-00805f9b34fb
    [CHG] Device 34:88:5D:5C:C2:65 UUIDs: 00001124-0000-1000-8000-00805f9b34fb
    [CHG] Device 34:88:5D:5C:C2:65 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
    [CHG] Device 34:88:5D:5C:C2:65 ServicesResolved: yes
    [CHG] Device 34:88:5D:5C:C2:65 Paired: yes
    Pairing successful
    [CHG] Device 34:88:5D:5C:C2:65 ServicesResolved: no
    [CHG] Device 34:88:5D:5C:C2:65 Connected: no
    [CHG] Device 00:17:55:B0:CC:14 RSSI: -89
    [CHG] Device 53:02:B7:C1:DA:EF AdvertisingFlags:
      02                                               .               
    [CHG] Device 68:47:92:B1:39:9C RSSI: -78
    [CHG] Device 5F:5C:FD:38:FC:36 ManufacturerData Key: 0x004c
    [CHG] Device 5F:5C:FD:38:FC:36 ManufacturerData Value:
      10 06 7e 1e 2a 4b a0 b5                          ..~.*K..        
    [CHG] Device 75:CB:B4:32:0F:29 RSSI: -88
    [CHG] Device 75:CB:B4:32:0F:29 AdvertisingFlags:
      00                                               .               
    [CHG] Device 74:31:32:C6:8F:67 RSSI: -87
    [CHG] Device 7F:70:C6:B1:18:7B RSSI: -90
    [CHG] Device 7F:70:C6:B1:18:7B TxPower: 12
    [CHG] Device 00:17:55:B0:CF:27 AdvertisingFlags:
      00                                               .               
    [bluetooth]# trust 34:88:5D:5C:C2:65
    [CHG] Device 34:88:5D:5C:C2:65 Trusted: yes
    Changing 34:88:5D:5C:C2:65 trust succeeded
    [CHG] Device 74:31:32:C6:8F:67 RSSI: -71
    [CHG] Device 00:17:55:B0:CC:14 RSSI: -80
    [CHG] Device 75:CB:B4:32:0F:29 AdvertisingFlags:
      02                                               .               
    [NEW] Device 79:2D:EA:FA:C8:07 79-2D-EA-FA-C8-07
    [CHG] Device 43:AF:C1:01:A4:9E AdvertisingFlags:
      00                                               .               
    [CHG] Device 42:39:EF:80:06:A0 AdvertisingFlags:
      00                                               .               
    [CHG] Device 68:47:92:B1:39:9C AdvertisingFlags:
      00                                               .               
    [CHG] Device 53:02:B7:C1:DA:EF AdvertisingFlags:
      00                                               .               
    [CHG] Device 00:17:55:B0:C3:D0 RSSI: -94
    [CHG] Device 00:17:55:B0:CF:27 AdvertisingFlags:
      06                                               .               
    [DEL] Device 7D:72:08:EE:56:18 7D-72-08-EE-56-18
    [DEL] Device 00:17:55:B0:CF:2E 44881995.01000222
    [DEL] Device 5F:B7:26:83:54:58 5F-B7-26-83-54-58
    [DEL] Device 72:1E:96:C2:47:34 72-1E-96-C2-47-34
    [DEL] Device 74:31:32:C6:8F:67 74-31-32-C6-8F-67
    [DEL] Device 5F:5C:FD:38:FC:36 5F-5C-FD-38-FC-36
    [DEL] Device 58:7B:3E:E0:3F:F5 58-7B-3E-E0-3F-F5
    [DEL] Device 68:47:92:B1:39:9C 68-47-92-B1-39-9C
    [DEL] Device 00:17:55:B0:CC:14 44881201.01000222
    [DEL] Device 42:39:EF:80:06:A0 42-39-EF-80-06-A0
    [DEL] Device 2E:23:6D:1E:EC:1A 2E-23-6D-1E-EC-1A
    [DEL] Device 52:16:A9:CA:B5:11 52-16-A9-CA-B5-11
    [DEL] Device 00:17:55:B0:CF:27 44881988.01000222
    [DEL] Device 7F:70:C6:B1:18:7B 7F-70-C6-B1-18-7B
    [DEL] Device 50:1E:AF:D4:17:76 50-1E-AF-D4-17-76
    [DEL] Device 00:17:55:B0:C3:AA 44879047.01000222
    [DEL] Device 6F:3D:D3:F2:4A:31 6F-3D-D3-F2-4A-31
    [DEL] Device DC:B5:4F:0A:1B:C7 Mike Bouchon
    [DEL] Device 00:17:55:B0:CC:16 44881203.01000222
    [DEL] Device 6F:44:C7:02:3B:D0 6F-44-C7-02-3B-D0
    [DEL] Device 4A:41:FE:14:FE:2A 4A-41-FE-14-FE-2A
    [DEL] Device 00:17:55:B0:CF:17 00-17-55-B0-CF-17
    [DEL] Device 40:CC:C6:57:E4:40 40-CC-C6-57-E4-40
    [DEL] Device 00:17:55:B0:CF:25 44881986.01000222
    [DEL] Device 70:4A:71:F9:0C:89 70-4A-71-F9-0C-89
    [DEL] Device 00:17:55:B0:CF:2C 44881993.01000222
    [DEL] Device 00:17:55:B0:C3:D0 00-17-55-B0-C3-D0
    [DEL] Device 76:7F:82:5E:9F:77 76-7F-82-5E-9F-77
    [DEL] Device 53:02:B7:C1:DA:EF 53-02-B7-C1-DA-EF
    [DEL] Device 57:09:04:A4:37:BD 57-09-04-A4-37-BD
    [DEL] Device 75:CB:B4:32:0F:29 75-CB-B4-32-0F-29
    [DEL] Device 43:AF:C1:01:A4:9E 43-AF-C1-01-A4-9E
    [DEL] Device 00:17:55:B0:CE:F5 44881938.01000222
    [DEL] Device 79:2D:EA:FA:C8:07 79-2D-EA-FA-C8-07
    [NEW] Device 7F:70:C6:B1:18:7B 7F-70-C6-B1-18-7B
    [bluetooth]# connect 34:88:5D:5C:C2:65
    Attempting to connect to 34:88:5D:5C:C2:65
    [CHG] Device 34:88:5D:5C:C2:65 Connected: yes
    Connection successful
    [NEW] Device DC:B5:4F:0A:1B:C7 Mike Bouchon
    [CHG] Device 34:88:5D:5C:C2:65 ServicesResolved: yes
    [NEW] Device 43:AF:C1:01:A4:9E 43-AF-C1-01-A4-9E
    [NEW] Device 5F:B7:26:83:54:58 5F-B7-26-83-54-58
    [NEW] Device 53:02:B7:C1:DA:EF 53-02-B7-C1-DA-EF
    [NEW] Device 7D:72:08:EE:56:18 7D-72-08-EE-56-18
    [NEW] Device 68:47:92:B1:39:9C 68-47-92-B1-39-9C
    [NEW] Device 10:B8:5D:5C:03:7E 10-B8-5D-5C-03-7E
    [NEW] Device 6F:1D:B5:96:AE:86 6F-1D-B5-96-AE-86
    [NEW] Device 74:31:32:C6:8F:67 74-31-32-C6-8F-67
    [NEW] Device 00:17:55:B0:CF:2E 44881995.01000222
    [NEW] Device 75:CB:B4:32:0F:29 75-CB-B4-32-0F-29
    [NEW] Device 42:39:EF:80:06:A0 42-39-EF-80-06-A0
    [NEW] Device 79:2D:EA:FA:C8:07 79-2D-EA-FA-C8-07
    [NEW] Device 00:17:55:B0:CF:27 44881988.01000222
    [NEW] Device 6F:3D:D3:F2:4A:31 6F-3D-D3-F2-4A-31
    [NEW] Device 00:17:55:B0:CC:14 44881201.01000222
    [NEW] Device 00:17:55:B0:C3:AA 44879047.01000222
    [CHG] Device 00:17:55:B0:CF:27 AdvertisingFlags:
      00                                               .               
    [NEW] Device 00:17:55:B0:CF:2C 44881993.01000222
    [NEW] Device 00:17:55:B0:CC:16 44881203.01000222
    [CHG] Device DC:B5:4F:0A:1B:C7 RSSI: -80
    

    처음 블루투스를 실행하면 잘 안되는데, 여기를 참조했다. ExecStart에 옵션을 잘 넣어주면 된다.

    pi@raspberrypi:/etc/systemd/system/bluetooth.target.wants $ pwd
    /etc/systemd/system/bluetooth.target.wants
    pi@raspberrypi:/etc/systemd/system/bluetooth.target.wants $ cat bluetooth.service bluetooth.service 
    [Unit]
    Description=Bluetooth service
    Documentation=man:bluetoothd(8)
    ConditionPathIsDirectory=/sys/class/bluetooth
    
    [Service]
    Type=dbus
    BusName=org.bluez
    #ExecStart=/usr/lib/bluetooth/bluetoothd
    ExecStart=/usr/lib/bluetooth/bluetoothd --compat --noplugin=sap -E 
    NotifyAccess=main
    #WatchdogSec=10
    #Restart=on-failure
    CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
    LimitNPROC=1
    ProtectHome=true
    ProtectSystem=full
    
    [Install]
    WantedBy=bluetooth.target
    Alias=dbus-org.bluez.service
    [Unit]
    Description=Bluetooth service
    Documentation=man:bluetoothd(8)
    ConditionPathIsDirectory=/sys/class/bluetooth
    
    [Service]
    Type=dbus
    BusName=org.bluez
    #ExecStart=/usr/lib/bluetooth/bluetoothd
    ExecStart=/usr/lib/bluetooth/bluetoothd --compat --noplugin=sap -E 
    NotifyAccess=main
    #WatchdogSec=10
    #Restart=on-failure
    CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
    LimitNPROC=1
    ProtectHome=true
    ProtectSystem=full
    
    [Install]
    WantedBy=bluetooth.target
    Alias=dbus-org.bluez.service
  • sort date로 정렬

    이런 식으로 파일을 날자 순대로 정렬하고 싶다.

    $cat 파토가과학하고앉아있네FileAndTitle.txt 
    삼테성즈! S7E10 공중 항공모함 실험_ 자판 표준화와 컴퓨터 시대의 세벌식 자판,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1637328376455.mp3,19 Nov 2021
    뉴스룸! S7E03 화성 퍼시비어런스 엠바고 속보! 그리고 자연계 5번째의 힘 발견? feat. 박인규 교수,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1617304165488.mp3,02 Apr 2021
    과학하고 앉아있네 S7E06 파토의 주화입마 특집,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1626662027566.mp3,18 Jul 2021
    격동 500년 수능 특집! 과탐 크레이지 파이널 카운트다운 (보충수업),https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1636685356545.mp3,11 Nov 2021
    격동 500년 수능 특집! 과탐 크레이지 파이널 카운트다운 (2부),https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1636196086460.mp3,06 Nov 2021
    격동 500년 수능 특집! 과탐 크레이지 파이널 카운트다운 (1부),https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1636098635289.mp3,05 Nov 2021
    격동 500년! S7E05 튀는 옥수수로 노벨상까지. 바바라 매클린톡!,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1623343073874.mp3,11 Jun 2021
    격동 500년! S7E03 태양의 정체를 밝히다! 세실리아 페인.,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1617934621403.mp3,09 Apr 2021
    삼테성즈! S7E09 누리호_ 초음속 순항미사일_ 공병우 타자기,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1634282011655.mp3,15 Oct 2021
    뉴스룸! S7E05 배아 줄기세포_ 뮤온_ 그리고 암흑에너지의 진실! feat. K박사_ 곽재식,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1622704402037.mp3,04 Jun 2021
    뉴스룸! S7E11 한국의 인공태양_ 국내 개발 수소 엔진_ 생체로봇_ 제임스 웹 우주망원경,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1638521352619.mp3,03 Dec 2021
    삼테성즈 S7E05 컨트롤러와 인간공학_ DOS/V의 탄생배경 그리고 거함거포 시대 직전 이야기,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1624605371567.mp3,25 Jun 2021
    과학하고 앉아있네 S7E05 의식의 근원을 찾아라 feat. 뇌과학자 장동선 박사,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1624496183412.mp3,23 Jun 2021
    과학하고 앉아있네 S7E10 유성의 과학! feat. 한국천문연구원 황정아 박사_ 공학박사 곽재식 작가,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1637916599658.mp3,26 Nov 2021
    과학하고 앉아있네 S7E08 우주의 지도를 그리다_ 스피어x! feat. 천문연 정웅섭 박사,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1631863050438.mp3,17 Sep 2021
    삼테성즈 S7E06 버진갤럭틱 우주관광_ 한자와 타자기_ 남미의 거함·거포 경쟁,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1627037475553.mp3,23 Jul 2021
    삼테성즈! S7E07 물리 엔진과 게임 스토리텔링_ 임어당의 한자 타자기_ 거함·거포 시대의 종말,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1630048724356.mp3,27 Aug 2021
    격동 500년! S7E08 약력의 정체를 밝힌 중국의 마리퀴리_ 우젠슝,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1631258788000.mp3,10 Sep 2021
    뉴스룸! S7E04 생명연장의 시간표_ 그리고 나의 뇌를 다스리자! feat. 카이스트 김대수 교수,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1620359306326.mp3,07 May 2021
    격동 500년! S7E04 세계적인 나비박사 석주명 선생!,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1620965968488.mp3,14 May 2021
    과학하고 앉아있네 S7E03 빛은 뭐고 LCD는 뭐고 OLED는 또 뭐냐? feat. 한림대 고재현 교수,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1618471405918.mp3,16 Apr 2021
    삼테성즈 S7E03 화제의 메타버스 특집! Feat. 강원대 김상균 교수,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1619141878558.mp3,23 Apr 2021
    뉴스룸! S7E06 배고픔의 메커니즘_ 2만4천년만에 깨어난 생물_ 그리고 제임스웹 우주망원경 feat. K박사_ 곽재식 작가,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1625469308983.mp3,05 Jul 2021
    (음질보정재업) 삼테성즈! S7E02 딥페이크_ 전기자동차_ NFT_ 비디오게임. Feat. K2박사_ 최팀장,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1616979006251.mp3,28 Mar 2021
    격동 500년! S7E07 더위를 물리치고 인류를 구하다_ 윌리스 캐리어,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1628844722616.mp3,13 Aug 2021
    격동 500년! S7E11 대한민국의 산림을 되살리다. 현신규,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1639123192915.mp3,10 Dec 2021
    뉴스룸! S7E010 요소수 대란_ 돼지 신장 이식_ 노벨 화학상_ 오무아무아,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1636763258800.mp3,12 Nov 2021
    삼테성즈 S7E04 반도체 대란_ KF21 핵심기술 그리고 게임의 역사2!,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1622166509979.mp3,28 May 2021
    삼테성즈! S7E08 SLBM에 담긴 기술_ 한글 맞춤법과 풀어쓰기,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1632468019235.mp3,24 Sep 2021
    과학하고 앉아있네 S7E07 기후 위기의 해법은 있을까 feat. 부경대학교 김백민 교수,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1629447892495.mp3,20 Aug 2021
    뉴스룸! S7E08 백신 관련 가짜뉴스_ 아프가니스탄 과학계의 위기_ 암흑에너지의 존재를 밝힌 3D 우주지도,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1630654336515.mp3,03 Sep 2021
    격동 500년! S7E06 과학계의 아이돌_ 리처드 파인만,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1625818493064.mp3,09 Jul 2021
    뉴스룸! S7E09 진짜 같은 합성우유_ 전고체 배터리_ 새로운 중력파 감지,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1633076684830.mp3,01 Oct 2021
    뉴스룸! S7E07 현실에 가까워진 워프 드라이브_ 양궁 활과 탄소섬유_ 인간이 견딜 수 있는 온도는? feat. K박사_ 곽재식 작가,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1628235649694.mp3,06 Aug 2021
    격동 500년! S7E09 X선 결정학을 불가능의 레벨까지 끌어올리다. 도로시 호지킨,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1633678920442.mp3,08 Oct 2021
    과학하고 앉아있네 S7E04 K박사 완전 복귀 특집! 암흑의 물질과 K박사의 어두운 미래,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1621561758166.mp3,21 May 2021
    과학하고 앉아있네 S7E9 2021 노벨물리학상 특집,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1634887885321.mp3,22 Oct 2021
    

    sort로 M 옵션을 넣으면 되는데, 한글을 사용한다면 locale을 변경해 줘야 제대로 된다!!

    https://stackoverflow.com/questions/12162210/sort-by-just-month-name-and-day-bash
    https://stackoverflow.com/questions/11536368/sorting-date-field-in-unix
    $ awk -F',' '{print $3,","$2,"," $1;}' 파토가과학하고앉아있네FileAndTitle.txt | LC_ALL=c sort -t' ' -k3nr -k2Mr -k1
    03 Dec 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1638521352619.mp3 ,뉴스룸! S7E11 한국의 인공태양_ 국내 개발 수소 엔진_ 생체로봇_ 제임스 웹 우주망원경
    10 Dec 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1639123192915.mp3 ,격동 500년! S7E11 대한민국의 산림을 되살리다. 현신규
    05 Nov 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1636098635289.mp3 ,격동 500년 수능 특집! 과탐 크레이지 파이널 카운트다운 (1부)
    06 Nov 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1636196086460.mp3 ,격동 500년 수능 특집! 과탐 크레이지 파이널 카운트다운 (2부)
    11 Nov 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1636685356545.mp3 ,격동 500년 수능 특집! 과탐 크레이지 파이널 카운트다운 (보충수업)
    12 Nov 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1636763258800.mp3 ,뉴스룸! S7E010 요소수 대란_ 돼지 신장 이식_ 노벨 화학상_ 오무아무아
    19 Nov 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1637328376455.mp3 ,삼테성즈! S7E10 공중 항공모함 실험_ 자판 표준화와 컴퓨터 시대의 세벌식 자판
    26 Nov 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1637916599658.mp3 ,과학하고 앉아있네 S7E10 유성의 과학! feat. 한국천문연구원 황정아 박사_ 공학박사 곽재식 작가
    01 Oct 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1633076684830.mp3 ,뉴스룸! S7E09 진짜 같은 합성우유_ 전고체 배터리_ 새로운 중력파 감지
    08 Oct 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1633678920442.mp3 ,격동 500년! S7E09 X선 결정학을 불가능의 레벨까지 끌어올리다. 도로시 호지킨
    15 Oct 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1634282011655.mp3 ,삼테성즈! S7E09 누리호_ 초음속 순항미사일_ 공병우 타자기
    22 Oct 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1634887885321.mp3 ,과학하고 앉아있네 S7E9 2021 노벨물리학상 특집
    03 Sep 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1630654336515.mp3 ,뉴스룸! S7E08 백신 관련 가짜뉴스_ 아프가니스탄 과학계의 위기_ 암흑에너지의 존재를 밝힌 3D 우주지도
    10 Sep 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1631258788000.mp3 ,격동 500년! S7E08 약력의 정체를 밝힌 중국의 마리퀴리_ 우젠슝
    17 Sep 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1631863050438.mp3 ,과학하고 앉아있네 S7E08 우주의 지도를 그리다_ 스피어x! feat. 천문연 정웅섭 박사
    24 Sep 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1632468019235.mp3 ,삼테성즈! S7E08 SLBM에 담긴 기술_ 한글 맞춤법과 풀어쓰기
    06 Aug 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1628235649694.mp3 ,뉴스룸! S7E07 현실에 가까워진 워프 드라이브_ 양궁 활과 탄소섬유_ 인간이 견딜 수 있는 온도는? feat. K박사_ 곽재식 작가
    13 Aug 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1628844722616.mp3 ,격동 500년! S7E07 더위를 물리치고 인류를 구하다_ 윌리스 캐리어
    20 Aug 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1629447892495.mp3 ,과학하고 앉아있네 S7E07 기후 위기의 해법은 있을까 feat. 부경대학교 김백민 교수
    27 Aug 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1630048724356.mp3 ,삼테성즈! S7E07 물리 엔진과 게임 스토리텔링_ 임어당의 한자 타자기_ 거함·거포 시대의 종말
    05 Jul 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1625469308983.mp3 ,뉴스룸! S7E06 배고픔의 메커니즘_ 2만4천년만에 깨어난 생물_ 그리고 제임스웹 우주망원경 feat. K박사_ 곽재식 작가
    09 Jul 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1625818493064.mp3 ,격동 500년! S7E06 과학계의 아이돌_ 리처드 파인만
    18 Jul 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1626662027566.mp3 ,과학하고 앉아있네 S7E06 파토의 주화입마 특집
    23 Jul 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1627037475553.mp3 ,삼테성즈 S7E06 버진갤럭틱 우주관광_ 한자와 타자기_ 남미의 거함·거포 경쟁
    04 Jun 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1622704402037.mp3 ,뉴스룸! S7E05 배아 줄기세포_ 뮤온_ 그리고 암흑에너지의 진실! feat. K박사_ 곽재식
    11 Jun 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1623343073874.mp3 ,격동 500년! S7E05 튀는 옥수수로 노벨상까지. 바바라 매클린톡!
    23 Jun 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1624496183412.mp3 ,과학하고 앉아있네 S7E05 의식의 근원을 찾아라 feat. 뇌과학자 장동선 박사
    25 Jun 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1624605371567.mp3 ,삼테성즈 S7E05 컨트롤러와 인간공학_ DOS/V의 탄생배경 그리고 거함거포 시대 직전 이야기
    07 May 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1620359306326.mp3 ,뉴스룸! S7E04 생명연장의 시간표_ 그리고 나의 뇌를 다스리자! feat. 카이스트 김대수 교수
    14 May 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1620965968488.mp3 ,격동 500년! S7E04 세계적인 나비박사 석주명 선생!
    21 May 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1621561758166.mp3 ,과학하고 앉아있네 S7E04 K박사 완전 복귀 특집! 암흑의 물질과 K박사의 어두운 미래
    28 May 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1622166509979.mp3 ,삼테성즈 S7E04 반도체 대란_ KF21 핵심기술 그리고 게임의 역사2!
    02 Apr 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1617304165488.mp3 ,뉴스룸! S7E03 화성 퍼시비어런스 엠바고 속보! 그리고 자연계 5번째의 힘 발견? feat. 박인규 교수
    09 Apr 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1617934621403.mp3 ,격동 500년! S7E03 태양의 정체를 밝히다! 세실리아 페인.
    16 Apr 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1618471405918.mp3 ,과학하고 앉아있네 S7E03 빛은 뭐고 LCD는 뭐고 OLED는 또 뭐냐? feat. 한림대 고재현 교수
    23 Apr 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1619141878558.mp3 ,삼테성즈 S7E03 화제의 메타버스 특집! Feat. 강원대 김상균 교수
    28 Mar 2021 ,https://cdn-cf.podty.me/meta/episode_audio/22286/174371_1616979006251.mp3 ,(음질보정재업) 삼테성즈! S7E02 딥페이크_ 전기자동차_ NFT_ 비디오게임. Feat. K2박사_ 최팀장
    

    ,로 구분된 파일 중 3번째에서 다시 순서대로 정렬해야 된다. sort가 multiplie seperator를 지원하지 않아 awk로 순서를 바꿨다.

    LC_ALL=c가 없어 날자 순대로 정렬되지 않음은 충격이다.

  • sigmoid funcion derivative

    machine learning에 잘 나오는 sigmoid function을 어떻게 미분하는지 설명한다. 마지막에 다시 sigmoid로 표현되는 부분이 재미있다.

    https://towardsdatascience.com/derivative-of-the-sigmoid-function-536880cf918e
  • vim hightlight multiple words with diffrent colors

    https://stackoverflow.com/questions/4162664/vim-highlight-a-list-of-words#comment4494852_4162735

    vim으로 행 구분을 하고 싶을 필요가 있다. 기본 기능으로 지원한다. 불행히도 match Todo /words/ 형식이 정규 표현식을 지원하지 않는다. 다른 방법으로 colorcolumn를 찾았다.

    https://stackoverflow.com/questions/6730713/highlight-specific-column-in-vim

    colorcolumn은 줄 자 같은 느낌이다. 결국 plugin을 설치했다.

    https://www.vim.org/scripts/script.php?script_id=2830

    github에서 최신 파일을 설치하자. ArrangeColumn을 치면 폭이 자동 조절된다. 아직 한글 칼럼은 잘 안되는 듯 하다.

    https://github.com/chrisbra/csv.vim