Checkout:
svn co URL[@REV]... [PATH]
Commit:
svn ci [PATH]
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
Log:
svn log [PATH][@REV]
URL[@REV] [PATH...]
-r ARG1[:ARG2] :
NUMBER: revision number
{DATE}: revision at start of the date, ex: {2015-01-01}
HEAD: latest in repository
BASE: base rev of item's working copy
COMMITTED: last commit at or before BASE
PREV: revision just before COMMITTED
Difference:
svn diff [-r ARG1[:ARG2]]
Merge:
Roll back to the old version:
$ svn up
$ svn merge -rHEAD:{NUMBER} [PATH]
$ svn ci
Edit Property:
svn pe svn:externals .
Note: svn recognizes the following special versioned properties
svn:ignore - A newline separated list of file glob patterns to ignore.
svn:keywords - Keywords to be expanded.
svn:executable - If present, make the file executable.
svn:eol-style - One of 'native', 'LF', 'CR', 'CRLF'.
svn:mime-type - The mimetype of the file.
svn:externals - A newline separated list of module specifiers, each of which consists of a URL and a relative directory path.
svn:needs-lock - If present, indicates that the file should be locked before it is modified.
2015年4月14日 星期二
2015年4月13日 星期一
Python OrderedDict
https://docs.python.org/2/library/collections.html#collections.OrderedDict
New in version 2.7.
See also: Equivalent OrderedDict recipe that runs on Python 2.4 or later.
New in version 2.7.
See also: Equivalent OrderedDict recipe that runs on Python 2.4 or later.
2015年4月10日 星期五
cURL: VERSIONS -- the version numbering scheme in curl
Version Numbers and Releases
Curl is not only curl. Curl is also libcurl. They're actually individually versioned, but they mostly follow each other rather closely.
The version numbering is always built up using the same system:
X.Y[.Z]
Where
X is main version number
Y is release number
Z is patch number
One of these numbers will get bumped in each new release. The numbers to the right of a bumped number will be reset to zero. If Z is zero, it may not be included in the version number.
The main version number will get bumped when *really* big, world colliding changes are made. The release number is bumped when changes are performed or things/features are added. The patch number is bumped when the changes are mere bugfixes.
It means that after release 1.2.3, we can release 2.0 if something really big has been made, 1.3 if not that big changes were made or 1.2.4 if mostly bugs were fixed.
Bumping, as in increasing the number with 1, is unconditionally only affecting one of the numbers (except the ones to the right of it, that may be set to zero). 1 becomes 2, 3 becomes 4, 9 becomes 10, 88 becomes 89 and 99 becomes 100. So, after 1.2.9 comes 1.2.10. After 3.99.3, 3.100 might come.
All original curl source release archives are named according to the libcurl version (not according to the curl client version that, as said before, might differ).
As a service to any application that might want to support new libcurl features while still being able to build with older versions, all releases have the libcurl version stored in the curl/curlver.h file using a static numbering scheme that can be used for comparison. The version number is defined as:
Where XX, YY and ZZ are the main version, release and patch numbers in hexadecimal. All three number fields are always represented using two digits (eight bits each). 1.2 would appear as "0x010200" while version 9.11.7 appears as "0x090b07".
This 6-digit hexadecimal number is always a greater number in a more recent release. It makes comparisons with greater than and less than work.
This number is also available as three separate defines: LIBCURL_VERSION_MAJOR, LIBCURL_VERSION_MINOR and LIBCURL_VERSION_PATCH.
The library name may always be "libcurl.so.4.1.1". So check the actually version number in "curl/curlver.h" or use the curl-config tool:
$ sh curl-config --version
Reference:
http://curl.haxx.se/docs/versions.html
http://curl.haxx.se/libcurl/using/
Curl is not only curl. Curl is also libcurl. They're actually individually versioned, but they mostly follow each other rather closely.
The version numbering is always built up using the same system:
X.Y[.Z]
Where
X is main version number
Y is release number
Z is patch number
One of these numbers will get bumped in each new release. The numbers to the right of a bumped number will be reset to zero. If Z is zero, it may not be included in the version number.
The main version number will get bumped when *really* big, world colliding changes are made. The release number is bumped when changes are performed or things/features are added. The patch number is bumped when the changes are mere bugfixes.
It means that after release 1.2.3, we can release 2.0 if something really big has been made, 1.3 if not that big changes were made or 1.2.4 if mostly bugs were fixed.
Bumping, as in increasing the number with 1, is unconditionally only affecting one of the numbers (except the ones to the right of it, that may be set to zero). 1 becomes 2, 3 becomes 4, 9 becomes 10, 88 becomes 89 and 99 becomes 100. So, after 1.2.9 comes 1.2.10. After 3.99.3, 3.100 might come.
All original curl source release archives are named according to the libcurl version (not according to the curl client version that, as said before, might differ).
As a service to any application that might want to support new libcurl features while still being able to build with older versions, all releases have the libcurl version stored in the curl/curlver.h file using a static numbering scheme that can be used for comparison. The version number is defined as:
Where XX, YY and ZZ are the main version, release and patch numbers in hexadecimal. All three number fields are always represented using two digits (eight bits each). 1.2 would appear as "0x010200" while version 9.11.7 appears as "0x090b07".
This 6-digit hexadecimal number is always a greater number in a more recent release. It makes comparisons with greater than and less than work.
This number is also available as three separate defines: LIBCURL_VERSION_MAJOR, LIBCURL_VERSION_MINOR and LIBCURL_VERSION_PATCH.
The library name may always be "libcurl.so.4.1.1". So check the actually version number in "curl/curlver.h" or use the curl-config tool:
$ sh curl-config --version
Reference:
http://curl.haxx.se/docs/versions.html
http://curl.haxx.se/libcurl/using/
2015年4月9日 星期四
Linux: Split A File Into Several Smaller Pieces
Split the "BIGFILE" into PREFIX001, PREFIX002, ..., PREFIXNNN files, and each file size is 1MB:
$ split -a 3 -b 1M -d BIGFILE PREFIX
-a: use suffixes of length N (default 2)
-b: put SIZE bytes per output file
SIZE may have a multiplier suffix: b 512, kB 1000, K 1024,
MB 1000*1000, M 1024*1024, GB 1000*1000*1000,
G 1024*1024*1024, and so on for T, P, E, Z, Y.
-d: use numeric suffixes instead of alphabetic
Split a text (log) file into several smaller files, and each one has 1000 lines:
$ split -a 3 -l 1000 -d LOGFILE PREFIX
-l: put NUMBER lines per output file
Split a text (log) file into several smaller files, and each file size is at most 1MB:
$ split -a 3 -C 1M -d LOGFILE PREFIX
-C: put at most SIZE bytes of lines per output file
Merge all split files into one:
$ cat PREFIX* > BIGFILE
$ split -a 3 -b 1M -d BIGFILE PREFIX
-a: use suffixes of length N (default 2)
-b: put SIZE bytes per output file
SIZE may have a multiplier suffix: b 512, kB 1000, K 1024,
MB 1000*1000, M 1024*1024, GB 1000*1000*1000,
G 1024*1024*1024, and so on for T, P, E, Z, Y.
-d: use numeric suffixes instead of alphabetic
Split a text (log) file into several smaller files, and each one has 1000 lines:
$ split -a 3 -l 1000 -d LOGFILE PREFIX
-l: put NUMBER lines per output file
Split a text (log) file into several smaller files, and each file size is at most 1MB:
$ split -a 3 -C 1M -d LOGFILE PREFIX
-C: put at most SIZE bytes of lines per output file
Merge all split files into one:
$ cat PREFIX* > BIGFILE
Linux: Change The System/Hardware Date & Time Zone
# Search the "Area/City" in /user/share/zoneinfo
Ubuntu:
$ sudo echo "Asia/Taipei" > /etc/timezone
CentOS:
$ sudo echo "ZONE=\"Asia/Taipei\"" > /etc/sysconfig/clock
$ sudo cp /usr/share/zoneinfo/Asia/Taipei /etc/localtime
# Set Date
$ sudo date 040911112015.00
# Set Hardware Clock
$ sudo hwclock -w
Ubuntu:
$ sudo echo "Asia/Taipei" > /etc/timezone
CentOS:
$ sudo echo "ZONE=\"Asia/Taipei\"" > /etc/sysconfig/clock
$ sudo cp /usr/share/zoneinfo/Asia/Taipei /etc/localtime
# Set Date
$ sudo date 040911112015.00
# Set Hardware Clock
$ sudo hwclock -w
2015年4月8日 星期三
2015年4月2日 星期四
Windows PowerShell "Pause"
Write-Host "Press any key to continue ..."
$x = $host.UI.RawUI.ReadKey("NoEcho, IncludeKeyDown")
In this line we’re using PowerShell’s automatic variable $host (which is actually an instance of the .NET Framework class System.Management.Automation.Host) and the ReadKey method. (Which is actually a method of the RawUI property, which is a property of the UI property, which is a property of $host. And the leg bone’s connected to the knee bone, the knee bone’s connected to the ankle bone, the ….) The ReadKey method enables us to get information about the key that has just been pressed. Of course, in this case the only information we care about is the fact that a key has been pressed. Therefore, we pass ReadKey two parameters:
NoEcho. This prevents any information from appearing on screen when the user presses a key. If you leave out this parameter the pressed key will be echoed back to the screen.
IncludeKeyDown. This tells the script to continue as soon as a key has been pressed; that means the script will continue even if the user presses and holds a key down. If you’d prefer to wait until the user has released the key, then use this parameter instead: IncludeKeyUp.
There’s one more parameter that we can add to the ReadKey method: AllowCtrlC. In Windows PowerShell, pressing Ctrl+C typically causes the script to terminate. If you add the AllowCtrlC parameter to the ReadKey method, however, the user can choose to press Ctrl+C instead of pressing any other key. If they do that, the script will not terminate, but instead continue on as if the user had pressed any other key on the keyboard. (But only in conjunction with the ReadKey method. If the user presses Ctrl+C somewhere else the script will terminate.)
Reference:
Pausing a Script Until the User Presses a Key
How do you do a ‘Pause’ with PowerShell 2.0?
How to Properly Pause a PowerShell Script
訂閱:
文章 (Atom)