Showing posts with label Tools. Show all posts
Showing posts with label Tools. Show all posts

Saturday, June 17, 2017

handy command line - sqlcl

happen to notice this command line tool called sqlcl from oracle.com

with this , it is portable, no need to administrator to modify sqlnet.ora on windows platform (commonly, in my environment). and not like instantclient, I need to asseble library files and sqlplus.exe into same directory.

Only 3 files after download, for linux, windows platform respectively. but requires JRE.

If no JRE installed, download it , and add %JAVA_HOME%/bin to %PATH% variable (for windows platform)

it supports ezconnect too. This is it.


/cygdrive/d/setup.dsk/apex/sqlcl-4.2.0.17.097.0719-no-jre/sqlcl/bin
$ ./sql.exe liqy/xxxxxx@//dbdev:1582/DB05

SQLcl: Release 4.2.0 Production on Tue Jun 13 13:52:30 2017

Copyright (c) 1982, 2017, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> exit
exit


Wednesday, September 14, 2016

install nerdtree with vbundle for vim

1. preparation

    touch ~/.vimrc
    mkdir~/.vim/bundle

2. install vbundle

git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
 

3. add the following to .vimrc

set nocompatible               " be iMproved
filetype off                   " required!

set rtp+=~/.vim/bundle/vundle/
call vundle#rc()

" let Vundle manage Vundle
" required! 
Bundle 'gmarik/vundle'

" My Bundles here:

filetype plugin indent on     " required!
"
" Brief help
" :BundleList          - list configured bundles
" :BundleInstall(!)    - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!)      - confirm(or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed.. 
 
 

4. install NERDTree, add the bundle name to .vimrc


call vundle#begin()

     
Bundle 'scrooloose/nerdtree'

call vundle#end()  



 5. re-launch vi, and type the :BundleInstall command to install the nerdtree.


6.  verify able to launch nerdtree, by typing ":NERDTree" . Note that the command is sensitive.

7. create hotkey  F2 for NERDTRee:  add below line to .vimrc.

 
 

 
some commands I learned easilly:
 
ctr+w+h  光标移到左侧树形目录,
ctrl+w+l 光标移到右侧文件显示窗口
ctrl + w + w    光标自动在左右侧窗口切换
 
   o 打开关闭文件或者目录

   t 在标签页中打开

  T 在后台标签页中打开

  ! 执行此文件

  p 到上层目录

  P 到根目录

  K 到第一个节点

  J 到最后一个节点
 k  previous
j  next 
  

tabs commands are what I am thinking to google,but already there.

:tabnew [++opt选项] [+cmd] 文件      建立对指定文件新的tab
:tabc   关闭当前的 tab
:tabo   关闭所有其他的 tab
:tabs   查看所有打开的 tab
:tabp   前一个 tab
:tabn   后一个 tab
 
 
 
and more to practice noted below.


ctrl + w + r    移动当前窗口的布局位置
go      在已有窗口 中打开文件、目录或书签,但不跳到该窗口
i       split 一个新窗口打开选中文件,并跳到该窗口
gi      split 一个新窗口打开选中文件,但不跳到该窗口
s       vsplit 一个新窗口打开选中文件,并跳到该窗口
gs      vsplit 一个新 窗口打开选中文件,但不跳到该窗口
!       执行当前文件
O       递归打开选中 结点下的所有目录
x       合拢选中结点的父目录
X       递归 合拢选中结点下的所有目录
e       Edit the current dif
双击    相当于 NERDTree-o
中键    对文件相当于 NERDTree-i,对目录相当于 NERDTree-e
D       删除当前书签
C       将选中目录或选中文件的父目录设为根结点
u       将当前根结点的父目录设为根目录,并变成合拢原根结点
U       将当前根结点的父目录设为根目录,但保持展开原根结点
r       递归刷新选中目录
R       递归刷新根结点
m       显示文件系统菜单
cd      将 CWD 设为选中目录
I       切换是否显示隐藏文件
f       切换是否使用文件过滤器
F       切换是否显示文件
B       切换是否显示书签
 

also reviewed commands to execute external commands.

:shell or just :sh  or Ctrl-z  and fg


:r textfile
:r ! ls -1 /home/user/directory


Installation on cygwin

Followed this article, I easily installed NERDTree  to the vim.

https://my.oschina.net/VASKS/blog/388907


Installed more bundle from  http://www.zlovezl.cn/articles/vim-plugins-cannot-live-without/


