Ubuntu 管理心得

搜尋此網誌

2021年12月31日 星期五

Remove ibus input method 輸入法

cf: https://askubuntu.com/questions/860780/how-to-remove-old-ibus-keyboard-input-menu-items 

Enter dconf-editor and go to org.gnome.desktop.input-sources.sources then delete the input method not needed, e,g, ('ibus', 'fuzzy_table')

2021年12月30日 星期四

Inquiry about paper staus

 cf: https://www.editage.com/insights/how-do-i-write-an-inquiry-to-the-editor-about-my-manuscripts-current-status


Dear Mr./Ms. XXX [Editor's Name],

I have submitted my revised manuscript titled XXXX [manuscript id: xxxx] to your journal via the online submission system on dd/mm/yyyy [date of submission]. Two days later, the status changed to ‘with editor.’ However, the status has remained unchanged ever since.

I would be grateful if you could let me know whether there has been any further progress on my submission.

Sincerely,

XXXX [Your name and contact details]

2021年12月5日 星期日

Clean /var/log/journal

cf: https://j7.lb168.tw/2019/07/vacuum-var-log-journal/


  1. sudo vim /etc/systemd/journald.conf
  2. Add the lines:
  3. SystemMaxUse=10M
    SystemMaxFileSize=10M
  4. sudo systemctl restart systemd-journald.service

cf: https://askubuntu.com/questions/1238214/big-var-log-journal 

  1. sudo journalctl --vacuum-size=10M
  2. sudojournalctl --vacuum-time=10d

2021年12月4日 星期六

Configure Thunderbird for localhost

 cf :  https://gist.github.com/raelgc/6031274

  1. 帳號設定 -> 新增其他帳號 -> Unix Mailspool(Movemail)(U)
  2. 您的大名: chiao
  3. 電子郵件地址: chiao@localhost
  4. 寄件伺服器: localhost

As of Thunderbird 87beta.x.x, Movemail support is removed. 

https://www.thunderbird.net/en-US/thunderbird/87.0beta/releasenotes/ 

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

cf: https://stackoverflow.com/questions/54184707/warning-continue-targeting-switch-is-equivalent-to-break-did-you-mean-to-u

 

 Error while exporting excel from FAHP online system:

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /usr/share/php/OLE.php on line 319

sudo vim +319 /usr/share/php/OLE.php

Change "continue" to "continue 2" as follows:

  default:
#chiao, 2021-12-5               
#                continue;
                continue 2;

2021年11月28日 星期日

Phpmyadmin error: OpenDocument:group:OpenDocument/OpenOffice :group:OpenDocument/OpenOffice

 cf: 

Edit /usr/share/phpmyadmin/libraries/classes/Config/Form.php, add

protected function cleanGroupPaths(array $form): array
{
  foreach($form as &$name) {
      if (mb_strpos((string) $name, ‘:group:’) === 0) {
         $name = str_replace(‘/’, ‘-‘, $name);
     }
  }
  return $form;
}


public function loadForm($form_name, array $form)
{
  $this->name = $form_name;
  $form = $this->cleanGroupPaths($form);
  $this->readFormPaths($form);
  $this->readTypes();


phpmyadmin using zip to export database

  1. Edit php.ini, set zlib.output_compression = On
  2. sudo apt install php7.4-zip

2021年11月27日 星期六

.htaccess: Options not allowed here

cf: https://serverfault.com/questions/680563/apache-2-4-9-on-debian-7-8-htaccess-options-not-allowed

Edit /etc/apache2/mods-enabled/userdir.conf, change the line

AllowOverride FileInfo AuthConfig Limit Indexes
to
AllowOverride FileInfo AuthConfig Limit Indexes Options
  

 

Cannpt login as mysql user root from normal user account

 cf: https://askubuntu.com/questions/766334/cant-login-as-mysql-user-root-from-normal-user-account-in-ubuntu-16-04


$ sudo mysql -u root
mysql> DROP USER 'root'@'localhost';
mysql> CREATE USER 'root'@'localhost' IDENTIFIED BY '<root_password>';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION; 
mysql> FLUSH PRIVILEGES;
 
In above, One replace 'root' e.g. with 'chiao' to create the a mysql user as root.  

2021年11月25日 星期四

Unexpected 'new' (T_NEW) in /usr/share/php/Spreadsheet/Excel/Writer/Workbook.php

cf: https://stackoverflow.com/questions/45057005/when-i-am-trying-to-export-excel-file-in-php-7-same-code-is-working-in-php5

Because Error msg:
Parse error: syntax error, unexpected 'new' (T_NEW) in /usr/share/php/Spreadsheet/Excel/Writer/Workbook.php on line 180

Edit the line 180 as:

#        $this->_parser           =& new Spreadsheet_Excel_Writer_Parser($this->_byte_order, $this->_BIFF_version);
        $this->_parser           =new Spreadsheet_Excel_Writer_Parser($this->_byte_order, $this->_BIFF_version);

And line 194 as:

#        $this->_tmp_format       =& new Spreadsheet_Excel_Writer_Format($this->_BIFF_version);
        $this->_tmp_format       =new Spreadsheet_Excel_Writer_Format($this->_BIFF_version);
 

2021年11月7日 星期日

Clone drupal9 to pi4

  1. The source directory chiao@pi4:~/public_html/drupal9 does not need to be changed.
  2. Export drupal database from kpci7 as sql source file from here.
  3. Save the sql as drupal_kpci72004_20211108.sql
  4. sed 's/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g' drupal_kpci72004_20211108.sql > drupal_kpci72004_20211108_update.sql
  5. Import drupal_kpci72004_20211108_update.sql to pi4 MySQL database (by phpmyadmin):
    1. Clone drupal database in pi4 as drupal_pi4_20211108
    2. Drop drupal database in pi4
    3. Import drupal_kpci72004_20211108_update.sql
  6.  Done.
  1. 下載 clonzilla zip 檔.
  2. 在USB上產生FAT32分割區(至少 200 MB) "mkfs.vfat -F 32 /dev/sdd1"
  3. mount /dev/sdd1 /media/usb
  4. 解壓縮檔案, 如: "unzip clonezilla-live-2.7.3-19-amd64.zip -d /media/usb/"
  5. 讓 USB 裝置可開機:
       cd /media/usb/utils/linux
       sudo bash makeboot.sh /dev/sdd

2021年11月5日 星期五

Power off unplug usb disk drive

sudo udisks --detach /dev/sdb

2021年10月27日 星期三

Exclude subdirectories or directories using tar

 Do not add the "/" at the end of the subdirectory which is to be excluded.

For example, the following line will NOT exclude the subdirectory: 

tar --one-file-system --exclude=/home/chiao/.local/share/Trash/  -cvf test_Trash.tar /home/chiao

Instead, it should be like this:

tar --one-file-system --exclude=/home/chiao/.local/share/Trash  -cvf test_Trash.tar /home/chiao

No / at the end of --exclude option.

2021年9月21日 星期二

float.sty multirow.sty not found

 sudo apt install texlive-latex-recommended

 sudo apt install texlive-latex-extra

 

2021年9月4日 星期六

double tilde in ceurart latex class

 cf: https://tex.stackexchange.com/questions/512516/pdfx-problem-with-double-tilde


Add the lines in preamble:

\makeatletter
\AtBeginDocument{\let\mathaccentV\AMS@mathaccentV}
\makeatother
 

 

2021年8月5日 星期四

Add Reference to Table of Contents


Add this line to the Reference: 

\addcontentsline{toc}{section}{Reference}

2021年7月29日 星期四

Speed Up macOS on vmware

 https://www.geekrar.com/speed-up-macos-mojave-on-virtual-machine/

usb 3.1 gen 1 gen2 ... etc.

 cf: https://www.kingston.com/tw/usb-flash-drives/usb-30


USB 3.1 Gen 1 與 USB 3.1 Gen 2 之比較

USB 3.1 Gen 1 及 USB 3.1 Gen 2 僅在速度上有所不同。USB 3.1 Gen 1 支援高達 5Gbit/s 的速度,而 USB 3.1 Gen 2 支援高達 10Gbit/s 的速度。USB-IF 打算使用不同名稱來稱呼 USB 3.1 Gen 1 和 USB 3.1 Gen 2,以便產品行銷。
他們想要將 USB 3.1 Gen 1 及 Gen 2 分別命名為「SuperSpeed USB」及「SuperSpeed USB+」,但業界並不買單。通常,OEMs 會對其規格表新增 5Gbps 或 10Gbps 的速度,以便在兩個 USB 標準之間作出區隔。業界其他公司則稱呼它們為「USB 3.1 Gen 1」或「USB 3.1 Gen 2」。

 
 
USB 3.2 面世

自此之後,USB 技術便突飛猛進,在 2017 年隆重推出 USB 3.2。USB 3.2 有四類,分別具有不同名稱及意義。四類USB 3.2:


USB 3.2
Gen 1x1

USB 3.2
Gen 1x2

USB 3.2
Gen 2x1

USB 3.2
Gen 2x2

傳輸速度 5Gbps 10Gbps 10Gbps 20Gbps
先前名為

USB 3.1 Gen 1
及 USB 3.0

-- USB 3.1 Gen 2 --
介面選項

USB-A、 USB-C、
microUSB

僅限 USB-C

USB-A、 USB-C、
microUSB

僅限 USB-C


 

2021年7月10日 星期六

Hide mounted drive unity launch bar

Open dconf-editor, and navigate to the org > gnome shell > extensions > dash-to-dock page, switching the show-mounts toggle to the off position

2021年6月19日 星期六

vmware 3d acceleration

 Add this line to .vmx file:

mks.gl.allowBlacklistedDrivers = "TRUE"

2021年6月9日 星期三

Create desktop url link on gnome

  1. Create file 士林區鄉鎮預報.desktop in /home/chiao/桌面/ contains:
    [Desktop Entry]
    Type=Application
    Terminal=False
    Name=士林區鄉鎮預報
    Icon=/usr/share/icons/hicolor/48x48/apps/firefox.png
    Exec=firefox http://www.cwb.gov.tw/V8/C/W/Town/Town.html?TID=6301100
    Categories=Application;
  2. Right click icon "士林區鄉鎮預報", turn on "允許啟動"
  3. Done

2021年6月8日 星期二

unzip encoding for big5

 unzip -I big-5 hw_157261.zip

 

2021年6月6日 星期日

bold math in beamer

 Add this to the preample:

\usefonttheme{professionalfonts}
 

2021年6月4日 星期五

unzip without folders (directories)

  1.  Download 7z-exe: https://www.7-zip.org/
  2.  Get into cmd window
  3. cd Z:\Classes\109year\Semester2\Calculus\B\HW\HW7
  4. md files
  5. "C:\Program Files\7-Zip\7z.exe" e -ofiles hw_157264.zip

2021年5月24日 星期一

plot linestyle legend fontsize

The following octave commands:

plot(x,[ymat(:,[1,2,4])],{"k-.","k-","k:"},"linewidth", 2)
set(gca,'fontsize',26)
axis([1,6,-20000, 120000])
title(['Health People with minimum t-norm for dpercent=0.05'])  
xlabel('time interval (month)')
ylabel('People (in thousands)') 
yticklabels({"-20","0","20","40","60","80","100","120"})
legend ({"upper bound", "modal value", "lower bound" }, "location", "northeast")
grid on

produce the graph:



2021年4月18日 星期日

[SOLVED] Add nic for creating a subset, dns cannot works,networkmanager priority

sudo mv /etc/resolv.conf /etc/resolve.conf_orig
sudo ln -s /run/resolvconf/resolv.conf /etc/
 
 
The solution for me is to set the network interface priority by setting the metric. 

Edit 網路連線 -> 有線連線2 -> IPv4 -> 路由(R)…,設定度量(Metric)為 99999 :

route -n shows:

chiao@kpchiao9600k:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.50.1    0.0.0.0         UG    101    0        0 eno1
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 enp3s0
192.168.0.0     0.0.0.0         255.255.255.0   U     100    0        0 enp3s0
192.168.0.0     192.168.0.1     255.255.255.0   UG    99999  0        0 enp3s0
192.168.50.0    0.0.0.0         255.255.255.0   U     101    0        0 eno1
192.168.51.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet1
192.168.188.0   0.0.0.0         255.255.255.0   U     0      0        0 vmnet8

2021年4月17日 星期六

ubuntu 18.04 /usr/lib/grub/i386-pc/modinfo.sh doesn't exist

I suspect this is caused by the wrong grub-install. So I do this:
apt purge grub-efi
apt purge grub2-common
 
Make sure grub-instal not exist:
ls  /usr/sbin/grub-instal
bash: /usr/sbin/grub-install: 沒有此一檔案或目錄


2021年4月13日 星期二

drupal error: Type Error: Argument 1 passed to Symfony\Component\HttpFoundation\ParameterBag::replace() must be of the type array,

 https://www.drupal.org/forum/support/installing-drupal/2020-12-06/unable-to-start-drupal-9-webpage-on-server

  1. Open settings.php (/sites/default/settings.php) in any plain text editor. Add this line to the end of the file and save it:

    $settings['rebuild_access'] = TRUE;
  2. Visit http://www.example.com/core/rebuild.php in your browser (where www.example.com is your site’s URL). After a short pause, you should be redirected to the home page of your site, and the cache should be rebuilt.
  3. Open settings.php (/sites/default/settings.php) in a text editor. Find the line you added with $settings[rebuild_access], remove this line, and save the file.

 

Import sql error utf8mb4_0900_ai_ci

 https://pixelthis.gr/content/1273-unknown-collation-utf8mb40900aici

sed -i '' 's/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g' db.sql 

2021年4月11日 星期日

System Dynamics

cf: /home/chiao/Fuzzy/Literature/SystemDynamics/15-988-fall-1998-spring-1999/contents/readings/teachers.pdf
 
  The level is an accumulation, or integration, or stock, to choose terminology from different fields. The rate is a flow that changes the amount in the level. The rate is defined by a “policy” statement that tells how the rate is controlled by the value of the level in comparison to a goal. All systems, everywhere, consist of these two kinds of concepts --levels and rates--and none other. 

 

Water in a bathtub is a level, the flow of water is the rate that changes the level. A person’s reputation is a level that is changed by the flow of good and bad actions by that person. The degree of frustration in a group is a level that gradually changes in response to surrounding pressures. 
At the point where a rate of flow is being determined, the condition of the system, as indicated by the values of the levels, is compared with a goal to determine control of the flow.  
 
 
A stock is the term for any entity that accumulates or depletes over time. A flow is the rate of change in a stock. 

網誌存檔