Ubuntu 管理心得

搜尋此網誌

2024年11月8日 星期五

Show second on top

gsettings set org.gnome.desktop.interface clock-show-seconds true

2024年11月6日 星期三

classicmenu-indicator is not working in 24.04

cf: https://askubuntu.com/questions/1525467/classicmenu-indicator-is-not-working-in-24-04

Comment out line 152:

vim +152

/usr/lib/python3/dist-packages/classicmenu_indicator/cmindicator.py
Add # in front of line. 
 

2024年10月21日 星期一

drupal no theme layout show

進入「管理」的「效能」,將最底下的「整合 CSS 檔案」及「整合 Javascript 檔案」unclick ! 即可展現 theme 的 layout

清除快取
快取
This is used as the value for max-age in Cache-Control headers.
頻寬最佳化
外部資源可自動優化,可以減少網站的檔案大小及請求數量。

The followings are from ChatGPT:

5. CSS/JS Aggregation Issues:

  • Cause: Sometimes, Drupal's CSS/JS aggregation can cause issues, especially during development.
  • Fix: Disable CSS/JS aggregation temporarily by unchecking the options under Admin > Configuration > Development > Performance.

 

no hdmi sound

在「系統設定值」中改變「顯示器」的解析度,例如: 1680x1050 即有 hdmi 音效選項了。

可以再改回 1920x1080


2024年10月20日 星期日

init_printing(use_unicode=False, wrap_line=False)

 init_printing(use_unicode=False, wrap_line=False)

update core

cf: https://www.drupal.org/project/drupal/releases/10.2.10

For example, upgrade to core 10.2.10

composer require drupal/core-recommended:10.2.10 drupal/core-composer-scaffold:10.2.10 drupal/core-project-message:10.2.10 --update-with-all-dependencies

 

2024年9月16日 星期一

apt-mark hold packages e.g. kernel

 Suppose the kernel version  5.15.0-121 to be held.

  1. dpkg -l linux-* | grep ^ii | grep 5.15.0-121
    Will list all the packages installed, 
  2. sudo apt-mark hold linux-headers-5.15.0-121 linux-headers-5.15.0-121-generic linux-image-5.15.0-121-generic linux-modules-extra-5.15.0-121-generic
  3. apt-mark showhold
    Will list the held packages,e.g
    linux-headers-5.15.0-121
    linux-headers-5.15.0-121-generic
    linux-image-5.15.0-121-generic
    linux-modules-extra-5.15.0-121-generic
  4. Done.

 

2024年9月13日 星期五

unzip sql into mysql

gunzip -cv drupal10_from_9_20240914.sql.zip | mysql -v -u chiao -p drupal10_from_9

2024年9月12日 星期四

7z split and splice

split:
tar -cf - mydir | 7z a -v1g -mx=9 -mmt=4 -p -si mydir.tar.7z

split files are mydir.tar.7z.001, mydir.tar.7z.002, ...

splice:
7z x -tsplit mydir.tar.7z.001

splce file is mydir.tar

 


2024年9月9日 星期一

for loop

#!/bin/bash

for i in {1..5}
do
   echo "Welcome $i times"
done

2024年9月5日 星期四

block comments

#!/bin/bash
echo "Something"
: <<
MyComments
akldsj 
aklsdfj kald'fa
kaldjsf adsf
MyComments

2024年8月16日 星期五

apt check auto or manul installed packages pkg

Because 'apt autoremove' will remove the pkgs installed from 'apt install', some old pkgs, eg. some old kernels are for vmware modules updated. can be not removed.

Vmware modules cannot be compiled in the new kernel 6.8.0-40.

  cf: https://help.ubuntu.com/community/RemoveOldKernels#GUI_Way 

The packages to remove are determined based in part on whether the package is marked as manually or automatically installed. You can check if a kernel providing package is marked as automatically installed using this command in a terminal:

apt-mark showauto 'linux-image-.*'

or to see if it is marked as manually installed:

apt-mark showmanual 'linux-image-.*'

In the event some kernel providing packages are marked as manual (possibly because they were installed via 'apt-get') and you want them autoremoved, you can change the status of the package using apt-mark auto and the package name. For example, to mark kernel 4.12.0-12-generic as autoremovable:

sudo apt-mark auto '^linux-.*-4\.12\.0-12(-generic)?$'
On the contrary, I want some kernels not to be autoremoved. So do this,
sudo apt-mark manual linux-headers-6.5.0-45-generic
sudo apt-mark manual linux-hwe-6.5-headers-6.5.0-45
sudo apt-mark manual linux-image-6.5.0-45-generic 
sudo apt-mark manual linux-modules-6.5.0-45-generic
sudo apt-mark manual linux-modules-extra-6.5.0-45-generic
sudo apt-mark manual linux-signatures-nvidia-6.5.0-45-generic
 
sudo apt-mark manual linux-headers-5.15.0-118
sudo apt-mark manual linux-headers-5.15.0-118-generic
sudo apt-mark manual linux-image-5.15.0-118-generic
sudo apt-mark manual linux-modules-5.15.0-118-generic
sudo apt-mark manual linux-modules-extra-5.15.0-118-generic
 


2024年8月13日 星期二

old firefox profile to new firefox

Because, firefox not allow using profile of old version, we can solve it as follows. 
  1. cp old profile to firefox user directory, say, /home/chiao/snap/firefox/common/.mozilla/
  2. In terminal, run:
    MOZ_ALLOW_DOWNGRADE=1 firefox -P
  3. close firefox and open firefox (no need in terminal)
  4. Done

2024年8月12日 星期一

Stuck at "press Ctrl-c to cancel the checks in progress on the filesystem"

Check /etc/fstab. Some line might cause this problem. For example, if some partition is deleted, but it is still in fstab, then ubuntu is keeping checking such non-exist partition. 


2024年6月26日 星期三

id and id $USER show different groups

I set my primary group as root in /etc/passwd, and I always do this when install a new system. I also add myself to other groups,eg. sudo, lp, dialout ... However, the id only shows I am in root group and no other groups shown.

So I change my primary group from root to chiao voila the problem is solved! The id and id chiao show the same groups. Futhermore, I can use thonny directly. 

2024年6月24日 星期一

pico w micropython custom module

 The custom module, say my.py, must be saved in pico w rather than computer. Otherwisr, micropython will complain not find import module.

I think this is due to the runtime module must be imported from pico w device.

2024年5月20日 星期一

gpio BCM and BOARD mode

  1. GPIO.setmode(GPIO.BOARD)
    pin numbers are as in board,1,2...40 sequentially. 
  2. GPIO.setmode(GPIO.BCM)
    pin numbers are as defined names as GPIO 14, GPIO 15 ...
  3. For example, pin 16 in BOARD mode is the pin GPIO 23 in BCM mode

 

gpio output vs input

 cf: https://electronics.stackexchange.com/questions/534268/difference-between-low-output-gpio-and-input-gpio

An output pin that is set high can push out (source) current, or when set low it can pull in (sink) current. An input does neither, it ideally needs no current to flow to sense if the input is high or low. 

 

 

2024年5月9日 星期四

fcitx 4 add boshiamy

  1. sudo apt install fcitx-tools fcitx-table-boshiamy
  2. fcitx 設定法設定 add 嘸蝦米
  3. For my own codes, run:
    #!/bin/bash
    txt2mb boshiamy_my.txt boshiamy_my.mb
    cp -f boshiamy_my.mb /home/chiao/.config/fcitx/table/
    sudo cp -f boshiamy_my.mb /usr/share/fcitx/table/
    cd /home/chiao/.config/fcitx/table
    ln -sf boshiamy_my.mb boshiamy.mb
    cd /usr/share/fcitx/table/
    sudo ln -fs boshiamy_my.mb boshiamy.mb
    echo ""
    echo " Restart fcitx "
    echo ""

 

 