In short time, I built up my own .vimrc as shown below.

hmc@hmc-P55A-UD3:~$ cat .vimrc
syntax enable
syntax on
set nocompatible              " be iMproved, required
filetype off                  " required

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

   
Bundle 'scrooloose/nerdtree'
Bundle 'jistr/vim-nerdtree-tabs'
Bundle 'scrooloose/syntastic'
Bundle 'Valloric/YouCompleteMe'
Bundle 'vim-airline/vim-airline'
Bundle 'chriskempson/base16-vim'
Bundle 'majutsushi/tagbar'

call vundle#end()            " required
filetype plugin indent on    " required

nmap :NERDTreeToggle
let g:nerdtree_tabs_open_on_console_startup=1
map n NERDTreeTabsToggle


" for YCM

" 设置跳转到方法/函数定义的快捷键
 nnoremap j :YcmCompleter GoToDefinitionElseDeclaration
 " 触发补全快捷键
let g:ycm_key_list_select_completion = ['', '', '']
let g:ycm_key_list_previous_completion = ['', '', '']
let g:ycm_auto_trigger = 1
" 最小自动触发补全的字符大小设置为 3
let g:ycm_min_num_of_chars_for_completion = 3
" YCM的previw窗口比较恼人,还是关闭比较好
set completeopt-=preview




References:



http://williamherry.com/blog/2012/07/16/master-vim-01-vundle/
http://williamherry.com/blog/2012/07/19/master-vim-02-nerdtree/

https://my.oschina.net/VASKS/blog/388907
https://www.linux.com/learn/vim-tips-working-external-commands
http://os.51cto.com/art/201507/484174.htm

http://blog.csdn.net/namecyf/article/details/7787479

Wednesday, September 07, 2016

cut and paste for vi

--For Solaris, AIX , HP-UX platform

shift + v    # for copy to clipboard
dd             # delete the line
p               # paste



--For Linux platform

shift + v
d            # delete the line, slightly different with Solaris
p


Ref: http://stackoverflow.com/questions/8773299/how-to-cut-an-entire-line-in-vim-and-paste-it

Monday, November 02, 2015

install oracle sample data

Famous scott/tiger is here.

ORCL2:/u01/app/oracle/product/11.2.0.4/rdbms/admin> ls utlsampl.sql
utlsampl.sql


SQL> conn scott/tiger
Connected.
SQL> select table_name from user_tables;

TABLE_NAME
------------------------------
DEPT
EMP
BONUS
SALGRADE


Install the sample schema installer files.
demo schemas are under $ORACLE_HOME/demo/schema directory.


DG:/u01/app/oracle/product/11.2.0.4/demo/schema/order_entry> sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Mon Oct 19 15:11:28 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SYS@DG> @oe_main

specify password for OE as parameter 1:
Enter value for 1: oe

specify default tablespeace for OE as parameter 2:
Enter value for 2: USERS

specify temporary tablespace for OE as parameter 3:
Enter value for 3: temp

specify password for HR as parameter 4:
Enter value for 4: hr

specify password for SYS as parameter 5:
Enter value for 5: ****

specify directory path for the data files as parameter 6:
Enter value for 6: /u01/app/oracle/product/11.2.0.4/demo/schema/order_entry

writeable directory path for the log files as parameter 7:
Enter value for 7: /u01/app/oracle/product/11.2.0.4/demo/schema/order_entry

specify version as parameter 8:
Enter value for 8: v3


User dropped.

old   1: CREATE USER oe IDENTIFIED BY &pass
new   1: CREATE USER oe IDENTIFIED BY oe

User created.

old   1: ALTER USER oe DEFAULT TABLESPACE &tbs QUOTA UNLIMITED ON &tbs
new   1: ALTER USER oe DEFAULT TABLESPACE USERS QUOTA UNLIMITED ON USERS

User altered.

old   1: ALTER USER oe TEMPORARY TABLESPACE &ttbs
new   1: ALTER USER oe TEMPORARY TABLESPACE temp

User altered.

Monday, September 28, 2015

running tiddlywiki on node.js in Ubuntu 14.04.3 LTS with existing tiddlers loaded

1. create a directory for tiddlywiki
mkdir tdwiki

2. Under this directory, initialize a notebook named "mywiki"

user:~/tdwiki$ tiddlywiki mywiki --init server
Copied edition 'server' to mywiki


