Setting up Windows

Installing WSL

  • Install Windows Subsystem for Linux and the VcXsrv X11 server.
  • Install the following programs
    • gnuplot - a plotting program
    • ImageMagick - a software suite to create, edit, compose, or convert bitmap images

Open a WSL terminal and run:

sudo apt update
sudo apt install gnuplot imagemagick

Installing common GUI tools

Setting up ssh-agent

  • Generate a key pair following the first bullet point under SSH-Agent , then skip to the last bullet point, and install weasel-pageant.
  • Open a WSL terminal and follow “On Ubuntu or Debian” in GPG-Agent.
  • Install the Windows version of GPG-agent following “On Windows”.
  • Add the lines under “Useful common settings”.

Setting up .ssh/config

Follow the steps in Customizing .ssh/config and set up Sharing sessions over a single connection and Host alias. Leave Multi-hop for later when you need it but do keep in mind of this option.

Windows Subsystem for Linux

Windows Subsystem for Linux (WSL) is a compatibility layer for running Linux binary executables (in ELF format) natively on Windows 10. This means you can download an executable compiled for Linux and run it unmodified under Windows. You can also use `apt install` to access the repertoire of all Ubuntu packages. You can also install a different distribution such as Fedora and openSUSE via Windows Store.

X11 and DBus

Since WSL does not currently support X11 and Unix sockets, which DBus uses by default, we need to do the following:

  • Install VcXsrv or Xming.
  • export DISPLAY=:0.0. You can add this to your shell init script:
echo "export DISPLAY=:0.0" >> ~/.bashrc
  • In /etc/dbus-1/session.conf, replace unix:tmpdir=/tmp with tcp:host=localhost,port=0. If the file or the line does not exist, simply add it.
  • Suppress a few other benign warnings:
echo "export NO_AT_BRIDGE=1" >> ~/.bashrc
sudo dbus-uuidgen > /etc/machine-id

Cygwin

Install packages from the command line

  • For simple usage, you can run Cygwin setup.exe directly:
setup-x86.exe -q -P packagename1,packagename2

Set different permissions for user and group

It is impossible to set different permissions for user and group, if group is set to None. To change this, simply set a valid group:

chown -R :Users directories_or_files

Install SSHD daemon

  • Use Cygwin setup.exe to install OpenSSH and cygrunsrv;
  • Start a Cygwin bash shell as an Administrator;
  • Run ssh-host-config [-y], answer yes to all questions except the one that asks if you want to use a different user name instead of “cyg_server”;
  • Enter “ntsec”, “tty ntsec” or “binmode ntsec” to the prompt “Enter the value of CYGWIN for the daemon”, which will enable communication with the NT authentication database;
  • Run the following commands to change permissions of relevant files:
chown cyg_server:root /etc/ssh*
chmod go-rwx /etc/ssh*_key
chown -R cyg_server:root /var/empty
chmod 755 /var/empty
chown cyg_server:root /var/log/sshd.log
chmod 644 /var/log/sshd.log
  • Open Computer Management, go to Services and Applications -> Services, right-click CYGWIN sshd and select Properties. In the Properties dialog box, go to the Log On tab, select Log on as this account, and specify the domain/user name and password. Click Apply.
  • SSHD daemon will now start at boot. You can start it right away with cygrunsrv -S sshd, net start sshd, or /usr/sbin/sshd;
  • Add a rule in Advanced Windows Firewall settings to allow C:\cygwin64\usr\sbin\sshd.exe. You can limit Services to “Apply to services only” and Local port to “Specific Ports” (e.g., 22).

Install cron daemon

  • Use Cygwin setup.exe to install cron and cygrunsrv;
  • Start a Cygwin bash shell as an Administrator;
  • Add cron as a Windows service and start it:
cygrunsrv -I cron -p /usr/sbin/cron -a -n
cygrunsrv -S cron # or "net start cron" or "/usr/sbin/cron -a -n"
  • As usual, use crontab to add tasks; maybe something like updating DDNS services every hour if you don’t have static IP addresses:
0 * * * * ip=$(curl -s "http://freedns.afraid.org/dynamic/update.php?SPECIAL_STRING"|/usr/bin/gawk 'NF==6{print $3}NF==7{print $4}'); curl "https://www.dtdns.com/api/autodns.cfm?id=yourname.suroot.com&pw=PASSWORD&ip=$ip" &> /dev/null; curl --user your@email.com:PASSWORD "https://www.dnsdynamic.org/api/?hostname=yourname.dnsd.info&myip=$ip" &> /dev/null; curl --user USERNAME:PASSWORD "https://members.dyndns.org/nic/update?hostname=yourname.dyndns.org&myip=$ip" &> /dev/null

Install zeromq / pyzmq

This software is needed if, for example, you want to pip install ipython[notebook]. As of 2015/01/08, you have to first install zeromq separately. Follow the “To build on UNIX-like systems” section, but you don’t need the build-essential and uuid/e2fsprogs packages.

To compile zeromq, you need to apply the hacks here. Basically, force libzmq.la to compile as C++ library:

mv tools/curve_keygen.c tools/curve_keygen.cpp
sed -i 's/\.c\>/&pp/' tools/Makefile.am
rm -f tools/.deps/curve_keygen.Po
./autogen.sh
make

Then you will need to create a shared library manually following the suggestions here:

export ARTIFACT=/usr/local # the path you have supplied to ./configure --prefix=$ARTIFACT

# shared libraries broken with 0MQ on Cygwin64
# manual shared library link and install from static library

gcc -shared -o cygzmq.dll -Wl,--out-implib=libzmq.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive src/.libs/libzmq.a -Wl,--no-whole-archive -lstdc++

mkdir -p $ARTIFACT/bin
install cygzmq.dll $ARTIFACT/bin

mkdir -p $ARTIFACT/lib
install libzmq.dll.a $ARTIFACT/lib

Then you can install ipython or do pip install pyzmq.

Online Resources

Computational Chemistry

  • Gaussian Basis Set Order Form: The Molecular Science Computing Facility of the Environmental and Molecular Sciences Laboratory (EMSL) is a part of the Pacific Northwest Laboratory located in Richland, Washington. This National Laboratory is funded by the U.S. Department of Energy. The EMSL Basis Set Order Form allows the user to extract Gaussian basis sets, formatted appropriately for a wide variety of popular computational chemistry software packages, including Gaussian and GAMESS.

  • STFC Computational Science and Engineering Software: software from UK Collaborative Computational Projects.

  • Software Archive: at the Materials Computation Center of UIUC.

  • Computational Chemistry List: is an electronic forum for chemistry researchers and educators.

  • Linux4Chemistry: provides information about computational chemistry software for the Linux operating system.

  • WebMO: WebMO is a web-based interface available in both freeware and commercial (Pro) versions that provides simple molecule building, set-up of calculations, and viewing of results. The program provides an easy-to-use interface to a variety of computational chemistry software packages, such as Gaussian, GAMESS, MOPAC, and Tinker. WebMO Pro, along with these four computational chemistry programs, is available on the North Carolina High School Computational Chemistry server.

  • Computational Chemistry for Chemistry Educators: Computational Chemistry for Chemistry Educators (CCCE) is the companion Web-based resource for the computational chemistry workshops offered through the Shodor Education Foundation’s National Computational Science Institute (NCSI). Funding for NCSI was provided (in part) by the Burroughs Wellcome Fund and the NSF. CCCE is designed to provide educators with sufficient information so they can begin to use molecular modeling tools in the chemistry classroom to improve the education of their students. Perhaps the most useful aspect of this site is the collection of computational laboratory exercises available for various software packages, including WebMO.

Chemical Properties

  • NIST Chemistry WebBook: provides access to data compiled and distributed by NIST under the Standard Reference Data Program, including Thermochemical data for over 7000 organic and small inorganic compounds, Reaction thermochemistry data for over 8000 reactions, IR spectra for over 16,000 compounds, Mass spectra for over 33,000 compounds, UV/Vis spectra for over 1600 compounds, Gas chromatography data for over 27,000 compounds, Electronic and vibrational spectra for over 5000 compounds, Constants of diatomic molecules (spectroscopic data) for over 600 compounds, Ion energetics data for over 16,000 compounds, Thermophysical property data for 74 fluids:

  • Computational Chemistry Comparison and Benchmark Database: A service of the National Institute of Standards and Technology (NIST), the Computational Chemistry Comparison and Benchmark Database (CCCBDB) provides a collection of both experimental and calculated thermochemical parameters for a selected set of molecules. These data are provided to help software developers evaluate program performance and to compare the results from different computational methods. The site also provides a useful source of data for educators and their students.

  • Merck Index: is an encyclopedia of chemicals, drugs and biologicals with over 10,000 monographs on single substances or groups of related compounds. It also includes an appendix with monographs on organic name reactions. It was published by the United States pharmaceutical company Merck & Co. from 1889 until 2013, when the title was acquired by the Royal Society of Chemistry.

  • CHEMnetBASE: is a web-based compilation of chemistry reference books produced by Chapman & Hall/CRC Press. The information is useful for quick access to chemical and physical property data and appropriate for undergraduate to professional levels. The contents of CHEMnetBASE come from well-known and well-respected reference books. Resources included are the Combined Chemical Dictionary (CCD), Dictionary of Commonly Cited Compounds, Dictionary of Drugs, Dictionary of Inorganic and Organometallic Compounds, Dictionary of Natural Products, Dictionary of Organic Compounds, the Handbook of Chemistry and Physics, Polymers: A Property Database, and Properties of Organic Compounds (POC).\   The Combined Chemical Dictionary is comprised of over 160,000 entries on compounds and their derivatives, uses, and properties from the five chemical dictionaries, each of which can also be searched separately. Now in its 87th edition, the Handbook of Chemistry and Physics, referred to as “the CRC” by many chemists, is the granddaddy of compilations of chemical data and often a chemist’s first reference source as a student. Polymers: A Property Database offers information on polymers for a wide range of physical properties as well as commercial information. Properties of Organic Compounds, the online equivalent of the Handbook of Data on Organic Compounds, is a collection of property information and searchable spectral data on about 29,000 organic compounds.

  • NCMS Solvents: brings together a wealth of information on commercially available solvents, including: Health and Safety considerations involved in choosing and using solvents; Chemical and Physical data affecting the suitability of a particular solvent for a wide range of potential applications; Regulatory responsibilities, including exposure and effluent limits, hazard classification status with respect to several key statutes, and selected reporting requirements; Environmental Fate data, to indicate whether a solvent is likely to break down or persist in air or water, and what types of waste treatment techniques may apply to it.

  • CODATA Key Values for Thermodynamics: A table presenting the final results of the project to establish internationally agreed values for the thermodynamic properties of key chemical substances conducted by Committee on Data for Science and Technology (CODATA).

  • Interactive Pressure-Temperature Nomograph: a web applet from Sigma-Aldrich with properties for common solvents built in.

  • Thermodynamic Properties of Air: calculates the thermodynamic properties of air given the pressure and entropy, pressure and density, specific energy and density, entropy and enthalpy, or pressure and temperature.

