Archive for the ‘OS & Software’ Category

Workflow: Extract VOB video clips from DVD without conversion

Friday, March 8th, 2013

Finally I figured out this workflow using free software on OS X, for my projects (they are produced into DVD but I need to take samples for Youtube). By doing this, I am leaving all the encoding work to Youtube, since it will re-encode your video anyway. Supplying the original file to Youtube directly will avoid any quality degradation from your local encoding works.

Here is how I do it:

  1. Open your favourite video player that can playback the DVD or the VOB file (I use VLC Media Player), take a note of the start and end time of video you want to extract.
  2. Use MPEG Streamclip to open the DVD or the VOB file), it will complain that it need Apple’s Quicktime MPEG-2 Playback codec ($20) to play the video. Ignore this, I am not going pay for that.
  3. Press ⌘+G (jump to time), enter the start time you noted, press I (set In point). Press ⌘+G (jump to time), enter the end time you noted, press O (set Out point).
  4. Press ⌘+T (trim), now you should have the section you wanted. Press ⌘+S (save) to save the extracted video clip. MPEG Streamclip will save it using original format (VOB) without conversion or re-encoding.
  5. Verify your VOB clip by opening it with your favourite video player. Use the same procedure above to make adjustments.
  6. Upload to Youtube*, even though Youtube said it doesn’t support VOB file, it actually works well (since it is just MPEG-2 video).
