Ubuntu 管理心得

搜尋此網誌

2019年12月29日 星期日

install gd fro php

sudo apt install php-gd
sudo systemctl restart apache2

2019年12月28日 星期六

drupal clean url not working

sudo a2enmod rewrite
sudo systemctl restart apache2

If drupal cannot work after cloning, then ... try this

Some error messages:

Error: Class 'DOMDocument' not found in Drupal\Component\Utility\Html::load() (line 286 of core/lib/Drupal/Component/Utility/Html.php)

sudo apt-get install php-xml
sudo systemctl restart apache2
 

Using root login mysql with password

sudo mysql
ALTER USER 'root'@'localhost%' IDENTIFIED WITH mysql_native_password BY 'your-password';
FLUSH PRIVILEGES;
exit;
 

2019年12月6日 星期五

cwtex with bkai and bsmi fonts

LyX source file
LaTeX source file

\documentclass{extarticle}
\renewcommand{\familydefault}{\rmdefault}
\usepackage[T1]{fontenc}
\usepackage{CJKutf8}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=0.75in,bmargin=0.75in,lmargin=0.75in,rmargin=0.75in}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage[authoryear]{natbib}
\begin{document}
\begin{CJK}{UTF8}{}%

\section{\CJKencfamily{UTF8}{bkai}

}


\CJKencfamily{UTF8}{bsmi}這是本文

{\Huge{}這是本文(最大字)}{\Huge\par}
\end{CJK}

\end{document}

2019年12月5日 星期四

cwfsu61 trouble solved!

Do not use 
\CJKencfamily{UTF8}{cwfsu}
use
\CJKencfamily{UTF8}{cwfsc}

Also, inside text contents use
\CJKencfamily{UTF8}{cwkc}

2019年11月5日 星期二

Wireless wakeup on lan

For my hp pavilion gaming 15 notebook:

iw phy0 wowlan show
sudo iw phy0 wowlan  enable magic-packet disconnect
iw phy0 wowlan show

2019年10月11日 星期五

2019年10月8日 星期二

Prevent break in inline math

Put the \nolinebreak in the place for not allowing line break, e.g.

 
\titi c=\titi a\oplus_{T_{p}^{\text{Y}}}\nolinebreak\titi b


2019年9月5日 星期四

MIssing glyphs




The following error while latexing (lyxing) may be caused by 文中有簡體字。例如:
"専案管理" 與 "專案管理", 前一個専是簡體,所以一直出現下列錯誤。

2019年9月1日 星期日

compiz put windows and other settings when not working

  1. Get into ccsm, 
  2. goto  偏好設定 -> 外掛清單,
  3. unclick  外掛程式自動排序
  4. 啟用的外掛 
  5. click "place"
  6. click "向上" on the bottom
  7. all the way to the top, then maybe stop at "regex"
     
  8. click  外掛程式自動排序 back
  9. 返回 on the lower left
  10. goto 視窗管理
  11. get into 放置視窗 and then change the way what you want
  12. Done. 

2019年8月20日 星期二

Switch monitor with xrandr command line

Set viewsonic as main, then hp:
xrandr --auto --output eDP-1 --mode 1920x1080 --right-of HDMI-1-2

Set hp as main, then viewsonic:
xrandr --auto --output HDMI-1-2 --mode 1920x1080 --right-of eDP-1

Turn off hp:
xrandr --auto --output eDP-1 --off  --right-of HDMI-1-2

Turn off viewsonic:
xrandr --auto --output HDMI-1-2 --off  --right-of eDP-1



2019年8月19日 星期一

setup nvidia for hp pavilion gaming 15


  1. Reboot
  2. F10 enter BIOS
  3. System Configureation -> power -> Security Boot
  4. disable 
  5. Follow the screen message, enter 4-digit then press enter
  6. boot into ubuntu
  7. sudo apt purge nvidia* 
  8. sudo apt update
  9. sudo apt-add-repository ppa:graphics-drivers/ppa
  10. Run 額外驅動程式,click Nvidia-430
  11. Reboot

2019年8月17日 星期六

software-properties-gtk no working 無: 套件庫 額外驅動程式

cf: https://askubuntu.com/questions/789966/software-updates-crashes-and-will-not-open
Reinstall with this line:
sudo aptitude reinstall apt apt-utils aptdaemon aptdaemon-data update-manager update-manager-core dbus

2019年8月16日 星期五

accented european letter in bibtex