Structure Databases

The following online resources contain files which can be downloaded for interactive viewing either from a stand-alone visualization software or viewed from the website as a Java applet.

  • Cambridge Structural Database: a repository for small-molecule organic and metal-organic crystal structures with over half-a-million x-ray and neutron diffraction analyses.

  • ICSD Web: the Inorganic Crystal Structure Database. This site contains a free demonstration version of the Inorganic Crystal Structure Database. This database contains a 3325 structure subset of the 76,480 inorganic structures as of 2004. The demo version can be queried and accessed by a web-interface which allows multiple methods of searching, and the resulting crystal structures can then be viewed online (with the CHIME plug-in) or downloaded for viewing with other visualization software. Also included on the site are updates of bug fixes, conditions of use and prices, tips for displaying the structures, a gallery of images, a flash movie, and instructions for installing a ICSD server.

  • American Mineralogist Crystal Structure Database. This site is an interface to a crystal structure database that includes every structure published in the American Mineralogist, the Canadian Mineralogist, and the European Journal of Mineralogy. The database is maintained under the care of the Mineralogical Society of America and the Mineralogical Association of Canada, and financed by the National Science Foundation. The site is searchable by mineral, author, chemistry, or cell parameters and symmetry.

  • Crystallography Open Database. This database is a sister to the American Mineralogist Crystal Structure Database (AMCSD) and contains all the data that is in the AMCSD as well as data that has been deposited by individuals and laboratories. The database is searchable by text, words, elements, volume, or number of elements. Crystal structure data are downloadable in CIF format, and users may upload crystal data as CIF or REF files.

  • Crystallographic Database for Minerals and Their Structural Analogues. This searchable database, maintained by the Russian Foundation of Basic Research, includes 4785 entries (2365 unique mineral names). Each mineral can be searched by name, specification, crystal chemical formula, or crystal structure characteristics. The crystal structure information includes mineral name, specification, crystal chemical formula, space group, unit cell parameters, coordinates, thermal factors and occupancy of atomic positions as well as literature references on crystal structure determination.

  • Crystal Structures. This website features interactive Java applets of a variety of crystal structures of minerals and non-minerals. The Java applet allows the user to rotate and change the size of the crystal. The site also includes links to other webpages about crystal structures.

  • Protein Data Bank: The Protein Data Bank (PDB) is a repository of structural information on large biological molecules such as proteins and nucleic acids. The structures have mostly been solved using single crystal X-ray diffraction, nuclear magnetic resonance (NMR), and cryo-electron microscopy (cryo-EM) techniques. A detailed understanding of the 3-D structure of these biomolecules can lead to an understanding of their function in a living organism. Atomic coordinates of the structures (in .pdb file format) can also be downloaded for use in computational chemistry programs.

  • Molecular Libraries: Reciprocal Net is funded by the U.S. National Science Foundation (NSF) as part of the National Science Digital Library (NSDL) project. Reciprocal Net maintains a distributed database of crystallographic information focused on smaller molecules of general interest. The structural data can be viewed in a variety of formats, and the data files can be downloaded and imported into programs such as WebMO so that calculations can be performed.\   The Mathmol library has 3-D structures for molecules that are often presented in introductory biology and chemistry textbooks. These structures can be downloaded (.pdb file format) and imported into WebMO.\   Another site that has downloadable structural files is 3DChem.com. Inorganic, organic, therapeutic drug, and biomolecular structures can be downloaded (.mol file format) and imported.

  • Bilbao Crystallographic Server: contains web-based crystallography tools the Bilbao Incommensurate Crystal Structure Database.

  • Database of Zeolite Structures: This database provides structural information on all of the Zeolite Framework Types that have been approved by the Structure Commission of the International Zeolite Association (IZA-SC). It includes descriptions and drawings of each framework type, user-controlled animated displays of each framework type, crystallographic data and simulated powder diffraction patterns for representative materials, relevant references, detailed instructions for building models, descriptions of some families of disordered zeolite structures.

