Skip to content

Instantly share code, notes, and snippets.

View jarvist's full-sized avatar

Jarvist Moore Frost jarvist

View GitHub Profile
@jarvist
jarvist / employment.sh
Created May 9, 2013 08:04
A few lines that have sat at the end of my .bashrc for the last few years. Originally this warned me when my PhD was ending + the date I needed to submit my thesis, and as I passed into PostDoc purgatory, I use it to remind me how long I have till the end of the next contract. As a bonus, it works correctly once you've passed the deadline, infor…
theend=` date --date "30 December 2013 17:00" +%s `
now=` date +%s `
diff=` expr $theend - $now `
echo "Really Unemployed in: " `expr $diff / 86400` days `expr \( $diff % 86400 \) / 3600` hours `expr \( \( $diff % 86400 \) % 3600 \) / 60` minutes `expr $diff % 60` seconds.
@jarvist
jarvist / C2H4_C2F4_dist04.00.nw
Last active July 24, 2021 16:09
NWCHEM input file for CDFT on a Ethylene (C2H4) / C2F4 molecular pair for calculating charge transfer state energies + comparing to a TD-DFT method.
title "C2F4 C2H4 with displacement: 04.00 Angstroms"
echo "This is a story about an ordinary teddy bear."
#Hellow 64GB / 16 node machine... will you be my friend?
memory stack 750 mb heap 1500 mb global 1500 mb
echo "Thundercats HO!"
geometry molA units angstroms noautoz noautosym
@jarvist
jarvist / angles_by_structure.py
Last active September 9, 2018 00:56
Calculates vertices of C60 buckyball from the Cartesian coordinates suggested on Wikipedia page, and a bit of permutation magic on the 'generator' thus describe. I'm sure there's a more elegant way to do the +- permutation too.
#See http://en.wikipedia.org/wiki/Truncated_icosahedron
phi = (1+5**0.5)/2 #golden mean
generator= [ [0,1,+3*phi],
[2,1+2*phi,phi],
[1,2+phi,2*phi]]
#From http://blog.adambachman.org/2008/10/simple-permutations-in-python-and-ruby.html
@jarvist
jarvist / northern_caves_cavemapsorg_etrex_6char_pack.gpx
Created October 29, 2012 18:20
Repack of the CaveMaps 2009 Northern Caves entrance GPS waypoints for old (eTrex, Gecko) 6-char only GPSes.
<gpx version="1.1" xmlns="http://www.topografix.com/GPX/1/1">
<wpt lat="54.164537" lon="-2.026381">
<name>DowCav</name>
</wpt>
<wpt lat="54.098515" lon="-1.974449">
<name>Fossil</name>
</wpt>
@jarvist
jarvist / sysmig_vrtnarija.err
Created October 15, 2012 20:10
Survey Errors, Sysmig / Vrtnarija 2012 data
Original length 12.87m ( 1 legs), moved 0.49m ( 0.49m/leg). Error 3.79%
Original length 17.43m ( 1 legs), moved 0.19m ( 0.19m/leg). Error 1.10%
Original length 21.24m ( 1 legs), moved 0.46m ( 0.46m/leg). Error 2.17%
Original length 5.98m ( 1 legs), moved 0.02m ( 0.02m/leg). Error 0.34%
Original length 13.45m ( 2 legs), moved 0.57m ( 0.28m/leg). Error 4.22%
Original length 21.15m ( 2 legs), moved 0.33m ( 0.16m/leg). Error 1.56%
Original length 26.66m ( 2 legs), moved 0.13m ( 0.06m/leg). Error 0.48%
Original length 32.36m ( 2 legs), moved 0.00m ( 0.00m/leg). Error 0.00%
Original length 23.05m ( 3 legs), moved 0.36m ( 0.12m/leg). Error 1.56%
Original length 50.81m ( 3 legs), moved 0.00m ( 0.00m/leg). Error 0.00%
#!/usr/bin/env python
# Version 1.5
# one dimensional chain
# Copyright under GNU General Public License 2010, 2012
# by Sinisa Coh and David Vanderbilt (see gpl-pytb.txt)
from pytb import * # import TB model class
import pylab as pl
@jarvist
jarvist / FOOTER
Created August 24, 2012 08:57
Build NWCHEM job from Gaussian logfile via extraction of Cartesian coords
for i #in */*.out
do
# echo -n "${i}"
#'sed -n 1p' will print 1st line, etc.
ELECTRONS=` grep "No. of electrons :" "${i}" | sed -n 1p | awk '{print $5/2}' `
#OK, this is now orbitals, not electrons (i.e. #electrons / 2)
ENERGY=` grep "Total DFT energy" "${i}" | sed -n 1p | awk '{print $5}' `
CAM=` grep " cam " "${i}" | sed -n 1p | awk '{print $2}' `
@jarvist
jarvist / AAA - Update 2014
Last active October 6, 2015 02:48
Vague notes written on upload - scripts to calculate Reorganisation Energies with Gaussian
Forgot about this gist, and made a full blown GitHub repo separately:- https://github.com/jarvist/polaron-lambda
Slight edits to allow more easy Method for the E calculations, a version to work from .log files rather than checkpoints, and a better description (perhaps).
Consider this Gist obsolete.
@jarvist
jarvist / com.vim
Last active June 7, 2018 09:51
Vim syntax highlighting file for the NWCHEM electronic structure package input deck (.nw extension), and an even cruder one for Gaussian (.com). Put this in ~/.vim/syntax, and add a suitable loader to ~/.vim/filetype.vim . Used with the Zenburn colour sch
" Vim syntax file
" Language: Gaussian (Electronic Structure Package) Input Files
" Maintainer: Jarvist Moore Frost
" Latest Revision: 27 May 2012
if exists("b:current_syntax")
finish
endif
"Oh Fortran, always ignoring case...