http://macrorit.com/partition-magic-manager/free-edition.html
Permanently Free Expert-level Disk Partition Magic Software
免費,容易使用,可格式化超過32GB的記憶卡
星期二, 8月 09, 2016
星期五, 8月 05, 2016
在ubuntu中disable apache2的方法
1. 最簡單的方法,安裝rcconf
sudo apt-get install rcconf
執行rcconf後,直接設定即可
2. 記得停止目前在執行的apach2
sudo service apach2 stop
sudo apt-get install rcconf
執行rcconf後,直接設定即可
2. 記得停止目前在執行的apach2
sudo service apach2 stop
星期日, 5月 29, 2016
Git 使用心得及記錄
0. 本地Commit有誤時,如何處理?
=>用reset
解法:
1. git reset --mixed (預設), repo的commit會取消,目前workspace己修改的檔案內容會保留,(就是好像退回到連add都沒做的狀態,好像什麼事都沒發生)
2. git reset --soft, repo的commit會取消,stage中會保持該取消的commit中的變更資料,(就是好像退回到原add的動作)。
3. git reset --hard, repo的commit會取消,會把workspace目前修改的檔案刪除,worksapce中的檔案會回到前一次commit的內容,所有這次改的資料都會不見。
可參考影片: https://www.youtube.com/watch?v=gVByWjwetVc
1. 如果不小心把本地端檔案殺掉了,但是reposity之前有儲存,要如何救回來?很簡單,就再從reposity checkout就好了。
2. Check out 會不會把目前目錄下的資料全部清除?
答案是會全把舊的資料全殺光,所以checkout之前要記得先commit或備份,以免損失慘重。
3. 把檔案用git add加到stage後,在workspace再修改,此時再commit時,檔案會用那個版本的?
Ans: 檔案會用staged的版本。workspace修改的版本或資料並不會commit進去。
(If I modify a file that is added, and retry the commit, the changes aren't recognized, so the commit will fail again.)
解決方法1: 再用git add重做一次就好
解決方法2: 先用預設 reset的命令(--mixed),取消stage的動作(此時不會覆蓋workspace的版本),再重新commit就好。
注意: 千萬不要亂下git reset -hard,會把workspace目前修改的檔案刪除
https://stackoverflow.com/questions/27776588/modifying-a-file-after-git-add
http://lib.csdn.net/article/git/28621
=>用reset
解法:
1. git reset --mixed (預設), repo的commit會取消,目前workspace己修改的檔案內容會保留,(就是好像退回到連add都沒做的狀態,好像什麼事都沒發生)
git reset HEAD file ( which by default is using the --mixed flag) is different in that in the case where the file is already in the repo, it replaces the index version of the file with the one from repo (HEAD), effectively unstaging the modifications to it.3. git reset --hard, repo的commit會取消,會把workspace目前修改的檔案刪除,worksapce中的檔案會回到前一次commit的內容,所有這次改的資料都會不見。
可參考影片: https://www.youtube.com/watch?v=gVByWjwetVc
1. 如果不小心把本地端檔案殺掉了,但是reposity之前有儲存,要如何救回來?很簡單,就再從reposity checkout就好了。
2. Check out 會不會把目前目錄下的資料全部清除?
答案是會全把舊的資料全殺光,所以checkout之前要記得先commit或備份,以免損失慘重。
3. 把檔案用git add加到stage後,在workspace再修改,此時再commit時,檔案會用那個版本的?
Ans: 檔案會用staged的版本。workspace修改的版本或資料並不會commit進去。
(If I modify a file that is added, and retry the commit, the changes aren't recognized, so the commit will fail again.)
解決方法1: 再用git add重做一次就好
注意: 千萬不要亂下git reset -hard,會把workspace目前修改的檔案刪除
https://stackoverflow.com/questions/27776588/modifying-a-file-after-git-add
http://lib.csdn.net/article/git/28621
星期三, 4月 13, 2016
ffmpeg gop 大小 x264 設定
http://superuser.com/questions/908280/what-is-the-correct-way-to-fix-keyframes-in-ffmpeg-for-dash
Method 1: with libx264's arguments
-c:v libx264 -x264opts keyint=GOPSIZE:min-keyint=GOPSIZE:scenecut=-1
#在壓x264時,有二個參數可以用來設定gop的大小,如果要設定成固定長度的gop,如每25個frame為一個GOP,則要把keyint 及 min-keyint設成同樣的值。
#在壓x264時,如果只設定keyint,則x264內定演算法scene_cut會偵測場景變化,選擇最有效率的I frame及GOP大小進行壓縮,此時,每個GOP的大小會是不定長度。
#scenecut=-1代表disable,則會採固定長度GOP進行壓縮,壓縮效率會比較差。
You should simply set the
Note that I am not assuming variable framerate sequences here. I honestly have no idea how to deal with those in practice—I honestly haven't come across any before.
To give you an example, I converted a clip three times:

As you can see, disabling scene cut detection and setting the keyframe interval is enough. It seems that even if you don't set a minimum, it'll insert keyframes at least at the interval specified by
I've researched this quite a bit a while ago—I'm currently involved in creating an ITU-T recommendation dealing with the analysis of DASH-type video transmission, so we had to figure out encoding settings that would be realistic, and from all of the documents and guides I've read, disabling scene cut detection and forcing the keyframe interval in x264 directly was the method of choice.
Method 1: with libx264's arguments
-c:v libx264 -x264opts keyint=GOPSIZE:min-keyint=GOPSIZE:scenecut=-1
#在壓x264時,有二個參數可以用來設定gop的大小,如果要設定成固定長度的gop,如每25個frame為一個GOP,則要把keyint 及 min-keyint設成同樣的值。
#在壓x264時,如果只設定keyint,則x264內定演算法scene_cut會偵測場景變化,選擇最有效率的I frame及GOP大小進行壓縮,此時,每個GOP的大小會是不定長度。
#scenecut=-1代表disable,則會採固定長度GOP進行壓縮,壓縮效率會比較差。
You should simply set the
keyint and min-keyint
to the same value and disable scene detection. If you don't disable
scene detection, the "counter" will indeed be reset, and your keyframes
end up at irregular intervals.Note that I am not assuming variable framerate sequences here. I honestly have no idea how to deal with those in practice—I honestly haven't come across any before.
To give you an example, I converted a clip three times:
keyint=25(i.e., scenecut enabled)keyint=25:scenecut=-1keyint=25:min-keyint=25:scenecut=-1
As you can see, disabling scene cut detection and setting the keyframe interval is enough. It seems that even if you don't set a minimum, it'll insert keyframes at least at the interval specified by
keyint. To be safe you should probably set min-keyint too.I've researched this quite a bit a while ago—I'm currently involved in creating an ITU-T recommendation dealing with the analysis of DASH-type video transmission, so we had to figure out encoding settings that would be realistic, and from all of the documents and guides I've read, disabling scene cut detection and forcing the keyframe interval in x264 directly was the method of choice.
Thank you! This is great
feedback. One question I have is how you generated that awesome table. I
could totally use something like that.
– Mark Gerolimatos
Apr 30 '15 at 21:39
(There appears to be no way
to write you directly) Can you please point me towards links to any
threads in this ITU-T discussion? Thanks!
– Mark Gerolimatos
Apr 30 '15 at 21:45
| 1 |
I just made that in Excel, pasting the output I got from three runs of
ffprobe -i input.mp4 -select_streams v -show_frames -of csv -show_entries frame=pict_type,
then coloring the cells. I'm afraid there are no public discussions,
but I'll see if I can dig up some of the links I found back then.
– slhck
Apr 30 '15 at 22:01
Could you please re-try your experiment with the
-force_key_frames expr:gte(t,n_forced*GOP_LEN_IN_SECONDS)
form? I just tried it and found that while there were extra I frames in
the stream, it DID seem to abide by my rule. A PERL program will follow
as an "answer", as you cannot apparently use markup in comments.
– Mark Gerolimatos
May 1 '15 at 1:08
Interesting. I believe it's
worth a separate "real" answer if you found out that it works. (Stack
Exchange sites aren't really good for this discussion-style reply.) The
last time I checked,
-force_key_frames didn't work for me, and so I never tried it again. That was more than a year ago. Perhaps it was a bug. I'll try again soon.
– slhck
May 1 '15 at 8:00
The answer therefore seems to be:
Script for the
Here is a short PERL program I used to verify I-frame cadence based
on the output of slhck's ffprobe suggestion. It seems to verify that the
|
星期二, 4月 12, 2016
ffprobe 觀察video frame使用方法
1. 觀察frame編號(coded_picture_number),資料大小(pkt_size),編碼類型IPB(pict_type), 播放時間順(pkt_pts_time), 解碼時間順(pkt_dts_time)
ffprobe -select_streams v:0 -show_entries frame=coded_picture_number,pkt_size,pict_type,pkt_pts_time,pkt_dts_time video.mp4 -of compact > result.txt
觀察結果
#檔案result.txt
frame|pkt_pts_time=0.000000|pkt_dts_time=0.000000|pkt_size=13695|pict_type=I|coded_picture_number=0
frame|pkt_pts_time=0.033367|pkt_dts_time=0.033367|pkt_size=630|pict_type=P|coded_picture_number=1
frame|pkt_pts_time=0.066733|pkt_dts_time=0.066733|pkt_size=827|pict_type=P|coded_picture_number=2
frame|pkt_pts_time=0.100100|pkt_dts_time=0.100100|pkt_size=1832|pict_type=P|coded_picture_number=3
frame|pkt_pts_time=0.133467|pkt_dts_time=0.133467|pkt_size=367|pict_type=P|coded_picture_number=4
frame|pkt_pts_time=0.166833|pkt_dts_time=0.166833|pkt_size=1544|pict_type=P|coded_picture_number=5
2. 找出所有I畫面幀
cat result.txt | grep 'type=I'
觀察結果
frame|pkt_pts_time=0.000000|pkt_dts_time=0.000000|pkt_size=13695|pict_type=I|cod
ed_picture_number=0
frame|pkt_pts_time=2.002000|pkt_dts_time=2.002000|pkt_size=17793|pict_type=I|cod
ed_picture_number=60
frame|pkt_pts_time=3.636967|pkt_dts_time=3.636967|pkt_size=15824|pict_type=I|cod
ed_picture_number=109
frame|pkt_pts_time=5.638967|pkt_dts_time=5.638967|pkt_size=15158|pict_type=I|cod
ed_picture_number=169
frame|pkt_pts_time=7.640967|pkt_dts_time=7.640967|pkt_size=11380|pict_type=I|cod
ed_picture_number=229
frame|pkt_pts_time=9.642967|pkt_dts_time=9.642967|pkt_size=16336|pict_type=I|cod
ed_picture_number=289
ffprobe -select_streams v:0 -show_entries frame=coded_picture_number,pkt_size,pict_type,pkt_pts_time,pkt_dts_time video.mp4 -of compact > result.txt
觀察結果
#檔案result.txt
frame|pkt_pts_time=0.000000|pkt_dts_time=0.000000|pkt_size=13695|pict_type=I|coded_picture_number=0
frame|pkt_pts_time=0.033367|pkt_dts_time=0.033367|pkt_size=630|pict_type=P|coded_picture_number=1
frame|pkt_pts_time=0.066733|pkt_dts_time=0.066733|pkt_size=827|pict_type=P|coded_picture_number=2
frame|pkt_pts_time=0.100100|pkt_dts_time=0.100100|pkt_size=1832|pict_type=P|coded_picture_number=3
frame|pkt_pts_time=0.133467|pkt_dts_time=0.133467|pkt_size=367|pict_type=P|coded_picture_number=4
frame|pkt_pts_time=0.166833|pkt_dts_time=0.166833|pkt_size=1544|pict_type=P|coded_picture_number=5
2. 找出所有I畫面幀
cat result.txt | grep 'type=I'
觀察結果
frame|pkt_pts_time=0.000000|pkt_dts_time=0.000000|pkt_size=13695|pict_type=I|cod
ed_picture_number=0
frame|pkt_pts_time=2.002000|pkt_dts_time=2.002000|pkt_size=17793|pict_type=I|cod
ed_picture_number=60
frame|pkt_pts_time=3.636967|pkt_dts_time=3.636967|pkt_size=15824|pict_type=I|cod
ed_picture_number=109
frame|pkt_pts_time=5.638967|pkt_dts_time=5.638967|pkt_size=15158|pict_type=I|cod
ed_picture_number=169
frame|pkt_pts_time=7.640967|pkt_dts_time=7.640967|pkt_size=11380|pict_type=I|cod
ed_picture_number=229
frame|pkt_pts_time=9.642967|pkt_dts_time=9.642967|pkt_size=16336|pict_type=I|cod
ed_picture_number=289
星期六, 3月 26, 2016
在ubutnu 14.04安裝ffmpeg
http://www.faqforge.com/linux/how-to-install-ffmpeg-on-ubuntu-14-04/
sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install ffmpeg
Why redirect output to 2>&1 and 1>&2?
Why redirect output to 2>&1 and 1>&2?
http://superuser.com/questions/436586/why-redirect-output-to-21-and-12
簡單的說,就是把stderr(2) 轉向到stdout(1), 讓一些命令可以進一步處理,例如grep就只能讀stdout的資料,如果我們想處理stderr的結果,就要2>&1
另外一種情況是想把stderr的錯誤也記錄下來到同一檔案, 可以一樣的做法。
http://superuser.com/questions/436586/why-redirect-output-to-21-and-12
簡單的說,就是把stderr(2) 轉向到stdout(1), 讓一些命令可以進一步處理,例如grep就只能讀stdout的資料,如果我們想處理stderr的結果,就要2>&1
另外一種情況是想把stderr的錯誤也記錄下來到同一檔案, 可以一樣的做法。
星期日, 3月 15, 2015
Windows Terminal, Command Line Shell Suggestion
ConEmu is opensource console emulator with tabs, which represents multiple consoles and simple GUI applications as one customizable GUI window.
推薦,中文輸入記得進入Setting中,把monospace選項取消,中文字就可以正常移動。
推薦,中文輸入記得進入Setting中,把monospace選項取消,中文字就可以正常移動。
星期六, 2月 28, 2015
su, sudo,sudo su
su
登入為root,需要輸入root的密碼,比較不安全。(fedora及大部份的distribution,建立系統時會建立root帳號及密碼)
sudo command
短暫取得root權限,執行後面指定的command命令。需要輸入自已己帳號的密碼,而不是root帳號的密碼。只有加入到sudoer檔案的帳號才可以執行sudo命令。優點,安全性較高,可避免登入到root帳號後,不小心下錯指令,導致大範圍失誤。( 在ubuntu系統中,預設不會建立root密碼啟用root登入功能。當需要執行root權限所需的命令時,都採用sudo command的方式來做。)
sudo su
同su功能,切換為root。即請sudo執行su命令,所不同的是輸入自己帳號密碼,而不是root密碼。原理當使用者輸入自己密碼後即取得root權限,此時再執行su,等同執行su root,就會切換成root身份。
為什麼要多此一舉? 因為在ubuntu系統中,預設不會建立root密碼啟用root登入功能。當需要執行root權限所需的命令時,都採用sudo command的方式來做。有時候要執行很多系統命令時,可以採用sudo su方式,切換到root身份後再下指令會比較方便。
WireShark 封包抓取學習好文章
Good Reference:
一站式学习Wireshark(一):Wireshark基本用法
https://community.emc.com/thread/194901
十大免费又好用的网络分析工具
https://community.emc.com/message/788944#788944
一站式学习Wireshark(一):Wireshark基本用法
https://community.emc.com/thread/194901
十大免费又好用的网络分析工具
https://community.emc.com/message/788944#788944
apache 權限設定好文章
Reference:
What permissions should my website files/folders have on a Linux webserver?
http://serverfault.com/questions/357108/what-permissions-should-my-website-files-folders-have-on-a-linux-webserver
What permissions should my website files/folders have on a Linux webserver?
http://serverfault.com/questions/357108/what-permissions-should-my-website-files-folders-have-on-a-linux-webserver
星期三, 2月 04, 2015
Windows 8 Apple Photostream沒有同步
因為不明原因,PhotoSteam無法跟 Windows 同步,解決方式如下:
Reference:
http://www.tinkertry.com/fix-the-issue-where-you-upgrade-to-windows-8-1-then-your-photo-stream-stops-updating/
- Kill these processes:
ApplePhotoStreams.exe , ApplePhotoStreamDownloader.exe , APSDaemon.exe , iCloudServices.exe, iCloud.exe- Delete this folder:
%AppData%\Apple Computer\MediaStream- Launch iCloud Control Panel. You will notice that Photos is not sync. Enable it and apply it.
Reference:
http://www.tinkertry.com/fix-the-issue-where-you-upgrade-to-windows-8-1-then-your-photo-stream-stops-updating/
星期四, 9月 25, 2014
Evernote install error
Solution:
http://www.nextofwindows.com/how-to-fix-evernote-unable-to-uninstall-install-or-update/
http://support.microsoft.com/mats/program_install_and_uninstall/
http://www.nextofwindows.com/how-to-fix-evernote-unable-to-uninstall-install-or-update/
http://support.microsoft.com/mats/program_install_and_uninstall/
星期四, 8月 21, 2014
Samsung ML-1520 driver for Mac OS X 10.14.x and old 10.9
Updated 2019-7-3: Since the old download can't work, please go to http://splix.ap2c.org/ site to download the splix source code. Then, unzip it. You can find a file named ml1520.ppd under the ppd sub-directory. Go to printer to install the ML-1520 printer with the custom ml1520.ppd driver. Now, all should be ok.
reference from: http://buklijas.info/blog/2018/02/01/samsung-ml-1520-os-x-10-12-mac-os-sierra/
----------------
OLD:The official site does not provide the driver, however, there has a open source mac driver that works on my MAC OS X 10.9.
http://guigo.us/mac/splix/
reference from: http://buklijas.info/blog/2018/02/01/samsung-ml-1520-os-x-10-12-mac-os-sierra/
----------------
OLD:The official site does not provide the driver, however, there has a open source mac driver that works on my MAC OS X 10.9.
http://guigo.us/mac/splix/
星期六, 8月 16, 2014
Acer s7 replace ssd hd 256gb
0. prepare a external USB hd with ntfs format.
1. using windows 7 recover in win 8 to create system image.
2. store the image to external disk.
3. create win 8 recover disk into a USB flash drive.
4. open the back cover, raplace the old ssd disk with new 256gb ssd disk. (msata interface )
5. reboot the system with USB flash drive.
6. select the recovery image with external USB hd for system recovery.
7. finish and reboot system.
8. use the disk tool to create new disk partitation and use the unused space.
訂閱:
文章 (Atom)