周秉翰
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # linux learning ###### tags: `linux` ---- ### 外接SDcard 新增 ```bash= sudo fdisk -l ## 查看SD卡 sudo umount /dev/mmcblk1p1 ## 卸載SD卡 sudo mkfs.ext4 /dev/mmcblk1p1 ##格式化成ext4 sudo blkid /dev/mmcblk1p1 ## 確認格式化是否成功 sudo mount /dev/mmcblk1p1 /media/ubunut/SD32G ##掛載 SD ## */* 根目錄下的資料夾 ``` ### 複製系統到SD Card ```bash= sudo cp -ax / /media/ubuntu/sd # #複製根目錄到SD sudo cd /media/ubuntu/sd ## 進入SD更改開機順序 ## extlinux.conf # 複製一份 sudo cp extlinux.conf extlinux.conf.orginal sudo vim extlinux.conf ## 複製LABEL 之後全部內容 # 更改 root=/dev/mmcblk0p1 to root=/dev/mmcblk1p1 # 貼上剛剛複製的LABEL 再更改LABEL 後面的名稱 # DEFAULT primary to DEFAULT sdcard ``` ### opencv libopencv_core.so.3.x ```shell= ## "libopencv_core.so.3.x" # 因為沒有在make opencv 時加入 寫入pkg-config的選項 # 1.Find the folder containing the shared library libopencv_core.so.3.2 using the following command line. sudo find / -name "libopencv_core.so.3.2*" ## Then I got the result: /usr/local/lib/libopencv_core.so.3.2. # # 2. Create a file called /etc/ld.so.conf.d/opencv.conf and write to it #the path to the folder where the binary is stored.For example, I wrote /usr/local/lib/ to my opencv.conf file. # 3. Run the command line as follows. sudo ldconfig -v #Try to run the test binary again. ``` ### grpc ```proto= asdasd ``` ### pkg-config ```shell= ## 查看pkg-config list of path pkg-config --variable pc_path pkg-config ``` https://github.com/grpc/grpc/tree/master/examples/cpp/helloworld ### makefile ```shell= $@:目前的目標項目名稱。 $<:代表目前的相依性項目。 $*:代表目前的相依性項目,但不含副檔名。 $?:代表需要重建(被修改)的相依性項目。 % : 萬用配對字元 vpath %h ../headers ## make 在 “../headers” 目錄下搜索所有以 “.h” 結尾的文件。 -lpthread ###include <thread> ``` ### jupyter #### setting no brower in remote pc ```shell= jupyter notebook --no-browser --port 8888 ``` #### 改背景 ``` pip install --upgrade jupyterthemes jt -l #查看主題 jt -t #更改主題 jt -r #恢復默認 ``` #### local pc use putty ![](https://i.imgur.com/S8TDZDs.png) ### GPIO (linux kernel) ```shell= ## gpio config path sudo su ## 為了進入kernel path cd /sys/kernel/debug cat gpio ## show gpio file ``` https://devtalk.nvidia.com/default/topic/1030443/jetson-tx2/using-gpio-on-nvidia-jetson-tx2/ http://derekmolloy.ie/kernel-gpio-programming-buttons-and-leds/ ### Linux kernel module ```shell ##You should avoid using global variables in kernel modules ``` ### pip install scipy error ```shell= sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran sudo pyhon3 -m pip install scipy sudo pip uninstall enum34 sudo apt-get install python3-scipy ``` ### dockerhub on jetson tx1 ```shell= docker pull emacski/tensorflow-serving:1.11.1-arm64v8 ``` [參考資料](https://hub.docker.com/r/emacski/tensorflow-serving) [參考資料_1](https://blog.cavedu.com/2018/12/07/%E7%BF%BB%E8%AD%AF-2016-12-07-%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8tensorflow-serving%E6%90%AD%E9%85%8Ddocker%EF%BC%9F/) [參考資料_2](http://fancyerii.github.io/books/tfserving-docker/) [參考資料_3](https://github.com/helmuthva/jetson) https://b8807053.pixnet.net/blog/post/82763069 helmuthva/jetson-xavier-tensorflow-serving:0.4.3 https://devtalk.nvidia.com/default/topic/1031642/jetson-tx2/tensorflow-serving-on-jetson-tx2/ ### 看資料夾大小 ```shell= du -sh /* ``` ### linux disk speed test ```shell= sudo hdparm -Tt /dev/sda ``` ### mri script mode of ar tool ```shell= create libnew.a addlib libopencv_core.a addlib libopencv_imgproc.a addlib libopencv_highgui.a addlib libmyown.a save end ar -M <script.mri ``` ### ldd config 抓出來 ```shell= ldd /bin/bash | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' test/ ``` https://blog.csdn.net/czyt1988/article/details/71194457 ### linux status of port ```shell= sudo nmap -sT -O localhost ``` ### vnc 丟丟看 [參考](https://raspberrypi.stackexchange.com/questions/13644/remote-access-with-vnc-outside-local-network) 1. 安裝 `sudo apt-get install x11vnc` 2. run command `x11vnc -ssh name@static-ip:outputport` 3. !!!name is remote viewer name.!!! ### terminal color `.bashrc` ```shell= force_color_prompt=yes ``` ### x11 forward [這個就懂](https://ssarcandy.tw/2017/03/20/Setup-x11-forwarding-on-Debian/) ### unzip multiple file ```shell= unzip '*.zip' ``` 一定要加`''`因為不加會像是 ```shell= unzip a.zip b.zip c.zip ``` ### 不用遠端看multi image ```shell= sudo apt-get install nitrogen ``` ### 記憶體不見了 [給你參考](https://www.linuxatemyram.com/) ### Top command terminal output to text ![](https://i.imgur.com/TU34KMR.png) [這篇](https://www.tecmint.com/save-top-command-output-to-a-file/) [top](https://david50.pixnet.net/blog/post/45252072-%5B%E7%AD%86%E8%A8%98%5Dlinux---top%E8%B3%87%E8%A8%8A) shell 裡面不能打`|&` ```shell= |& ## 要換成 2>&1 | ``` ## ls color 之前要先把本來的LS_COLORS存下來 ```shell= LS_COLORS='*.c=01;32:*.cpp=31:*.pl=01;35:' export LS_COLORS= ``` [參考](http://linux-sxs.org/housekeeping/lscolors.html) ## count folder of file ```shell= ls -1 | wc -l ``` ## write conda env. in to jupyter ```shell= pip3 install ipykernel python -m ipykernel install --user --name 环境名称 --display-name "Python (env_name)" ``` ## xavier power mode ![](https://i.imgur.com/BGASahA.png) ## find word in text ```shell= grep -rnw '/path/to/somewhere/' -e 'pattern' ``` ## install jetson 4.3 error 如果安裝L4T有問題 或是 apt get error 需要將欲安裝的jetson apt update upgrade 才可以順利安裝 ## zip multi threads ```shell= tar -cv -T file_list.txt |pigz -1 -p 32 > n0001.tar.gz # unzip tar xzvf *.tar.gz pigz -dc target.tar.gz | tar xf - tar cf - paths-to-archive | pigz > archive.tar.gz ``` ## ImportError: cannot import name 'PILLOW_VERSION' from 'PIL' ![](https://i.imgur.com/EhagGfO.png) ## ls sort by extension ```shell= ls -X (ls sort=extension) ``` ## 很酷看cpu-usage ```shell= watch -n1 "cat /proc/cpuinfo | grep 'MHz' | awk '{print $1}'" ``` ## 在bash裡隨機挑選file ```bash= ls|shuf -n 20 ``` 範例 ```bash= scp `ls|shuf -n 20` me7122-2@140.124.32.122:/home/me7122-2/CHOU/ps44tairoa/image/val/n0001 ``` b https://reader.elsevier.com/reader/sd/pii/S0019057816000422?token=CDB05B140601E0A481042F1ADFF1E2B7A9E8B77467BA6B29AF197AF39ABAF166F3FF9E1AD3FFBF1A049CC5D9F658FCEB docker run --gpus=1 --rm -p8000:8000 -p8001:8001 -p8002:8002 -v/home/me7122-2/Yan/triton-inference-server/docs/examples/model_repository:/models nvcr.io/nvidia/tritonserver:20.06-py3 tritonserver --model-repository=/models ## RDP https://medium.com/@riley.kao/wsl2-ubuntu20-04-gui-remote-desktop-connection-rdp-2bbd21d2fa71#:~:text=%23%20xce4%0Astartxfce4-,Enable%20dbus,-sudo%20systemctl%20enable ```shell= sudo systemctl enable dbus sudo /etc/init.d/dbus start sudo /etc/init.d/xrdp start ``` ## 你好

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully