Skip to content

Instantly share code, notes, and snippets.

View cwpearson's full-sized avatar
🙀
I have approximate knowledge of many things.

Carl Pearson cwpearson

🙀
I have approximate knowledge of many things.
View GitHub Profile
#! /bin/bash
set -eou pipefail
workdir=`mktemp -d -p $HOME`
workdir=`readlink -f $workdir`
echo $workdir
#trap "{ echo cleaning up $workdir; rm -r $workdir; }" EXIT
trap "{ echo workdir was $workdir; }" EXIT
@cwpearson
cwpearson / install-cmake.sh
Last active March 2, 2025 18:44
install CMake from source
set -eu
set -x
# create a `cmake` directory and extract cmake into there
# build cmake in there, and install to prefix
PREFIX=$HOME/software/cmake-3.17.0-rc3
wget -SL https://github.com/Kitware/CMake/releases/download/v3.17.0-rc3/cmake-3.17.0-rc3.tar.gz
mkdir -p cmake-3.17.0-rc3.src
@cwpearson
cwpearson / llvm-10.0.0.sh
Last active May 11, 2020 22:07
Install llvm 10.0.0 to $HOME/software/llvm-10.0.0
#! /bin/bash
set -eou pipefail
set -x
workdir=`mktemp -d`
workdir=`readlink -f $workdir`
echo $workdir
#trap "{ echo cleaning up $workdir; rm -r $workdir; }" EXIT
@cwpearson
cwpearson / suitesparse-download.sh
Last active April 26, 2021 21:35
Bash script to download suitesparse matrices if they're missing
#! /bin/bash
set -eou pipefail
match_size_or_get() {
url=$1
echo "working on $url"
# get expected size of url content.
# first, follow redirects to get effective url
@cwpearson
cwpearson / automatic1111.sh
Last active July 29, 2023 20:24
Install AUTOMATIC1111 on GCE
# install some useful stuff
sudo apt install -y htop
# On Debian 11 this brings python 3.9, but the docs ask for python 3.10.6
sudo apt install -y wget git python3 python3-venv
# install pyenv for newer pythons
curl https://pyenv.run | bash
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc