2025/04/04

[Raspberry] Pi 4 Enable serial0

[install_raspi-config]

https://github.com/EmilGus/install_raspi-config/blob/master/README.md

 

  • Start raspi-config: sudo raspi-config
  • Select option - Update
  • Reboot
  • Select option 3 - Interface Options
  • Select option P6 - Serial Port
  • At the prompt Would you like a login shell to be accessible over serial?, answer 'No'
  • At the prompt Would you like the serial port hardware to be enabled?, answer 'Yes'

  • 注意:如果您在樹莓派上安裝了 Ubuntu 作業系統,請進行如下組態:

    • /boot/config.txt 加入 enable_uart=1

    • 在 Ubuntu系統的文件 /boot/firmware/cmdline.txt中刪除

    console=serial0,115200(類似於在樹莓派系統中文件/boot/cmdline.txt)

    • 運行以下命令關閉序列控制台:

    sudo systemctl stop serial-getty@ttyS0.service && sudo systemctl disable serial-getty@ttyS0.service

    • 請確保您已安裝python 序列庫 pyserial,而不是來自 apt 的 python-serial。

    • 建立 udev file (/etc/udev/rules.d/50-tty.rules),並加入以下內容:

    • KERNEL=="ttyS0", SYMLINK+="serial0" GROUP="tty" MODE="0660"
      KERNEL=="ttyAMA0", SYMLINK+="serial1" GROUP="tty" MODE="0660"
    • 運行以下命令多載 udev 規則:

    sudo udevadm control --reload-rules && sudo udevadm trigger

    2025/04/03

    Raspberry 4B pin definition



    Linux nano cmd

     

    • Ctrl+K 剪下整列或選取範圍
    • Alt+6 複製整列或選取範圍
    • Ctrl+6 開始選取
    • Ctrl+U 貼上剪貼簿內容
    • Alt+U Undo
    • Alt+E Redo
    • Alt+Del 刪除整行
    • Alt+3 Comment/Uncomment
    • Alt+/ || Alt+G 跳到指定行數
    • Ctrl+G Help
    • Alt+W || F6 尋找
    • Alt+Q 尋找下一個
    • Alt+W 尋找上一個
    • Alt+R 尋找並置換
    • Alt+X 關閉下方 Help 提示
    • Ctrl+S 存檔
    • Ctrl+O 另存新檔
    • Ctrl+X 退出

    2015/08/17

    [ Android ] 拆apk的.dex

    ref: 參考

    dex2jar: dex2jar
    JD-GUI: JD-GUI

    1.解壓縮 apk
    2. dex2jar 將 dex 轉 jar
    3.  JD-GUI 看 jar

    2013/08/13

    [ Excel ] 解除活頁簿保護巨集

    Sub PasswordBreaker()
        'Breaks worksheet password protection.
        Dim i As Integer, j As Integer, k As Integer
        Dim l As Integer, m As Integer, n As Integer
        Dim i1 As Integer, i2 As Integer, i3 As Integer
        Dim i4 As Integer, i5 As Integer, i6 As Integer
        On Error Resume Next
        For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
        For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
        For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
        For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
        ActiveSheet.Unprotect Chr(i) & Chr(j) & Chr(k) & _
            Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
            Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
        If ActiveSheet.ProtectContents = False Then
            MsgBox "One usable password is " & Chr(i) & Chr(j) & _
                Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _
                Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
             Exit Sub
        End If
        Next: Next: Next: Next: Next: Next
        Next: Next: Next: Next: Next: Next
    End Sub