vdm 矩陣
2024年1月19日 星期五
聯想詞的設定
vdm 矩陣
Engineering Graphics Lecture Notes, mkEngGraLectureNotes.sh
docxfile=$1
TeXfile=$2
LyXfile="${2%.*}.lyx"
pandoc --extract-media ./ $docxfile -o $TeXfile
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/>/' $TeXfile
#sed -i 's/\/\\/g' $TeXfile
echo " \\end{document}" >> $TeXfile
cat > tmpfile << EOF
\\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
\\pdfpageheight\\paperheight
\\pdfpagewidth\\paperwidth
\\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{}
EOF
cat $TeXfile >> tmpfile
mv -f tmpfile $TeXfile
tex2lyx -f $TeXfile
2024年1月18日 星期四
window dialog using zenity with buttons
zenity --question --width=100 --ok-label="Shutdown anyway" --cancel-label="Cancel" --title="Shutdown reminder" --text="Shutdown now?"
status="$?"
if [ "$status" = 0 ]; then
zenity --info --width=100 --title="Cancel Shutdown" --text="Cancel Shutdown"
fi
else
gnome-session-quit --power-off
fi
Compress with tar 7z
2024年1月12日 星期五
software update pop up notification turn off
cf: https://askubuntu.com/questions/1237825/how-to-turn-off-software-updater-pop-up-notification
- gsettings set com.ubuntu.update-notifier no-show-notifications true
- Or use dconf-editor. Go to /com/ubuntu/update-notifier, and unclick no-show-notification to false.
Check with:
gsettings get com.ubuntu.update-notifier no-show-notifications
If shows true, done.
2024年1月8日 星期一
Test video nouveau driver nvidia graphic card
[Scene] build
[Scene] bump
[Scene] clear
[Scene] conditionals
[Scene] desktop
[Scene] effect2d
[Scene] function
[Scene] ideas
[Scene] jellyfish
[Scene] loop
[Scene] pulsar
[Scene] refract
[Scene] shading
[Scene] shadow
[Scene] terrain
[Scene] texture
Description : Time coefficient (1.0 is "wall clock" speed, <1.0 is slower, >1.0 is faster). A special value of "duration" computes this as a function of the "duration" option
Description : Enable random rotation speeds
2024年1月5日 星期五
My boshiamy fcitx
- Adding new codes into /download/Boshiamy/boshiamy_my.txt
- sudo apt install fcitx-tools
- txt2mb boshiamy_my.txt boshiamy_my.mb
- cp boshiamy_my.mb /home/chiao/.config/fcitx/table/
- sudo cp boshiamy_my.mb /usr/share/fcitx/table/
- cd /home/chiao/.config/fcitx/table
- mv boshiamy.mb boshiamy_orig
- ln -s boshiamy_my.mb boshiamy.mb
- cd /usr/share/fcitx/table/
- sudo mv boshiamy.mb boshiamy_orig
- sudo ln -s boshiamy_my.mb boshiamy.mb
- im-config, select fcitx as new input method
- logout, then login
- Done
2023年12月30日 星期六
ubuntu 22.04+ 無中文台灣
sudo add-apt-repository universesudo apt-get install fcitx fcitx-chewing「設定」-> 「地區及語言」->「管理安裝的語言」->「調整輸入法系統」,選取fcitx在「語言」tab 中選取並移動「中文台灣」至第一選項logout, then loginDone
2023年12月26日 星期二
Check Pi Camera connected
sudo vcgencmd get_camera
If exists:
supported=1 detected=1, libcamera interfaces=0
2023年12月15日 星期五
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
2023年12月11日 星期一
pi raspbian backup system
Browse the link: Image File Utilities
Download image-utils.zip
- Unzip image-utils.zip to ~/image-copy
- cd ~/image-copy
- 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)"
---------------------------------------------------------------------- - sudo mount -t nfs 192.168.1.2:/BACKUP-nvme1n1p2/pi4 /mnt/nfs
- sudo ./mkpi4.sh /mnt/nfs
- 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
- pandoc --extract-media ./ chapter14_text_2022_111_1.docx -o chap14.tex
- cd images/media
- rename imagexx.tmp imagexx.png
- convert imagexx.emf image40.png
- 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
- 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{} - Add the line at the endding:
\end{document} - import into lyx
- inside lyx:
文件->設定->字型,click 「使用非-TeX字型」,底下全選「Noto Serif CJK TC」
文件->設定->語言,選「中文(正體)」
文件->設定->PDF屬性,click「使用 Hyperref 功能」
文件->設定->浮動框位置,選「肯定在此」 - 編輯 LyX 檔內容
2023年12月2日 星期六
2023年11月30日 星期四
Java 11 installation complains about dependencies
cf: https://askubuntu.com/questions/1356835/java-11-installation-complains-about-dependencies
While
sudo apt --fix-broken install
or
sudo apt purge openjdk-11-jdk-headless
Get the followings:
dpkg: error processing archive /var/cache/apt/archives/openjdk-11-jre-headless_11.0.
21+9-0ubuntu1~22.04_amd64.deb (--unpack):
無法將 './usr/lib/jvm/java-11-openjdk-amd64/lib/modules' 的解壓縮資料複製到 '/usr/l
ib/jvm/java-11-openjdk-amd64/lib/modules.dpkg-new':檔案或資料串流意外結束
處理時發生錯誤:
/var/cache/apt/archives/openjdk-11-jre-headless_11.0.21+9-0ubuntu1~22.04_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Fix by running the followings:
sudo apt-get clean
sudo apt-get install -f
sudo dpkg --configure -a
2023年11月14日 星期二
php cannot run inside drupal subdirectory
...
RewriteCond %{REQUEST_URI} !/core/[^/]*\.php
Done.
2023年11月13日 星期一
Upgrade drupal 10 from 9
- Copy drupal database to drupal10_from_9
- Copy ~/public_html/drupal to ~/public_html/drupal10_from_9
- Edit web/sites/default/settings.php. Change database from drupal to drupal10_from_9
- In phpmyadmin, set drupal10_from_9 database privileges to user drupaladmin
- Browse http://localhost/~chiao/drupal10_from_9/web, go to: 管理 -> 擴展
- 安裝:
- 解除安裝:
CKEditor (Deprecated)
Add HW Exam
Add My Exams Forms
Amazing forms
Appraisal Edit Forms
Appraisal Export Forms
Appraisal List Forms
Engineering Graphics
Engineering Graphics YouTube
FAHP Expert Data Creation Forms
FAHP Hierarchy Creation Forms
FAHP Online forms
FAHP Show Membership Forms
FAHP Synthesis Computation Form
(for drupaladm)PCM Consistency Check Forms
Grade Query forms
Hello World
Industrial English
List HW Exam
Science Technology English
Teacher Appraisal Forms
- cf: https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-or-later/how-to-upgrade-from-drupal-9-to-drupal-10
chmod 777 web/sites/default
sudo chmod 666 web/sites/default/*settings.php
chmod 666 web/sites/default/*services.yml
composer require 'drupal/core-recommended:^10' 'drupal/core-composer-scaffold:^10' 'drupal/core-project-message:^10' --no-update
composer require 'drupal/core-dev:^10' --dev --no-update
composer update - set $settings['update_free_access']= TRUE in settings.php
- visiting httsp://localhost/~chiao/drupal10_from9/web/update.php
Some modules need to be upgraded, e.g. color. Click color will open the color module project, then copy the composer line to install it inside ~/public_html/drupal0_from_9/web- If there are messages like below:
Status Details
發現錯誤
Removed core modules
You must add the following contributed modules and reload this page.
Color
Quick Edit
RDF
These modules are installed on your site but are no longer provided by Core.
For more information read the documentation on deprecated modules.
Removed core themes
You must add the following contributed themes and reload this page.
Seven
Bartik - cd ~/public_html/drupal10_from_9, then
composer require 'drupal/color:^1.0'
composer require 'drupal/quickedit:^1.0'
composer require 'drupal/rdf:^2.1'
composer require 'drupal/seven:^1.0'
composer require 'drupal/bartik:^1.0' - Go to and make sure update.php page not complain anymore. (IMPORTANT!),
If shows "Drupal 資料庫更新", then click 繼續 and Apply pending updates Until the page shows "Drupal 資料庫更新". - set back $settings['update_free_access'] = FALSE in settings.php.
chmod 755 web/sites/defaultsudo chmod 600 web/sites/default/*settings.phpchmod 644 web/sites/default/*services.ymlGo to http://localhost/~chiao/drupal10_from_9/web/admin/reports/updates It should beDrupal 核心
最新的Drupal core 10.1.6Go to http://localhost/~chiao/drupal10_from_9/web/admin/config/development/performance Click "清除所有快取"Add my own modules, e.g. Grade Query:
cd ~/public_html/drupal10_from_9/web/modules/custom/grade_query
Edit grade_query.info.yml: core_version_requirement: ^8 || ^9 || ^10
Go to http://localhost/~chiao/drupal10_from_9/web/admin/modules
Click: Grade Query forms 查詢成績
安裝
- If there are messages like below:
phpmyadmin import file size too large
edit /etc/php/8.1/fpm/php.int:
upload_max_filesize = 200M
post_max_size = 300M
sudo systemctl restart php8.1-fpm
Go to: http://localhost/~chiao/phpinfo.php to check if it is changed.
2023年11月6日 星期一
Renew
sudo systemctl stop apache2For pi4, change back the dilink wifi router port forward for internet inbound 80 and 443.sudo certbot renewsudo systemctl start apache2For pi4, change the dilink wifi router port forward for internet inbound 9680->80 and 9681->443
One more thing:
Just wait until the end of 3-month period to renew, because the next expiration date is counted from the renew date.
2023年11月3日 星期五
加中文異體字
cf: https://latexlyx.blogspot.com/2020/12/noto-fonts-xelatex.html
Follow the steps above. Some 中文異體字 that not be able to be created using CJK can be prooduced using. e.g xelatex aa.tex.
2023年10月28日 星期六
mouse slow and sticky lag
cf: https://forums.raspberrypi.com/viewtopic.php?t=84999
2023年10月27日 星期五
usb automount partition in gnome ubuntu (kpci7)
In dconf editor, set:
org->gnome->desktop->media-handling->automount
to True.
2023年10月24日 星期二
Extra \endgroup error
cf: https://tex.stackexchange.com/questions/581907/extra-endgroup-error
Add \RequirePackage[2020-02-02]{latexrelease} before \documentclass[]{}.
LyX cannot insert such command. Use kile.
2023年8月13日 星期日
Octave multiple arguments for function handle
Use the command for example:
quad( @(x) myfunc (x, 1, 2),0,1)
It outputs the quad integraion of myfunc from 0 to 1 with the argument a=1, b=2.
2023年7月22日 星期六
The label function was deprecated in Matplotlib 3.1
2023年7月15日 星期六
kpchiao9600k-SATA2TB_MBR_partition_table_20230714
- Save it between dash lines, e.g. as SATA2TB_MBR_partition_table_20230714.txt.
- Recover back partition table with the command:
sfdisk /dev/sda < SATA2TB_MBR_partition_table_20230714.txt
-----------------------------------------------------------------------------
label: dos
label-id: 0xbda255d3
device: /dev/sda
unit: sectors
sector-size: 512
/dev/sda1 : start= 391168, size= 1269243904, type=83
/dev/sda2 : start= 1273829376, size= 2633199616, type=f
/dev/sda5 : start= 1273831424, size= 1851142144, type=83
/dev/sda6 : start= 3124975616, size= 782053376, type=83
-----------------------------------------------------------------------------
-
cf: https://ubuntuhandbook.org/index.php/2022/01/default-torrent-app-magnet-links-ubuntu/ Set “QBittorrent” as default app for magnet link,...
-
Download 7z-exe: https://www.7-zip.org/ Get into cmd window cd Z:\Classes\109year\Semester2\Calculus\B\HW\HW7 md files "C:\Program Fi...
-
Setting up Google Drive with rclone config involves creating a "remote" connection through an interactive terminal wizard. S...

