Ubuntu 管理心得

搜尋此網誌

2020年4月29日 星期三

Thunderbird AU calendar not working and not shown

Delete the 'AU' calender, and create it again.

2020年4月15日 星期三

drupal 批次設定使用者角色 (role)






然後在「動作」中點選「Add the QuantitativeMethods role to the selected user(s)

2020年3月17日 星期二

Pulse Secure installation

  1. Download the Pulse Secure client:
    https://its.wpi.edu/software/259/pulse-secure
    https://drive.narlabs.org.tw/navigate/s/6C30CA2A0C7A47E48C2D4034C4A55630GUY
    Pulse Secure Installer (Linux 64-bit)Ubuntu

  2. sudo dpkg --install pulse-9.1R3.x86_64.deb
  3. sudo apt-get install libwebkitgtk-1.0-0
  4. sudo apt-get install libproxy1-plugin-webkit
  5. /usr/local/pulse/pulseUi
  6. Add new connection for AU using URL:
    https://au.twaren.net/au/staff

2020年2月28日 星期五

replace xz with 7z with password

#!/bin/bash

for i in /BACKUP/kpchiao9600k/20200225_Ubuntu_18.04.4_LTS/*; do
    xzcat $i | 7z a -mx=9 -mmt=4 -p -si "$(basename "$i" .tar.xz)_pwd_bsun.tar.7z"
done
#
# Decompress with the following command followed by the password.
#   7z x -so boot_efi_2020_02_25_pwd_bsun.tar.7z | tar tvf -
# Just key in the password, no prompt will be shown.

2020年2月27日 星期四

setup permission for mysqldump


  1. Create ~/.my.cnf, add these lines:
    [mysqldump]
    user=student
    password=student
    chmod 0600 ~/.my.cnf
  2. Inside phpmyadmin, set 'Select' and 'LOCK TABLES' permission to database 'drupal' for 'student' as the following image:


  3. Then, dump drupal with the command without username and password:
     mysqldump drupal > kpchiao9600k_drupal.sql
    or
     mysqldump -B drupal > kpchiao9600k_drupal.sql
    The -B option will add the create database and use datatebase lines into dump file as:
    CREATE DATABASE /*!32312 IF NOT EXISTS*/ `drupal` /*!40100 DEFAULT CHARACTER SET latin1 */;

    USE `drupal`;





2020年2月14日 星期五

2020年2月12日 星期三

Install nvidia driver ubuntu

  1. ubuntu-drivers devices
    e.g. nvidia-driver-435 - distro non-free recommended
  2. sudo ubuntu-drivers autoinstall or

    sudo ubuntu-drivers nvidia-driver-435 

  3. reboot 

2020年2月9日 星期日

mysql installation on ubuntu 18.04

  1. sudo apt update
  2. sudo apt install mysql-server
  3. sudo mysql_secure_installation
  4. sudo mysql, then issue the command: SELECT user,authentication_string,plugin,host FROM mysql.user;
Originally, the root user is authenticated with the "auth_socket" plugin.
To configure the root account to authenticate with a password,
run the following ALTER USER command.
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
 
Replacing the 'password' with a new strong password. 
Note that this command will change the root password you set in Step 2. 

2020年1月19日 星期日

Catalina on Virtualbox installation

cf: https://techsviewer.com/install-macos-10-15-catalina-on-virtualbox-on-windows-pc/

These codes are critical. Issue  these lines in user account (chiao) not sudo.
Code for VirtualBox (New): 
Note: replace "Your VM Name" in this commands line with your Virtual Machine Name in step 3, then type in the following code:
  • cd "C:\Program Files\Oracle\VirtualBox\"
  • VBoxManage modifyvm "Your VM Name" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
  • VBoxManage setextradata "Your VM Name" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
  • VBoxManage setextradata "Your VM Name" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
  • VBoxManage setextradata "Your VM Name" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
  • VBoxManage setextradata "Your VM Name" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
  • VBoxManage setextradata "Your VM Name" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1

Change the screen size (e.g. 1440x900):
VBoxManage setextradata  "Your VM Name" VBoxInternal2/EfiGraphicsResolution 1440x900

2020年1月11日 星期六

screen useful commands

Screen commands

 create new window C-a c
rename current window C-a A
see window list C-a " (allows you to select a window to change to)  

split display horizontally C-a S
split display vertically C-a | or C-a V (for the vanilla vertical screen patch)
jump to next display region C-a tab
remove current region C-a X
remove all regions but the current one C-a Q


Scrollback-buffer

In copy mode, one can navigate the scrollback buffer in various ways:
half page up C-u half page down C-d
back C-b forward C-f
cursor left/down/up/right h/j/k/l

2020年1月3日 星期五

vmware mac OS Catalina installation

cf from: https://techsviewer.com/how-to-install-macos-10-15-catalina-on-vmware-on-windows-pc/

  1. update vmware wordkstation to 15.5.1
  2. download unlocker 3.0.3, VERY IMPORTANT!, Edit lnx-install.sh,
    Change the lines inside of lnx-install.sh from 'python gettools.py' to 'python3.7  gettools.py
  3.  Create new guest : Select Guest Operation System: Apple OS X -> macOS 10.15
  4.  After get into guest, then power off, close vmware workstation
  5.  Edit vmx file: insert smc.version = "0" 
  6. Open guest and click Options tab, Guest Operating System  change  to Microsoft Windows and Version to Windows 10 x64
  7.  Power on guest, get into the page: macOS 工具程式,select:
  8. click it, then
  9. Then erase it and format as Mac OS 擴充格式 (日誌式)
    click 清除.

  10. Back into macOS 工具程式,then 安裝 macOS
  11. Wait ... couple of hours !
  12. After installation is ok, change Guest OS back to "macOS 10.15"

2020年1月2日 星期四

clone grade database

Clone from  kpci7:
mysqldump -u chiao -h localhost  -p grade_108_1 > grade_108_1_20200103.sql

to kpchiaoi5:
mysql -u chiao -p grade_108_1 < grade_108_1_20200103.sql



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

網誌存檔