2024年5月7日 星期二

Install windows 11 without login microsoft

 cf: https://www.makeuseof.com/windows-11-set-up-without-internet-connection/


  1. Make sure your computer is not connected to the Internet. 
  2. Enter your product key. If you don't have a product key, click the
    I don't have a product key
    link in the bottom right corner.
  3. Once in the Let’s connect you to a network screen, press Shift + F10 to launch the Command Prompt.
  4. In the Command Prompt window, type
           OOBE\BYPASSNRO 
  5. Upon successful execution, your system will restart and relaunch the OOBE dialog.
  6. Click on I don’t have Internet option
  7. Next, click on Continue with limited setup.

2024年5月6日 星期一

fcitx 5 快速片語

 設定->附加元件->模組->快速片語 點選右側圖示,出現「快速片語-Fcitx 設定」視窗,點選下方「編輯器」即可加入片語。

使用 Super(Win)+; 啟動快速片語輸入


2024年5月3日 星期五

mycodes

adh 伴隨矩陣
ahp 層級分析法
alt 方案
au 真理大學
aug 增廣矩陣
chia 喬國平
cofa 餘因子
cri 準則
deci 決策分析
det 行列式
eig 特徵值
eiv 特徵向量
elem 元素
elm 基本矩陣
elro 基本列運算
ext 擴充原理
fahp 模糊層級分析法
flow 流程圖
fuzz 模糊集合
gau 高斯消去法
gau 高斯喬丹消去法
goo 如圖
goo 如此
ifs 區間二型直覺模糊集合
imei 工業管理與經營資訊學系
lcom 線性組合
ldep 線性相關
lina 線性代數
lind 線性獨立
lp 線性規劃
lsys 線性系統
mem 隸屬度函數
mous 滑鼠
pcm 成對比較矩陣
pivo 軸元素
pj 平面
rect 矩形
ref 列梯形矩陣
rref 列簡梯形矩陣
rz 微積分
uqll 電腦繪圖
user 使用者
vdm 矩陣
zya 等角
zya 等角圖

2024年5月2日 星期四

Ubuntyt 24.04 fcitx 加嘸蝦米

sudo apt install fcitx5-table-extra

在右上角輸入法 click 設定,點選「嘸蝦米」


2024年4月30日 星期二

add user defined layouts in lyx for windows

 Put into: 

c:\Users\chiao\AppData\Roaming\LyX2.3\layouts\

2024年4月20日 星期六

sudo a2ensite default-ssl

 sudo a2ensite default-ssl
 sudo systemctl reload apache2

2024年4月16日 星期二

2024年4月8日 星期一

Uninstall mathematica

 cf: https://support.wolfram.com/12473

 Remove the subdirectories:

  • /usr/local/Wolfram/Mathematica/
  • /usr/share/Mathematica/
  • ~/.Mathematica/
  • ~/.Wolfram/
  • ~/.cache/Wolfram

 


 

2024年4月6日 星期六

clip video ffmpeg

ffmpeg -i a.mp4 -ss 00:10:57 -to 00:23:00 -c:v copy -c:a copy output2.mp4

Use kdnlive:

 

 

2024年4月4日 星期四

Show resize info windows using mouse

 Inside CompizConfig, activate "Resize Info"


2024年4月2日 星期二

Clone 教學網頁

  1. Rename drupal0_from_9 database to drupal10_from_9_pi4_20240402
  2. Using command line mysql instead of phpmyadmin to clone draupal0_from_9 database from kpci7 to pi4
  3. Using sudo to clone public_html/drupal10_from_9 from kpci7 to pi4
  4. In pi4 phpmyadmin, update the drupal10_from_9 database privileges for drupaladmin

網誌存檔