---
# System prepended metadata

title: 10/05 duckie
tags: [Duckie]

---

---
title: 10/05 duckie
tags: Duckie
---
# 10/05 duckie

[wheel](https://drive.google.com/file/d/1Dj4g4iDXOY9sV3VDhWMdKOEJAKEOAhYr/view)


*  [hypriotos-rpi-v1.12.3.img.zip](https://github.com/hypriot/image-builder-rpi/releases/download/v1.12.3/hypriotos-rpi-v1.12.3.img.zip)

* [Windows](https://github.com/balena-io/etcher/releases/download/v1.5.109/balenaEtcher-Setup-1.5.109.exe)

<!-- [our-user-data](https://github.com/GrassLab/NCTU_CS_ZOO/blob/Lab5/others/user-data.yaml)
 -->

[our-config](https://github.com/GrassLab/NCTU_CS_ZOO/blob/Lab5/others/boot_config.txt) 

- SSH Key
```
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCoDbDNTYAMS0NQ5NJsKXQ5rsfDY/UGkN5w1coAvgq+mVUBeivIue6CTUSQWj7zK9acDF7u+3kDVz7nK93V1K7N9jcc1RdSMShmQuSDPeN0yqKp9mO06YRkyu0ELZm64ibL5DTEnuexAeHQBlN5xTyZC0JitfOFSUdqyet3Rom6G3Zvu3QL9eksZRL7K+q59vUb2XsAgOiQjU4CJupqZQ66ksK5tX4DkbTcfw/biCIlHEPZIpuhgIf1eACYclLiL+ra7PnYnHLQD1y/Q7N089GP+pQ/HTF97IDaRuituLHZkIPL8K1NxkoNSjmHI6vfsxcKf/nSUH7jTxo5flkyvtqavvXQ/TfIUYkWLHTTIlHL5tPrFQ2MPy4Sg1olU2jp+cx0Zj8TvL56X/KM2aaRVDjTkLz6mndwh9OsK5VvExrDf0l1EcKgkD4O3sGH8tblTnWAp7NOPLbb38tnDMhuqyiUWj4zwUZ90N4gwFC1fEQFpieHkkAK9A7nfas6DXpIK9M= yhlu@luyanxundeMacBook-Air.local
```

- SSH Key 
<div style="position: fixed; bottom: 0; right: 0; border: 5px solid aqua; background-color: brown; width: 80%px; height: 50%;">
<a href="https://hackmd.io/hMaSFsfaQmWLm8iHLZbJpA" target="_blank">click me to get user data</a>
</div>

```
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj3RHwTCGVqW7aAlxsFYGJ9YcdUnd8NHUq9I9J5MFsoJtuDK8rxYmYs9WlcJAZIq4OopQRLolevxPXIaGQ+dSSDUuX7XCNIOlqOuJle4bYhzmIU9AkO0Jn8aUhJ5gVF7pk6XH5Mn9EHT9mSSeRS7rBoRbH0aEcVhZ0N6YYIULl7dNIfVCb2sxDylNA/62zrTQ6OHklYx1sIEtlMcaNZR6wRDlnRbhEVIorIilIgZTORtjBaK6n+7/va9Xg5iqTbha1qUFTpgKvBmntYOytLdIOBWyeU3VD9jcXOpo1e4VTwvfwpQXnhLfeF5GcYIoo84LK9mVoV+qVPN45JKh5WxJ6a2+9w0UCKHu67p5rKiNKm9swDshago1BcT26g7s562TxUJPJeUaaWcJRo5zrC4WfmRUrnMdmmXxC1zZHJXMfSflgoiWTQrwuWnIxdxN2Ue4odmK9usjjOe1qlsN0mu7KMFljS7ISWt5vVvEjE61E6x0xyBh2gjSaP5DbwYHbLIc= yzlin@LAPTOP-G6LVQ0UI
```


## user_data
```
#cloud-config
# vim: syntax=yaml
#

# refer to https://cloudinit.readthedocs.io/en/latest/topics/examples.html get more information

# Set your hostname here, the manage_etc_hosts will update the hosts file entries as well
hostname: duckie-109550129
manage_etc_hosts: true

resize_rootfs: true
growpart:
    mode: auto
    devices: ["/"]
    ignore_growroot_disabled: false

# You could modify this for your own user information
users:
  - name: whoamTest
    gecos: "Duckie"
    sudo: ALL=(ALL) NOPASSWD:ALL
    shell: /bin/bash
    groups: users,docker,video,input,i2c
    plain_text_passwd: "test123"
    lock_passwd: false
    ssh_pwauth: true
    chpasswd: { expire: false }
  - name: TA
    gecos: "TA"
    sudo: ALL=(ALL) NOPASSWD:ALL
    shell: /bin/bash
    groups: users,docker,video,input,i2c
    lock_passwd: true
    ssh_authorized_keys:
    - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmGb51TnaKwDGROPc3Fakc7bjfFe+RkCnm9QJK0ISaejYeezrDg/+9Ur1M0G6UiJlFXX2GOkQQ8fn4I+5bSH6DQBplGhZFIN5YklXBz73Hnz9UsHO7nzpVQFXLFeZOsBfBeDw6wITwrnBYeR612y/7Ir6/mTtn1VGs68MxnqzbB/vyx0dJrJVUFzyi7lJ/2Nn4j2ZSqXCHm67WaO7fnJs0aTsMpcHQ6H6cS6h3IKWtcbNgN2dqAH2SVHndkvVRrsI12y6SgrpnR8IMWVLwaAHjA/AETKJNLn5ALAZ9Jq2A4VlF/Bm/ZJDmmZwltKDRmYcVKU129ztzF7vJboaf03J7"
  - name: testWSL
    gecos: "yzLin"
    sudo: ALL=(ALL) NOPASSWD:ALL
    shell: /bin/bash
    groups: users,docker,video,input,i2c
    lock_passwd: true
    ssh_authorized_keys:
    - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj3RHwTCGVqW7aAlxsFYGJ9YcdUnd8NHUq9I9J5MFsoJtuDK8rxYmYs9WlcJAZIq4OopQRLolevxPXIaGQ+dSSDUuX7XCNIOlqOuJle4bYhzmIU9AkO0Jn8aUhJ5gVF7pk6XH5Mn9EHT9mSSeRS7rBoRbH0aEcVhZ0N6YYIULl7dNIfVCb2sxDylNA/62zrTQ6OHklYx1sIEtlMcaNZR6wRDlnRbhEVIorIilIgZTORtjBaK6n+7/va9Xg5iqTbha1qUFTpgKvBmntYOytLdIOBWyeU3VD9jcXOpo1e4VTwvfwpQXnhLfeF5GcYIoo84LK9mVoV+qVPN45JKh5WxJ6a2+9w0UCKHu67p5rKiNKm9swDshago1BcT26g7s562TxUJPJeUaaWcJRo5zrC4WfmRUrnMdmmXxC1zZHJXMfSflgoiWTQrwuWnIxdxN2Ue4odmK9usjjOe1qlsN0mu7KMFljS7ISWt5vVvEjE61E6x0xyBh2gjSaP5DbwYHbLIc= yzlin@LAPTOP-G6LVQ0UI"
  - name: test
    gecos: "test"
    sudo: ALL=(ALL) NOPASSWD:ALL
    shell: /bin/bash
    groups: users,docker,video,input,i2c
    lock_passwd: true
    ssh_authorized_keys:
    - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCoDbDNTYAMS0NQ5NJsKXQ5rsfDY/UGkN5w1coAvgq+mVUBeivIue6CTUSQWj7zK9acDF7u+3kDVz7nK93V1K7N9jcc1RdSMShmQuSDPeN0yqKp9mO06YRkyu0ELZm64ibL5DTEnuexAeHQBlN5xTyZC0JitfOFSUdqyet3Rom6G3Zvu3QL9eksZRL7K+q59vUb2XsAgOiQjU4CJupqZQ66ksK5tX4DkbTcfw/biCIlHEPZIpuhgIf1eACYclLiL+ra7PnYnHLQD1y/Q7N089GP+pQ/HTF97IDaRuituLHZkIPL8K1NxkoNSjmHI6vfsxcKf/nSUH7jTxo5flkyvtqavvXQ/TfIUYkWLHTTIlHL5tPrFQ2MPy4Sg1olU2jp+cx0Zj8TvL56X/KM2aaRVDjTkLz6mndwh9OsK5VvExrDf0l1EcKgkD4O3sGH8tblTnWAp7NOPLbb38tnDMhuqyiUWj4zwUZ90N4gwFC1fEQFpieHkkAK9A7nfas6DXpIK9M= yhlu@luyanxundeMacBook-Air.local"

# # Set the locale of the system
locale: "en_US.UTF-8"

# # Set the timezone
# Value of 'timezone' must exist in /usr/share/zoneinfo
timezone: "Asia/Taipei"

# # Update apt packages on first boot
#package_update: true
#package_upgrade: true
#package_reboot_if_required: true
package_upgrade: false

# # Install any additional apt packages you need here
packages:
  - ntp

# # WiFi connect to HotSpot
# - use `wpa_passphrase SSID PASSWORD` to encrypt the psk
write_files:
  - content: |
      allow-hotplug wlan0
      iface wlan0 inet dhcp
      wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
      iface default inet dhcp
    path: /etc/network/interfaces.d/wlan0
  - content: |
      ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
      update_config=1
      network={
        ssid="duckietown"
        psk=d341c51267daf7e7bc551dcb9edaf4725becbf976449a51a1935197e0939fd93
        priority=1000
      }
      network={
        ssid="duckie222"
        psk="duckie222"
        priority=100
      }
      network={
        ssid="iilaiii"
        psk="wblh5211"
        priority=10
      }
    path: /etc/wpa_supplicant/wpa_supplicant.conf
  - path: /etc/cron.d/nctu_cs_zoo
    owner: root:root
    permissions: '0644'
    content: |
      SHELL=/bin/bash
      PATH=/sbin:/bin:/usr/sbin:/usr/bin
      @reboot root iw wlan0 set power_save off
  - path: /etc/modules-load.d/nctu_cs_zoo.conf
    owner: root:root
    permissions: '0644'
    content: |
      # load driver for i2c
      i2c-dev
      i2c-bcm2835
# These commands will be ran once on first boot only
runcmd:
  # Pickup the hostname changes
  - 'systemctl restart avahi-daemon'

  # Activate WiFi interface
  - 'ifup wlan0'

  # load driver for i2c when first time booting
  - 'modprobe i2c-dev i2c-bcm2835'
```
