2014年9月14日 星期日

Using Exiftool to shift datetime

1. Download the command line tool: exiftool
    ( http://www.sno.phy.queensu.ca/~phil/exiftool/ )
2.  Change all datetime tags in exif to add 1 year 2 month 3 day 4 hour 5 min 6 sec, and also overwite the original file
    >> exif tool "-AllDates+=1:2:3 4:5:6" -overwrite_original DIR_PATH
3. Finish

2014年9月10日 星期三

Python, Parse key, value pair without section

import StringIO
import ConfigParser

ini_path = "key_value_file_name"
ini_str = '[fakesection]\n' + open(ini_path).read()
ini_fp = StringIO.StringIO(ini_str)
config = ConfigParser.RawConfigParser()
config.readfp(ini_fp)
print config.items('fakesection')

2014年9月9日 星期二

Use Services For UNIX to Install NFS Server in Windows

1. Download "Windows Services for UNIX" Version 3.5
    (SFU35EL_EN.exe)
2. Execute SFU35EL_EN.exe to unzip the file.
3. Execute the unzipped "Setup.exe" to install the NFS Server.
4. Use "Custom Install" selection
5. Only select "Server for NFS" and "Server for NFS Authentication"
    (It will also install "User Name Mapping)
6. After installation, it will start the service "Server for NFS".
    If not, goto services to start it.
7. Setting the "User Name Mapping", select "Use Password and Group files" item.
    And then select the path of "passwd" and "group"
    This two file's sample can be show as:
      passwd:
        root:x:0:0:root:/root:/bin/bash
      group:
        root:x:0:
8. After setting need to press "Apply" button.
9. Open "File Manager" to the share folder, press right button to setting "NFS Sharing".
    Select "Share this folder".
10. In Linux platform, use "mount" command with NFS version 3 option to mount it.
    >> sudo mount -v -t nfs -o nfsvers=3 IP:/folder/path /mount/path
11. After using the NFS data, want to un-mount the folder
    >> sudo umount /mount/path