顯示具有 suse 標籤的文章。 顯示所有文章
顯示具有 suse 標籤的文章。 顯示所有文章

2013-04-17

LINUX - 備份/還原 SUSE 的 crontab


把 crontab 備份到 /tmp/trully/crontab
crontab -l > /tmp/trully/crontab

由 /tmp/trully/crontab 還原 crontab
crontab /tmp/trully/crontab

2012-10-15

LINUX - 讓 error log 有顏色

example :
Util_Reporter::log(LOG_MARK."\033[1;31m LIGHT_RED \033[m !!!", LOG_PATH);
Util_Reporter::log(LOG_MARK."\033[1;32m LIGHT_GREEN \033[m !!!", LOG_PATH);
Util_Reporter::log(LOG_MARK."\033[1;34m LIGHT_BLUE \033[m !!!", LOG_PATH);
Util_Reporter::log(LOG_MARK."\033[1;33m YELLOW \033[m !!!", LOG_PATH);
Util_Reporter::log(LOG_MARK."\033[1;35m Light Purple \033[m !!!", LOG_PATH);
Util_Reporter::log(LOG_MARK."\033[1;36m Light Cyan \033[m !!!", LOG_PATH);
Util_Reporter::log(LOG_MARK."\033[1;37m WHITE \033[m !!!", LOG_PATH);

ref
http://chunchaichang.blogspot.tw/2011/07/printf.html
http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html

2012-10-14

LINUX - find 指令

example :
find . -name '*.webm'
find /home/www/nas/home8/upload_8 -name '*.mkv'

2012-08-28

LINUX - 使用 ffmpeg 在影片加上 padding

要解決「LINUX - 使用 ffmpeg 合併(連接)影片」裡的直/横影片問題
參考 youtube 的做法, 把直的影 scale 成横式的影片, 再利用 padding 的方式補上黑色的底

2012-08-17

LINUX - 利用 ffmpeg 與 MP4Box 將影片的聲音抽離

如題, 有時從 youtube 抓下來的 mv 影片我們只需要 audio 的部份,
要達成這個目的可以使用 ffmpegMP4Box 來做到

2012-08-16

LINUX - MediaInfo 使用筆記

mediainfo --help 的內容如下
--Inform=...  Specify a template (BETA)
Usage: "MediaInfo --Inform=[xxx;]Text FileName"

xxx can be: General, Video, Audio, Text, Chapter, Image, Menu
Text can be the template text, or a filename
     Filename must be in the form file://filename

See --Info-Parameters for available parameters in the text
(Parameters must be surrounded by "%" sign)

Example: "MediaInfo --Inform=Video;%AspectRatio% FileName"

Example: "MediaInfo --Inform=Video;file://Video.txt FileName"
and Video.txt contains 
"%DisplayAspectRatio%"        for Video Aspect Ratio.

Example: "MediaInfo --Inform=file://Text.txt FileName"
and Text.txt contains
"Video;%DisplayAspectRatio%"  for Video Aspect Ratio.
"Audio;%Format%"              for Audio Format.

2012-05-07

LINUX - shell 的字串取代

sample 1 :
# 將號嗎間的空白改由 @@ 取代, 這樣多筆才能順利傳進 php 裡
# MOBILES 是變數
argv=${MOBILES/ /@@}

sample 2 :
# 將號嗎間的空白改由 @@ 取代, 這樣多筆才能順利傳進 php 裡
# /home/MOBILE_CONFIG.sh 是一個 file
sed -e "s/@@/\ /g" /home/MOBILE_CONFIG.sh



LINUX - sudo 成 root 時, 也載入 profile 設定

as title
sudo -u root bash -l



2012-05-04

LINUX - 用 tail 顯示 log 的倒數 n 行

ex : 顯示 error.log 的倒數五行
tail -n 5 /home/logs/php/error.log


[options]
-c:--bytes=N 指定輸出檔案最後的 "N" 個字元組。
-n:--lines=N 指定輸出檔案最後 "N" 行。
-f:持續顯示檔案更新的資訊。
-q:--quiet, --silen 不輸出檔案名稱的訊息。
+n:從第n 行開始顯示到檔案結尾。


cf : http://blog.xuite.net/altohorn/linux/17259888




LINUX - 查看作業系統種類及 kernel

lsb_release -a