{\"a} {\^e} {\`i} {\.I} {\o} {\'u} {\aa} {\c c} {\u g} {\l} {\~n} {\H o} {\v r} {\ss}

enter image description here

2019年8月11日 星期日

Enable HP Pavilion HDMI for Ubuntu

  1. 額外的驅動程式,click 430
  2. 輸入 security password
  3. reboot
  4. enroll emks ( something like this ?),  DO NOT just click continue, Have to enroll first !
  5. reboot
  6. HDMI should be ok.
  7. check if the module is enabled by issuing:
    lsmod | grep nvidia
    or
    run nvidia-settings

2019年8月1日 星期四

Install operation system on SD fron linux


sudo dd bs=4M if=ubuntu-18.04.2-preinstalled-server-arm64+raspi3.img of=/dev/sdX status=progress conv=fsync

2019年7月29日 星期一

line 無鈴聲

設定 -> 提醒 -> 提醒鈴聲
換另一個鈴聲,例如: LINE (歡樂版),
關掉 line,再進入 line
就應該有聲音了。
可以再重覆一次,選回原來自已喜歡的鈴聲。
測試方式:
可開啟 Line 的提醒,打開在 PC 上的line,聽聽看手機上的line 有無聲音。

2019年7月26日 星期五

kicks

  1. 行車記錄器的記憶卡在駕駛座座位下方,把座位滑到最前面後可以從後座取出

Post setup raspbian

sudo apt install motion aptitude vim package-update-indicator incron krusader fcitx-table-boshiamy lynx screen
  • incron:
    edit /etc/incron.allow, add these:
     root
     pi
    incrontab -e , add this line:
     /home/pi/webcam/    IN_CREATE    /usr/bin/rclone copy /home/pi/webcam/*   mydropbox:webcam/FrontDoor

    sudo systemctl restart incron

setup motion in raspbian

  1. sudo apt install motion
  2. edit /etc/default/motion,
    start_motion_daemon=yes
  3. edit /etc/motion/motion.conf
    output_pictures on
    locate_motion_mode on
    picture_filename %Y%m%d/%H/%M%S-%q
    stream_localhost off
    stream_port 8081
    webcontrol_localhost off
    # stream_nrt 8081
    ffmpeg_output_movies off
  4. sudo systemctl restart motion

2019年7月22日 星期一

中文的"圖"、"表"

Put the followings into TeX box inside lyx, NOT in preample:


\renewcommand{\figurename}{圖}
\renewcommand{\tablename}{表}
also
\renewcommand{\theoremname}{定理}
\renewcommand{\definitionname}{定義}
\renewcommand{\corollaryname}{推論}
\renewcommand{\refname}{參考文獻}



2019年7月20日 星期六

Show footnote wtih visiable rule

Put this into preample:
\renewcommand\footnoterule{%
\kern -3pt
\hbox to \textwidth{\vrule height 0.4pt width \columnwidth}
\kern 2.6pt
}
will like this,

In my paper, /home/chiao/Fuzzy/Papers/2019/1107iFuzzy/Papers/ote_add.lyx
 

2019年7月13日 星期六

Capital letter in bibtex

In bib file, add {} for the word with first capital letter,
e.g.

title="Controllable Fuzziness of General Fuzzy Numbers Addition Based on {Yager} T-norms",

then the title in Reference will display the Yager rather than yager.

2019年7月3日 星期三

Reomve obsolete packages

The 'rc' status means the configuration files of the removed packages are not removed. Issue the following cli command to remove them.

sudo dpkg -l|grep "^rc"|awk '{print $2}' | xargs sudo apt-get remove -y --purge



2019年6月18日 星期二

my new word is in ehchant

This file,/home/chiao/.config/enchant/en_US.dic contains my new words from lyx.

2019年6月16日 星期日

Beamer allowframebreaks

In LyX: DO NOT put brackets around allowframebreaks,


2019年6月10日 星期一

Show filename on top bar (lyx, kate, ...)

「系統設定值」-> 「外觀」-> 「運作方式」->「選單可見度」,點選「滑鼠懸浮時顯示」

2019年6月9日 星期日

Set table column spacing

Put this in TeX box : \setlength{\tabcolsep}{1pt}, e.g.
The pdf result is



2019年6月4日 星期二

Beamer compile error

This is caused by my installation of old beamer in /home/chiao/texmf.

/bin/rm -rf /home/chiao/texmf/tex/latex/beamer
/bin/rm -rf /home/chiao/texmf/tex/latex/pgf
texhash /home/chiao/texmf

2019年6月2日 星期日

latex code to word , libreoffice

In LyX, export (匯出) "MS Word Office Open XML". Then open it in word.
In LyX, export (匯出) "OpenDocument (Pandoc)". Then open it in libreoffice.

2019年5月25日 星期六

Break the long in-line math

If the in-line math contains too long expression, e.g, parenthesis, just add an math space in between the equality and the left parenthesis. Then the line will be broke at the math space. The following graph is the lyx source:

Note that there is math space. The following is the pdf graph.

Or put  \allowbreak in the place for breaking line, e.g. 
The pdf output is

2019年3月25日 星期一

Copy drupal from kpchiaoi5 to kpci7

In kpchiai5:
  1. mysqldump -u drupaladmin -h localhost --skip-lock-tables -p drupal > drupal_20160826_kpchiaoi5.sql
  2. gzip -9 drupal_20160826_kpchiaoi5.sql
  3. sudo tar zcvf public_html_drupal_20160826_kpchiaoi5.tgz public_html/drupal

In kpci5:
  1. download from kpchiaoi5: drupal_20160826_kpchiaoi5.sql.gz, public_html_drupal_20160826_kpchiaoi5.tgz
  2. gzip -dc drupal_20160826_kpchiaoi5.sql.gz | sed -e '/^UNLOCK/d' -e '/^LOCK/d' > ~/a.sql
  3. Using phpmyadmin to drop all drupal tables.
  4. mysql -u drupaladmin -p drupal < ~/a.sql
  5. sudo tar zxvfp public_html_drupal_20160826_kpchiaoi5.tgz -C /home/chiao
  6. sudo chown -R www-data.www-data /home/chiao/public_html/drupal (IMPORTANT!!!!)
  7. 6. 設定 -> 開發 -> 效能 -> 清除所有快取

2019年3月24日 星期日

For drupal having “htaccess: Options not allowed here” error

Edit /etc/apache2/mods-available/userdir.conf, add Options in AllowOveride, namely,

AllowOverride FileInfo AuthConfig Limit Indexes Options

2019年3月15日 星期五

Prevent dash on the repeated author for IEEE bibliography

The following might not be work. Try my another blog:

https://kpchiaoo.blogspot.com/2019/07/bibtex-citation-with-author-for.html
  1. Put the following line inside bib file, @IEEEtranBSTCTL{IEEEexample:nodash,CTLdash_repeated_names = "no"}
  2. Put the TeX ERT inside lyx file contains
    \bstctlcite{IEEEexample:nodash}
  3. Make sure "nodash" in both files are the same
  4. Or edit IEEEtrans.bst, change # 1 to #0 as follows:
    % #0 turns off the "dashification" of repeated (i.e., identical to those
    % of the previous entry) names. The IEEE normally does this.
    % #1 enables
    FUNCTION {default.is.dash.repeated.names} { #1 }

2019年3月3日 星期日

icon too big in nautilus

dconf-editor->org->gnome->nautilus->icon-view->default-zoom-level

2019年3月2日 星期六

disable baloo

In user shell, rather than root or sudo:

balooctl status
balooctl disable

2019年3月1日 星期五

ssh without password

Let Client be A, and Server be B.
Then inisde A, run this line: ssh-keygen -t rsa
Press Enter 2 or 3 times. Then copy/append the contents in id_rsa.pub to B:$HOME/.ssh/authorized_keys2

Done!

2019年2月22日 星期五

build krusader

  1. sudo apt-get build-dep krusader
  2. git clone http://anongit.kde.org/krusader
  3. mkdir MyKrusader
  4. cd MyKrusader
  5. cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_C_FLAGS="-O2 -fPIC" -DCMAKE_CXX_FLAGS="-O2 -fPIC" 
  6. (NB, step 5 has .. )
  7. make
  8. sudo make install

2019年2月18日 星期一

wake on lan WOL windows 10

In control panel, uncheck the  快速啟動 option


setup HP-LaserJet PRo M15W

  1. Download latest driver from:  https://sourceforge.net/projects/hplip/files/hplip/
    e.g. hplip-3.19.1.run (as of 20190218)
  2. sudo hplip-3.19.1.run
  3.  Done!

2019年1月30日 星期三

IEEE keyword

Inside LaTeX box: \begin{IEEEkeywords}

My keyword 1, My keyword 2, My keyword  3... 
Inside LaTeX box: \end{IEEEkeywords}

2019年1月25日 星期五

Increase row height

Put this into LaTeX box (Ctrl-L) in front of table:
\setlength\extrarowheight{5pt} Or \renewcommand{\arraystretch}{1.5}
If the above not work, try add vphantom inside the table cell, e.g.
\vphantom{{ \displaystyle {\frac{1}{5}} }}
 
 


2019年1月24日 星期四

dash style

cf: /home/chiao/Fuzzy/Papers/2019/0623FUZZ-IEEE/papers/example/Matplotlib/exm.ipynb

#[8, 4, 6, 2] means: 8pt. line + 4pt. break + 6pt. line + 2pt. break ]
dstary=[[1,0],[8, 2],[5, 2], [3,2], [1,2]]
ax.plot(x, yL,label=labl,linewidth=2, dashes=dstary[1], color='black')

2019年1月3日 星期四

Plot several functions with differenet domains

Show[Plot[0.025` Sqrt[3156 - 1800 x + 225 x^2], {x, 5.4048, 6}],
 Plot[0.5339, {x, 6, 11}],
 Plot[\[Sqrt](30.091788404703134` - 4.696813600723558` x +
     0.18064667695090608` x^2), {x, 11, 11.4437}], PlotRange -> All]

網誌存檔