Bash alias 如何傳入參數($1)

Linux 的 Bash shell 會將常用的命令(或記不起來的命令)設定 alias,但是想要帶入參數,要怎麼做?

註:Bash shell 純 alias 無法帶入參數,在此使用 Bash shell 的 function 來輔助達成。

閱讀全文〈Bash alias 如何傳入參數($1)〉

微軟讓 SQL Server 於 Linux 運行

不得不說,微軟真的不一樣了。

想嚐鮮的可於此申請:SQL Server on Linux—Preview | Microsoft

目錄權限修改造成 Logrotate 失敗的修復步驟

Log (/var/log/apache2) 的資料夾權限變更,造成 Logrotate 的時候無法 rotation,錯誤訊息如下:

error: skipping "/var/log/apache2/access.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.

要如何修正此問題呢?

註:Logrotate 的權限一定是夠,所以不是權限不夠的問題。

閱讀全文〈目錄權限修改造成 Logrotate 失敗的修復步驟〉

使用 find 找出指定的檔案、目錄權限值

想要將目錄下的檔案、目錄做權限設定,可以參考此篇:使用 find 快速修改 目錄下的 檔案/目錄 權限

在此是想要反過來,找出目錄內有哪些權限數值是跟預想不同的。

閱讀全文〈使用 find 找出指定的檔案、目錄權限值〉

Linux 擷取圖片、抓畫面與快速編輯的程式 - Shutter

Ubuntu Linux 臨時想要將目前畫面抓下來、取得某區塊,並且圈區塊等等,可以考慮 Shutter。

  • 安裝:apt-get install shutter # shutter - feature-rich screenshot program

程式執行後,點選取區塊,選完區塊按 Enter 就會自動擷取圖片,ESC 就取消,也有類似小畫家的功能,功能還蠻簡單好用的,推薦使用。

註:純粹想抓畫面的話,可用內建的 gnome-screenshot 或直接按 Print Screen SysRq 的按鍵抓取。