After this command, we are supposed to a see sub-directory named "mywiki" created under the parent directory "tdwiki"

3. To load exting tiddlers in index_2015-9-23.html created by tiddlywiki desktop verion

3.1 --type the help on load command
user:~/tdwiki$ tiddlywiki --help load
Load tiddlers from 2.x.x TiddlyWiki files (.html), .tiddler, .tid, .json or other files


3.2 --actual loading

To load tiddlers from the exsiting html file.

tiddlywiki ./MyWiki --load my_encrypted_wiki.html


user:~/tdwiki$ tiddlywiki ./mywiki  --load index_2015-9-23.html
syncer-server: Dispatching 'save' task: $:/StoryList
FileSystem: Saved file /home/user/tdwiki/mywiki/tiddlers/$__StoryList.tid
syncer-server: Dispatching 'save' task: bf Operator
FileSystem: Saved file /home/user/tdwiki/mywiki/tiddlers/bf_Operator.tid
syncer-server: Dispatching 'save' task: BetaReleases
FileSystem: Saved file /home/user/tdwiki/mywiki/tiddlers/BetaReleases.tid
syncer-server: Dispatching 'save' task: before Operator (Examples)
FileSystem: Saved file /home/user/tdwiki/mywiki/tiddlers/before_Operator_(Examples).tid
syncer-server: Dispatching 'save' task: before Operator
FileSystem: Saved file /home/user/tdwiki/mywiki/tiddlers/before_Operator.tid
...



4. verify that many tiddlers are created under the "miwiki" subdirectory



5. finaly, start the tiddlywiki service for "mywiki" on port 8080 of server ip 192.168.0.96, with logon id & password

nohup /usr/local/bin/tiddlywiki /home/user/tdwiki/mywiki --server 8080 $:/core/save/all text/plain text/html user xxxxxxx 192.168.0.96  &



6. To permanent add it as sysv service in 14.04. I created the following  3 scripts for init.d service to start the service called "mywiki" automatically upon rebooting.

 /home/user/tdwiki/start_mywiki.sh
 /home/user/tdwiki/stop_mywiki.sh
 /etc/init.d/mywiki
 



user:~/tdwiki$ cat start_mywiki.sh
#!/bin/bash

nohup /usr/local/bin/tiddlywiki /home/user/tdwiki/mywiki --server 8080 $:/core/save/all text/plain text/html user xxxxxxx 192.168.0.96   &




user:~/tdwiki$ cat stop_mywiki.sh
#!/bin/bash

ps -fu user |grep mywiki |grep 8080 |awk '{ print $2 }' | xargs kill




#Note here the scipt name /etc/init.d/mywiki should not have the suffix ".sh"

user:~/tdwiki$ cat /etc/init.d/mywiki
#! /bin/sh
### BEGIN INIT INFO
# Provides: daoqidao wiki
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: for daoqidao tiddlywiki service
# Description: This file starts and stops tiddlywiki server
#
### END INIT INFO

case "$1" in
 start)
   su user -c /home/user/tdwiki/start_mywiki.sh
   ;;
 stop)
   su user -c /home/user/tdwiki/stop_mywiki.sh
   sleep 1
   ;;
 status)
   ps -fu user |grep mywiki |grep 8080
   ;;
 restart)
   su user -c /home/user/tdwiki/stop_mywiki.sh
   sleep 2
   su user -c /home/user/tdwiki/start_mywiki.sh
   ;;
 *)
   echo "Usage: mywiki {start|stop|restart}" >&2
   exit 3
   ;;
esac

7. If all goes well then register the script as an init script:

sudo update-rc.d mywiki defaults

8. Reboot the machine and make sure that Tomcat has started.

References:  https://mobiarch.wordpress.com/2014/05/16/creating-an-init-script-in-ubuntu-14-04/


9. I also created a such service in one Ubuntu 15.04, which uses systemd instead to manage the service. The script is different.


user:~/tdwiki/ubuntu15.04$ cat /etc/tiddlywiki.conf
WIKI=/home/user/tdwiki/mywiki
PORT=8080
OPTS="$:/core/save/all text/plain text/html"
USER=user
PWD=xxxxxxx
IP=192.168.0.96

user:~/tdwiki/ubuntu15.04$ cat tiddlywiki.service
[Unit]
Description=TiddlyWiki
After=syslog.target

