This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: | |
# abbrv "input_file.bib" > output_file.bib | |
file=$1 | |
awk '{sub(/{Annual Review of Astronomy and Astrophysics}/, "{ARA\{\\\\\\&\}A}"); print}' $file | | |
awk '{sub(/{Monthly Notices of the Royal Astronomical Society}/,"{MNRAS}"); print}' | | |
awk '{sub(/{Mon. Not. R. Astron. Soc}/,"{MNRAS}"); print}' | | |
awk '{sub(/{Publications of the Astronomical Society of the Pacific}/,"{PASP}"); print}' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib | |
import matplotlib.pyplot as plt | |
n_plots = 10 | |
how_many_colors = 12 | |
cmap_name = 'jet' | |
norm = matplotlib.colors.Normalize(vmin=0, vmax=n_plots) | |
cmap = matplotlib.cm.get_cmap(cmap_name, how_many_colors) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo service bluetooth stop | |
sudo apt install build-essential debhelper fakeroot wget dh-autoreconf flex bison libdbus-glib-1-dev libglib2.0-dev libcap-ng-dev udev libudev-dev libreadline-dev libical-dev check dh-systemd libebook1.2-dev libasound2-dev | |
cd /tmp/ | |
mkdir blumidi | |
cd blumidi/ | |
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/bluez/5.48-0ubuntu3.1/bluez_5.48.orig.tar.xz | |
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/bluez/5.48-0ubuntu3.1/bluez_5.48-0ubuntu3.1.debian.tar.xz | |
tar xJf bluez_5.48.orig.tar.xz | |
cd bluez-5.48/ | |
tar xJf ../bluez_5.48-0ubuntu3.1.debian.tar.xz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pushd ~ | |
mkdir -p bin | |
cd bin | |
git clone https://github.com/madler/pigz.git pigz.src | |
cd pigz.src | |
make | |
cd .. | |
ln -s pigz.src/pigz pigz.src/unpigz . | |
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Parse conda env list | |
CONDA_ENVS=`conda env list --json | python -c 'import json,sys,os;obj=json.load(sys.stdin);print(" ".join(os.path.basename(p) for p in obj["envs"]))'` | |
# Add the root env because "conda env list --json" doesn't show the root env | |
CONDA_ENVS+=" root" | |
TODAY=`date +%F` | |
HOUR=`date +%Hh%Mm` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo -v | |
wget http://www.fftw.org/fftw-2.1.5.tar.gz | |
tar -xzf fftw-2.1.5.tar.gz | |
cd fftw-2.1.5 | |
# single precision | |
./configure --enable-mpi --enable-type-prefix --enable-float && make -j4 | |
sudo make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/csh | |
# Get the name of this script | |
set script_name = `basename $0` | |
# Get arguments | |
if ( $#argv < 1 ) then | |
echo "" | |
echo "Usage: source $script_name <CONDAENV>" | |
exit 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt update && apt upgrade | |
apt install python python-dev pip clang | |
pip install --upgrade pip | |
pip install conda | |
## All the following packages are needed by conda | |
pip install auxlib ruamel.yaml requests | |
## Install pycosat (this can be ignored if https://github.com/ContinuumIO/pycosat/pull/29 is fixed) | |
wget https://pypi.python.org/packages/76/0f/16edae7bc75b79376f2c260b7a459829785f08e463ecf74a8ccdef62dd4a/pycosat-0.6.1.tar.gz#md5=c1fc35b17865f5f992595ae0362f9f9f | |
tar -xf pycosat-0.6.1.tar.gz |