devz howto II

devz Howto

Get devz
$ git clone
$ cd devz

Install devz as root
$ su
# ./
# source ~/.bashrc

Install devz for a user
# exit
$ ./
$ source ~/.bashrc

Configure devz
  • 1) Copy public SSH key to remote system(s)
  • 2) Adjust ~/.devzconfig/production-servers
1) Create SSH key pair and copy the public key to a remote "production" server.
$ ssh-keygen -t dsa
$ scp ~/.ssh/ production_server:~/.ssh/authorized_keys2
2) An example ~/.devzconfig/production-servers
# production servers
# IP address , SSH TCP port, user,44,usar,22,usar

Use devz

Initialize SSH agent.
$ devz-setagent

$ stor blah
devz:The directory ./stor does not exist! I will create it.
devz:blah is at ./stor/blah.0

$ toprod blah 
devz:/home/usar/blah to usar@
blah                                                                                                          100%    6     0.0KB/s   00:00  
devz:/home/usar/blah to usar@
blah                                                                                                          100%    6     0.0KB/s   00:00

$ ctoprod "cat blah"
devz: usar@ "cat blah"

devz: usar@ 


$ fromprod blah
devz:blah exists! Please stor it and delete it or rename it.
$ rm blah
$ fromprod blah
devz:ipduh@ to /hom/usar/blah
blah                                                                                                          100%    6     0.0KB/s 00:00                                       

get help-cheatsheet
$ devz
DEVeloper'S Stupid Servant.
A bash extention that helps the administrator of similar dev and production systems.
g0 2010 -
devz verbs:
'toprod' or 'devz toprod'
 toprod file
 scp a file to the production server(s)
'ctoprod' or 'devz ctoprod'
 ctoprod 'command;command;'
 send command(s) to poduction server(s)
'fromprod' or 'devz fromprod'
 fromprod file
 scp a file from the first production server here.
'stor' or 'devz stor'
 stor file
 creates the directory stor in the current directory if it does not exist.
 makes a copy of the file in stor
 the file gets a version number like file.n where n [0,n]
'devz-setagent' or 'devz setagent'
 start an ssh-agent login session
'devz-showconfig' or 'devz showconfig'
 See the Current devz configuration
'devz-setconfig' or 'devz setconfig'
 add server to the production-servers list file
 setconfig cannot configure much, check the devz-howto for your first setup
'devz-prodsrvexists' or 'devz prodsrvexists'
 check if ${DEVZ_PRO_SRV} exists and  print an example ${DEVZ_PRO_SRV} file