[Service]
User=user
Group=user
SyslogIdentifier=tiddlywiki
Restart=always
setuid=1000
StandardOutput=syslog
EnvironmentFile=/etc/tiddlywiki.conf
ExecStart=/usr/local/bin/tiddlywiki $WIKI --server $PORT $OPTS $USER $PWD $IP

[Install]
WantedBy=multi-user.target


10. move the file tiddlywiki.service to /etc/systemd/system and ran sudo systemctl enable tiddlywiki.service to create link scripts.

11. Restart server for verification

Friday, September 25, 2015

running tiddlywiki on windows as a service

Referenced below two links: http://tiddlywiki.com/static/Installing%2520TiddlyWiki%2520on%2520Node.js.html
http://www.rubix.nl/blogs/running-tiddlywiki-service-linux-and-windows

But they are not detai enough for me, so list down my steps after spending half an hour on the setup.

1. download node.js from https://nodejs.org/dist/latest/ and installed it.

2. now I have npm.exe to install tiddlywiki.


C:\Users\liqy>npm install -g tiddlywiki
C:\Users\liqy\AppData\Roaming\npm\tiddlywiki -> C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki\tiddlywiki.js
tiddlywiki@5.1.9 C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki

Note that tiddlywiki.js is installed under AppData sub-directory by default.

C:\Users\liqy>

3. now initialize the notebook named "mywiki". The step should be followed, which same as on Linux platform.


Note that the directory for notebook "mywiki" should be empty.

C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki>node .\tiddlywiki.js "
D:\mydoc\pp\sync\mywiki" --init server
Error: Wiki folder is not empty

--this is due to I put a local copy of tiddlywik html file there.

--after remove it , and try again

C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki>node .\tiddlywiki.js "
D:\mydoc\pp\sync\mywiki" --init server
Copied edition 'server' to D:\mydoc\pp\sync\mywiki


3.2 If not, I hit below error when I try to start the service

C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki>node .\tiddlywiki.js "
D:\mydoc\pp\sync\mywiki" --server 88 --verbose --rendertiddler $:/core/save/all
mywiki.html text/plain
Warning: Wiki folder 'D:\mydoc\pp\sync\mywiki' does not exist or is missing a ti
ddlywiki.info file
Serving on 127.0.0.1:88
(press ctrl-C to exit)