Spectroscopy Databases

  • Bio-Rad Spectral Database: offers over 1.4 million high-quality IR, MS, NMR, NIR, Raman, and UV-Vis spectra (including Sadtler data), for interpretation, identification, verification, and classification of spectra.

  • FTIRsearch.com/RAMANsearch.com: is a unique web site dedicated to providing analytical chemists with on-line access to high quality FTIR and Raman spectral libraries. It replaces the free Spectra Online.

  • Spectral Database for Organic Compounds SDBS: is an integrated spectral database system for 34,000, mostly commercial organic compounds, which includes 24,700 electron impact Mass spectra (EI-MS), 52,500 Fourier transform infrared spectra (FT-IR), 15,400 1H nuclear magnetic resonance (NMR) spectra, 13,600 13C NMR spectra, 3,500 laser Raman spectra, and 2,000 electron spin resonance (ESR) spectra.

Scientific Computing

Fortran

Fortran Compilers

Linux Backup Commands

Command Backup that preserves hard links Hard link backups
GNU cp cp -av /source/directory /target/directory cp -avl /source/directory /target/directory
rsync rsync -avzPH --stats --delete --delete-excluded /source/directory /target/directory N/A
cpio find /source/directory -print -depth|cpio -pdum /target/directory find /source/directory -print -depth|cpio -pduml /target/directory
tar tar -cSf - /source/directory|tar -xvSpf - -C /target/directory N/A
dump (dump -0uanf - /source/directory|restore -xyvf - /target/directory) >& log N/A

Tar select files in a directory tree

find . -name 'test.*' | tar czvf test.tar.gz -T -
find . -name test.\* -print0 | xargs -0 tar czvf test.tar.gz
find . -name "test.*" -exec tar -rvf test.tar '{}' \;
# find . -name "test.*" -exec tar -cvf test.tar '{}' \; +  # not tested
find . -name "test.*" | cpio -o -H ustar | gzip -c > test.tar.gz

Visualization

Summary

ParaView and VisIt are two general purpose visualization tools, which support volume rendering and other advanced techniques. VTK is an open-source C++ library for 3D computer graphics, image processing and visualization, and has several interpreted interface layers including Tcl/Tk, Java, and Python. VMD is a very popular molecular visualization program.

Schrodinger

Install Schrodinger.

Jmol

Install Jmol

VMD

Installing VMD

  1. Go to the website
  2. Click on the VMD button and find your platform (preferably with Open GL). Click to begin the download.
  3. Follow the instructions to create a user account (used to determine usage and reported to the NSF or other funding agency supporting VMD development) and browse the README file (onscreen) while the program downloads.
  4. When download is complete, open a Finder window and move VMD into the Applications folder. To do this, drag the VMD icon (looks like a water molecule) over the ‘Applications’ menu on the left of the Finder window. The cursor should become a green plus sign.

Generating high-quality images

  • Make sure that in the Graphical Representations window, all your visualized components have high values for their resolution.
  • Open File Render Controls: from VMD Main window, File -> Render.
  • Changing the method from “Snapshot (VMD OpenGL window)” to basically anything else will dramatically improve the image quality. VMD User’s Guide recommends “Tachyon (internal, in-memory rendering)”. The default Snapshot renderer just captures what is on the VMD OpenGL Display area. It will even include other objects that are on top of the display window at the time when you perform the rendering.
  • To use renderers other than “Snapshot (VMD OpenGL Window)” or “Tachyon (internal, in-memory rendering)”, you need to perform two steps: first generate a scene description file from VMD, and second run the separate rendering program with your desired options to generate a raster graphics file. See Chapter 8.2 Higher Quality Rendering of VMD User’s Guide for more details on the different rendering programs and recommended options.
  • For example, to use Tachyon renderer with custom parameters, choose “Tachyon”, and in the Render Command text box enter: “/Applications/VMD 1.9.1.app/Contents/vmd/tachyon_MACOSXX86” -aasamples 8 -rescale_lights 0.4 -add_skylight 0.7 %s -format TARGA -o %s.tga. VMD will generate a scene file suitable as input for the Tachyon rendering program, with the name specified in the Filename text box, and then run the command given in the Render Command box to actually render the image. “%s” is the file name specified in the Filename box.
  • In addition, you can manually modify the scene file in order to change settings such as the resolution, anti aliasing threshold, and re-run the rendering program from the command line to generate another image file with the modifications you just made to scene descriptions.

