Skip to content

Instantly share code, notes, and snippets.

@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).
@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 / 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 / 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 / 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 / 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 / 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 / atlas_install.sh
Last active December 4, 2021 11:53
A bash script to install ATLAS on a Debian (Ubuntu) machine. To install run the script: sudo bash atlas_install.sh. Note on newer linux machines will have to 1. Edit /etc/default/grub 2. Find line with: GRUB_CMDLINE_LINUX_DEFAULT 3. Append the following to args: intel_pstate=disable 4. Update grub: update-grub 5. Reboot; from http://math-atlas.s…
#!/bin/bash
### ATLAS Ubuntu install
# Assign user name
read -p "Enter your user name: " UserName
### MAIN ###
# Number of CPUs
CPUNum=$(nproc)
@kparrish
kparrish / getmachine
Created August 30, 2013 19:48
The configure file (getmachine) for GULP (General Utility Lattice Program) for Debian (Ubuntu) linux and g95 complier
#! /bin/sh
#
# This shell script adapts the Makefile in dependence
# of the machine and the operating system you use.
# It is called from 'make' before the compiler
# is invoked.
#
# 7/97 IRIX64 directory name modified to handle IRIX7
# 2/99 Cray options added (IW)
#
find ~/Dropbox/ntpl-paper/disorder/used/ -name '*.pdf' -exec pdftotext {} - \; | grep "Boson peak"