Ubuntu 管理心得

搜尋此網誌

2018年8月29日 星期三

setup gmail relay

cf: https://www.howtoforge.com/tutorial/configure-postfix-to-use-gmail-as-a-mail-relay/#debian-ubuntu
  1. edit /etc/postfix/sasl_passwd, add this line
    [smtp.gmail.com]:587 username@gmail.com:password 
  2. chmod 0400 /etc/postfix/sasl_passwd, 
  3. vi /etc/postfix/main.cf, add these lines:
    #relayhost = (uncomment this line)
    # chiao
    relayhost = [smtp.gmail.com]:587
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    smtp_sasl_security_options =
    smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
    smtp_use_tls = yes 
  4. postmap /etc/postfix/sasl_passwd 
  5. service postfix restart

2018年8月12日 星期日

xfig bad screen text fonts

If xfig screen fonts are bad, e.g.
then it needs do this:
sudo apt install gsfonts-x11
logout then login.
After installing gsfonts-x11, the xfig screen will look like this

2018年8月11日 星期六

Octave produce blank fig (xfig) file in ubuntu 18.04

I have a post in http://octave.1599824.n4.nabble.com/Cannot-produce-fig-file-td4687972.html#a4688009.

The reason why fig cannot be created is due to the bug in ghostscript 9.22.  
I found a solution (temporarily) in ubuntu 18.04. The steps are:
  1. Download the ghostscript 9.23  here
  2. Untar it at, say, /foo/.
  3. sudo mv /usr/bin/gs /usr/bin/gs_orig_922
  4. sudo ln -sf /download/Ghostscript/ghostscript-9.23-linux-x86_64/gs-923-linux-x86_64 /usr/bin/gs
  5. Done!

2018年8月8日 星期三

Convert vmdk for using in ESXi

The vmdk file, e.g, created in vmware workstation, cannot be directlt used in ESXi. It needs to be converted. The process is:
  1. Enable ssh connection in ESXi host.
  2. ssh to ESXi host, e.g. ssh -l root 192.168.1.110
  3. cd to the directory containing the vmdk file, e.g.
    cd /vmfs/volumes/62169753-c96da716/vmdk
  4. Suppose the vmdk file is ubuntu.vmdk, and let the converted vmdk filename be ubuntu_convert.vmdk. Then issue the command,
    vmkfstools -i ubuntu.vmdk ubuntu_convert.vmdk -d thin
  5. It will show something like:
    ...
    Clone: 100% done.
    It does not mean thee conversion is really finished. Just wait until the shell returns prompt, e.g. [root@chiao-dell:/vmfs/volumes/62169753-c96da716/vmdk]
  6. Usually, it will take couple of hours to finish for large file, YES! H.O.U.R.S. !
  7. If the datastore in on an nfs server, e.g. 192.168.1.8, then get into the nfs directory and use the following command to display the converted file size.
    ls -lsh ubunut_convert-flat.vmdk
    You will see something like this line:
    2.0G -rw------- 1 myuid mygid 510G  8月  8 16:27 ubuntu_convert-flat.vmdk
    Keep running this command, the size at the front is increasing. 

2018年8月6日 星期一

Delete backup files with tilde ~ suffix

Delete all backup files in pwd and sub-directories:

find ./ -name "*~" -delete
confirm to delete,
find ./ -name "*~" -ok rm {} \;


2018年8月5日 星期日

Prevent dash on the repeated author for IEEE bibliography-1

設定如下圖:
輸出如下圖:

complie lyx

sudo apt-get build-dep lyx
cd /download1/LyX/lyx-2.3.0
./configure --enable-qt5
make
make install

網誌存檔