2018年2月26日

ubuntu (mint 18) 安裝字形

在 home 目錄下建立一個,  ./font 的子目錄,然後將你自已要用的字型檔放在裡面,登出再登入即可生效。
或者直接在 terminal 下個指令,可立即生效
 
接著下 fc-cache -v
  
==或參考以下== 
https://ithelp.ithome.com.tw/questions/10144653

先以root 身份登入,cd到 /usr/share/fonts
建立一個目錄,假設是 myfonts
然後將想要安裝的字型 cp 到 /usr/share/fonts/myfonts/ 底下.
接著下 fc-cache -v /usr/share/fonts/myfonts
就會安裝.
可以用 fc-list 看看系統已經安裝哪些字型.

2018年2月8日

Mint 18a 發生錯誤 (待解決)

==2018/2/15==
$ inxi -r
Repos:     Active apt sources in file: /etc/apt/sources.list.d/official-package-repositories.list
           deb http://free.nchc.org.tw/linuxmint/packages sonya main upstream import backport
           deb http://ftp.nsysu.edu.tw/Ubuntu/ubuntu xenial main restricted universe multiverse
           deb http://ftp.nsysu.edu.tw/Ubuntu/ubuntu xenial-updates main restricted universe multiverse
           deb http://ftp.nsysu.edu.tw/Ubuntu/ubuntu xenial-backports main restricted universe multiverse
           deb http://security.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
           deb http://archive.canonical.com/ubuntu/ xenial partner
 

$ inxi -Fxz
System:    Host: min18a Kernel: 4.8.0-53-generic x86_64 (64 bit gcc: 5.4.0) Desktop: Xfce 4.12.3 (Gtk 2.24.28)
           Distro: Linux Mint 18.2 Sonya
Machine:   Mobo: ASUSTeK model: M4A785T-M v: Rev X.0x Bios: American Megatrends v: 0801 date: 10/14/2009
CPU:       Quad core AMD Phenom II X4 945 (-MCP-) cache: 2048 KB
           flags: (lm nx sse sse2 sse3 sse4a svm) bmips: 24108
           clock speeds: max: 3000 MHz 1: 800 MHz 2: 800 MHz 3: 2300 MHz 4: 800 MHz
Graphics:  Card: Advanced Micro Devices [AMD/ATI] RS880 [Radeon HD 4200] bus-ID: 01:05.0
           Display Server: X.Org 1.18.4 drivers: ati,radeon (unloaded: fbdev,vesa) Resolution: 1280x1024@60.02hz
           GLX Renderer: AMD RS880 (DRM 2.46.0 / 4.8.0-53-generic, LLVM 5.0.0)
           GLX Version: 3.0 Mesa 17.2.4 Direct Rendering: Yes
Audio:     Card-1 Advanced Micro Devices [AMD/ATI] RS880 HDMI Audio [Radeon HD 4200 Series]
           driver: snd_hda_intel bus-ID: 01:05.1
           Card-2 Advanced Micro Devices [AMD/ATI] SBx00 Azalia (Intel HDA) driver: snd_hda_intel bus-ID: 00:14.2
           Sound: Advanced Linux Sound Architecture v: k4.8.0-53-generic
Network:   Card-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
           driver: r8169 v: 2.3LK-NAPI port: e800 bus-ID: 02:00.0
           IF: enp2s0 state: down mac:
           Card-2: Ralink RT2501/RT2573 Wireless Adapter driver: rt73usb v: 2.3.0 usb-ID: 001-003
           IF: wlx00106017f645 state: N/A mac: N/A
Drives:    HDD Total Size: 1671.9GB (67.7% used) ID-1: /dev/sda model: WDC_WD6400AADS size: 640.1GB temp: 41C
           ID-2: USB /dev/sdb model: Transcend size: 1000.2GB temp: 0C
           ID-3: USB /dev/sdc model: Transcend_32GB size: 31.6GB temp: 0C
Partition: ID-1: / size: 127G used: 51G (42%) fs: ext4 dev: /dev/sda5
           ID-2: swap-1 size: 9.13GB used: 0.05GB (1%) fs: swap dev: /dev/sda6
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 42.0C mobo: 45.0C
           Fan Speeds (in rpm): cpu: 3096 psu: 0 sys-1: 0
Info:      Processes: 224 Uptime: 4 days Memory: 1832.8/7730.8MB Init: systemd runlevel: 5 Gcc sys: 5.4.0
           Client: Shell (bash 4.3.481) inxi: 2.2.35


==2018/2/8==

(讀取資料庫 ... 目前共安裝了 212536 個檔案和目錄。)
準備解開 .../libminiupnpc10_1.9.20140610-2ubuntu2.16.04.2_amd64.deb ...
Unpacking libminiupnpc10:amd64 (1.9.20140610-2ubuntu2.16.04.2) over (1.9.20140610-2ubuntu2.16.04.1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
設定 initramfs-tools (0.122ubuntu8.10) ...
update-initramfs: deferring update (trigger activated)
設定 libminiupnpc10:amd64 (1.9.20140610-2ubuntu2.16.04.2) ...
Processing triggers for initramfs-tools (0.122ubuntu8.10) ...
update-initramfs: Generating /boot/initrd.img-4.8.0-53-generic
cp: 無法 stat '/usr/share/initramfs-tools/scripts/casper-functions': 沒有此一檔案或目錄
E: /usr/share/initramfs-tools/hooks/casper failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.8.0-53-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 子程序 已安裝的 post-installation script 傳回了錯誤退出狀態 1
Processing triggers for libc-bin (2.23-0ubuntu10) ...
處理時發生錯誤:
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
套件安裝失敗。正嘗試恢復:
設定 initramfs-tools (0.122ubuntu8.10) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.122ubuntu8.10) ...
update-initramfs: Generating /boot/initrd.img-4.8.0-53-generic
cp: 無法 stat '/usr/share/initramfs-tools/scripts/casper-functions': 沒有此一檔案或目錄
E: /usr/share/initramfs-tools/hooks/casper failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.8.0-53-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 子程序 已安裝的 post-installation script 傳回了錯誤退出狀態 1

2018年2月4日

git 的使用

cd gretl-git

#先從遠端 server 更新
git pull

# 在本地產生一個分支,例如叫做 m1
git branch m1

# 切換到 m1 這個分支去編輯
git checkout m1

# 把要更新的檔放進 gretl-git 目錄之後,再用 git add 新增
git add zh_TW.po

# 再確認,並寫下註解在引號中 "...."
git commit -m "for 2018a v1"

# 最後上傳已變更的分支到 server
git push --set-upstream origin m1

==其它的相關指令==
# 看自己有權更新的 repo
git remote -v

# 查看目前狀態
git status

(出現回應如下)
On branch m1
Your branch is up-to-date with 'origin/m1'.
Untracked files:
  (use "git add ..." to include in what will be committed)

    LINGUAS
    Makefile.in.in

...(以下略)

# 查歷史紀錄
git log

==以下的都亂試沒懂==
cd gretl-git
git pull
cd po
git commit zh_TW.po
git push

git add zh_TW.po
git commit -a -m 'Initial commit'
git add
git reset --soft HEAD^
git add zh_TW.po
git commit -a -m 'Initial commit'
remote add origin ssh://USER@git.code.sf.net/u/USER/gretl
git push -u origin master
git commit zh_TW.po
git commit zh_TW.po
git commit ./po/zh_TW.po
git remote add origin ssh://USER@git.code.sf.net/u/USER/gretl
git push -u origin master



==git 2.0 之後有些變動==
我選擇設成 simple

$ git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master