$:/core/modules/commands/server.js:304
        if($tw.boot.wikiInfo.plugins.indexOf("tiddlywiki/tiddlyweb") === -1 || $
tw.boot.wikiInfo.plugins.indexOf("tiddlywiki/filesystem") === -1) {
                            ^
TypeError: Cannot read property 'plugins' of null
    at Command.execute ($:/core/modules/commands/server.js:304:22)
    at Commander.executeNextCommand ($:/core/modules/commander.js:82:14)
    at Commander.execute ($:/core/modules/commander.js:46:7)
    at Object.exports.startup ($:/core/modules/startup/commands.js:34:12)
    at $tw.boot.executeNextStartupTask (C:\Users\liqy\AppData\Roaming\npm\node_m
odules\tiddlywiki\boot\boot.js:1905:10)
    at $tw.boot.executeNextStartupTask (C:\Users\liqy\AppData\Roaming\npm\node_m
odules\tiddlywiki\boot\boot.js:1903:21)
    at $tw.boot.executeNextStartupTask (C:\Users\liqy\AppData\Roaming\npm\node_m
odules\tiddlywiki\boot\boot.js:1903:21)
    at $tw.boot.executeNextStartupTask (C:\Users\liqy\AppData\Roaming\npm\node_m
odules\tiddlywiki\boot\boot.js:1903:21)
    at $tw.boot.executeNextStartupTask (C:\Users\liqy\AppData\Roaming\npm\node_m
odules\tiddlywiki\boot\boot.js:1903:21)
    at $tw.boot.startup (C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywi
ki\boot\boot.js:1856:11)








4.  Try to start the service to see if any error, before adding as a service

The command
node .\tiddlywiki.js "D:\mydoc\pp\sync\mywiki" --server 88 --verbose --rendertiddler $:/core/save/all mywiki.html text/plain

This is to start the tiddly service listening on localhost port 88 , for notebook named "mywiki"

C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki>node .\tiddlywiki.js "
D:\mydoc\pp\sync\mywiki" --server 88 --verbose --rendertiddler $:/core/save/all
mywiki.html text/plain
Serving on 127.0.0.1:88
(press ctrl-C to exit)
Boot log:
  Startup task: load-modules
  Startup task: info after: load-modules before: startup
  Startup task: startup after: load-modules
  Startup task: story after: startup
  Startup task: commands platforms: node after: story
Executing command: rendertiddler $:/core/save/all mywiki.html text/plain
syncer-server: Dispatching 'save' task: $:/StoryList
FileSystem: Saved file D:\mydoc\pp\sync\mywiki\tiddlers\$__StoryList.tid
syncer-server: Dispatching 'save' task: $:/StoryList
FileSystem: Saved file D:\mydoc\pp\sync\mywiki\tiddlers\$__StoryList.tid


5. Confirmed no issue with method, pressed CTRL+C to stop it , and invoke the nssm installed to add service to the windows registry.

D:\tools\nssm\win32>nssm install tiddlywiki
Service "tiddlywiki" installed successfully!

The startup directory in my case is:

 C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki

The arguments in my case is :

.\tiddlywiki.js "D:\mydoc\pp\sync\mywiki" --server 88 --verbose --rendertiddler $:/core/save/all mywiki.html text/plain

By the way, command to edit the tiddlywiki is
D:\tools\nssm\win32>nssm edit  tiddlywiki



6.Verify that "tiddlywiki" service is added in "control panel/services"



7. Finally I see it in my web browser with address "http://localhost:88"




8. If there is existing tiddlers in a single html file, I believe tiddlywiki upload command can help to migrate existing tiddlers.







Tuesday, July 21, 2015

Open Cygwin Terminal in Windows Explorer

I like opening a terminal session under Linux file explorer.  I want to have the same in Windows Explorer.

Second round with hard working of Googling, I made it for another DBA Knife !

Again, playing with registry .






References:

http://scottiestech.info/2009/11/15/addyourownprogramtothewindowsexplorerrightclickcontextmenu/
http://www.vultaire.net/blog/2013/06/18/simpletrickscyghereopencygwinshellhere/

Right Click and Zip with PeaZip in windows 7

Feeling not convenient in Windows Explorer, which can only extract a .zip file, but can't zip a file or directory.  Due to license issue, I have to use open source PeaZip to do the compression job.

After hard working with Google, here are my new member of DBA Knife.

For selected file.



For selected directory


Note that the double quota of %1, which allows space with a file/directory name.


Tuesday, December 24, 2013

decode/unwrap .plb file

find a useful link http://www.codecrete.net/UnwrapIt/, helped to see what is inside the hotfix in .plb format.

With this we are have a bit confidence to roll it out to production, while waiting for further detail explanation from vendor.



to relevant utility to create plb file is  DBMS_DDL.CREATE_WRAPPED.

more info http://www.orafaq.com/wiki/PL/SQL_FAQ

How can I protect my PL/SQL source code?

Oracle provides a binary wrapper utility that can be used to scramble PL/SQL source code. This utility was introduced in Oracle7.2 (PL/SQL V2.2) and is located in the ORACLE_HOME/bin directory.
The utility use human-readable PL/SQL source code as input, and writes out portable binary object code (somewhat larger than the original). The binary code can be distributed without fear of exposing your proprietary algorithms and methods. Oracle will still understand and know how to execute the code. Just be careful, there is no "decode" command available. So, don't lose your source!
The syntax is:
wrap iname=myscript.pls oname=xxxx.plb
Please note: there is no legal way to unwrap a *.plb binary file. You are supposed to backup and keep your *.pls source files after wrapping them. However it is possible for skilled hackers to unwrap your wrapped Oracle PL/SQL code.

How can I know which stored PL/SQL code is wrapped?

The following query gives the list of all wrapped PL/SQL code:
select owner, name, type
from dba_source
where line = 1
  and instr(text, ' wrapped'||chr(10))+instr(text, ' wrapped '||chr(10)) > 0
order by 1, 2, 3
/


Tuesday, January 15, 2013

cywin log location

always notice cygwin hang at 100% after download and running preremove scripts, from the log found in /var/logs/ , I see the conflict.
Next, I use processexploer and search cygwin to kill suspicious process. Finally I get it move.

Thursday, January 10, 2013

turn off vi syntax color when using Putty

when using putty SSH to linux server, the vi syntax color is always make me to difficult to see them clearly no matter how I try to change to backgroud putty color , as shown above.






Thanks to the following two URL.


Enabling vi syntax colors

Turn on or off color syntax highlighting in vi or vim



The solution to me is to create .vimrc file in one's home directory.

orarac1poc:DG:/home/oracle> cat .vimrc
syntax off

or inside vi, type command ":syntax off"

That is it.

Sunday, April 01, 2012

Quest Toad and Alternatives

Quest Toad and Alternatives

http://yong321.freeshell.org/oranotes/ToadAndAlternatives.html#ToadAlternatives


Wednesday, April 27, 2011

Install Cygwin Xserver

Xserver Hummybird Exceed is funny, after launch it, I can't open multiple x-windows -- they overlap (the first window is right under 2nd one, thus can't interactive it) , e.g running dbua to upgrade multiple databases in parallel to save downtime.  Hence, I think of using Cygwin/X to avoid install x11, which is easy without any license issue.