Add/remove bonds

When reading in a simulation snapshot, VMD will try to determine the bonds between atoms. Sometimes it will draw bonds where they should not exist and at other times it can also miss certain bonds. Use the pickbond script from VMD Script Library to add/remove bonds.

  • Save the file to your disk.
  • Open VMD Main Window -> Extensions -> Tk Console.
  • Change to the directory where you save the tcl script and invoke the script:
cd target/directory
source pickbond.tcl # read in the script
pickbond add/del/stop # add bond, remove bond, stop pickbond action
  • Change the mouse mode to Pick by pressing P or from VMD Main Window -> Mouse -> Pick.
  • Click the two atoms between which you want to create and delete a bond.

Perform periodic boundary conditions at arbitrary positions

Sometimes you will want a particular molecule to be at the center of your system while your movie file has it always at the boundary of the simulation box. Suppose the simulation box is cubic with sides of length 32.0, and the molecule of interest is at (16.0, 32.0, 0.0), you can do the following:

set sel [atomselect top "all"] # select all atoms in your top molecule
$sel moveby {0 -16 16} # move all molecules
pbc set {32.0 32.0 32.0 90.0 90.0 90.0} # set the lattice parameters of the simulation box
pbc wrap # perform periodic boundary conditions
pbc join connected # re-connect molecules

Remote Access

If you ever want to work from home, connecting remotely to your computer is a must. In order for things to work the way you expect, you need to keep a few things in mind.

SSH

X Forwarding

  1. To connect to your office desktop (MSI and College of Science and Engineering Labs also offer SSH connection to their Linux machines), you will need an SSH client on your home computer or laptop. If you are working from a Mac or a Linux machine, you already have one built in. Just open a terminal and go. If you are working from a Windows PC, you can use MobaXterm (with X11 server and support for RDP, VNC, SSH, telnet, rsh, FTP, SFTP and XDMCP) or PuTTY.
  2. To run your X11 programs, you need some kind of X-emulator to mimic the X Window System. If you work from a Mac or a Linux machine at home, you already have one built in. If you work from a Windows PC and the client program you are using does not have it bundled, then you need VcXsrv or Xming.
  3. Be mindful of the firewall. Your desktop is set to deny access to any IP address coming from off-campus computers. To get around this, you can either first connect to one of MSI’s machines, and then connect to your computer, or to allow your home IP address Configure the tcp wrapper.
  4. To avoid all the trouble of getting SSH and X11 forwarding, as well as other Unix stuff, to work in Microsoft Windows, without the need for dual-booting, you can use Windows Subsystem for Linux, cygwin, or install a Linux distribution within your Windows operating system using VirtualBox.
  5. If you just want to access the library, then either VPN or SSH Tunneling should be sufficient.

SSH Tunneling

You can set up machines to which you have SSH access as Internet proxy via SSH Tunneling. This is useful for journal/database services which are restricted to university IP addresses. Firefox-proxy-setting.png

  • Establish a SSH connection with dynamical port forwarding: under Linux or Mac OS X, just open a terminal and enter: ssh -D 2001 -fN your_user_name@your_machine.dept.univ.edu. If you use PuTTY on Windows, load a saved session or create a new one, then in the left panel of the Configuration window, under Connection -> SSH -> Tunnels, enter 2001 as Source port, check Dynamic, click Add, and finally click Open to connect. You can save this back to the session if you like.
  • Direct the application to use the SOCKS proxy: set up your browser to use SOCKS v4 proxy at host 127.0.0.1 on port 2001. For Firefox, the setting is under Options -> Advanced -> Network -> Connection Settings. For Chrome, it is under Settings -> Show advanced settings -> Network -> Change proxy settings. You can also use add-ons such as FoxyProxy to easily switch between different proxy settings.
  • Check your IP address at, e.g. https://ipleak.net. It should show the IP address of the remote machine now.

SSH-Agent/Keychain/Pageant

To avoid having to enter a password every time you SSH, you can use ssh-agent, pageant from PuTTY or gpg-agent.

  • First generate a key pair and copy the public key to the target remote system. Make sure to provide a passphrase.
ssh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa
scp ~/.ssh/id_rsa.pub user@remote.system:.
ssh user@remote.system 'cat id_rsa.pub >> .ssh/authorized_keys && rm id_rsa.pub'

On Windows, simply use PuttyGen from PuTTY to generate a SSH-2 RSA key.

  • Do the following every time you begin a new terminal session:
eval $(ssh-agent)
ssh-add ~/.ssh/id_rsa

This will export a few environment variables so that tools such as ssh know where to request keys.

On Windows, use Pageant to serve keys. Many other software tools (i.e., WinSCP) know how to use PuTTY keys too. You can also create a shortcut to launch PuTTY immediately after adding a key:

C:\PuTTY\pageant.exe C:\path\to\id_rsa.ppk -c C:\PuTTY\putty.exe
  • A nuisance with the approach so far is that the relevant environment variables are not preserved between shell sessions. As a result, you have to start many ssh-agent instances. To locate existing ssh-agent sessions (and start new ones if none is found), use keychain (a single-file shell script). If it is not provided by your package manager, simply download and unzip it somewhere. Then do the following or add them to ~/.profile:
eval $(/path/to/keychain --eval ~/.ssh/id_rsa)
eval $(/mnt/c/path/to/weasel-pageant/weasel-pageant -r) # for weasel-pageant
eval $(ssh-pageant -r -a "/tmp/.ssh-pageant-$USER") # for ssh-pageant

This solution replaces ssh-agent + keychain, and will require Pageant to be running.

GPG-Agent

GnuPG is an encryption and digital signing software package used for emails (i.e., Mailvelope or Mymail-Crypt for GMail, and EnigMail for Thunderbird), signing code, etc. It provides its own key daemon which can be a drop-in replacement for ssh-agent + keychain and Pageant.

  • Useful common settings in gpg-agent.conf

The following specifies that a passphrase is remembered for 57600 seconds (16 hours) from its last usage so you don’t need to enter it again if you are actively working and making connections. The passphrase will however expire at least once every 999999 seconds (~ 11.6 days).

default-cache-ttl 57600
default-cache-ttl-ssh 57600
max-cache-ttl 999999
max-cache-ttl-ssh 999999
  • On Ubuntu or Debian:
sudo apt install gnupg-agent dbus-user-session
echo enable-ssh-support >> ~/.gnupg/gpg-agent.conf

and comment out “use-ssh-agent” from /etc/X11/Xsession.options to disable ssh-agent.

Then start gpg-agent and import existing SSH keys via ssh-add:

gpg-agent --daemon
ssh-add ~/.ssh/id_rsa

It will first ask you for the passphrase to decrypt the private key, and immediately ask you again for a passphrase to encrypt and store it with gpg-agent. This step needs to be run only once, and gpg-agent will remember the authentication keys across sessions. In addition, gpg-agent itself will be started automatically due to /etc/X11/Xsession.d/90gpg-agent. When a program needs to authenticate, gpg-agent will prompt you for the passphrase if the key has not been cached.

  • On MacOS:
brew install gpg pinentry-mac
echo 'pinentry-program /usr/local/bin/pinentry-mac' >> ~/.gnupg/gpg-agent.conf
echo enable-ssh-support >> ~/.gnupg/gpg-agent.conf

then start gpg-agent and import existing keys as above. Unlike in Linux, the environmental variables are not set up automatically, so you need to do or add the following to ~/.profile

export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
  • On Windows, use the installer provided by GnuPG, and add enable-putty-support to %AppData%\gnupg\gpg-agent.conf. You can create new authentication-only keys for gpg-agent, but it is not clear how to import existing SSH keys (like we can do with ssh-add under Linux or MacOS). You can, however, copy ~/.gnupg/sshcontrol and relevant keys from .gnupg/private-keys-v1.d from your Linux/Mac machine to %AppData%\gnupg. Optionally, you can create a shortcut to start gpg-agent:
"%ProgramFiles(x86)%\GnuPG\bin\gpg-connect-agent.exe" /bye

PuTTY, WinSCP and other programs should then be able to authenticate as usual.

Customizing .ssh/config

Sharing sessions over a single connection

Add the following to the end of ~/.ssh/config:

Host *
  ServerAliveInterval 300
  ServerAliveCountMax 3
  TCPKeepAlive no
  ControlMaster auto
  ControlPath ~/mux-%L-%r@%h:%p
  ControlPersist 30m

Host alias

If you would like to be able to ssh hostA instead of ssh userX@hostA.dept.univ.edu, add the following to ~/.ssh/config:

Host hostA
  HostName hostA.dept.univ.edu
  User userX

Multi-hop

  • If you need to SSH to a machine via a proxy node, you can do:
ssh -t user1@proxy.system ssh user2@remote.system

This quickly becomes cumbersome, especially if you use scp or rsync too. Automate it in ~/.ssh/config:

Host mesabi ln000? cn0???
  HostName remote.system
  User user2
  ProxyCommand ssh user1@proxy.system nc %h %p

You can then simply do: ssh mesabi.

  • Logging into some HPC systems (e.g., very.secure.system) requires a hardware token in addition to password. To avoid doing it every time, you can first set up ~/.ssh/authorized_keys in very.secure.system, and SSH to it on a different, long-running computer:
ssh -L1322:localhost:22 -fN user@very.secure.system

This step needs the hardware token. Now on other computers you use, add to ~/.ssh/config:

Host cascade glogin*
  HostName localhost
  Port 1322
  User user
  ProxyCommand ssh user2@long.running.system nc %h %p

after which you can ssh cascade without needing the hardware token. It will connect to very.secure.system via port 1322 at long.running.system. However, ALCF’s machines have disabled authentication by SSH keys, so this method will not work there.

