Skip to content

Instantly share code, notes, and snippets.

@kparrish
kparrish / npswap.py
Created April 1, 2013 20:25
Numpy Simple Swap Algorithm, avoid views.
def swap(array, index1, index2):
t = np.copy(array[index1])
array[index1] = array[index2]
array[index2] = t
return array
@kparrish
kparrish / lammps_parallel.sh
Last active October 12, 2016 19:04
Install a parallel version of lammps on ubuntu based systems.
#!/bin/bash
### Lammps parallel install
# Assign user name
read -p "Enter your user name: " UserName
# Install required packages
apt-get update
apt-get -y upgrade
apt-get -y install build-essential openmpi-bin openmpi-doc libopenmpi-dev fftw2 fftw-dev
@kparrish
kparrish / .bashrc
Created July 23, 2013 17:02
My .bashrc
# Display system information using archey
/usr/bin/archey
# Installed Packages
export PATH=${PATH}:/opt/lammps/src
export PATH=${PATH}:/opt/gulp/Src
export PATH=${PATH}:/opt/zotero
export PATH=${PATH}:/opt/LD_300
export PATH=${PATH}:/usr/local/matlab/R2012a/bin
@kparrish
kparrish / fresh_install.sh
Last active January 16, 2017 19:33
Run fresh_install.sh script on a new linux install.
#!/bin/bash
### Fresh install for a new Ubuntu derivative
# Assign user name
read -p "Enter your user name: " UserName
read -p "Enter your full name: " MyName
read -p "Enter your email address: " MyEmail
# update all
apt-get update
@kparrish
kparrish / simple_install.sh
Last active January 16, 2017 19:33
A base install for Ubuntu and Ubuntu derivatives.
#!/bin/bash
### Fresh install for a new Ubuntu derivative
# Assign user name
read -p "Enter your user name: " UserName
read -p "Enter your full name: " MyName
read -p "Enter your email address: " MyEmail
# update all
apt-get update
@kparrish
kparrish / matplotlib_example.py
Last active December 20, 2015 08:39
A short simple example of using matplotlib
## ## ## matplotlib_example.py ## ## ##
## ## ## Created by: KDP ## ## ##
import numpy as np
import matplotlib.pyplot as plt
## Create data
x = np.linspace(0, 4 * np.pi, num=100)
y = np.sin(x)
@kparrish
kparrish / pypar_install.sh
Last active December 20, 2015 18:49
Install shell script for pypar
### Install pypar
# Assign user name
read -p "Enter your user name: " UserName
# update all
apt-get update
apt-get -y upgrade
# Pypar
find ~/Dropbox/ntpl-paper/disorder/used/ -name '*.pdf' -exec pdftotext {} - \; | grep "Boson peak"
@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)
#
@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)