1. Open Cygwin setup application, install X11 package with default choice.
2. Type "starxwin" to launch X server
3. In the terminal , type "xhost + " to allow all connections from any
computers. (This step is important)
4. In putty session, export DISPALY=< x-server ip:0 >
5. For testing purpose, test launch "xclock"

Friday, October 01, 2010

editing multpile files with vi

Googled and learned useful commands can still recall today
:n    #go to next file
:rew  # rewind to first file
:e!     # abandon all changes

I think these basic commands are more than enough

Sunday, July 11, 2010

virtualbox vs vmware

VirtualBox 3 vs Vmware Workstation 6.5.2

 

5 Reasons Why You Should Use VirtualBox Over VMware Server

VirtualBox vs. VMware vs. Parallels

 

[My key opinion]

 VMWare:   Better support USB devices, while virtualbox uses share folder.

VirtualBox:  Suppose both sounds of host and guest. 


 

 

Performance of compress tools : 7z and gzip

hmc@hmc-desktop:/mnt/vm$ ls -l xp
total 5358756
-rw------- 1 hmc hmc 5481996800 2010-07-10 22:52 xp.vdi



compress this  5Gb file of virtual image, using 7z takes near 1 hours to finish, while gzip is about 8 minutes.  However, 7z's compress ratio is higher than gzip about 16%.

hmc@hmc-desktop:/mnt/vm$ time tar cvfz xp.gz ./xp
./xp/
./xp/xp.vdi

real    7m49.668s
user    6m3.430s
sys    0m28.660s


[compressed file size]

-rw-r--r-- 1 hmc  hmc  2587547513 2010-07-10 23:41 xp.7z
-rw-r--r-- 1 hmc  hmc  3332232784 2010-07-10 23:52 xp.gz


Here is a good article about compress tools' performance 

Compression Tools Compared

Add testing result with bz2.  Looks gz format will be my first choice.

hmc@hmc-desktop:/mnt/vm$ time tar cvfj xp.bz2 ./xp
./xp/
./xp/xp.vdi

real    36m11.689s
user    29m39.640s
sys    0m36.570s
hmc@hmc-desktop:/mnt/vm$ ls -l xp
total 5371056
-rw------- 1 hmc hmc 5494579712 2010-07-11 13:53 xp.vdi
hmc@hmc-desktop:/mnt/vm$ ls -l xp.bz2
-rw-r--r-- 1 hmc hmc 3318611695 2010-07-11 15:15 xp.bz2
 

Tuesday, April 20, 2010

SSH public key authentication

Finally I configured SSH public key authentication on my Cygwin.  So it is so convenient to log on to various Unix servers.  :-)

-- on my local PC
$ pwd
/home/liqy/.ssh
$ ls -l
total 8
-rw------- 1 liqy Domain Users  898 2010-04-19 11:09 id_rsa
-rw-r--r-- 1 liqy Domain Users 1196 2010-04-19 10:56 known_hosts
$ ssh rpt02
Last   successful login for liqy: Mon Apr 19 11:10:48 SST-8 2010
Last unsuccessful login for liqy: Tue Mar 16 01:59:06 SST-8 2010    
Last login: Mon Apr 19 11:10:48 2010 from 146-105-22.int.m1.com.sg
rpt02@/home/liqy> cd .ssh    
-- on remote server                                          
rpt02@/home/liqy/.ssh> ls -lrt
total 64
-rw-------   1 liqy       users         1024 Nov 27  2007 prng_seed
-rw-r--r--   1 liqy       users         9061 Dec 14 09:57 known_hosts
-rw-r--r--   1 liqy       users          220 Apr  1 13:57 authorized_keys