Developer

From bone.wiki
Jump to navigation Jump to search

vtkMy

WinCVS and PuTTY for vtkMy

Setting up WinCVS to use PuTTY is fairly straghtforward, but does require a few configuration settints in addition to installing the software. You can do it with the following steps.

  1. Install PuTTY (http://www.chiark.greenend.org.uk/~sgtatham/putty/).
  2. Install wincvs (http://www.wincvs.org/)
  3. Make a key:
    • Follow menus: Start/Programs/PuTTY/PuTTYgen From the PuTTY Manual:
    ...press the "Generate" button and PuTTYgen will begin the process of actually generating the key.
    • First, a progress bar will appear and PuTTYgen will ask you to move the mouse around to generate randomness. Wave the mouse in circles over the blank area in the PuTTYgen window, and the progress bar will gradually fill up as PuTTYgen collects enough randomness. You don't need to wave the mouse in particularly imaginative patterns (although it can't hurt); PuTTYgen will collect enough randomness just from the fine detail of exactly how far the mouse has moved each time Windows samples its position.
    • When the progress bar reaches the end, PuTTYgen will begin creating the key. The progress bar will reset to the start, and gradually move up again to track the progress of the key generation. It will not move evenly, and may occasionally slow down to a stop; this is unfortunately unavoidable, because key generation is a random process and it is impossible to reliably predict how long it will take.
    • When the key generation is complete, a new set of controls will appear in the window to indicate this.
  4. Set the key comment and password. Set the key comment to your email address by typing it into the "Key Comment" box. Set the password by entering it twice, once in the "Key passphrase" box and once in the "Confirm Passphrase" box.
  5. Save the keys:
    save the public key on your desktop as identity.pub and the private one as identity.ppk
  6. Email the identity.pub file as an attachment to skboyd@ucalgary.ca and ask for it to be added to the .ssh/authorized_keys file for your cvs repository. Please specify which repository you are requesting access to in the e-mail (i.e., vtkMy).
  7. Setup environment variables
    • Choose Menus:
      Start/Settings/Control Panel
    • Double click on the "System" Control Panel
    • Pick the "Advanced" tab and pick "Environment Varibles..."
    • Add User environement variables
    - Add PLINK_PROTOCOL value "ssh"
    - Add CVS_RSH value "plink"
    - Edit or Add PATH appending value ";C:\Program Files\PuTTY"
  8. In WinCVS, bring up the "Preferences" dialogue box from the Admin menu
    • In the "General" tab put in your CVSROOT value, (i.e. :ext:myusername@m177.enme.ucalgary.ca:/localhost/cvsroot)
      File:Wincvs general.jpg
    • Switch to the "Ports" tab.
    • Tick the box there labelled "Check for an alternate rsh name" and in the text entry field to the right enter "plink".
      File:Wincvs ports tab.jpg
    • Select "OK" on teh "Preferences" dialogue box.
  9. Once you've heard back from the administrator (skboyd) that your ssh keys have been added, test your putty key configuration:
    • Double click on "identity.ppk" on your desktop. If this doesn’t start pagaent.exe automatically, then manually start the program from the directory you installed putty.exe.
    • If your identity file isn't already loaded, you will be prompted for the password you entered in step 4.
    • The Pageant icon (a little PC with a hat) should appear in the bottom right menu bar.


You should now be able to use WinCVS to access the repository, with a secure connection whenever Pageant is running. You can start Pageant by double-clicking on your identity.ppk file.

XEmacs

Pretty print

  • For colour printing, select "Options", "Syntax Highlighting", "In this buffer"
  • In "Page Setup" set the margins to be 10 mm on the left and rights sides
  • In the "Printer Properties" on the "Effects" tab, use 90% of Normal size

C Shell Scripts

These scripts must be executable.

$ chmod 775 myscript.com

Sample 1

This file aim2voi.com shows the use of command line arguments in a CSH script.

#!/bin/csh
#------------------------------------------------------------------------------
onintr end
if ($#argv < 1) goto usage
#------------------------------------------------------------------------------
aix $1.aim > $1.dsc
aic2voi $1.aim $1.voi
goto end
#------------------------------------------------------------------------------
usage:
#
echo ""
echo "Usage:"
echo ""
echo "aim2voi aim_filename (without aim extension)"
echo "will create a voi and dsc file from an aim"
echo ""
#
exit
#------------------------------------------------------------------------------
end:
exit
#------------------------------------------------------------------------------

Sample 2

Similar to above, but aim2bid.com generates a temporary file called stack which is used as input.

#!/bin/csh
#------------------------------------------------------------------------------
onintr end
if ($#argv < 4) goto usage
#------------------------------------------------------------------------------
set i = $3
while ($i <= $4)
  set nr = $i
  if ($nr<10)  set nr = "0"$nr""
  if ($nr<100) set nr = "0"$nr""
#  if ($nr<1000) set nr = "0"$nr""
  echo "XY" >! stack
  echo "$i" >> stack
  echo "$5" >> stack
  if ($6 != "") then
    echo "0" >> stack
    aio $1 "$2"_"$nr".bid 14 < stack
    convert -size "$7" "$2"_"$nr".bid "$2"_"$nr"."$6"
    \rm -f "$2"_"$nr".bid
  else
    echo "2" >> stack
    aio $1 "$2"_"$nr".bid 14 < stack
  endif
  \rm -f stack
  @ i = $i + 1
end
goto end
#------------------------------------------------------------------------------
usage:
#
echo ""
echo "Usage:"
echo ""
echo "aim2bid aim_filename bid_prefix first_slice last_slice scal_factor [form size])"
echo "                                (values are one-based)              gif/tif/..."
echo ""
#
exit
#------------------------------------------------------------------------------
end:
exit
#------------------------------------------------------------------------------

Sample 3

An example where a sequence of commands are executed resulting in an e-mail to let the user know that their job is finished.

#!/bin/csh
# 
nohup faim -s $1; /bin/csh -cbf "Mail -s 'JOB $1 FINISHED' boyd@kin < ~/adm/mailer/faimjob.txt" &

You would run this script called faim.com as follows

$ faim.com inputfile

Sample 4

This example uses two files. One called wrap.com is the base program that is called in a more general program called wrap_all.com so that many different files can be processed by the base script.

  • wrap.com
#!/bin/csh

echo "0" >! stack
echo "0" >> stack
echo "0" >> stack

/home/skb/works/fio/aim_io $1.aim $1_sub.aim minimal 15 < stack

/rm -f stack

exit
  • wrap_all.com
#!/bin/csh

~/works/com/wrap calgary_dog_aclx_03-04_med_fem_left
~/works/com/wrap calgary_dog_aclx_03-04_med_fem_right
~/works/com/wrap calgary_dog_aclx_03-04_med_tib_left
~/works/com/wrap calgary_dog_aclx_03-04_med_tib_right

echo "DONE!"
exit

temple.ucalgary.ca

Configuration Details

I include in the attachments my checklist I use for a Solaris 10 installation, adjusted to show only items particular to yours and not my entire decision tree. I added brief explanations for some of the items that might seem arbitrary otherwise.

Very similar decisions are made when installing any release of Linux, Solaris, MS Windows or yet another operating system - the details vary though.

http://docs.sun.com/ has all (too many) the details.

Install XEmacs

However, I would not install both Emacs and XEmacs at the same time. Nowadays, I highly recommend installing only one of them, with my preference given to XEmacs. Of course, only when there are no specialized Lisp packages that require Emacs.

Then my installation would be like below:

$ cd /cdrom/s10_software_companion/components/sparc/Packages
$ cat > /tmp/nointeraction
  mail=
  instance=unique
  partial=nocheck
  runlevel=nocheck
  idepend=nocheck
  rdepend=nocheck
  space=quit
  setuid=nocheck
  conflict=quit
  action=nocheck
  basedir=default

$ pkgadd -a /tmp/nointeraction -d . -n SFWbdb SFWgcc34l SFWxmacs
  [ Copyright and legal notices omitted for brevity. ]
  21872 blocks

  Installation of <SFWbdb> was successful.
  [ Copyright and legal notices omitted for brevity. ]
  69953 blocks

  Installation of <SFWgcc34l> was successful.
  [Copyright and legal notices omitted for brevity. ]
  264202 blocks

  Installation of <SFWxmacs> was successful.

$ emacs () { /opt/sfw/bin/xemacs $* ; }

$ pkgadd -a /tmp/nointeraction -d . -n SFWddd SFWgbin SFWgdb
  [ To complete installation of the other packages you require. ]

$ pkginfo SFWbdb SFWddd SFWgbin SFWgcc34l SFWgdb SFWxmacs
  system      SFWbdb    berkeleyDB - Berkeley Database Library
  system      SFWddd    ddd - GNU Data Display Debugger
  system      SFWgbin   binutils - GNU binary utilities
  system      SFWgcc34l gcc-3.4.2 - GNU Compiler Collection Runtime Libraries
  system      SFWgdb    gdb - GNU source level debugger
  system      SFWxmacs  XEmacs - text editor