Remote Desktop

If you want remote desktop functionality, there are a few options. NoMachine and TeamViewer are so fast that you can even stream HD videos over Internet.

  • VNC is a cross-platform solution. A server program needs to be run on the remote end, and a viewer program is used to connect to the server. Mac OS X has built-in VNC server support (System Preferences -> Sharing -> Screening Sharing), but it is not as fast as other implementations (such as RealVNC, TightVNC, and UltraVNC).
  • NoMachine started as an improvement of the X Window System by compressing and transferring only the changed region of the screen and wrapping the connections in SSH for encryption. Version 4 began to provide remote desktop between machines that have both installed the software, in addition to connecting to NoMachine servers that are specifically set up. Open-source server implementations(FreeNX, Neatx) exist for Linux. MSI and College of Science and Engineering Labs provides NX servers, from which you can connect to other HPC machines and your workstation. The sessions are preserved unless you terminate them, so you will not lose any ongoing work because of dropped connections and can pick up where you were when you go back and forth between office and home.
  • TeamViewer supports remote control, online meeting, and VPN. It runs on Microsoft Windows, Mac OS X, Linux, Android, iOS, Windows RT, and Windows Phone.

Mount ext2/3/4, NTFS file systems

Mac OS X does not have native kernel support for the ext2/3/4 file systems used by most Linux distributions and the NTFS file system used by Windows. MacFUSE, OSXFUSE, and Fuse4X are loadable kernel modules for Mac OS X based on the GPLed Linux module FUSE, which provides a “bridge” to the kernel interfaces and allows file system code to run in user space. fuse-ext2, NTFS-3G for Mac OS X, and NTFS for Mac OS X are file systems built on top of FUSE.

  • First of all, download and install MacFUSE. With 64-bit OS X, you also need to install macfuse-core-10.5-2.1.9.dmg and MacFUSE.prefPane-2.0-64-bit-2009-09-10.zip in sequence. (MacFUSE is no longer maintained by its original author. Alternatively, you can use OSXFUSE which is a drop-in replacement for MacFUSE. You need to enable MacFuse Compatibility Layer during the installation of OSXFUSE.)
  • For ext2/3/4 support, install fuse-ext2. If the hard drive does not auto-mount, mount it manually with something like “mkdir /Volumes/disk2s1 && fuse-ext2 /dev/disk2s1 /Volumes/disk2s1”
  • Download and install NTFS-3G for Mac OS X from here. If needed, mount manually using “mount -t ntfs-3g /dev/disk2s1 /Volumes/disk2s1”

TraPPE Force Field

Below is a list of the different papers that make up the TraPPE (Transferrable Potentials for Phase Equilibria.) force field, along with some information concerning what types of molecules are treated.

TraPPE-CG

TraPPE-UA

  • M.G. Martin, and J.I. Siepmann, ‘Transferable potentials for phase equilibria. 1. United-atom description of n-alkanes,’ J. Phys. Chem. B, 102, 2569-2577 (1998).
  • M.G. Martin, and J.I. Siepmann, ‘Novel configurational-bias Monte Carlo method for branched molecules. Transferable potentials for phase equilibria. 2. United-atom description of branched alkanes,’ J. Phys. Chem. B, 103, 4508-4517 (1999).
  • C.D. Wick, M.G. Martin, and J.I. Siepmann, ‘Transferable potentials for phase equilibria. 4. United-atom description of linear and branched alkenes and of alkylbenzenes,’ J. Phys. Chem. B, 104, 8008-8016 (2000).
    • Ethene, propene, 1-butene, trans- and cis-2-butene, 2-methylpropene, 1,5-hexadiene, 1-octene, benzene, toluene, ethylbenzene, propylbenzene, isopropylbenzene, o-, m-, and p-xylene, naphthalene
  • B. Chen, J.J. Potoff, and J.I. Siepmann, ‘Monte Carlo calculations for alcohols and their mixtures with alkanes. Transferable potentials for phase equilibria. 5. United-atom description of primary, secondary and tertiary alcohols,’ J. Phys. Chem. B, 105, 3093-3104 (2001).
  • J.M. Stubbs, J.J. Potoff, and J.I. Siepmann, ‘Transferable potentials for phase equilibria. 6. United-atom description for ethers, glycols, ketones and aldehydes,’ J. Phys. Chem. B, 108, 17596-17605 (2004).
  • X.S. Zhao, B. Chen, S. Karaborni, and J.I. Siepmann, ‘Vapor-liquid and vapor-solid phase equilibria for united-atom benzene models near their triple points: The importance of quadrupolar interactions,’ J. Phys. Chem. B 109, 5368-5374 (2005).
    • 6-site model: 6 x CH placed at carbon sites
    • 9-site model: 6 x CH placed at carbon sites, 3 additional charge sites
      • +0.242 e on benzene plane, -0.121 e at ±0.785 A from benzene plane
      • Q = -23.9 x 10-40 C m2
  • C.D. Wick, J.M. Stubbs, N. Rai, and J.I. Siepmann, ‘Transferable potentials for phase equilibria. 7. United-atom description for nitrogen, amines, amides, nitriles, pyridine and pyrimidine,’ J. Phys. Chem. B, 109, 18974-18982 (2005).
  • N. Lubna, G. Kamath, J.J. Potoff, N. Rai, and J.I. Siepmann, ‘Transferable potentials for phase equilibria. 8. United-atom description for thiols, sulfides, disulfides, and thiophene,’ J. Phys. Chem. B, 109, 24100-24107 (2005).
  • K.A. Maerzke, N.E. Schultz, R.B. Ross, and J.I. Siepmann, ‘TraPPE-UA force field for acrylates and Monte Carlo simulations for their mixtures with alkanes and alcohols,’ J. Phys. Chem. B 113, 6415-6425 (2009).
  • S.J. Keasler, S.M. Charan, C.D. Wick, I.G. Econonmou, and J.I. Siepmann, ‘Transferable potentials for phase equilibria-United atom description of five- and six-membered cyclic alkanes and ethers,’ J. Phys. Chem. B, 116, 11234-11246 (2012).
    • Cyclopentane, tetrahydrofuran, 1,3-dioxolane, cyclohexane, oxane, 1,4-dioxane, 1,3-dioxane, 1,3,5-trioxane

