Skip to content

Zeroplex 生活隨筆

軟體開發、伺服器和生活瑣事

小 縮小字型大小。 中 重設字型大小。 大 放大字型大小。

Alias Command Contains Spaces in Bash

Posted on 2013 年 7 月 9 日2021 年 3 月 12 日 By 日落 在〈Alias Command Contains Spaces in Bash〉中尚無留言

.bashrc 下設定 command alias 的方法是:

alias svm='svn'   # 我常常手殘

不過假設要 alias 的指令包含空白,如「svn commit」要 alias 成「svn commit –editor-cmd vim」,就得靠自訂 function 了。

新增一個 function 蓋掉原本的 svn 指令,如果 svn 後接的參數是 commit,便加上 –editor-cmd:

svn(){
   if [[ $@ == commit ]]; then
      command svn commit --editor-cmd vim
   else
      command svn "$@"
   fi
}

不過 svn commit 有時還會有其他參數,像是檔案路徑等,所以這樣寫還是會發生意外。要把參數判斷要改,順便在執行指令的時候把參數也塞回去:

svn(){
   if [[ $@ == commit* ]] || [[ $@ == ci* ]]; then
      command svn "$@" --editor-cmd vim
   else
      command svn "$@"
   fi
}
Tags:Bash, Linux

Google Reader Bye

Posted on 2013 年 7 月 3 日2021 年 3 月 12 日 By 日落 在〈Google Reader Bye〉中尚無留言
Google Reader Bye

Google Reader 停止服務,這才發現 RSS Reader 在生活中也是不可或缺的一部分。

從收到停止服務的消息以後,開始尋覓還有什麼服務可以用。試了 Fleedly、Bloglines 等,最後還是選 The Old Reader,畢竟能留有原來的 rss 分類,快速鍵也和 Google Reader 一樣,不需要再花什麼時間去適應。

Tags:生活雜記

Firefox PPA on Ubuntu 12.04

Posted on 2013 年 7 月 1 日2021 年 3 月 12 日 By 日落 在〈Firefox PPA on Ubuntu 12.04〉中尚無留言

Mozilla 官方 PPA:

sudo add-apt-repository ppa:mozillateam/firefox-next
sudo aptitude update
sudo aptitude install firefox  # or aptitude update
Tags:Firefox, Ubuntu

修改 Ubuntu 12.04 登入畫面背景圖片

Posted on 2013 年 6 月 29 日2021 年 3 月 12 日 By 日落 在〈修改 Ubuntu 12.04 登入畫面背景圖片〉中尚無留言

開啟 /usr/share/glib-2.0/schemas/com.canonical.unity-greeter.gschema.xml,並找到「com.canonical.unity-greeter」,將 key「background」改成新的圖片路徑:

<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="unity-greeter">
  <schema id="com.canonical.unity-greeter" path="/com/canonical/unity-greeter/">
    <key name="background" type="s">
      <default>'/usr/share/backgrounds/warty-final-ubuntu.png'</default>
      <summary>Background file to use, either an image path or a color (e.g. #772953)</summary>
    </key>

將設定值重新編譯:

cd /usr/share/glib-2.0/schemas/
sudo glib-compile-schemas .
Tags:Linux, Ubuntu

Vim 編譯參數

Posted on 2013 年 6 月 25 日2021 年 3 月 12 日 By 日落 在〈Vim 編譯參數〉中尚無留言

Vim configure 時預設不會支援 multi-byte,若要讓 vim 支援需設定參數 –with-features=big (或 huge) 及 –enable-multibyte:

./configure --prefix=/usr/ --with-tlib=ncurses --with-features=big --enable-multibyte
Tags:Vim

文章分頁

上一頁 1 ... 117 118 119 ... 318 下一頁

其他

關於我  (About me)

  文章 RSS Feed

  留言 RSS Feed

Apache AWS Bash C/C++ Docker FreeBSD GCP Git Google Java JavaScript Laravel Linux Microsoft MSSQL MySQL Nginx PHP PHPUnit PostgreSQL Python Qt Ubuntu Unix Vim Web Windows WordPress XD 作業系統 分享 好站推薦 專題 攝影 新奇搞笑 新聞 旅遊 生活雜記 程式設計 網路架站 網頁設計 資訊學習 資訊安全 遊戲 音樂


創用 CC 授權條款
本著作係採用創用 CC 姓名標示-相同方式分享 4.0 國際 授權條款授權.