* The VOB file is likely to be very big. If you have slow connection / bandwidth limit / can’t wait, then you will be much better off by encoding the video to H.264 first :)

    Upgrading to PHP 5.3 on CentOS

    Tuesday, November 20th, 2012


    CentOS came with an older version of PHP 5.1 and it doesn’t offer some of the newer features offered by PHP 5.2+ (I need json support as then I don’t need to write my own data structure, or parsing xml…). Upgrade it is non-trivial as you will most likely to get this:

    yum install php53

    --> php53-common conflicts with php-common
    Error: php53-common conflicts with php-common
    You could try using --skip-broken to work around the problem
    You could try running: package-cleanup --problems
    package-cleanup --dupes
    rpm -Va --nofiles --nodigest
    The program package-cleanup is found in the yum-utils package.

    If you can afford to remove php completely then that is the best way to give your system a refreshed version of php. Take a backup/snapshot of the system before doing so, though. Just in case :)

    yum remove php*

    This will remove all the php packages, including php-common (the conflicting one) and any other extensions you may have installed previously. Take a note of these and you will need them when you install php53. Yum will backup your previous php.ini file.

    yum install php53

    This will give you php53, php53-cli and php53-common as the base install. Check the version with php -v

    service httpd restart

    Now test with phpinfo()!

    (more…)

    The meaning of MiB and GiB

    Thursday, August 11th, 2011

    Basically MB/GB means the prefixes M (10^6) and G (10^9) are counted in decimal. MiB/GiB means the prefixes are counted in binary - Mi (2^20), Gi (2^30).

    See the article on Wikipedia: Binary prefix

    Vendors specify capacities (of hard drives for example) using GB/MB which results in a higher value compared to GiB/MiB. However, Windows (and possibly other OSes) will usually only tell you the GiB/MiB value, despite the fact that it writes GB/MB as unit behind the value :)

    [分享] Fit作者华君: 我为什么偏爱苹果电脑和Mac OS X

    Wednesday, May 18th, 2011

    …当我只用Windows的时候,我并不知道Windows的缺点,我以为自己生活在一个完美的世界里。…

    …Mac OS X真正闪光和留住用户的是他的设计哲学。那是简单,尽量不要让一些不必要的概念来干扰用户。…

    (more…)

    A Glasses of Wine, Mac & Linux flavoured

    Friday, October 29th, 2010

    Do you know how to use Windows application on Mac/Linux? - Wine

    An excellent article of installing Wine on Mac: http://davidbaumgold.com/tutorials/wine-mac/

    How do you execute an .msi file on Mac/Linux? - Wine

    Sometimes windows installers come with msi extension instead of regular exe extension. Such software can be installed with the msiexec command which comes with wine. For example to install a file setup.msi you will run: msiexec setup.msi

    http://tech.gaeatimes.com/index.php/archive/how-to-install-windows-msi-installers-with-wine-on-linux/

    Very easy :) A glass of Wine.

    Windows Command Line Tips You Should Check Out

    Friday, October 22nd, 2010

    Linux geeks are proud of their command line prowess and generally have some tricks up their sleeves. While the Windows command line is not considered as powerful as a Linux’s, here are some Windows command line tips and tricks not everyone might know about.

    Here I included a few examples, better-cooler tips are in this post: (I like the “sleep” command hack & the full screen cmd console….)

    (more…)

    Cisco VPN with Snow Leopard using a .pcf File

    Tuesday, July 13th, 2010

    I’ve been trying to use the native Cisco IPSec VPN on Snow Leopard, but I only got the Cisco .pcf file….

    Snow Leopard lacks the ability to import the .pcf file for its native Cisco VPN support, which is just annoying…Damn Apple..

    What could I do with a .pcf file? I need a group password but (obviously) it is encrypted in the .pcf file.

    Google reveals a somewhat “non-ethical” approach to this problem:

    Open the .pcf file in a text editor. Copy the text from the ‘enc_GroupPwd’ field, paste it into the form on this web site: http://www.unix-ag.uni-kl.de/~massar/bin/cisco-decode and click ‘decode!’. Select and copy the text next to ‘clear:’ and go to the next step.
    (Note: if there isn’t anything in ‘enc_GroupPwd’ but there is something in ‘GroupPwd’ they you can skip this step. Just copy the text from ‘GroupPwd’)

    (more…)

    Useful SSL debug info for IIS

    Monday, February 22nd, 2010

    Copied from random places:

    1. Tool: SSL Diagnostics, available from Microsoft.
      Very powerful tool for debuging SSL related problems. Highly recommended if you are having trouble with SSL on IIS.
    2. This command is for repairing the private key asscoiated with a cert. Usefull when the pk is shown as corrupted or missing.

      certutil -repairstore my “SerialNumber

      More info about privatekeys: http://support.microsoft.com/kb/889651/

    3. If you see this in SSL diagnostics (Like the one i saw today..):
      #WARNING: You have a private key that corresponds to this certificate but CryptAcquireCertificatePrivateKey failed’.

      The cure is here :)
      1. Set the correct permission for Machinekey folder C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys

      2. Grant administrator and system Full Control Permissions. You should check ‘Replace permission entries on all child objects with entries shown here that apply to child objects’ check box on the ‘Advanced’ dialog.

      3. Restart IIS (IIS manager > All Tasks > Restart IIS…)

      Original post: http://www.derkeiler.com/Newsgroups/microsoft.public.inetserver.iis.security/2005-01/0205.html

    Thanks to those info & tools I finally solved the damn SSL cert problem on my TMS sever today, yeah~

    [小Tip]Command Line中对付有空格文件(夹)的办法

    Sunday, January 10th, 2010

    先来个经典版:

    • 使用引号:
    • $cd "MSN Files"

    嘿嘿我今天突然发现了又一个办法来对付文件名中的空格:

    • 用backslash ‘\’ 来escape空格:
    • $cd MSN\ Files

    Enjoy~

    解决了某Java在Mac下不能运行的问题!

    Sunday, January 10th, 2010

    太帅了,我总算把Candy的project在Mac上 run 起来了。。。

    一开始Candy在她的Mac上面怎么都run不了她project的code demo,后来我试了一下,也不行。。我可是完全follow instruction的e。。。因为试NullPointer我就怀疑试path的问题,因为那个demo要take一个directory path作为args。。。但无论我用各种valid的path都不行,不管试relative的还是absolute的path,通通无效。。

    后来我把那个demo拿的我windows上面run,,啥问题都没有。。。为什么就Mac有问题呢?

    奇怪了吧?在linux下面似乎也ok的e?

    (more…)