TraPPE-EH

  • N. Rai, and J.I. Siepmann, ‘Transferable potentials for phase equilibria. 9. Explicit-hydrogen description of benzene and 5-membered and 6-membered heterocyclic aromatic compounds,’ J. Phys. Chem. B, 111, 10790-10799 (2007).
    • Benzene, pyridine, pyrimidine, pyrazine, pyridazine, thiophene, furan, pyrrole, thiazole, oxazole, isoxazole, imidazole, pyrazole
  • N. Rai, D. Bhatt, J.I. Siepmann, and L.E. Fried, ‘Monte Carlo simulations of 1,3,5-triamino-2,4,6-trinitrobenzene (TATB): Pressure and temperature effects for the solid phase and vapor-liquid phase equilibria,’ J. Chem. Phys. 129, art. no. 194510/8 pages (2008).
  • N. Rai, and J.I. Siepmann, ‘Transferable potentials for phase equilibria. 10. Explicit-hydrogen description of substituted benzenes and polycyclic aromatic compounds,’ J. Phys. Chem. B, 117, 273-288 (2013).

TraPPE-pol

  • B. Chen, J.J. Potoff, and J.I. Siepmann, ‘Adiabatic nuclear and electronic sampling Monte Carlo simulations in the Gibbs ensemble: Application to polarizable force fields for water,’ J. Phys. Chem. B 104, 2378-2390 (2000).

TrPPE-small

Perfluoroalkanes

  • S.T. Cui, J.I. Siepmann, H.D. Cochran, and P.T. Cummings, ‘Intermolecular potentials and vapor-liquid phase equilibria of perfluorinated alkanes,’ Fluid Phase Equil. 146, 51-61 (1998).
  • L. Zhang and J.I. Siepmann, ‘Pressure dependence of the vapor-liquid-liquid phase behavior of ternary mixtures consisting of n-alkanes, n-perfluoroalkanes and carbon dioxide,’ J. Phys. Chem. B 109, 2911-2919 (2005).
  • N. Rai, and J.I. Siepmann, ‘High-Level Electronic Structure Calculations for Methane/Perfluoromethane Dimers. Development of the TraPPE-EH Force Field for Hydrofluorocarbons,’ (2009). ppt

TraPPE-zeo

  • P. Bai, M. Tsapatsis, and J.I. Siepmann, ‘TraPPE-zeo: Transferable potentials for phase equilibria force field for all-silica zeolites,’ J. Phys. Chem. C 117, 24375-24387 (2013).
    • Rigid framework assumption, so tight fitting systems such as benzene, xylenes in MFI can be problematic.
    • Adsorption and diffusion of any types of molecules on all-silica zeolites of any framework type. Tested: non-polar: methane, ethane, n-heptane, 2-methylpropane, 2-methylpentane, 3-methylpentane, 2,2-dimethylbutane adsorption in MFI; propane adsorption in TON; quadrupolar: carbon dioxide adsorption in MFI; polar and hydrogen-bonding: methanol, ethanol, water adsorption in MFI; methanol adsorption in FAU; diffusion: methane, water in MFI.
  • An ad-hoc extension to Ca2+-exchanged aluminosilicates is developed for a simulation challenge: P. Bai, P. Ghosh, J. Sung, D. Kohen, J.I. Siepmann, and R.Q. Snurr, ‘A computational study of the adsorption of n-perfluorohexane in zeolite BCR-704,’ Fluid Phase Equil. 360, online (2013).