Ubuntu 管理心得

搜尋此網誌

2023年12月30日 星期六

ubuntu 22.04+ 無中文台灣

cf: https://aishuafei.com/ubuntu-chinese-language/
  1. sudo add-apt-repository universe 
  2. sudo apt-get install fcitx fcitx-chewing
  3. 「設定」-> 「地區及語言」->「管理安裝的語言」->「調整輸入法系統」,選取fcitx
  4. 在「語言」tab 中選取並移動「中文台灣」至第一選項
  5. logout, then login
  6. Done
 


2023年12月26日 星期二

Check Pi Camera connected

sudo vcgencmd get_camera

If exists:
    supported=1 detected=1, libcamera interfaces=0

else
    supported=0 detected=0, libcamera interfaces=0


2023年12月15日 星期五

lyx package keyval error

 Delete ~/texmf/tex/latex/hyperref

2023年12月14日 星期四

Remove texlive

 sudo apt-get purge texlive-* -y
 sudo apt-get autoremove -y
 sudo apt-get autoclean -y
 sudo /bin/rm -rf /var/lib/texmf
 sudo /bin/rm -rf /etc/texmf
 sudo /bin/rm -rf /usr/local/share/texmf
 sudo /bin/rm -rf /usr/share/doc/texmf
 sudo /bin/rm -rf /usr/share/doc/texlive
rm -rf ~/.texlive2021
sudo /bin/rm -rf /var/lib/texmf



lmroman12-regular not loadable

 sudo apt-get install fonts-lmodern

2023年12月11日 星期一

pi raspbian backup system

Browse the link: Image File Utilities
Download image-utils.zip

  1. Unzip image-utils.zip to ~/image-copy
  2. cd ~/image-copy
  3. Create shell script, mkpi4.sh from dash line to dash line:
    ----------------------------------------------------------------------
    #!/bin/bash
    if [ "$#" -lt 1 ]; then
        echo "Usage: $0 <path>"
        exit
    fi

    prefix=$1
    IMG=$(date +pi4_bookworm_%Y%m%d.img)
    START=$(date +%F\ %T)
    sudo /bin/bash /home/chiao/image-copy/image-backup --initial $prefix/$IMG,,1000 -o -P,--exclude-from=/home/chiao/image-copy/exclude.txt
    echo "Start:  $START"
    echo "End: $(date +%F\ %T)"
    ----------------------------------------------------------------------
  4. sudo mount -t nfs 192.168.1.2:/BACKUP-nvme1n1p2/pi4 /mnt/nfs
  5. sudo ./mkpi4.sh /mnt/nfs
  6. Wait ...
 



 

 

 


2023年12月9日 星期六

Software and updates not working 軟體與更新 無法開啟

 https://askubuntu.com/questions/789966/software-updates-crashes-and-will-not-open

 

sudo aptitude reinstall apt apt-utils aptdaemon\
 aptdaemon-data update-manager update-manager-core dbus

2023年12月6日 星期三

CKeditor 5 setup for drupal 10

 Go to
     首頁->管理 ->設定-> 內容撰寫 ->文字格式與編輯器
set 文字編輯器 to CKEditor 5

Also, for other 文字格式。

2023年12月3日 星期日

docx to lyx

  1. pandoc --extract-media ./ chapter14_text_2022_111_1.docx -o chap14.tex
  2. cd images/media
  3. rename imagexx.tmp imagexx.png
  4. convert imagexx.emf image40.png
  5. sed -i -e '/hypertarget/d' -e 's/\\label.*$//' -e 's/includegraphics\[width=.*\]/includegraphics/' -e '/includegraphics{/i \\\\begin\{figure\}\n\\begin\{centering\}' -e '/includegraphics{/a \\\\end\{centering\}\n\\caption\{\}\n\\end\{figure\}' -e 's/\\textgreater/>/' chap1.tex
  6. Edit chap1.tex. Add the lines at the beginning:
    \documentclass[10pt,a4paper]{extarticle}
    \usepackage[utf8]{inputenc}
    \usepackage{amsmath}
    \usepackage{amsthm}
    \usepackage{fontspec}
    \setmainfont[Mapping=tex-text]{Noto Serif CJK TC}
    \setsansfont[Mapping=tex-text]{Noto Serif CJK TC}
    \setmonofont{Noto Serif CJK TC}
    \usepackage{float}
    \usepackage{graphicx}
    \usepackage[unicode=true,pdfusetitle,
     bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
     breaklinks=false,pdfborder={0 0 0},pdfborderstyle={},backref=false,colorlinks=false]
     {hyperref}

    \makeatletter

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
    \pdfpageheight\paperheight
    \pdfpagewidth\paperwidth


    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
    \theoremstyle{definition}
     \newtheorem{example}{\protect\examplename}

    \@ifundefined{date}{}{\date{}}
    \makeatother

    %\providecommand{\examplename}{範例}

    \begin{document}

    \renewcommand{\footrulewidth}{0.4pt}
    \thispagestyle{empty}\tableofcontents{}
    \pagebreak{}
    \renewcommand{\footrulewidth}{0.4pt}
    \thispagestyle{empty}\tableofcontents{}
    \pagebreak{}
  7. Add the line at the endding:
    \end{document}
  8. import into lyx
  9. inside lyx:
    文件->設定->字型,click 「使用非-TeX字型」,底下全選「Noto Serif CJK TC」
    文件->設定->語言,選「中文(正體)」
    文件->設定->PDF屬性,click「使用 Hyperref 功能」
    文件->設定->浮動框位置,選「肯定在此」
  10. 編輯 LyX 檔內容

2023年12月2日 星期六

lyx 匯入latex 中文亂碼

 Add this line in LaTeX file:

\usepackage[utf8]{inputenc}

網誌存檔