Skip to content

Instantly share code, notes, and snippets.

@kparrish
kparrish / spglib_install.sh
Last active July 5, 2019 16:13
A bash script to install spglib on a Debian (Ubuntu) machine. To install run the script: sudo bash spglib_install.sh
#!/bin/bash
### spglib Ubuntu install
# Assign user name
read -p "Enter your user name: " UserName
### MAIN ###
# Install required packages
apt-get update
@kparrish
kparrish / lapack_install.sh
Last active August 25, 2017 11:40
A bash script to install lapack and lapacke on a Debian (Ubuntu) machine. To install run the script: sudo bash lapack_install.sh
#!/bin/bash
### LAPACK Ubuntu install
# Assign user name
read -p "Enter your user name: " UserName
### MAIN ###
# Install required packages
apt-get update
apt-get -y upgrade
@kparrish
kparrish / remote_backup.sh
Created October 22, 2013 18:26
Remote Backup
#!/bin/bash
# rsync backup, see www.linux.com/learn/tutorials/284789-writing-a-simple-bash-script-
SOURCEDIR1=/home/user
DESTDIR1=user@hostname:/path/to/folder
rsync -az --progress --exclude='*.bak' --rsh 'ssh ' $SOURCEDIR1 $DESTDIR1
@kparrish
kparrish / PS1_bash_git.txt
Created January 16, 2014 17:00
PS1 settings in .bashrc to show git branch.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1='\[\033[01;34m\]\u@\h\[\033[01;32m\] \w\[\033[01;31m\]$(parse_git_branch) \[\033[01;32m\]\$\[\033[00m\] '
@kparrish
kparrish / mpiexample.c
Last active March 8, 2020 23:05
A simple mpi example to perform distributed calculations on an array.
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
int main(int argc, char** argv){
// MPI
int PE, nPE;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nPE);
MPI_Comm_rank(MPI_COMM_WORLD, &PE);
@kparrish
kparrish / .vimrc
Created April 20, 2018 01:19
My vimrc
set t_Co=256
colorscheme pychimp
" autocmd BufRead,BufNewFile *.py let python_highlight_all=1
set number
set autoindent
set mouse=a
" filetype on
" filetype plugin on
@kparrish
kparrish / matplotlibrc
Created July 22, 2018 19:57
matplotlibrc for myself
### MATPLOTLIBRC FORMAT
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overwritten in your next install.
# If you want to keep a permanent local copy that will not be
# overwritten, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).