Author Archives: cowman.chiang

FFMPEG:segment fromat add timestamp into filename option

原本只能輸出成 %4d.mp4 ==> 0000.mp4, 0001.mp4 要改成可以像行車紀錄器般的檔案格式 201405020248.mp4 增加 %t 的參數 ffmpeg -i input -f segment -segment_time 60 -reset_timestamps 1 %t.mp4 這邊將 %t.mp4 定義成 Webcam年日月/E年日月時分秒.mp4 strftime(buf1, sizeof(buf1), “WebCam%Y%m%d/E%Y%m%d%H%M%S”, localtime(&tv.tv_sec)); 修改方式如下: 修改 ffmpeg source / libavformat / utils.c 檔案 增加引用 #include <sys/time.h> … Continue reading

Posted in FFMpeg | Leave a comment

FFmpeg:Install in the Ubuntu 12.04

#!/bin/sh # # Name: ffmpeg git # Version: 0.01a # Description: ffmpeg git compilation with libvorbis, x264, mp3 lame support # Script_URI: http://www.techno-blog.net # # Author: Nikos ########################### ##### Run some checks ##### ########################### # Check if user is root … Continue reading

Posted in FFMpeg, Ubuntu | Leave a comment

Install Vim Plugin: YouCompleteMe in CentOS #1

前一篇文章安裝一直失敗,所以重裝了vim後再來試試看! 基本上準備動作跟前一篇失敗的安裝記錄一樣

Posted in Linux | Leave a comment

Upgrade Vim version to 7.4 (tar install)

前一篇文章將vim更新至7.4後不僅plugin安裝失敗,連syntax顏色都不見了 所以就來試試看另外用tar安裝的方式 (但應該只是BundleInstall沒有執行….,不過都移除重新安裝了就沒再試了)

Posted in Linux | Leave a comment

Install Vim Plugin: YouCompleteMe in CentOS

最近一則fb鬧得沸沸揚揚XD 主要是說我怎麼會用vim編輯php編了兩年… 然後就很多人開始提供說vim才是最好用的~因為有許多plugin可以用….Orz 現在就來安裝一下還蠻多人推的ycm

Posted in Linux | Leave a comment

Upgrade Vim version to 7.4

按照官網的說明 (連結),升級vim版本有點簡單 不過可以先檢查vim的版本,以免做白工了

Posted in Linux | Leave a comment

PHP Eclipse Editor

怒了, 還是來裝一下Editor好了 不然vim打得好累…… 參考蛙齋的作法1、蛙齋的作法2 先到官網下載Eclipse軟體安裝後,利用help=>install new software找到『Web, XML, Java EE and OSGi Enterprise Development』項目 在此項目下就可以看到php的相關plugin 然後再安裝rse,主要是可以讓eclipse支援remote操作(ftp、ssh等) rse主要在General Purpose Tools下,需要安裝『Remote System Explorer End-User Runtime、Remote System Explorer User Actions』這兩個 安裝完後便可以利用『Remote System Explorer』設定ssh的連線資訊 設定完成後選擇遠端的網頁目錄按右鍵『Create Remote Project』 這時候便可以用php explorer來瀏覽、編輯網頁 註:我比較懶,且不算是生產線上的系統,所以選擇直接編輯 通常最適當做法應該是在本機創模擬環境,確認ok後再上傳

Posted in PHP | Leave a comment

MySQL Trigger 備份

目前MySQL每天都有透過mysqldump將資料倒出備份到另外一台NAS去 就會很害怕trigger會被捨棄掉不備份….. 還好~查了一下trigger是會被照顧的 只有store procedure跟function不會 恰恰好這兩個我都沒用到XD “mysqldump will backup by default all the triggers but NOT the stored procedures/functions.” Source

Posted in MySQL | Leave a comment

查詢關鍵字是否存在於以逗號分隔的資料欄位中

這樣有個好處 table的欄位可以開少一點 只是拉出來時如果要個別拆開 就需要程式語言有支援了…. (還有php有支援XD) 只是這邊有一點要小心,逗號前後的空格都有可能會影響比對的部分

Posted in MySQL, PHP | Leave a comment

查詢資料表中重複的資訊

每次要用時都會小忘記一下…. 來記錄看以後會不會記得 (謎之聲:不會….) select * from unit where `schoolid` in (select `schoolid` from unit group by `schoolid` having count(`schoolid`)>1 ) order by `schoolid`

Posted in MySQL | Leave a comment